Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Add vendor-defined XTheadSync (Multi-core synchronization) ex…
…tension The vendor-defined XTheadSync (no comparable standard extension exists at the time of writing) extension adds multi-core synchronization instructions. It is supported by the C9xx cores (e.g., found in the wild in the Allwinner D1) by Alibaba T-Head. The current (as of this commit) public documentation for this extension is available at: https://github.com/T-head-Semi/thead-extension-spec/releases/download/2.2.2/xthead-2023-01-30-2.2.2.pdf Support for these instructions has already landed in GNU Binutils: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=547c18d9bb95571261dbd17f4767194037eb82bd Depends on D144496 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D144501
- Loading branch information
Showing
9 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# RUN: not llvm-mc -triple riscv32 -mattr=+xtheadsync < %s 2>&1 | FileCheck %s | ||
# RUN: not llvm-mc -triple riscv64 -mattr=+xtheadsync < %s 2>&1 | FileCheck %s | ||
|
||
th.sfence.vmas t0 # CHECK: :[[@LINE]]:1: error: too few operands for instruction | ||
th.sync t0 # CHECK: :[[@LINE]]:9: error: invalid operand for instruction | ||
th.sync.s t0 # CHECK: :[[@LINE]]:11: error: invalid operand for instruction | ||
th.sync.i t0 # CHECK: :[[@LINE]]:11: error: invalid operand for instruction | ||
th.sync.is t0 # CHECK: :[[@LINE]]:12: error: invalid operand for instruction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# RUN: llvm-mc %s -triple=riscv32 -mattr=+xtheadsync -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+xtheadsync < %s \ | ||
# RUN: | llvm-objdump --mattr=+xtheadsync -d -r - \ | ||
# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
# RUN: llvm-mc %s -triple=riscv64 -mattr=+xtheadsync -show-encoding \ | ||
# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s | ||
# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+xtheadsync < %s \ | ||
# RUN: | llvm-objdump --mattr=+xtheadsync -d -r - \ | ||
# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s | ||
|
||
# CHECK-ASM-AND-OBJ: th.sfence.vmas a0, a1 | ||
# CHECK-ASM: encoding: [0x0b,0x00,0xb5,0x04] | ||
th.sfence.vmas a0, a1 | ||
|
||
# CHECK-ASM-AND-OBJ: th.sync | ||
# CHECK-ASM: encoding: [0x0b,0x00,0x80,0x01] | ||
th.sync | ||
|
||
# CHECK-ASM-AND-OBJ: th.sync.i | ||
# CHECK-ASM: encoding: [0x0b,0x00,0xa0,0x01] | ||
th.sync.i | ||
|
||
# CHECK-ASM-AND-OBJ: th.sync.is | ||
# CHECK-ASM: encoding: [0x0b,0x00,0xb0,0x01] | ||
th.sync.is | ||
|
||
# CHECK-ASM-AND-OBJ: th.sync.s | ||
# CHECK-ASM: encoding: [0x0b,0x00,0x90,0x01] | ||
th.sync.s |