1 # RUN: llvm-mc %s -triple=riscv32 -riscv-no-aliases -show-encoding \
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 %s -triple=riscv64 -riscv-no-aliases -show-encoding \
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 ##################################
14 # Machine Information Registers
15 ##################################
19 # CHECK-INST: csrrs t1, mvendorid, zero
20 # CHECK-ENC: encoding: [0x73,0x23,0x10,0xf1]
21 # CHECK-INST-ALIAS: csrr t1, mvendorid
23 # CHECK-INST: csrrs t2, mvendorid, zero
24 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0xf1]
25 # CHECK-INST-ALIAS: csrr t2, mvendorid
27 csrrs t1
, mvendorid
, zero
33 # CHECK-INST: csrrs t1, marchid, zero
34 # CHECK-ENC: encoding: [0x73,0x23,0x20,0xf1]
35 # CHECK-INST-ALIAS: csrr t1, marchid
37 # CHECK-INST: csrrs t2, marchid, zero
38 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xf1]
39 # CHECK-INST-ALIAS: csrr t2, marchid
41 csrrs t1
, marchid
, zero
47 # CHECK-INST: csrrs t1, mimpid, zero
48 # CHECK-ENC: encoding: [0x73,0x23,0x30,0xf1]
49 # CHECK-INST-ALIAS: csrr t1, mimpid
51 # CHECK-INST: csrrs t2, mimpid, zero
52 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xf1]
53 # CHECK-INST-ALIAS: csrr t2, mimpid
54 csrrs t1
, mimpid
, zero
60 # CHECK-INST: csrrs t1, mhartid, zero
61 # CHECK-ENC: encoding: [0x73,0x23,0x40,0xf1]
62 # CHECK-INST-ALIAS: csrr t1, mhartid
64 # CHECK-INST: csrrs t2, mhartid, zero
65 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xf1]
66 # CHECK-INST-ALIAS: csrr t2, mhartid
68 csrrs t1
, mhartid
, zero
72 ##################################
74 ##################################
78 # CHECK-INST: csrrs t1, mstatus, zero
79 # CHECK-ENC: encoding: [0x73,0x23,0x00,0x30]
80 # CHECK-INST-ALIAS: csrr t1, mstatus
82 # CHECK-INST: csrrs t2, mstatus, zero
83 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x30]
84 # CHECK-INST-ALIAS: csrr t2, mstatus
86 csrrs t1
, mstatus
, zero
92 # CHECK-INST: csrrs t1, misa, zero
93 # CHECK-ENC: encoding: [0x73,0x23,0x10,0x30]
94 # CHECK-INST-ALIAS: csrr t1, misa
96 # CHECK-INST: csrrs t2, misa, zero
97 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x30]
98 # CHECK-INST-ALIAS: csrr t2, misa
102 csrrs t2
, 0x301, zero
106 # CHECK-INST: csrrs t1, medeleg, zero
107 # CHECK-ENC: encoding: [0x73,0x23,0x20,0x30]
108 # CHECK-INST-ALIAS: csrr t1, medeleg
110 # CHECK-INST: csrrs t2, medeleg, zero
111 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0x30]
112 # CHECK-INST-ALIAS: csrr t2, medeleg
114 csrrs t1
, medeleg
, zero
116 csrrs t2
, 0x302, zero
121 # CHECK-INST: csrrs t1, mideleg, zero
122 # CHECK-ENC: encoding: [0x73,0x23,0x30,0x30]
123 # CHECK-INST-ALIAS: csrr t1, mideleg
125 # CHECK-INST: csrrs t2, mideleg, zero
126 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0x30]
127 # CHECK-INST-ALIAS: csrr t2, mideleg
130 csrrs t1
, mideleg
, zero
132 csrrs t2
, 0x303, zero
136 # CHECK-INST: csrrs t1, mie, zero
137 # CHECK-ENC: encoding: [0x73,0x23,0x40,0x30]
138 # CHECK-INST-ALIAS: csrr t1, mie
140 # CHECK-INST: csrrs t2, mie, zero
141 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0x30]
142 # CHECK-INST-ALIAS: csrr t2, mie
146 csrrs t2
, 0x304, zero
150 # CHECK-INST: csrrs t1, mtvec, zero
151 # CHECK-ENC: encoding: [0x73,0x23,0x50,0x30]
152 # CHECK-INST-ALIAS: csrr t1, mtvec
154 # CHECK-INST: csrrs t2, mtvec, zero
155 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0x30]
156 # CHECK-INST-ALIAS: csrr t2, mtvec
158 csrrs t1
, mtvec
, zero
160 csrrs t2
, 0x305, zero
164 # CHECK-INST: csrrs t1, mcounteren, zero
165 # CHECK-ENC: encoding: [0x73,0x23,0x60,0x30]
166 # CHECK-INST-ALIAS: csrr t1, mcounteren
168 # CHECK-INST: csrrs t2, mcounteren, zero
169 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0x30]
170 # CHECK-INST-ALIAS: csrr t2, mcounteren
172 csrrs t1
, mcounteren
, zero
174 csrrs t2
, 0x306, zero
178 # CHECK-INST: csrrs t1, mscratch, zero
179 # CHECK-ENC: encoding: [0x73,0x23,0x00,0x34]
180 # CHECK-INST-ALIAS: csrr t1, mscratch
182 # CHECK-INST: csrrs t2, mscratch, zero
183 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x34]
184 # CHECK-INST-ALIAS: csrr t2, mscratch
186 csrrs t1
, mscratch
, zero
188 csrrs t2
, 0x340, zero
192 # CHECK-INST: csrrs t1, mepc, zero
193 # CHECK-ENC: encoding: [0x73,0x23,0x10,0x34]
194 # CHECK-INST-ALIAS: csrr t1, mepc
196 # CHECK-INST: csrrs t2, mepc, zero
197 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x34]
198 # CHECK-INST-ALIAS: csrr t2, mepc
202 csrrs t2
, 0x341, zero
206 # CHECK-INST: csrrs t1, mcause, zero
207 # CHECK-ENC: encoding: [0x73,0x23,0x20,0x34]
208 # CHECK-INST-ALIAS: csrr t1, mcause
210 # CHECK-INST: csrrs t2, mcause, zero
211 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0x34]
212 # CHECK-INST-ALIAS: csrr t2, mcause
214 csrrs t1
, mcause
, zero
216 csrrs t2
, 0x342, zero
220 # CHECK-INST: csrrs t1, mtval, zero
221 # CHECK-ENC: encoding: [0x73,0x23,0x30,0x34]
222 # CHECK-INST-ALIAS: csrr t1, mtval
224 # CHECK-INST: csrrs t2, mtval, zero
225 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0x34]
226 # CHECK-INST-ALIAS: csrr t2, mtval
228 csrrs t1
, mtval
, zero
230 csrrs t2
, 0x343, zero
234 # CHECK-INST: csrrs t1, mip, zero
235 # CHECK-ENC: encoding: [0x73,0x23,0x40,0x34]
236 # CHECK-INST-ALIAS: csrr t1, mip
238 # CHECK-INST: csrrs t2, mip, zero
239 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0x34]
240 # CHECK-INST-ALIAS: csrr t2, mip
244 csrrs t2
, 0x344, zero
246 ######################################
247 # Machine Protection and Translation
248 ######################################
249 # Tests for pmpcfg1, pmpcfg2 in rv32-machine-csr-names.s
253 # CHECK-INST: csrrs t1, pmpcfg0, zero
254 # CHECK-ENC: encoding: [0x73,0x23,0x00,0x3a]
255 # CHECK-INST-ALIAS: csrr t1, pmpcfg0
257 # CHECK-INST: csrrs t2, pmpcfg0, zero
258 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x3a]
259 # CHECK-INST-ALIAS: csrr t2, pmpcfg0
261 csrrs t1
, pmpcfg0
, zero
263 csrrs t2
, 0x3A0, zero
267 # CHECK-INST: csrrs t1, pmpcfg2, zero
268 # CHECK-ENC: encoding: [0x73,0x23,0x20,0x3a]
269 # CHECK-INST-ALIAS: csrr t1, pmpcfg2
271 # CHECK-INST: csrrs t2, pmpcfg2, zero
272 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0x3a]
273 # CHECK-INST-ALIAS: csrr t2, pmpcfg2
275 csrrs t1
, pmpcfg2
, zero
277 csrrs t2
, 0x3A2, zero
280 ######################################
281 # Machine Counter and Timers
282 ######################################
285 # CHECK-INST: csrrs t1, mcycle, zero
286 # CHECK-ENC: encoding: [0x73,0x23,0x00,0xb0]
287 # CHECK-INST-ALIAS: csrr t1, mcycle
289 # CHECK-INST: csrrs t2, mcycle, zero
290 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0xb0]
291 # CHECK-INST-ALIAS: csrr t2, mcycle
292 csrrs t1
, mcycle
, zero
294 csrrs t2
, 0xB00, zero
298 # CHECK-INST: csrrs t1, minstret, zero
299 # CHECK-ENC: encoding: [0x73,0x23,0x20,0xb0]
300 # CHECK-INST-ALIAS: csrr t1, minstret
302 # CHECK-INST: csrrs t2, minstret, zero
303 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xb0]
304 # CHECK-INST-ALIAS: csrr t2, minstret
306 csrrs t1
, minstret
, zero
308 csrrs t2
, 0xB02, zero
311 ######################################################
312 # Debug and Trace Registers (shared with Debug Mode)
313 ######################################################
316 # CHECK-INST: csrrs t1, tselect, zero
317 # CHECK-ENC: encoding: [0x73,0x23,0x00,0x7a]
318 # CHECK-INST-ALIAS: csrr t1, tselect
320 # CHECK-INST: csrrs t2, tselect, zero
321 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x7a]
322 # CHECK-INST-ALIAS: csrr t2, tselect
324 csrrs t1
, tselect
, zero
326 csrrs t2
, 0x7A0, zero
330 # CHECK-INST: csrrs t1, tdata1, zero
331 # CHECK-ENC: encoding: [0x73,0x23,0x10,0x7a]
332 # CHECK-INST-ALIAS: csrr t1, tdata1
334 # CHECK-INST: csrrs t2, tdata1, zero
335 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x7a]
336 # CHECK-INST-ALIAS: csrr t2, tdata1
338 csrrs t1
, tdata1
, zero
340 csrrs t2
, 0x7A1, zero
344 # CHECK-INST: csrrs t1, tdata2, zero
345 # CHECK-ENC: encoding: [0x73,0x23,0x20,0x7a]
346 # CHECK-INST-ALIAS: csrr t1, tdata2
348 # CHECK-INST: csrrs t2, tdata2, zero
349 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0x7a]
350 # CHECK-INST-ALIAS: csrr t2, tdata2
351 csrrs t1
, tdata2
, zero
353 csrrs t2
, 0x7A2, zero
357 # CHECK-INST: csrrs t1, tdata3, zero
358 # CHECK-ENC: encoding: [0x73,0x23,0x30,0x7a]
359 # CHECK-INST-ALIAS: csrr t1, tdata3
361 # CHECK-INST: csrrs t2, tdata3, zero
362 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0x7a]
363 # CHECK-INST-ALIAS: csrr t2, tdata3
365 csrrs t1
, tdata3
, zero
367 csrrs t2
, 0x7A3, zero
369 #######################
370 # Debug Mode Registers
371 ########################
374 # CHECK-INST: csrrs t1, dcsr, zero
375 # CHECK-ENC: encoding: [0x73,0x23,0x00,0x7b]
376 # CHECK-INST-ALIAS: csrr t1, dcsr
378 # CHECK-INST: csrrs t2, dcsr, zero
379 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x7b]
380 # CHECK-INST-ALIAS: csrr t2, dcsr
384 csrrs t2
, 0x7B0, zero
388 # CHECK-INST: csrrs t1, dpc, zero
389 # CHECK-ENC: encoding: [0x73,0x23,0x10,0x7b]
390 # CHECK-INST-ALIAS: csrr t1, dpc
392 # CHECK-INST: csrrs t2, dpc, zero
393 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x7b]
394 # CHECK-INST-ALIAS: csrr t2, dpc
398 csrrs t2
, 0x7B1, zero
402 # CHECK-INST: csrrs t1, dscratch, zero
403 # CHECK-ENC: encoding: [0x73,0x23,0x20,0x7b]
404 # CHECK-INST-ALIAS: csrr t1, dscratch
406 # CHECK-INST: csrrs t2, dscratch, zero
407 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0x7b]
408 # CHECK-INST-ALIAS: csrr t2, dscratch
410 csrrs t1
, dscratch
, zero
412 csrrs t2
, 0x7B2, zero
416 # CHECK-INST: csrrs t1, mhpmcounter3, zero
417 # CHECK-ENC: encoding: [0x73,0x23,0x30,0xb0]
418 # CHECK-INST-ALIAS: csrr t1, mhpmcounter3
420 # CHECK-INST: csrrs t2, mhpmcounter3, zero
421 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xb0]
422 # CHECK-INST-ALIAS: csrr t2, mhpmcounter3
424 csrrs t1
, mhpmcounter3
, zero
426 csrrs t2
, 0xB03, zero
430 # CHECK-INST: csrrs t1, mhpmcounter4, zero
431 # CHECK-ENC: encoding: [0x73,0x23,0x40,0xb0]
432 # CHECK-INST-ALIAS: csrr t1, mhpmcounter4
434 # CHECK-INST: csrrs t2, mhpmcounter4, zero
435 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xb0]
436 # CHECK-INST-ALIAS: csrr t2, mhpmcounter4
438 csrrs t1
, mhpmcounter4
, zero
440 csrrs t2
, 0xB04, zero
444 # CHECK-INST: csrrs t1, mhpmcounter5, zero
445 # CHECK-ENC: encoding: [0x73,0x23,0x50,0xb0]
446 # CHECK-INST-ALIAS: csrr t1, mhpmcounter5
448 # CHECK-INST: csrrs t2, mhpmcounter5, zero
449 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0xb0]
450 # CHECK-INST-ALIAS: csrr t2, mhpmcounter5
452 csrrs t1
, mhpmcounter5
, zero
454 csrrs t2
, 0xB05, zero
458 # CHECK-INST: csrrs t1, mhpmcounter6, zero
459 # CHECK-ENC: encoding: [0x73,0x23,0x60,0xb0]
460 # CHECK-INST-ALIAS: csrr t1, mhpmcounter6
462 # CHECK-INST: csrrs t2, mhpmcounter6, zero
463 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0xb0]
464 # CHECK-INST-ALIAS: csrr t2, mhpmcounter6
466 csrrs t1
, mhpmcounter6
, zero
468 csrrs t2
, 0xB06, zero
472 # CHECK-INST: csrrs t1, mhpmcounter7, zero
473 # CHECK-ENC: encoding: [0x73,0x23,0x70,0xb0]
474 # CHECK-INST-ALIAS: csrr t1, mhpmcounter7
476 # CHECK-INST: csrrs t2, mhpmcounter7, zero
477 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0xb0]
478 # CHECK-INST-ALIAS: csrr t2, mhpmcounter7
480 csrrs t1
, mhpmcounter7
, zero
482 csrrs t2
, 0xB07, zero
486 # CHECK-INST: csrrs t1, mhpmcounter8, zero
487 # CHECK-ENC: encoding: [0x73,0x23,0x80,0xb0]
488 # CHECK-INST-ALIAS: csrr t1, mhpmcounter8
490 # CHECK-INST: csrrs t2, mhpmcounter8, zero
491 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0xb0]
492 # CHECK-INST-ALIAS: csrr t2, mhpmcounter8
494 csrrs t1
, mhpmcounter8
, zero
496 csrrs t2
, 0xB08, zero
500 # CHECK-INST: csrrs t1, mhpmcounter9, zero
501 # CHECK-ENC: encoding: [0x73,0x23,0x90,0xb0]
502 # CHECK-INST-ALIAS: csrr t1, mhpmcounter9
504 # CHECK-INST: csrrs t2, mhpmcounter9, zero
505 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0xb0]
506 # CHECK-INST-ALIAS: csrr t2, mhpmcounter9
508 csrrs t1
, mhpmcounter9
, zero
510 csrrs t2
, 0xB09, zero
514 # CHECK-INST: csrrs t1, mhpmcounter10, zero
515 # CHECK-ENC: encoding: [0x73,0x23,0xa0,0xb0]
516 # CHECK-INST-ALIAS: csrr t1, mhpmcounter10
518 # CHECK-INST: csrrs t2, mhpmcounter10, zero
519 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0xb0]
520 # CHECK-INST-ALIAS: csrr t2, mhpmcounter10
522 csrrs t1
, mhpmcounter10
, zero
524 csrrs t2
, 0xB0A, zero
528 # CHECK-INST: csrrs t1, mhpmcounter11, zero
529 # CHECK-ENC: encoding: [0x73,0x23,0xb0,0xb0]
530 # CHECK-INST-ALIAS: csrr t1, mhpmcounter11
532 # CHECK-INST: csrrs t2, mhpmcounter11, zero
533 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0xb0]
534 # CHECK-INST-ALIAS: csrr t2, mhpmcounter11
536 csrrs t1
, mhpmcounter11
, zero
538 csrrs t2
, 0xB0B, zero
542 # CHECK-INST: csrrs t1, mhpmcounter12, zero
543 # CHECK-ENC: encoding: [0x73,0x23,0xc0,0xb0]
544 # CHECK-INST-ALIAS: csrr t1, mhpmcounter12
546 # CHECK-INST: csrrs t2, mhpmcounter12, zero
547 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0xb0]
548 # CHECK-INST-ALIAS: csrr t2, mhpmcounter12
550 csrrs t1
, mhpmcounter12
, zero
552 csrrs t2
, 0xB0C, zero
556 # CHECK-INST: csrrs t1, mhpmcounter13, zero
557 # CHECK-ENC: encoding: [0x73,0x23,0xd0,0xb0]
558 # CHECK-INST-ALIAS: csrr t1, mhpmcounter13
560 # CHECK-INST: csrrs t2, mhpmcounter13, zero
561 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0xb0]
562 # CHECK-INST-ALIAS: csrr t2, mhpmcounter13
564 csrrs t1
, mhpmcounter13
, zero
566 csrrs t2
, 0xB0D, zero
570 # CHECK-INST: csrrs t1, mhpmcounter14, zero
571 # CHECK-ENC: encoding: [0x73,0x23,0xe0,0xb0]
572 # CHECK-INST-ALIAS: csrr t1, mhpmcounter14
574 # CHECK-INST: csrrs t2, mhpmcounter14, zero
575 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0xb0]
576 # CHECK-INST-ALIAS: csrr t2, mhpmcounter14
578 csrrs t1
, mhpmcounter14
, zero
580 csrrs t2
, 0xB0E, zero
584 # CHECK-INST: csrrs t1, mhpmcounter15, zero
585 # CHECK-ENC: encoding: [0x73,0x23,0xf0,0xb0]
586 # CHECK-INST-ALIAS: csrr t1, mhpmcounter15
588 # CHECK-INST: csrrs t2, mhpmcounter15, zero
589 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0xb0]
590 # CHECK-INST-ALIAS: csrr t2, mhpmcounter15
592 csrrs t1
, mhpmcounter15
, zero
594 csrrs t2
, 0xB0F, zero
598 # CHECK-INST: csrrs t1, mhpmcounter16, zero
599 # CHECK-ENC: encoding: [0x73,0x23,0x00,0xb1]
600 # CHECK-INST-ALIAS: csrr t1, mhpmcounter16
602 # CHECK-INST: csrrs t2, mhpmcounter16, zero
603 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0xb1]
604 # CHECK-INST-ALIAS: csrr t2, mhpmcounter16
606 csrrs t1
, mhpmcounter16
, zero
608 csrrs t2
, 0xB10, zero
612 # CHECK-INST: csrrs t1, mhpmcounter17, zero
613 # CHECK-ENC: encoding: [0x73,0x23,0x10,0xb1]
614 # CHECK-INST-ALIAS: csrr t1, mhpmcounter17
616 # CHECK-INST: csrrs t2, mhpmcounter17, zero
617 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0xb1]
618 # CHECK-INST-ALIAS: csrr t2, mhpmcounter17
620 csrrs t1
, mhpmcounter17
, zero
622 csrrs t2
, 0xB11, zero
626 # CHECK-INST: csrrs t1, mhpmcounter18, zero
627 # CHECK-ENC: encoding: [0x73,0x23,0x20,0xb1]
628 # CHECK-INST-ALIAS: csrr t1, mhpmcounter18
630 # CHECK-INST: csrrs t2, mhpmcounter18, zero
631 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0xb1]
632 # CHECK-INST-ALIAS: csrr t2, mhpmcounter18
634 csrrs t1
, mhpmcounter18
, zero
636 csrrs t2
, 0xB12, zero
640 # CHECK-INST: csrrs t1, mhpmcounter19, zero
641 # CHECK-ENC: encoding: [0x73,0x23,0x30,0xb1]
642 # CHECK-INST-ALIAS: csrr t1, mhpmcounter19
644 # CHECK-INST: csrrs t2, mhpmcounter19, zero
645 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0xb1]
646 # CHECK-INST-ALIAS: csrr t2, mhpmcounter19
648 csrrs t1
, mhpmcounter19
, zero
650 csrrs t2
, 0xB13, zero
654 # CHECK-INST: csrrs t1, mhpmcounter20, zero
655 # CHECK-ENC: encoding: [0x73,0x23,0x40,0xb1]
656 # CHECK-INST-ALIAS: csrr t1, mhpmcounter20
658 # CHECK-INST: csrrs t2, mhpmcounter20, zero
659 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0xb1]
660 # CHECK-INST-ALIAS: csrr t2, mhpmcounter20
662 csrrs t1
, mhpmcounter20
, zero
664 csrrs t2
, 0xB14, zero
668 # CHECK-INST: csrrs t1, mhpmcounter21, zero
669 # CHECK-ENC: encoding: [0x73,0x23,0x50,0xb1]
670 # CHECK-INST-ALIAS: csrr t1, mhpmcounter21
672 # CHECK-INST: csrrs t2, mhpmcounter21, zero
673 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0xb1]
674 # CHECK-INST-ALIAS: csrr t2, mhpmcounter21
676 csrrs t1
, mhpmcounter21
, zero
678 csrrs t2
, 0xB15, zero
682 # CHECK-INST: csrrs t1, mhpmcounter22, zero
683 # CHECK-ENC: encoding: [0x73,0x23,0x60,0xb1]
684 # CHECK-INST-ALIAS: csrr t1, mhpmcounter22
686 # CHECK-INST: csrrs t2, mhpmcounter22, zero
687 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0xb1]
688 # CHECK-INST-ALIAS: csrr t2, mhpmcounter22
690 csrrs t1
, mhpmcounter22
, zero
692 csrrs t2
, 0xB16, zero
696 # CHECK-INST: csrrs t1, mhpmcounter23, zero
697 # CHECK-ENC: encoding: [0x73,0x23,0x70,0xb1]
698 # CHECK-INST-ALIAS: csrr t1, mhpmcounter23
700 # CHECK-INST: csrrs t2, mhpmcounter23, zero
701 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0xb1]
702 # CHECK-INST-ALIAS: csrr t2, mhpmcounter23
704 csrrs t1
, mhpmcounter23
, zero
706 csrrs t2
, 0xB17, zero
710 # CHECK-INST: csrrs t1, mhpmcounter24, zero
711 # CHECK-ENC: encoding: [0x73,0x23,0x80,0xb1]
712 # CHECK-INST-ALIAS: csrr t1, mhpmcounter24
714 # CHECK-INST: csrrs t2, mhpmcounter24, zero
715 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0xb1]
716 # CHECK-INST-ALIAS: csrr t2, mhpmcounter24
718 csrrs t1
, mhpmcounter24
, zero
720 csrrs t2
, 0xB18, zero
724 # CHECK-INST: csrrs t1, mhpmcounter25, zero
725 # CHECK-ENC: encoding: [0x73,0x23,0x90,0xb1]
726 # CHECK-INST-ALIAS: csrr t1, mhpmcounter25
728 # CHECK-INST: csrrs t2, mhpmcounter25, zero
729 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0xb1]
730 # CHECK-INST-ALIAS: csrr t2, mhpmcounter25
732 csrrs t1
, mhpmcounter25
, zero
734 csrrs t2
, 0xB19, zero
738 # CHECK-INST: csrrs t1, mhpmcounter26, zero
739 # CHECK-ENC: encoding: [0x73,0x23,0xa0,0xb1]
740 # CHECK-INST-ALIAS: csrr t1, mhpmcounter26
742 # CHECK-INST: csrrs t2, mhpmcounter26, zero
743 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0xb1]
744 # CHECK-INST-ALIAS: csrr t2, mhpmcounter26
746 csrrs t1
, mhpmcounter26
, zero
748 csrrs t2
, 0xB1A, zero
752 # CHECK-INST: csrrs t1, mhpmcounter27, zero
753 # CHECK-ENC: encoding: [0x73,0x23,0xb0,0xb1]
754 # CHECK-INST-ALIAS: csrr t1, mhpmcounter27
756 # CHECK-INST: csrrs t2, mhpmcounter27, zero
757 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0xb1]
758 # CHECK-INST-ALIAS: csrr t2, mhpmcounter27
760 csrrs t1
, mhpmcounter27
, zero
762 csrrs t2
, 0xB1B, zero
766 # CHECK-INST: csrrs t1, mhpmcounter28, zero
767 # CHECK-ENC: encoding: [0x73,0x23,0xc0,0xb1]
768 # CHECK-INST-ALIAS: csrr t1, mhpmcounter28
770 # CHECK-INST: csrrs t2, mhpmcounter28, zero
771 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0xb1]
772 # CHECK-INST-ALIAS: csrr t2, mhpmcounter28
774 csrrs t1
, mhpmcounter28
, zero
776 csrrs t2
, 0xB1C, zero
780 # CHECK-INST: csrrs t1, mhpmcounter29, zero
781 # CHECK-ENC: encoding: [0x73,0x23,0xd0,0xb1]
782 # CHECK-INST-ALIAS: csrr t1, mhpmcounter29
784 # CHECK-INST: csrrs t2, mhpmcounter29, zero
785 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0xb1]
786 # CHECK-INST-ALIAS: csrr t2, mhpmcounter29
788 csrrs t1
, mhpmcounter29
, zero
790 csrrs t2
, 0xB1D, zero
794 # CHECK-INST: csrrs t1, mhpmcounter30, zero
795 # CHECK-ENC: encoding: [0x73,0x23,0xe0,0xb1]
796 # CHECK-INST-ALIAS: csrr t1, mhpmcounter30
798 # CHECK-INST: csrrs t2, mhpmcounter30, zero
799 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0xb1]
800 # CHECK-INST-ALIAS: csrr t2, mhpmcounter30
802 csrrs t1
, mhpmcounter30
, zero
804 csrrs t2
, 0xB1E, zero
808 # CHECK-INST: csrrs t1, mhpmcounter31, zero
809 # CHECK-ENC: encoding: [0x73,0x23,0xf0,0xb1]
810 # CHECK-INST-ALIAS: csrr t1, mhpmcounter31
812 # CHECK-INST: csrrs t2, mhpmcounter31, zero
813 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0xb1]
814 # CHECK-INST-ALIAS: csrr t2, mhpmcounter31
816 csrrs t1
, mhpmcounter31
, zero
818 csrrs t2
, 0xB1F, zero
821 ######################################
822 # Machine Counter Setup
823 ######################################
826 # CHECK-INST: csrrs t1, mhpmevent3, zero
827 # CHECK-ENC: encoding: [0x73,0x23,0x30,0x32]
828 # CHECK-INST-ALIAS: csrr t1, mhpmevent3
830 # CHECK-INST: csrrs t2, mhpmevent3, zero
831 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0x32]
832 # CHECK-INST-ALIAS: csrr t2, mhpmevent3
834 csrrs t1
, mhpmevent3
, zero
836 csrrs t2
, 0x323, zero
840 # CHECK-INST: csrrs t1, mhpmevent4, zero
841 # CHECK-ENC: encoding: [0x73,0x23,0x40,0x32]
842 # CHECK-INST-ALIAS: csrr t1, mhpmevent4
844 # CHECK-INST: csrrs t2, mhpmevent4, zero
845 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0x32]
846 # CHECK-INST-ALIAS: csrr t2, mhpmevent4
848 csrrs t1
, mhpmevent4
, zero
850 csrrs t2
, 0x324, zero
854 # CHECK-INST: csrrs t1, mhpmevent5, zero
855 # CHECK-ENC: encoding: [0x73,0x23,0x50,0x32]
856 # CHECK-INST-ALIAS: csrr t1, mhpmevent5
858 # CHECK-INST: csrrs t2, mhpmevent5, zero
859 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0x32]
860 # CHECK-INST-ALIAS: csrr t2, mhpmevent5
862 csrrs t1
, mhpmevent5
, zero
864 csrrs t2
, 0x325, zero
868 # CHECK-INST: csrrs t1, mhpmevent6, zero
869 # CHECK-ENC: encoding: [0x73,0x23,0x60,0x32]
870 # CHECK-INST-ALIAS: csrr t1, mhpmevent6
872 # CHECK-INST: csrrs t2, mhpmevent6, zero
873 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0x32]
874 # CHECK-INST-ALIAS: csrr t2, mhpmevent6
876 csrrs t1
, mhpmevent6
, zero
878 csrrs t2
, 0x326, zero
882 # CHECK-INST: csrrs t1, mhpmevent7, zero
883 # CHECK-ENC: encoding: [0x73,0x23,0x70,0x32]
884 # CHECK-INST-ALIAS: csrr t1, mhpmevent7
886 # CHECK-INST: csrrs t2, mhpmevent7, zero
887 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0x32]
888 # CHECK-INST-ALIAS: csrr t2, mhpmevent7
890 csrrs t1
, mhpmevent7
, zero
892 csrrs t2
, 0x327, zero
896 # CHECK-INST: csrrs t1, mhpmevent8, zero
897 # CHECK-ENC: encoding: [0x73,0x23,0x80,0x32]
898 # CHECK-INST-ALIAS: csrr t1, mhpmevent8
900 # CHECK-INST: csrrs t2, mhpmevent8, zero
901 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0x32]
902 # CHECK-INST-ALIAS: csrr t2, mhpmevent8
904 csrrs t1
, mhpmevent8
, zero
906 csrrs t2
, 0x328, zero
910 # CHECK-INST: csrrs t1, mhpmevent9, zero
911 # CHECK-ENC: encoding: [0x73,0x23,0x90,0x32]
912 # CHECK-INST-ALIAS: csrr t1, mhpmevent9
914 # CHECK-INST: csrrs t2, mhpmevent9, zero
915 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0x32]
916 # CHECK-INST-ALIAS: csrr t2, mhpmevent9
918 csrrs t1
, mhpmevent9
, zero
920 csrrs t2
, 0x329, zero
924 # CHECK-INST: csrrs t1, mhpmevent10, zero
925 # CHECK-ENC: encoding: [0x73,0x23,0xa0,0x32]
926 # CHECK-INST-ALIAS: csrr t1, mhpmevent10
928 # CHECK-INST: csrrs t2, mhpmevent10, zero
929 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0x32]
930 # CHECK-INST-ALIAS: csrr t2, mhpmevent10
932 csrrs t1
, mhpmevent10
, zero
934 csrrs t2
, 0x32A, zero
938 # CHECK-INST: csrrs t1, mhpmevent11, zero
939 # CHECK-ENC: encoding: [0x73,0x23,0xb0,0x32]
940 # CHECK-INST-ALIAS: csrr t1, mhpmevent11
942 # CHECK-INST: csrrs t2, mhpmevent11, zero
943 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0x32]
944 # CHECK-INST-ALIAS: csrr t2, mhpmevent11
946 csrrs t1
, mhpmevent11
, zero
948 csrrs t2
, 0x32B, zero
952 # CHECK-INST: csrrs t1, mhpmevent12, zero
953 # CHECK-ENC: encoding: [0x73,0x23,0xc0,0x32]
954 # CHECK-INST-ALIAS: csrr t1, mhpmevent12
956 # CHECK-INST: csrrs t2, mhpmevent12, zero
957 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0x32]
958 # CHECK-INST-ALIAS: csrr t2, mhpmevent12
960 csrrs t1
, mhpmevent12
, zero
962 csrrs t2
, 0x32C, zero
966 # CHECK-INST: csrrs t1, mhpmevent13, zero
967 # CHECK-ENC: encoding: [0x73,0x23,0xd0,0x32]
968 # CHECK-INST-ALIAS: csrr t1, mhpmevent13
970 # CHECK-INST: csrrs t2, mhpmevent13, zero
971 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0x32]
972 # CHECK-INST-ALIAS: csrr t2, mhpmevent13
974 csrrs t1
, mhpmevent13
, zero
976 csrrs t2
, 0x32D, zero
980 # CHECK-INST: csrrs t1, mhpmevent14, zero
981 # CHECK-ENC: encoding: [0x73,0x23,0xe0,0x32]
982 # CHECK-INST-ALIAS: csrr t1, mhpmevent14
985 # CHECK-INST: csrrs t2, mhpmevent14, zero
986 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0x32]
987 # CHECK-INST-ALIAS: csrr t2, mhpmevent14
989 csrrs t1
, mhpmevent14
, zero
991 csrrs t2
, 0x32E, zero
995 # CHECK-INST: csrrs t1, mhpmevent15, zero
996 # CHECK-ENC: encoding: [0x73,0x23,0xf0,0x32]
997 # CHECK-INST-ALIAS: csrr t1, mhpmevent15
999 # CHECK-INST: csrrs t2, mhpmevent15, zero
1000 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0x32]
1001 # CHECK-INST-ALIAS: csrr t2, mhpmevent15
1003 csrrs t1
, mhpmevent15
, zero
1005 csrrs t2
, 0x32F, zero
1009 # CHECK-INST: csrrs t1, mhpmevent16, zero
1010 # CHECK-ENC: encoding: [0x73,0x23,0x00,0x33]
1011 # CHECK-INST-ALIAS: csrr t1, mhpmevent16
1013 # CHECK-INST: csrrs t2, mhpmevent16, zero
1014 # CHECK-ENC: encoding: [0xf3,0x23,0x00,0x33]
1015 # CHECK-INST-ALIAS: csrr t2, mhpmevent16
1017 csrrs t1
, mhpmevent16
, zero
1019 csrrs t2
, 0x330, zero
1023 # CHECK-INST: csrrs t1, mhpmevent17, zero
1024 # CHECK-ENC: encoding: [0x73,0x23,0x10,0x33]
1025 # CHECK-INST-ALIAS: csrr t1, mhpmevent17
1027 # CHECK-INST: csrrs t2, mhpmevent17, zero
1028 # CHECK-ENC: encoding: [0xf3,0x23,0x10,0x33]
1029 # CHECK-INST-ALIAS: csrr t2, mhpmevent17
1031 csrrs t1
, mhpmevent17
, zero
1033 csrrs t2
, 0x331, zero
1037 # CHECK-INST: csrrs t1, mhpmevent18, zero
1038 # CHECK-ENC: encoding: [0x73,0x23,0x20,0x33]
1039 # CHECK-INST-ALIAS: csrr t1, mhpmevent18
1041 # CHECK-INST: csrrs t2, mhpmevent18, zero
1042 # CHECK-ENC: encoding: [0xf3,0x23,0x20,0x33]
1043 # CHECK-INST-ALIAS: csrr t2, mhpmevent18
1045 csrrs t1
, mhpmevent18
, zero
1047 csrrs t2
, 0x332, zero
1051 # CHECK-INST: csrrs t1, mhpmevent19, zero
1052 # CHECK-ENC: encoding: [0x73,0x23,0x30,0x33]
1053 # CHECK-INST-ALIAS: csrr t1, mhpmevent19
1055 # CHECK-INST: csrrs t2, mhpmevent19, zero
1056 # CHECK-ENC: encoding: [0xf3,0x23,0x30,0x33]
1057 # CHECK-INST-ALIAS: csrr t2, mhpmevent19
1059 csrrs t1
, mhpmevent19
, zero
1061 csrrs t2
, 0x333, zero
1065 # CHECK-INST: csrrs t1, mhpmevent20, zero
1066 # CHECK-ENC: encoding: [0x73,0x23,0x40,0x33]
1067 # CHECK-INST-ALIAS: csrr t1, mhpmevent20
1069 # CHECK-INST: csrrs t2, mhpmevent20, zero
1070 # CHECK-ENC: encoding: [0xf3,0x23,0x40,0x33]
1071 # CHECK-INST-ALIAS: csrr t2, mhpmevent20
1073 csrrs t1
, mhpmevent20
, zero
1075 csrrs t2
, 0x334, zero
1079 # CHECK-INST: csrrs t1, mhpmevent21, zero
1080 # CHECK-ENC: encoding: [0x73,0x23,0x50,0x33]
1081 # CHECK-INST-ALIAS: csrr t1, mhpmevent21
1083 # CHECK-INST: csrrs t2, mhpmevent21, zero
1084 # CHECK-ENC: encoding: [0xf3,0x23,0x50,0x33]
1085 # CHECK-INST-ALIAS: csrr t2, mhpmevent21
1087 csrrs t1
, mhpmevent21
, zero
1089 csrrs t2
, 0x335, zero
1093 # CHECK-INST: csrrs t1, mhpmevent22, zero
1094 # CHECK-ENC: encoding: [0x73,0x23,0x60,0x33]
1095 # CHECK-INST-ALIAS: csrr t1, mhpmevent22
1097 # CHECK-INST: csrrs t2, mhpmevent22, zero
1098 # CHECK-ENC: encoding: [0xf3,0x23,0x60,0x33]
1099 # CHECK-INST-ALIAS: csrr t2, mhpmevent22
1101 csrrs t1
, mhpmevent22
, zero
1103 csrrs t2
, 0x336, zero
1107 # CHECK-INST: csrrs t1, mhpmevent23, zero
1108 # CHECK-ENC: encoding: [0x73,0x23,0x70,0x33]
1109 # CHECK-INST-ALIAS: csrr t1, mhpmevent23
1111 # CHECK-INST: csrrs t2, mhpmevent23, zero
1112 # CHECK-ENC: encoding: [0xf3,0x23,0x70,0x33]
1113 # CHECK-INST-ALIAS: csrr t2, mhpmevent23
1115 csrrs t1
, mhpmevent23
, zero
1117 csrrs t2
, 0x337, zero
1121 # CHECK-INST: csrrs t1, mhpmevent24, zero
1122 # CHECK-ENC: encoding: [0x73,0x23,0x80,0x33]
1123 # CHECK-INST-ALIAS: csrr t1, mhpmevent24
1125 # CHECK-INST: csrrs t2, mhpmevent24, zero
1126 # CHECK-ENC: encoding: [0xf3,0x23,0x80,0x33]
1127 # CHECK-INST-ALIAS: csrr t2, mhpmevent24
1129 csrrs t1
, mhpmevent24
, zero
1131 csrrs t2
, 0x338, zero
1135 # CHECK-INST: csrrs t1, mhpmevent25, zero
1136 # CHECK-ENC: encoding: [0x73,0x23,0x90,0x33]
1137 # CHECK-INST-ALIAS: csrr t1, mhpmevent25
1139 # CHECK-INST: csrrs t2, mhpmevent25, zero
1140 # CHECK-ENC: encoding: [0xf3,0x23,0x90,0x33]
1141 # CHECK-INST-ALIAS: csrr t2, mhpmevent25
1143 csrrs t1
, mhpmevent25
, zero
1145 csrrs t2
, 0x339, zero
1149 # CHECK-INST: csrrs t1, mhpmevent26, zero
1150 # CHECK-ENC: encoding: [0x73,0x23,0xa0,0x33]
1151 # CHECK-INST-ALIAS: csrr t1, mhpmevent26
1153 # CHECK-INST: csrrs t2, mhpmevent26, zero
1154 # CHECK-ENC: encoding: [0xf3,0x23,0xa0,0x33]
1155 # CHECK-INST-ALIAS: csrr t2, mhpmevent26
1157 csrrs t1
, mhpmevent26
, zero
1159 csrrs t2
, 0x33A, zero
1163 # CHECK-INST: csrrs t1, mhpmevent27, zero
1164 # CHECK-ENC: encoding: [0x73,0x23,0xb0,0x33]
1165 # CHECK-INST-ALIAS: csrr t1, mhpmevent27
1167 # CHECK-INST: csrrs t2, mhpmevent27, zero
1168 # CHECK-ENC: encoding: [0xf3,0x23,0xb0,0x33]
1169 # CHECK-INST-ALIAS: csrr t2, mhpmevent27
1171 csrrs t1
, mhpmevent27
, zero
1173 csrrs t2
, 0x33B, zero
1177 # CHECK-INST: csrrs t1, mhpmevent28, zero
1178 # CHECK-ENC: encoding: [0x73,0x23,0xc0,0x33]
1179 # CHECK-INST-ALIAS: csrr t1, mhpmevent28
1181 # CHECK-INST: csrrs t2, mhpmevent28, zero
1182 # CHECK-ENC: encoding: [0xf3,0x23,0xc0,0x33]
1183 # CHECK-INST-ALIAS: csrr t2, mhpmevent28
1185 csrrs t1
, mhpmevent28
, zero
1187 csrrs t2
, 0x33C, zero
1191 # CHECK-INST: csrrs t1, mhpmevent29, zero
1192 # CHECK-ENC: encoding: [0x73,0x23,0xd0,0x33]
1193 # CHECK-INST-ALIAS: csrr t1, mhpmevent29
1195 # CHECK-INST: csrrs t2, mhpmevent29, zero
1196 # CHECK-ENC: encoding: [0xf3,0x23,0xd0,0x33]
1197 # CHECK-INST-ALIAS: csrr t2, mhpmevent29
1199 csrrs t1
, mhpmevent29
, zero
1201 csrrs t2
, 0x33D, zero
1205 # CHECK-INST: csrrs t1, mhpmevent30, zero
1206 # CHECK-ENC: encoding: [0x73,0x23,0xe0,0x33]
1207 # CHECK-INST-ALIAS: csrr t1, mhpmevent30
1209 # CHECK-INST: csrrs t2, mhpmevent30, zero
1210 # CHECK-ENC: encoding: [0xf3,0x23,0xe0,0x33]
1211 # CHECK-INST-ALIAS: csrr t2, mhpmevent30
1213 csrrs t1
, mhpmevent30
, zero
1215 csrrs t2
, 0x33E, zero
1219 # CHECK-INST: csrrs t1, mhpmevent31, zero
1220 # CHECK-ENC: encoding: [0x73,0x23,0xf0,0x33]
1221 # CHECK-INST-ALIAS: csrr t1, mhpmevent31
1223 # CHECK-INST: csrrs t2, mhpmevent31, zero
1224 # CHECK-ENC: encoding: [0xf3,0x23,0xf0,0x33]
1225 # CHECK-INST-ALIAS: csrr t2, mhpmevent31
1227 csrrs t1
, mhpmevent31
, zero
1229 csrrs t2
, 0x33F, zero