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, 3200
23 # CHECK-INST: csrrs t2, 3201, zero
24 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0xc8]
25 # CHECK-INST-ALIAS: csrr t2, 3201
30 # CHECK-INST: csrrs t2, 3202, zero
31 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xc8]
32 # CHECK-INST-ALIAS: csrr t2, 3202
37 # CHECK-INST: csrrs t2, 3203, zero
38 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xc8]
39 # CHECK-INST-ALIAS: csrr t2, 3203
44 # CHECK-INST: csrrs t2, 3204, zero
45 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xc8]
46 # CHECK-INST-ALIAS: csrr t2, 3204
51 # CHECK-INST: csrrs t2, 3205, zero
52 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0xc8]
53 # CHECK-INST-ALIAS: csrr t2, 3205
58 # CHECK-INST: csrrs t2, 3206, zero
59 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0xc8]
60 # CHECK-INST-ALIAS: csrr t2, 3206
65 # CHECK-INST: csrrs t2, 3207, zero
66 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0xc8]
67 # CHECK-INST-ALIAS: csrr t2, 3207
72 # CHECK-INST: csrrs t2, 3208, zero
73 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0xc8]
74 # CHECK-INST-ALIAS: csrr t2, 3208
79 # CHECK-INST: csrrs t2, 3209, zero
80 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0xc8]
81 # CHECK-INST-ALIAS: csrr t2, 3209
86 # CHECK-INST: csrrs t2, 3210, zero
87 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0xc8]
88 # CHECK-INST-ALIAS: csrr t2, 3210
93 # CHECK-INST: csrrs t2, 3211, zero
94 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0xc8]
95 # CHECK-INST-ALIAS: csrr t2, 3211
100 # CHECK-INST: csrrs t2, 3212, zero
101 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0xc8]
102 # CHECK-INST-ALIAS: csrr t2, 3212
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, 3213
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, 3214
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, 3215
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, 3216
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, 3217
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, 3218
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, 3219
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, 3220
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, 3221
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, 3222
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, 3223
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, 3224
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, 3225
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, 3226
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, 3227
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, 3228
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, 3229
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, 3230
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, 3231
236 csrrs t2
, 0xC9F, zero