[clang] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

Kito Cheng via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 13 23:39:48 PDT 2025


================
@@ -0,0 +1,105 @@
+# XAndesPerf - Andes Performance Extension
+# RUN: llvm-mc %s -triple=riscv32 -mattr=+xandesperf -show-encoding \
+# RUN:     | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
+# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+xandesperf < %s \
+# RUN:     | llvm-objdump --mattr=+xandesperf -M no-aliases --no-print-imm-hex -d -r - \
+# RUN:     | FileCheck -check-prefixes=CHECK-OBJ,CHECK-OBJ32,CHECK-ASM-AND-OBJ %s
+# RUN: llvm-mc %s -triple=riscv64 -mattr=+xandesperf -show-encoding \
+# RUN:     | FileCheck -check-prefixes=CHECK-ASM,CHECK-ASM-AND-OBJ %s
+# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+xandesperf < %s \
+# RUN:     | llvm-objdump --mattr=+xandesperf -M no-aliases --no-print-imm-hex -d -r - \
+# RUN:     | FileCheck -check-prefixes=CHECK-OBJ,CHECK-OBJ64,CHECK-ASM-AND-OBJ %s
+
+# CHECK-OBJ: nds.bbc a0, 16, 0x200
+# CHECK-ASM: nds.bbc a0, 16, 512
+# CHECK-ASM: encoding: [0x5b,0x70,0x05,0x21]
+nds.bbc a0, 16, 512
+
+# CHECK-OBJ32: nds.bbs a1, 21, 0xffffff04
+# CHECK-OBJ64: nds.bbs a1, 21, 0xffffffffffffff04
+# CHECK-ASM: nds.bbs a1, 21, -256
+# CHECK-ASM: encoding: [0x5b,0xf0,0x55,0xf1]
+nds.bbs a1, 21, -256
+
+# CHECK-OBJ: beqc t0, 23, 0x108
+# CHECK-ASM: beqc t0, 23, 256
----------------
kito-cheng wrote:

`nds.`?

https://github.com/llvm/llvm-project/pull/135110


More information about the cfe-commits mailing list