1 # RUN: llvm-mc %s -triple=riscv64 -riscv-no-aliases -show-encoding \
2 # RUN: | FileCheck -check-prefixes=CHECK-INST,CHECK-ENC %s
3 # RUN: llvm-mc -filetype=obj -triple riscv64 < %s \
4 # RUN: | llvm-objdump -d - \
5 # RUN: | FileCheck -check-prefix=CHECK-INST-ALIAS %s
7 # These user mode CSR register names are RV32 only, but RV64
8 # can encode and disassemble these registers if given their value.
10 ##################################
11 # User Counter and Timers
12 ##################################
16 # CHECK-INST: csrrs t2, 3200, zero
17 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0xc8]
18 # CHECK-INST-ALIAS: csrr t2, 0xc80
23 # CHECK-INST: csrrs t2, 3201, zero
24 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0xc8]
25 # CHECK-INST-ALIAS: csrr t2, 0xc81
30 # CHECK-INST: csrrs t2, 3202, zero
31 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xc8]
32 # CHECK-INST-ALIAS: csrr t2, 0xc82
37 # CHECK-INST: csrrs t2, 3203, zero
38 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xc8]
39 # CHECK-INST-ALIAS: csrr t2, 0xc83
44 # CHECK-INST: csrrs t2, 3204, zero
45 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xc8]
46 # CHECK-INST-ALIAS: csrr t2, 0xc84
51 # CHECK-INST: csrrs t2, 3205, zero
52 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0xc8]
53 # CHECK-INST-ALIAS: csrr t2, 0xc85
58 # CHECK-INST: csrrs t2, 3206, zero
59 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0xc8]
60 # CHECK-INST-ALIAS: csrr t2, 0xc86
65 # CHECK-INST: csrrs t2, 3207, zero
66 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0xc8]
67 # CHECK-INST-ALIAS: csrr t2, 0xc87
72 # CHECK-INST: csrrs t2, 3208, zero
73 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0xc8]
74 # CHECK-INST-ALIAS: csrr t2, 0xc88
79 # CHECK-INST: csrrs t2, 3209, zero
80 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0xc8]
81 # CHECK-INST-ALIAS: csrr t2, 0xc89
86 # CHECK-INST: csrrs t2, 3210, zero
87 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0xc8]
88 # CHECK-INST-ALIAS: csrr t2, 0xc8a
93 # CHECK-INST: csrrs t2, 3211, zero
94 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0xc8]
95 # CHECK-INST-ALIAS: csrr t2, 0xc8b
100 # CHECK-INST: csrrs t2, 3212, zero
101 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0xc8]
102 # CHECK-INST-ALIAS: csrr t2, 0xc8c
103 csrrs t2
, 0xC8C, zero
107 # CHECK-INST: csrrs t2, 3213, zero
108 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0xc8]
109 # CHECK-INST-ALIAS: csrr t2, 0xc8d
110 csrrs t2
, 0xC8D, zero
114 # CHECK-INST: csrrs t2, 3214, zero
115 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0xc8]
116 # CHECK-INST-ALIAS: csrr t2, 0xc8e
117 csrrs t2
, 0xC8E, zero
121 # CHECK-INST: csrrs t2, 3215, zero
122 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0xc8]
123 # CHECK-INST-ALIAS: csrr t2, 0xc8f
124 csrrs t2
, 0xC8F, zero
128 # CHECK-INST: csrrs t2, 3216, zero
129 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0xc9]
130 # CHECK-INST-ALIAS: csrr t2, 0xc90
131 csrrs t2
, 0xC90, zero
135 # CHECK-INST: csrrs t2, 3217, zero
136 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0xc9]
137 # CHECK-INST-ALIAS: csrr t2, 0xc91
138 csrrs t2
, 0xC91, zero
142 # CHECK-INST: csrrs t2, 3218, zero
143 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xc9]
144 # CHECK-INST-ALIAS: csrr t2, 0xc92
145 csrrs t2
, 0xC92, zero
149 # CHECK-INST: csrrs t2, 3219, zero
150 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xc9]
151 # CHECK-INST-ALIAS: csrr t2, 0xc93
152 csrrs t2
, 0xC93, zero
156 # CHECK-INST: csrrs t2, 3220, zero
157 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xc9]
158 # CHECK-INST-ALIAS: csrr t2, 0xc94
159 csrrs t2
, 0xC94, zero
163 # CHECK-INST: csrrs t2, 3221, zero
164 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0xc9]
165 # CHECK-INST-ALIAS: csrr t2, 0xc95
166 csrrs t2
, 0xC95, zero
170 # CHECK-INST: csrrs t2, 3222, zero
171 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0xc9]
172 # CHECK-INST-ALIAS: csrr t2, 0xc96
173 csrrs t2
, 0xC96, zero
177 # CHECK-INST: csrrs t2, 3223, zero
178 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0xc9]
179 # CHECK-INST-ALIAS: csrr t2, 0xc97
180 csrrs t2
, 0xC97, zero
184 # CHECK-INST: csrrs t2, 3224, zero
185 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0xc9]
186 # CHECK-INST-ALIAS: csrr t2, 0xc98
187 csrrs t2
, 0xC98, zero
191 # CHECK-INST: csrrs t2, 3225, zero
192 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0xc9]
193 # CHECK-INST-ALIAS: csrr t2, 0xc99
194 csrrs t2
, 0xC99, zero
198 # CHECK-INST: csrrs t2, 3226, zero
199 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0xc9]
200 # CHECK-INST-ALIAS: csrr t2, 0xc9a
201 csrrs t2
, 0xC9A, zero
205 # CHECK-INST: csrrs t2, 3227, zero
206 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0xc9]
207 # CHECK-INST-ALIAS: csrr t2, 0xc9b
208 csrrs t2
, 0xC9B, zero
212 # CHECK-INST: csrrs t2, 3228, zero
213 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0xc9]
214 # CHECK-INST-ALIAS: csrr t2, 0xc9c
215 csrrs t2
, 0xC9C, zero
219 # CHECK-INST: csrrs t2, 3229, zero
220 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0xc9]
221 # CHECK-INST-ALIAS: csrr t2, 0xc9d
222 csrrs t2
, 0xC9D, zero
226 # CHECK-INST: csrrs t2, 3230, zero
227 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0xc9]
228 # CHECK-INST-ALIAS: csrr t2, 0xc9e
229 csrrs t2
, 0xC9E, zero
233 # CHECK-INST: csrrs t2, 3231, zero
234 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0xc9]
235 # CHECK-INST-ALIAS: csrr t2, 0xc9f
236 csrrs t2
, 0xC9F, zero