diff options
author | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-01-25 17:03:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-25 17:03:25 +0800 |
commit | 1a14c446dd800b1d79fed1735c48e392d06e495d (patch) | |
tree | 42f5ef63f4a32ae61ce7319fdf5c26d1ae83de69 /llvm/test/MC | |
parent | a15ebe0246c75faedfe9cb2fbc6ea7b62e265026 (diff) | |
download | llvm-1a14c446dd800b1d79fed1735c48e392d06e495d.zip llvm-1a14c446dd800b1d79fed1735c48e392d06e495d.tar.gz llvm-1a14c446dd800b1d79fed1735c48e392d06e495d.tar.bz2 |
[RISCV][MC] Add experimental support of Zaamo and Zalrsc
`A` extension has been split into two parts: Zaamo (Atomic Memory
Operations) and Zalrsc (Load-Reserved/Store-Conditional). See also
https://github.com/riscv/riscv-zaamo-zalrsc.
This patch adds the MC support.
Reviewers: dtcxzyw, topperc, kito-cheng
Reviewed By: topperc
Pull Request: https://github.com/llvm/llvm-project/pull/78970
Diffstat (limited to 'llvm/test/MC')
-rw-r--r-- | llvm/test/MC/RISCV/rv32i-invalid.s | 3 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv32zaamo-invalid.s | 1 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv32zaamo-valid.s | 10 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv32zalrsc-invalid.s | 1 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv32zalrsc-valid.s | 10 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv64zaamo-invalid.s | 1 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv64zaamo-valid.s | 9 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv64zalrsc-invalid.s | 1 | ||||
-rw-r--r-- | llvm/test/MC/RISCV/rv64zalrsc-valid.s | 9 |
9 files changed, 44 insertions, 1 deletions
diff --git a/llvm/test/MC/RISCV/rv32i-invalid.s b/llvm/test/MC/RISCV/rv32i-invalid.s index c5e0657..80a59df 100644 --- a/llvm/test/MC/RISCV/rv32i-invalid.s +++ b/llvm/test/MC/RISCV/rv32i-invalid.s @@ -170,7 +170,8 @@ xor s2, s2 # CHECK: :[[@LINE]]:1: error: too few operands for instruction # Instruction not in the base ISA div a4, ra, s0 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'M' (Integer Multiplication and Division){{$}} -amomaxu.w s5, s4, (s3) # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'A' (Atomic Instructions){{$}} +amomaxu.w s5, s4, (s3) # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'A' (Atomic Instructions) or 'Zaamo' (Atomic Memory Operations){{$}} +lr.w t0, (t1) # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'A' (Atomic Instructions) or 'Zalrsc' (Load-Reserved/Store-Conditional){{$}} fadd.s ft0, ft1, ft2 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'F' (Single-Precision Floating-Point){{$}} fadd.h ft0, ft1, ft2 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'Zfh' (Half-Precision Floating-Point){{$}} fadd.s a0, a1, a2 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'Zfinx' (Float in Integer){{$}} diff --git a/llvm/test/MC/RISCV/rv32zaamo-invalid.s b/llvm/test/MC/RISCV/rv32zaamo-invalid.s index f6183fb..fb4dab4 100644 --- a/llvm/test/MC/RISCV/rv32zaamo-invalid.s +++ b/llvm/test/MC/RISCV/rv32zaamo-invalid.s @@ -1,4 +1,5 @@ # RUN: not llvm-mc -triple riscv32 -mattr=+a < %s 2>&1 | FileCheck %s +# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zaamo < %s 2>&1 | FileCheck %s # Final operand must have parentheses amoswap.w a1, a2, a3 # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset diff --git a/llvm/test/MC/RISCV/rv32zaamo-valid.s b/llvm/test/MC/RISCV/rv32zaamo-valid.s index ea1ae79..f6b5799 100644 --- a/llvm/test/MC/RISCV/rv32zaamo-valid.s +++ b/llvm/test/MC/RISCV/rv32zaamo-valid.s @@ -8,6 +8,16 @@ # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+a < %s \ # RUN: | llvm-objdump --mattr=+a -M no-aliases -d -r - \ # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-zaamo -riscv-no-aliases -show-encoding \ +# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zaamo -riscv-no-aliases -show-encoding \ +# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zaamo < %s \ +# RUN: | llvm-objdump --mattr=+experimental-zaamo -M no-aliases -d -r - \ +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zaamo < %s \ +# RUN: | llvm-objdump --mattr=+experimental-zaamo -M no-aliases -d -r - \ +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s # CHECK-ASM-AND-OBJ: amoswap.w a4, ra, (s0) # CHECK-ASM: encoding: [0x2f,0x27,0x14,0x08] diff --git a/llvm/test/MC/RISCV/rv32zalrsc-invalid.s b/llvm/test/MC/RISCV/rv32zalrsc-invalid.s index 61cfc61..9233c97 100644 --- a/llvm/test/MC/RISCV/rv32zalrsc-invalid.s +++ b/llvm/test/MC/RISCV/rv32zalrsc-invalid.s @@ -1,4 +1,5 @@ # RUN: not llvm-mc -triple riscv32 -mattr=+a < %s 2>&1 | FileCheck %s +# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zalrsc < %s 2>&1 | FileCheck %s # Final operand must have parentheses lr.w a4, a5 # CHECK: :[[@LINE]]:10: error: expected '(' or optional integer offset diff --git a/llvm/test/MC/RISCV/rv32zalrsc-valid.s b/llvm/test/MC/RISCV/rv32zalrsc-valid.s index 0d4881a..f59a4df 100644 --- a/llvm/test/MC/RISCV/rv32zalrsc-valid.s +++ b/llvm/test/MC/RISCV/rv32zalrsc-valid.s @@ -8,6 +8,16 @@ # RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+a < %s \ # RUN: | llvm-objdump --mattr=+a -M no-aliases -d -r - \ # RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc %s -triple=riscv32 -mattr=+experimental-zalrsc -riscv-no-aliases -show-encoding \ +# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zalrsc -riscv-no-aliases -show-encoding \ +# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc -filetype=obj -triple=riscv32 -mattr=+experimental-zalrsc < %s \ +# RUN: | llvm-objdump --mattr=+experimental-zalrsc -M no-aliases -d -r - \ +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zalrsc < %s \ +# RUN: | llvm-objdump --mattr=+experimental-zalrsc -M no-aliases -d -r - \ +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s # CHECK-ASM-AND-OBJ: lr.w t0, (t1) # CHECK-ASM: encoding: [0xaf,0x22,0x03,0x10] diff --git a/llvm/test/MC/RISCV/rv64zaamo-invalid.s b/llvm/test/MC/RISCV/rv64zaamo-invalid.s index 70a4e55..e00c1ec 100644 --- a/llvm/test/MC/RISCV/rv64zaamo-invalid.s +++ b/llvm/test/MC/RISCV/rv64zaamo-invalid.s @@ -1,4 +1,5 @@ # RUN: not llvm-mc -triple riscv64 -mattr=+a < %s 2>&1 | FileCheck %s +# RUN: not llvm-mc -triple riscv64 -mattr=+experimental-zaamo < %s 2>&1 | FileCheck %s # Final operand must have parentheses amoswap.d a1, a2, a3 # CHECK: :[[@LINE]]:19: error: expected '(' or optional integer offset diff --git a/llvm/test/MC/RISCV/rv64zaamo-valid.s b/llvm/test/MC/RISCV/rv64zaamo-valid.s index 73cdc55..51493b9 100644 --- a/llvm/test/MC/RISCV/rv64zaamo-valid.s +++ b/llvm/test/MC/RISCV/rv64zaamo-valid.s @@ -6,6 +6,15 @@ # # RUN: not llvm-mc -triple riscv32 -mattr=+a < %s 2>&1 \ # RUN: | FileCheck -check-prefix=CHECK-RV32 %s +# +# RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zaamo -riscv-no-aliases -show-encoding \ +# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zaamo < %s \ +# RUN: | llvm-objdump --mattr=+experimental-zaamo -M no-aliases -d -r - \ +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s +# +# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zaamo < %s 2>&1 \ +# RUN: | FileCheck -check-prefix=CHECK-RV32 %s # CHECK-ASM-AND-OBJ: amoswap.d a4, ra, (s0) # CHECK-ASM: encoding: [0x2f,0x37,0x14,0x08] diff --git a/llvm/test/MC/RISCV/rv64zalrsc-invalid.s b/llvm/test/MC/RISCV/rv64zalrsc-invalid.s index 0be0097..e2ad2fc 100644 --- a/llvm/test/MC/RISCV/rv64zalrsc-invalid.s +++ b/llvm/test/MC/RISCV/rv64zalrsc-invalid.s @@ -1,4 +1,5 @@ # RUN: not llvm-mc -triple riscv64 -mattr=+a < %s 2>&1 | FileCheck %s +# RUN: not llvm-mc -triple riscv64 -mattr=+experimental-zalrsc < %s 2>&1 | FileCheck %s # Final operand must have parentheses lr.d a4, a5 # CHECK: :[[@LINE]]:10: error: expected '(' or optional integer offset diff --git a/llvm/test/MC/RISCV/rv64zalrsc-valid.s b/llvm/test/MC/RISCV/rv64zalrsc-valid.s index d4c8752..5f44372 100644 --- a/llvm/test/MC/RISCV/rv64zalrsc-valid.s +++ b/llvm/test/MC/RISCV/rv64zalrsc-valid.s @@ -6,6 +6,15 @@ # # RUN: not llvm-mc -triple riscv32 -mattr=+a < %s 2>&1 \ # RUN: | FileCheck -check-prefix=CHECK-RV32 %s +# +# RUN: llvm-mc %s -triple=riscv64 -mattr=+experimental-zalrsc -riscv-no-aliases -show-encoding \ +# RUN: | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s +# RUN: llvm-mc -filetype=obj -triple=riscv64 -mattr=+experimental-zalrsc < %s \ +# RUN: | llvm-objdump --mattr=+experimental-zalrsc -M no-aliases -d -r - \ +# RUN: | FileCheck --check-prefix=CHECK-ASM-AND-OBJ %s +# +# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zalrsc < %s 2>&1 \ +# RUN: | FileCheck -check-prefix=CHECK-RV32 %s # CHECK-ASM-AND-OBJ: lr.d t0, (t1) # CHECK-ASM: encoding: [0xaf,0x32,0x03,0x10] |