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 machine mode CSR register names are RV32 only, but RV64
8 # can encode and disassemble these registers if given their value.
10 ######################################
11 # Machine Protection and Translation
12 ######################################
16 # CHECK-INST: csrrs t2, 929, zero
17 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x3a]
18 # CHECK-INST-ALIAS: csrr t2, 929
23 # CHECK-INST: csrrs t2, 931, zero
24 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0x3a]
25 # CHECK-INST-ALIAS: csrr t2, 931
28 ######################################
29 # Machine Counter and Timers
30 ######################################
33 # CHECK-INST: csrrs t2, 2944, zero
34 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0xb8]
35 # CHECK-INST-ALIAS: csrr t2, 2944
40 # CHECK-INST: csrrs t2, 2946, zero
41 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xb8]
42 # CHECK-INST-ALIAS: csrr t2, 2946
47 # CHECK-INST: csrrs t2, 2947, zero
48 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xb8]
49 # CHECK-INST-ALIAS: csrr t2, 2947
54 # CHECK-INST: csrrs t2, 2948, zero
55 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xb8]
56 # CHECK-INST-ALIAS: csrr t2, 2948
61 # CHECK-INST: csrrs t2, 2949, zero
62 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0xb8]
63 # CHECK-INST-ALIAS: csrr t2, 2949
68 # CHECK-INST: csrrs t2, 2950, zero
69 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0xb8]
70 # CHECK-INST-ALIAS: csrr t2, 2950
75 # CHECK-INST: csrrs t2, 2951, zero
76 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0xb8]
77 # CHECK-INST-ALIAS: csrr t2, 2951
82 # CHECK-INST: csrrs t2, 2952, zero
83 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0xb8]
84 # CHECK-INST-ALIAS: csrr t2, 2952
89 # CHECK-INST: csrrs t2, 2953, zero
90 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0xb8]
91 # CHECK-INST-ALIAS: csrr t2, 2953
96 # CHECK-INST: csrrs t2, 2954, zero
97 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0xb8]
98 # CHECK-INST-ALIAS: csrr t2, 2954
103 # CHECK-INST: csrrs t2, 2955, zero
104 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0xb8]
105 # CHECK-INST-ALIAS: csrr t2, 2955
106 csrrs t2
, 0xB8B, zero
110 # CHECK-INST: csrrs t2, 2956, zero
111 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0xb8]
112 # CHECK-INST-ALIAS: csrr t2, 2956
113 csrrs t2
, 0xB8C, zero
117 # CHECK-INST: csrrs t2, 2957, zero
118 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0xb8]
119 # CHECK-INST-ALIAS: csrr t2, 2957
120 csrrs t2
, 0xB8D, zero
124 # CHECK-INST: csrrs t2, 2958, zero
125 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0xb8]
126 # CHECK-INST-ALIAS: csrr t2, 2958
127 csrrs t2
, 0xB8E, zero
131 # CHECK-INST: csrrs t2, 2959, zero
132 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0xb8]
133 # CHECK-INST-ALIAS: csrr t2, 2959
134 csrrs t2
, 0xB8F, zero
138 # CHECK-INST: csrrs t2, 2960, zero
139 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0xb9]
140 # CHECK-INST-ALIAS: csrr t2, 2960
141 csrrs t2
, 0xB90, zero
145 # CHECK-INST: csrrs t2, 2961, zero
146 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0xb9]
147 # CHECK-INST-ALIAS: csrr t2, 2961
148 csrrs t2
, 0xB91, zero
152 # CHECK-INST: csrrs t2, 2962, zero
153 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xb9]
154 # CHECK-INST-ALIAS: csrr t2, 2962
155 csrrs t2
, 0xB92, zero
159 # CHECK-INST: csrrs t2, 2963, zero
160 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xb9]
161 # CHECK-INST-ALIAS: csrr t2, 2963
162 csrrs t2
, 0xB93, zero
166 # CHECK-INST: csrrs t2, 2964, zero
167 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xb9]
168 # CHECK-INST-ALIAS: csrr t2, 2964
169 csrrs t2
, 0xB94, zero
173 # CHECK-INST: csrrs t2, 2965, zero
174 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0xb9]
175 # CHECK-INST-ALIAS: csrr t2, 2965
176 csrrs t2
, 0xB95, zero
180 # CHECK-INST: csrrs t2, 2966, zero
181 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0xb9]
182 # CHECK-INST-ALIAS: csrr t2, 2966
183 csrrs t2
, 0xB96, zero
187 # CHECK-INST: csrrs t2, 2967, zero
188 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0xb9]
189 # CHECK-INST-ALIAS: csrr t2, 2967
190 csrrs t2
, 0xB97, zero
194 # CHECK-INST: csrrs t2, 2968, zero
195 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0xb9]
196 # CHECK-INST-ALIAS: csrr t2, 2968
197 csrrs t2
, 0xB98, zero
201 # CHECK-INST: csrrs t2, 2969, zero
202 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0xb9]
203 # CHECK-INST-ALIAS: csrr t2, 2969
204 csrrs t2
, 0xB99, zero
208 # CHECK-INST: csrrs t2, 2970, zero
209 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0xb9]
210 # CHECK-INST-ALIAS: csrr t2, 2970
211 csrrs t2
, 0xB9A, zero
215 # CHECK-INST: csrrs t2, 2971, zero
216 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0xb9]
217 # CHECK-INST-ALIAS: csrr t2, 2971
218 csrrs t2
, 0xB9B, zero
222 # CHECK-INST: csrrs t2, 2972, zero
223 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0xb9]
224 # CHECK-INST-ALIAS: csrr t2, 2972
225 csrrs t2
, 0xB9C, zero
229 # CHECK-INST: csrrs t2, 2973, zero
230 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0xb9]
231 # CHECK-INST-ALIAS: csrr t2, 2973
232 csrrs t2
, 0xB9D, zero
236 # CHECK-INST: csrrs t2, 2974, zero
237 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0xb9]
238 # CHECK-INST-ALIAS: csrr t2, 2974
239 csrrs t2
, 0xB9E, zero
243 # CHECK-INST: csrrs t2, 2975, zero
244 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0xb9]
245 # CHECK-INST-ALIAS: csrr t2, 2975
246 csrrs t2
, 0xB9F, zero