2 * QEMU RISC-V Disassembler for xthead.
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #include "qemu/osdep.h"
8 #include "disas/riscv.h"
9 #include "disas/riscv-xthead.h"
12 /* 0 is reserved for rv_op_illegal. */
29 rv_op_th_dcache_ciall
,
40 rv_op_th_dcache_cpal1
,
41 rv_op_th_dcache_cval1
,
43 rv_op_th_icache_ialls
,
46 rv_op_th_l2cache_call
,
47 rv_op_th_l2cache_ciall
,
48 rv_op_th_l2cache_iall
,
123 rv_op_th_sfence_vmas
,
130 const rv_opcode_data xthead_opcode_data
[] = {
131 { "th.illegal", rv_codec_illegal
, rv_fmt_none
, NULL
, 0, 0, 0 },
133 { "th.addsl", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
135 { "th.srri", rv_codec_r2_imm6
, rv_fmt_rd_rs1_imm
, NULL
, 0, 0, 0 },
136 { "th.srriw", rv_codec_r2_imm5
, rv_fmt_rd_rs1_imm
, NULL
, 0, 0, 0 },
137 { "th.ext", rv_codec_r2_immhl
, rv_fmt_rd_rs1_immh_imml
, NULL
, 0, 0, 0 },
138 { "th.extu", rv_codec_r2_immhl
, rv_fmt_rd_rs1_immh_imml
, NULL
, 0, 0, 0 },
139 { "th.ff0", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
140 { "th.ff1", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
141 { "th.rev", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
142 { "th.revw", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
143 { "th.tstnbz", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
145 { "th.tst", rv_codec_r2_imm6
, rv_fmt_rd_rs1_imm
, NULL
, 0, 0, 0 },
147 { "th.dcache.call", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
148 { "th.dcache.ciall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
149 { "th.dcache.iall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
150 { "th.dcache.cpa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
151 { "th.dcache.cipa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
152 { "th.dcache.ipa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
153 { "th.dcache.cva", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
154 { "th.dcache.civa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
155 { "th.dcache.iva", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
156 { "th.dcache.csw", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
157 { "th.dcache.cisw", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
158 { "th.dcache.isw", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
159 { "th.dcache.cpal1", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
160 { "th.dcache.cval1", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
161 { "th.icache.iall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
162 { "th.icache.ialls", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
163 { "th.icache.ipa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
164 { "th.icache.iva", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
165 { "th.l2cache.call", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
166 { "th.l2cache.ciall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
167 { "th.l2cache.iall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
169 { "th.mveqz", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
170 { "th.mvnez", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
172 { "th.flrd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
173 { "th.flrw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
174 { "th.flurd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
175 { "th.flurw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
176 { "th.fsrd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
177 { "th.fsrw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
178 { "th.fsurd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
179 { "th.fsurw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
181 { "th.fmv.hw.x", rv_codec_r
, rv_fmt_rd_frs1
, NULL
, 0, 0, 0 },
182 { "th.fmv.x.hw", rv_codec_r
, rv_fmt_rd_frs1
, NULL
, 0, 0, 0 },
184 { "th.mula", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
185 { "th.mulaw", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
186 { "th.mulah", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
187 { "th.muls", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
188 { "th.mulsw", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
189 { "th.mulsh", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
191 { "th.lbia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
192 { "th.lbib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml
, NULL
, 0, 0, 0 },
193 { "th.lbuia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
194 { "th.lbuib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
195 { "th.lhia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
196 { "th.lhib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
197 { "th.lhuia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
198 { "th.lhuib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
199 { "th.lwia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
200 { "th.lwib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
201 { "th.lwuia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
202 { "th.lwuib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
203 { "th.ldia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
204 { "th.ldib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
205 { "th.sbia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
206 { "th.sbib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
207 { "th.shia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
208 { "th.shib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
209 { "th.swia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
210 { "th.swib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
211 { "th.sdia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
212 { "th.sdib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
213 { "th.lrb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
214 { "th.lrbu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
215 { "th.lrh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
216 { "th.lrhu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
217 { "th.lrw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
218 { "th.lrwu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
219 { "th.lrd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
220 { "th.srb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
221 { "th.srh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
222 { "th.srw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
223 { "th.srd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
224 { "th.lurb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
225 { "th.lurbu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
226 { "th.lurh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
227 { "th.lurhu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
228 { "th.lurw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
229 { "th.lurwu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
230 { "th.lurd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
231 { "th.surb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
232 { "th.surh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
233 { "th.surw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
234 { "th.surd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
236 { "th.ldd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
237 { "th.lwd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
238 { "th.lwud", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
239 { "th.sdd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
240 { "th.swd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
242 { "th.sfence.vmas", rv_codec_r
, rv_fmt_rs1_rs2
, NULL
, 0, 0, 0 },
243 { "th.sync", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
244 { "th.sync.i", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
245 { "th.sync.is", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
246 { "th.sync.s", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
249 void decode_xtheadba(rv_decode
*dec
, rv_isa isa
)
251 rv_inst inst
= dec
->inst
;
252 rv_opcode op
= rv_op_illegal
;
254 switch (((inst
>> 0) & 0b11)) {
256 switch (((inst
>> 2) & 0b11111)) {
259 switch ((inst
>> 12) & 0b111) {
261 switch ((inst
>> 25) & 0b1111111) {
265 case 0b0000011: op
= rv_op_th_addsl
; break;
278 void decode_xtheadbb(rv_decode
*dec
, rv_isa isa
)
280 rv_inst inst
= dec
->inst
;
281 rv_opcode op
= rv_op_illegal
;
283 switch (((inst
>> 0) & 0b11)) {
285 switch (((inst
>> 2) & 0b11111)) {
288 switch ((inst
>> 12) & 0b111) {
290 switch ((inst
>> 25) & 0b1111111) {
291 case 0b0001010: op
= rv_op_th_srriw
; break;
293 if (((inst
>> 20) & 0b11111) == 0) {
294 op
= rv_op_th_tstnbz
;
298 if (((inst
>> 20) & 0b11111) == 0) {
303 if (((inst
>> 20) & 0b11111) == 0) {
308 if (((inst
>> 20) & 0b11111) == 0) {
314 if (((inst
>> 20) & 0b11111) == 0) {
319 case 0b0000101: op
= rv_op_th_srri
; break;
322 case 2: op
= rv_op_th_ext
; break;
323 case 3: op
= rv_op_th_extu
; break;
334 void decode_xtheadbs(rv_decode
*dec
, rv_isa isa
)
336 rv_inst inst
= dec
->inst
;
337 rv_opcode op
= rv_op_illegal
;
339 switch (((inst
>> 0) & 0b11)) {
341 switch (((inst
>> 2) & 0b11111)) {
344 switch ((inst
>> 12) & 0b111) {
346 switch ((inst
>> 26) & 0b111111) {
347 case 0b100010: op
= rv_op_th_tst
; break;
360 void decode_xtheadcmo(rv_decode
*dec
, rv_isa isa
)
362 rv_inst inst
= dec
->inst
;
363 rv_opcode op
= rv_op_illegal
;
365 switch (((inst
>> 0) & 0b11)) {
367 switch (((inst
>> 2) & 0b11111)) {
370 switch ((inst
>> 12) & 0b111) {
372 switch ((inst
>> 20 & 0b111111111111)) {
374 if (((inst
>> 20) & 0b11111) == 0) {
375 op
= rv_op_th_dcache_call
;
379 if (((inst
>> 20) & 0b11111) == 0) {
380 op
= rv_op_th_dcache_ciall
;
384 if (((inst
>> 20) & 0b11111) == 0) {
385 op
= rv_op_th_dcache_iall
;
388 case 0b000000101001: op
= rv_op_th_dcache_cpa
; break;
389 case 0b000000101011: op
= rv_op_th_dcache_cipa
; break;
390 case 0b000000101010: op
= rv_op_th_dcache_ipa
; break;
391 case 0b000000100101: op
= rv_op_th_dcache_cva
; break;
392 case 0b000000100111: op
= rv_op_th_dcache_civa
; break;
393 case 0b000000100110: op
= rv_op_th_dcache_iva
; break;
394 case 0b000000100001: op
= rv_op_th_dcache_csw
; break;
395 case 0b000000100011: op
= rv_op_th_dcache_cisw
; break;
396 case 0b000000100010: op
= rv_op_th_dcache_isw
; break;
397 case 0b000000101000: op
= rv_op_th_dcache_cpal1
; break;
398 case 0b000000100100: op
= rv_op_th_dcache_cval1
; break;
400 if (((inst
>> 20) & 0b11111) == 0) {
401 op
= rv_op_th_icache_iall
;
405 if (((inst
>> 20) & 0b11111) == 0) {
406 op
= rv_op_th_icache_ialls
;
409 case 0b000000111000: op
= rv_op_th_icache_ipa
; break;
410 case 0b000000110000: op
= rv_op_th_icache_iva
; break;
412 if (((inst
>> 20) & 0b11111) == 0) {
413 op
= rv_op_th_l2cache_call
;
417 if (((inst
>> 20) & 0b11111) == 0) {
418 op
= rv_op_th_l2cache_ciall
;
422 if (((inst
>> 20) & 0b11111) == 0) {
423 op
= rv_op_th_l2cache_iall
;
438 void decode_xtheadcondmov(rv_decode
*dec
, rv_isa isa
)
440 rv_inst inst
= dec
->inst
;
441 rv_opcode op
= rv_op_illegal
;
443 switch (((inst
>> 0) & 0b11)) {
445 switch (((inst
>> 2) & 0b11111)) {
448 switch ((inst
>> 12) & 0b111) {
450 switch ((inst
>> 25) & 0b1111111) {
451 case 0b0100000: op
= rv_op_th_mveqz
; break;
452 case 0b0100001: op
= rv_op_th_mvnez
; break;
465 void decode_xtheadfmemidx(rv_decode
*dec
, rv_isa isa
)
467 rv_inst inst
= dec
->inst
;
468 rv_opcode op
= rv_op_illegal
;
470 switch (((inst
>> 0) & 0b11)) {
472 switch (((inst
>> 2) & 0b11111)) {
475 switch ((inst
>> 12) & 0b111) {
477 switch ((inst
>> 27) & 0b11111) {
478 case 8: op
= rv_op_th_flrw
; break;
479 case 10: op
= rv_op_th_flurw
; break;
480 case 12: op
= rv_op_th_flrd
; break;
481 case 14: op
= rv_op_th_flurd
; break;
485 switch ((inst
>> 27) & 0b11111) {
486 case 8: op
= rv_op_th_fsrw
; break;
487 case 10: op
= rv_op_th_fsurw
; break;
488 case 12: op
= rv_op_th_fsrd
; break;
489 case 14: op
= rv_op_th_fsurd
; break;
502 void decode_xtheadfmv(rv_decode
*dec
, rv_isa isa
)
504 rv_inst inst
= dec
->inst
;
505 rv_opcode op
= rv_op_illegal
;
507 switch (((inst
>> 0) & 0b11)) {
509 switch (((inst
>> 2) & 0b11111)) {
512 switch ((inst
>> 12) & 0b111) {
514 switch ((inst
>> 25) & 0b1111111) {
516 if (((inst
>> 20) & 0b11111) == 0) {
517 op
= rv_op_th_fmv_hw_x
;
521 if (((inst
>> 20) & 0b11111) == 0) {
522 op
= rv_op_th_fmv_x_hw
;
537 void decode_xtheadmac(rv_decode
*dec
, rv_isa isa
)
539 rv_inst inst
= dec
->inst
;
540 rv_opcode op
= rv_op_illegal
;
542 switch (((inst
>> 0) & 0b11)) {
544 switch (((inst
>> 2) & 0b11111)) {
547 switch ((inst
>> 12) & 0b111) {
549 switch ((inst
>> 25) & 0b1111111) {
550 case 0b0010000: op
= rv_op_th_mula
; break;
551 case 0b0010001: op
= rv_op_th_muls
; break;
552 case 0b0010010: op
= rv_op_th_mulaw
; break;
553 case 0b0010011: op
= rv_op_th_mulsw
; break;
554 case 0b0010100: op
= rv_op_th_mulah
; break;
555 case 0b0010101: op
= rv_op_th_mulsh
; break;
568 void decode_xtheadmemidx(rv_decode
*dec
, rv_isa isa
)
570 rv_inst inst
= dec
->inst
;
571 rv_opcode op
= rv_op_illegal
;
573 switch (((inst
>> 0) & 0b11)) {
575 switch (((inst
>> 2) & 0b11111)) {
578 switch ((inst
>> 12) & 0b111) {
580 switch ((inst
>> 27) & 0b11111) {
581 case 0: op
= rv_op_th_lrb
; break;
582 case 1: op
= rv_op_th_lbib
; break;
583 case 2: op
= rv_op_th_lurb
; break;
584 case 3: op
= rv_op_th_lbia
; break;
585 case 4: op
= rv_op_th_lrh
; break;
586 case 5: op
= rv_op_th_lhib
; break;
587 case 6: op
= rv_op_th_lurh
; break;
588 case 7: op
= rv_op_th_lhia
; break;
589 case 8: op
= rv_op_th_lrw
; break;
590 case 9: op
= rv_op_th_lwib
; break;
591 case 10: op
= rv_op_th_lurw
; break;
592 case 11: op
= rv_op_th_lwia
; break;
593 case 12: op
= rv_op_th_lrd
; break;
594 case 13: op
= rv_op_th_ldib
; break;
595 case 14: op
= rv_op_th_lurd
; break;
596 case 15: op
= rv_op_th_ldia
; break;
597 case 16: op
= rv_op_th_lrbu
; break;
598 case 17: op
= rv_op_th_lbuib
; break;
599 case 18: op
= rv_op_th_lurbu
; break;
600 case 19: op
= rv_op_th_lbuia
; break;
601 case 20: op
= rv_op_th_lrhu
; break;
602 case 21: op
= rv_op_th_lhuib
; break;
603 case 22: op
= rv_op_th_lurhu
; break;
604 case 23: op
= rv_op_th_lhuia
; break;
605 case 24: op
= rv_op_th_lrwu
; break;
606 case 25: op
= rv_op_th_lwuib
; break;
607 case 26: op
= rv_op_th_lurwu
; break;
608 case 27: op
= rv_op_th_lwuia
; break;
612 switch ((inst
>> 27) & 0b11111) {
613 case 0: op
= rv_op_th_srb
; break;
614 case 1: op
= rv_op_th_sbib
; break;
615 case 2: op
= rv_op_th_surb
; break;
616 case 3: op
= rv_op_th_sbia
; break;
617 case 4: op
= rv_op_th_srh
; break;
618 case 5: op
= rv_op_th_shib
; break;
619 case 6: op
= rv_op_th_surh
; break;
620 case 7: op
= rv_op_th_shia
; break;
621 case 8: op
= rv_op_th_srw
; break;
622 case 9: op
= rv_op_th_swib
; break;
623 case 10: op
= rv_op_th_surw
; break;
624 case 11: op
= rv_op_th_swia
; break;
625 case 12: op
= rv_op_th_srd
; break;
626 case 13: op
= rv_op_th_sdib
; break;
627 case 14: op
= rv_op_th_surd
; break;
628 case 15: op
= rv_op_th_sdia
; break;
642 void decode_xtheadmempair(rv_decode
*dec
, rv_isa isa
)
644 rv_inst inst
= dec
->inst
;
645 rv_opcode op
= rv_op_illegal
;
647 switch (((inst
>> 0) & 0b11)) {
649 switch (((inst
>> 2) & 0b11111)) {
652 switch ((inst
>> 12) & 0b111) {
654 switch ((inst
>> 27) & 0b11111) {
655 case 28: op
= rv_op_th_lwd
; break;
656 case 30: op
= rv_op_th_lwud
; break;
657 case 31: op
= rv_op_th_ldd
; break;
661 switch ((inst
>> 27) & 0b11111) {
662 case 28: op
= rv_op_th_swd
; break;
663 case 31: op
= rv_op_th_sdd
; break;
676 void decode_xtheadsync(rv_decode
*dec
, rv_isa isa
)
678 rv_inst inst
= dec
->inst
;
679 rv_opcode op
= rv_op_illegal
;
681 switch (((inst
>> 0) & 0b11)) {
683 switch (((inst
>> 2) & 0b11111)) {
686 switch ((inst
>> 12) & 0b111) {
688 switch ((inst
>> 25) & 0b1111111) {
689 case 0b0000010: op
= rv_op_th_sfence_vmas
; break;
691 switch ((inst
>> 20) & 0b11111) {
692 case 0b11000: op
= rv_op_th_sync
; break;
693 case 0b11010: op
= rv_op_th_sync_i
; break;
694 case 0b11011: op
= rv_op_th_sync_is
; break;
695 case 0b11001: op
= rv_op_th_sync_s
; break;