2 * QEMU RISC-V Disassembler for xthead.
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #include "disas/riscv.h"
8 #include "disas/riscv-xthead.h"
11 /* 0 is reserved for rv_op_illegal. */
28 rv_op_th_dcache_ciall
,
39 rv_op_th_dcache_cpal1
,
40 rv_op_th_dcache_cval1
,
42 rv_op_th_icache_ialls
,
45 rv_op_th_l2cache_call
,
46 rv_op_th_l2cache_ciall
,
47 rv_op_th_l2cache_iall
,
122 rv_op_th_sfence_vmas
,
129 const rv_opcode_data xthead_opcode_data
[] = {
130 { "th.illegal", rv_codec_illegal
, rv_fmt_none
, NULL
, 0, 0, 0 },
132 { "th.addsl", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
134 { "th.srri", rv_codec_r2_imm6
, rv_fmt_rd_rs1_imm
, NULL
, 0, 0, 0 },
135 { "th.srriw", rv_codec_r2_imm5
, rv_fmt_rd_rs1_imm
, NULL
, 0, 0, 0 },
136 { "th.ext", rv_codec_r2_immhl
, rv_fmt_rd_rs1_immh_imml
, NULL
, 0, 0, 0 },
137 { "th.extu", rv_codec_r2_immhl
, rv_fmt_rd_rs1_immh_imml
, NULL
, 0, 0, 0 },
138 { "th.ff0", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
139 { "th.ff1", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
140 { "th.rev", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
141 { "th.revw", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
142 { "th.tstnbz", rv_codec_r2
, rv_fmt_rd_rs1
, NULL
, 0, 0, 0 },
144 { "th.tst", rv_codec_r2_imm6
, rv_fmt_rd_rs1_imm
, NULL
, 0, 0, 0 },
146 { "th.dcache.call", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
147 { "th.dcache.ciall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
148 { "th.dcache.iall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
149 { "th.dcache.cpa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
150 { "th.dcache.cipa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
151 { "th.dcache.ipa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
152 { "th.dcache.cva", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
153 { "th.dcache.civa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
154 { "th.dcache.iva", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
155 { "th.dcache.csw", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
156 { "th.dcache.cisw", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
157 { "th.dcache.isw", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
158 { "th.dcache.cpal1", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
159 { "th.dcache.cval1", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
160 { "th.icache.iall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
161 { "th.icache.ialls", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
162 { "th.icache.ipa", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
163 { "th.icache.iva", rv_codec_r
, rv_fmt_rs1
, NULL
, 0, 0, 0 },
164 { "th.l2cache.call", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
165 { "th.l2cache.ciall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
166 { "th.l2cache.iall", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
168 { "th.mveqz", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
169 { "th.mvnez", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
171 { "th.flrd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
172 { "th.flrw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
173 { "th.flurd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
174 { "th.flurw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
175 { "th.fsrd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
176 { "th.fsrw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
177 { "th.fsurd", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
178 { "th.fsurw", rv_codec_r_imm2
, rv_fmt_frd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
180 { "th.fmv.hw.x", rv_codec_r
, rv_fmt_rd_frs1
, NULL
, 0, 0, 0 },
181 { "th.fmv.x.hw", rv_codec_r
, rv_fmt_rd_frs1
, NULL
, 0, 0, 0 },
183 { "th.mula", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
184 { "th.mulaw", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
185 { "th.mulah", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
186 { "th.muls", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
187 { "th.mulsw", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
188 { "th.mulsh", rv_codec_r
, rv_fmt_rd_rs1_rs2
, NULL
, 0, 0, 0 },
190 { "th.lbia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
191 { "th.lbib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml
, NULL
, 0, 0, 0 },
192 { "th.lbuia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
193 { "th.lbuib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
194 { "th.lhia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
195 { "th.lhib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
196 { "th.lhuia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
197 { "th.lhuib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
198 { "th.lwia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
199 { "th.lwib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
200 { "th.lwuia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
201 { "th.lwuib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
202 { "th.ldia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
203 { "th.ldib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
204 { "th.sbia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
205 { "th.sbib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
206 { "th.shia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
207 { "th.shib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
208 { "th.swia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
209 { "th.swib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
210 { "th.sdia", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
211 { "th.sdib", rv_codec_r2_imm2_imm5
, rv_fmt_rd_rs1_immh_imml_addr
, NULL
, 0, 0, 0 },
212 { "th.lrb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
213 { "th.lrbu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
214 { "th.lrh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
215 { "th.lrhu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
216 { "th.lrw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
217 { "th.lrwu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
218 { "th.lrd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
219 { "th.srb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
220 { "th.srh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
221 { "th.srw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
222 { "th.srd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
223 { "th.lurb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
224 { "th.lurbu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
225 { "th.lurh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
226 { "th.lurhu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
227 { "th.lurw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
228 { "th.lurwu", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
229 { "th.lurd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
230 { "th.surb", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
231 { "th.surh", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
232 { "th.surw", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
233 { "th.surd", rv_codec_r_imm2
, rv_fmt_rd_rs1_rs2_imm
, NULL
, 0, 0, 0 },
235 { "th.ldd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
236 { "th.lwd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
237 { "th.lwud", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
238 { "th.sdd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
239 { "th.swd", rv_codec_r_imm2
, rv_fmt_rd2_imm
, NULL
, 0, 0, 0 },
241 { "th.sfence.vmas", rv_codec_r
, rv_fmt_rs1_rs2
, NULL
, 0, 0, 0 },
242 { "th.sync", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
243 { "th.sync.i", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
244 { "th.sync.is", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
245 { "th.sync.s", rv_codec_none
, rv_fmt_none
, NULL
, 0, 0, 0 },
248 void decode_xtheadba(rv_decode
*dec
, rv_isa isa
)
250 rv_inst inst
= dec
->inst
;
251 rv_opcode op
= rv_op_illegal
;
253 switch (((inst
>> 0) & 0b11)) {
255 switch (((inst
>> 2) & 0b11111)) {
258 switch ((inst
>> 12) & 0b111) {
260 switch ((inst
>> 25) & 0b1111111) {
264 case 0b0000011: op
= rv_op_th_addsl
; break;
277 void decode_xtheadbb(rv_decode
*dec
, rv_isa isa
)
279 rv_inst inst
= dec
->inst
;
280 rv_opcode op
= rv_op_illegal
;
282 switch (((inst
>> 0) & 0b11)) {
284 switch (((inst
>> 2) & 0b11111)) {
287 switch ((inst
>> 12) & 0b111) {
289 switch ((inst
>> 25) & 0b1111111) {
290 case 0b0001010: op
= rv_op_th_srriw
; break;
292 if (((inst
>> 20) & 0b11111) == 0) {
293 op
= rv_op_th_tstnbz
;
297 if (((inst
>> 20) & 0b11111) == 0) {
302 if (((inst
>> 20) & 0b11111) == 0) {
307 if (((inst
>> 20) & 0b11111) == 0) {
313 if (((inst
>> 20) & 0b11111) == 0) {
318 case 0b0000101: op
= rv_op_th_srri
; break;
321 case 2: op
= rv_op_th_ext
; break;
322 case 3: op
= rv_op_th_extu
; break;
333 void decode_xtheadbs(rv_decode
*dec
, rv_isa isa
)
335 rv_inst inst
= dec
->inst
;
336 rv_opcode op
= rv_op_illegal
;
338 switch (((inst
>> 0) & 0b11)) {
340 switch (((inst
>> 2) & 0b11111)) {
343 switch ((inst
>> 12) & 0b111) {
345 switch ((inst
>> 26) & 0b111111) {
346 case 0b100010: op
= rv_op_th_tst
; break;
359 void decode_xtheadcmo(rv_decode
*dec
, rv_isa isa
)
361 rv_inst inst
= dec
->inst
;
362 rv_opcode op
= rv_op_illegal
;
364 switch (((inst
>> 0) & 0b11)) {
366 switch (((inst
>> 2) & 0b11111)) {
369 switch ((inst
>> 12) & 0b111) {
371 switch ((inst
>> 20 & 0b111111111111)) {
373 if (((inst
>> 20) & 0b11111) == 0) {
374 op
= rv_op_th_dcache_call
;
378 if (((inst
>> 20) & 0b11111) == 0) {
379 op
= rv_op_th_dcache_ciall
;
383 if (((inst
>> 20) & 0b11111) == 0) {
384 op
= rv_op_th_dcache_iall
;
387 case 0b000000101001: op
= rv_op_th_dcache_cpa
; break;
388 case 0b000000101011: op
= rv_op_th_dcache_cipa
; break;
389 case 0b000000101010: op
= rv_op_th_dcache_ipa
; break;
390 case 0b000000100101: op
= rv_op_th_dcache_cva
; break;
391 case 0b000000100111: op
= rv_op_th_dcache_civa
; break;
392 case 0b000000100110: op
= rv_op_th_dcache_iva
; break;
393 case 0b000000100001: op
= rv_op_th_dcache_csw
; break;
394 case 0b000000100011: op
= rv_op_th_dcache_cisw
; break;
395 case 0b000000100010: op
= rv_op_th_dcache_isw
; break;
396 case 0b000000101000: op
= rv_op_th_dcache_cpal1
; break;
397 case 0b000000100100: op
= rv_op_th_dcache_cval1
; break;
399 if (((inst
>> 20) & 0b11111) == 0) {
400 op
= rv_op_th_icache_iall
;
404 if (((inst
>> 20) & 0b11111) == 0) {
405 op
= rv_op_th_icache_ialls
;
408 case 0b000000111000: op
= rv_op_th_icache_ipa
; break;
409 case 0b000000110000: op
= rv_op_th_icache_iva
; break;
411 if (((inst
>> 20) & 0b11111) == 0) {
412 op
= rv_op_th_l2cache_call
;
416 if (((inst
>> 20) & 0b11111) == 0) {
417 op
= rv_op_th_l2cache_ciall
;
421 if (((inst
>> 20) & 0b11111) == 0) {
422 op
= rv_op_th_l2cache_iall
;
437 void decode_xtheadcondmov(rv_decode
*dec
, rv_isa isa
)
439 rv_inst inst
= dec
->inst
;
440 rv_opcode op
= rv_op_illegal
;
442 switch (((inst
>> 0) & 0b11)) {
444 switch (((inst
>> 2) & 0b11111)) {
447 switch ((inst
>> 12) & 0b111) {
449 switch ((inst
>> 25) & 0b1111111) {
450 case 0b0100000: op
= rv_op_th_mveqz
; break;
451 case 0b0100001: op
= rv_op_th_mvnez
; break;
464 void decode_xtheadfmemidx(rv_decode
*dec
, rv_isa isa
)
466 rv_inst inst
= dec
->inst
;
467 rv_opcode op
= rv_op_illegal
;
469 switch (((inst
>> 0) & 0b11)) {
471 switch (((inst
>> 2) & 0b11111)) {
474 switch ((inst
>> 12) & 0b111) {
476 switch ((inst
>> 27) & 0b11111) {
477 case 8: op
= rv_op_th_flrw
; break;
478 case 10: op
= rv_op_th_flurw
; break;
479 case 12: op
= rv_op_th_flrd
; break;
480 case 14: op
= rv_op_th_flurd
; break;
484 switch ((inst
>> 27) & 0b11111) {
485 case 8: op
= rv_op_th_fsrw
; break;
486 case 10: op
= rv_op_th_fsurw
; break;
487 case 12: op
= rv_op_th_fsrd
; break;
488 case 14: op
= rv_op_th_fsurd
; break;
501 void decode_xtheadfmv(rv_decode
*dec
, rv_isa isa
)
503 rv_inst inst
= dec
->inst
;
504 rv_opcode op
= rv_op_illegal
;
506 switch (((inst
>> 0) & 0b11)) {
508 switch (((inst
>> 2) & 0b11111)) {
511 switch ((inst
>> 12) & 0b111) {
513 switch ((inst
>> 25) & 0b1111111) {
515 if (((inst
>> 20) & 0b11111) == 0) {
516 op
= rv_op_th_fmv_hw_x
;
520 if (((inst
>> 20) & 0b11111) == 0) {
521 op
= rv_op_th_fmv_x_hw
;
536 void decode_xtheadmac(rv_decode
*dec
, rv_isa isa
)
538 rv_inst inst
= dec
->inst
;
539 rv_opcode op
= rv_op_illegal
;
541 switch (((inst
>> 0) & 0b11)) {
543 switch (((inst
>> 2) & 0b11111)) {
546 switch ((inst
>> 12) & 0b111) {
548 switch ((inst
>> 25) & 0b1111111) {
549 case 0b0010000: op
= rv_op_th_mula
; break;
550 case 0b0010001: op
= rv_op_th_muls
; break;
551 case 0b0010010: op
= rv_op_th_mulaw
; break;
552 case 0b0010011: op
= rv_op_th_mulsw
; break;
553 case 0b0010100: op
= rv_op_th_mulah
; break;
554 case 0b0010101: op
= rv_op_th_mulsh
; break;
567 void decode_xtheadmemidx(rv_decode
*dec
, rv_isa isa
)
569 rv_inst inst
= dec
->inst
;
570 rv_opcode op
= rv_op_illegal
;
572 switch (((inst
>> 0) & 0b11)) {
574 switch (((inst
>> 2) & 0b11111)) {
577 switch ((inst
>> 12) & 0b111) {
579 switch ((inst
>> 27) & 0b11111) {
580 case 0: op
= rv_op_th_lrb
; break;
581 case 1: op
= rv_op_th_lbib
; break;
582 case 2: op
= rv_op_th_lurb
; break;
583 case 3: op
= rv_op_th_lbia
; break;
584 case 4: op
= rv_op_th_lrh
; break;
585 case 5: op
= rv_op_th_lhib
; break;
586 case 6: op
= rv_op_th_lurh
; break;
587 case 7: op
= rv_op_th_lhia
; break;
588 case 8: op
= rv_op_th_lrw
; break;
589 case 9: op
= rv_op_th_lwib
; break;
590 case 10: op
= rv_op_th_lurw
; break;
591 case 11: op
= rv_op_th_lwia
; break;
592 case 12: op
= rv_op_th_lrd
; break;
593 case 13: op
= rv_op_th_ldib
; break;
594 case 14: op
= rv_op_th_lurd
; break;
595 case 15: op
= rv_op_th_ldia
; break;
596 case 16: op
= rv_op_th_lrbu
; break;
597 case 17: op
= rv_op_th_lbuib
; break;
598 case 18: op
= rv_op_th_lurbu
; break;
599 case 19: op
= rv_op_th_lbuia
; break;
600 case 20: op
= rv_op_th_lrhu
; break;
601 case 21: op
= rv_op_th_lhuib
; break;
602 case 22: op
= rv_op_th_lurhu
; break;
603 case 23: op
= rv_op_th_lhuia
; break;
604 case 24: op
= rv_op_th_lrwu
; break;
605 case 25: op
= rv_op_th_lwuib
; break;
606 case 26: op
= rv_op_th_lurwu
; break;
607 case 27: op
= rv_op_th_lwuia
; break;
611 switch ((inst
>> 27) & 0b11111) {
612 case 0: op
= rv_op_th_srb
; break;
613 case 1: op
= rv_op_th_sbib
; break;
614 case 2: op
= rv_op_th_surb
; break;
615 case 3: op
= rv_op_th_sbia
; break;
616 case 4: op
= rv_op_th_srh
; break;
617 case 5: op
= rv_op_th_shib
; break;
618 case 6: op
= rv_op_th_surh
; break;
619 case 7: op
= rv_op_th_shia
; break;
620 case 8: op
= rv_op_th_srw
; break;
621 case 9: op
= rv_op_th_swib
; break;
622 case 10: op
= rv_op_th_surw
; break;
623 case 11: op
= rv_op_th_swia
; break;
624 case 12: op
= rv_op_th_srd
; break;
625 case 13: op
= rv_op_th_sdib
; break;
626 case 14: op
= rv_op_th_surd
; break;
627 case 15: op
= rv_op_th_sdia
; break;
641 void decode_xtheadmempair(rv_decode
*dec
, rv_isa isa
)
643 rv_inst inst
= dec
->inst
;
644 rv_opcode op
= rv_op_illegal
;
646 switch (((inst
>> 0) & 0b11)) {
648 switch (((inst
>> 2) & 0b11111)) {
651 switch ((inst
>> 12) & 0b111) {
653 switch ((inst
>> 27) & 0b11111) {
654 case 28: op
= rv_op_th_lwd
; break;
655 case 30: op
= rv_op_th_lwud
; break;
656 case 31: op
= rv_op_th_ldd
; break;
660 switch ((inst
>> 27) & 0b11111) {
661 case 28: op
= rv_op_th_swd
; break;
662 case 31: op
= rv_op_th_sdd
; break;
675 void decode_xtheadsync(rv_decode
*dec
, rv_isa isa
)
677 rv_inst inst
= dec
->inst
;
678 rv_opcode op
= rv_op_illegal
;
680 switch (((inst
>> 0) & 0b11)) {
682 switch (((inst
>> 2) & 0b11111)) {
685 switch ((inst
>> 12) & 0b111) {
687 switch ((inst
>> 25) & 0b1111111) {
688 case 0b0000010: op
= rv_op_th_sfence_vmas
; break;
690 switch ((inst
>> 20) & 0b11111) {
691 case 0b11000: op
= rv_op_th_sync
; break;
692 case 0b11010: op
= rv_op_th_sync_i
; break;
693 case 0b11011: op
= rv_op_th_sync_is
; break;
694 case 0b11001: op
= rv_op_th_sync_s
; break;