1 # RUN: llvm-mc -triple riscv32 -riscv-no-aliases -show-encoding %s \
2 # RUN: | FileCheck -check-prefixes CHECK-INST,CHECK-ENC %s
3 # RUN: llvm-mc -filetype obj -triple riscv32 %s \
4 # RUN: | llvm-objdump -d - \
5 # RUN: | FileCheck -check-prefix=CHECK-INST-ALIAS %s
7 # RUN: llvm-mc -triple riscv64 -riscv-no-aliases -show-encoding %s \
8 # RUN: | FileCheck -check-prefixes CHECK-INST,CHECK-ENC %s
9 # RUN: llvm-mc -filetype obj -triple riscv64 %s \
10 # RUN: | llvm-objdump -d - \
11 # RUN: | FileCheck -check-prefix=CHECK-INST-ALIAS %s
13 # RUN: llvm-mc -triple riscv32 %s 2>&1 | FileCheck -check-prefix CHECK-WARN %s
17 # CHECK-INST: csrrw zero, stval, zero
18 # CHECK-ENC: encoding: [0x73,0x10,0x30,0x14]
19 # CHECK-INST-ALIAS: csrw stval, zero
21 # CHECK-INST: csrrw zero, stval, zero
22 # CHECK-ENC: encoding: [0x73,0x10,0x30,0x14]
23 # CHECK-INST-ALIAS: csrw stval, zero
27 csrrw zero
, 0x143, zero
29 # CHECK-WARN: warning: 'sbadaddr' is a deprecated alias for 'stval'
33 # CHECK-INST: csrrw zero, mtval, zero
34 # CHECK-ENC: encoding: [0x73,0x10,0x30,0x34]
35 # CHECK-INST-ALIAS: csrw mtval, zero
37 # CHECK-INST: csrrw zero, mtval, zero
38 # CHECK-ENC: encoding: [0x73,0x10,0x30,0x34]
39 # CHECK-INST-ALIAS: csrw mtval, zero
43 csrrw zero
, 0x343, zero
45 # CHECK-WARN: warning: 'mbadaddr' is a deprecated alias for 'mtval'
49 # CHECK-INST: csrrw zero, utval, zero
50 # CHECK-ENC: encoding: [0x73,0x10,0x30,0x04]
51 # CHECK-INST-ALIAS: csrw utval, zero
53 # CHECK-INST: csrrw zero, utval, zero
54 # CHECK-ENC: encoding: [0x73,0x10,0x30,0x04]
55 # CHECK-INST-ALIAS: csrw utval, zero
59 csrrw zero
, 0x043, zero
61 # CHECK-WARN: warning: 'ubadaddr' is a deprecated alias for 'utval'
65 # CHECK-INST: csrrw zero, satp, zero
66 # CHECK-ENC: encoding: [0x73,0x10,0x00,0x18]
67 # CHECK-INST-ALIAS: csrw satp, zero
69 # CHECK-INST: csrrw zero, satp, zero
70 # CHECK-ENC: encoding: [0x73,0x10,0x00,0x18]
71 # CHECK-INST-ALIAS: csrw satp, zero
75 csrrw zero
, 0x180, zero
77 # CHECK-WARN: warning: 'sptbr' is a deprecated alias for 'satp'