6#if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
15#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
21class RISCVDisassembler {
23 explicit RISCVDisassembler(
char*
buffer,
25 ExtensionSet extensions)
31 bool Supports(
Extension extension)
const {
32 return extensions_.Includes(extension);
34 bool Supports(ExtensionSet extensions)
const {
35 return extensions_.IncludesAll(extensions);
38 intptr_t Disassemble(uword pc) {
39 uint16_t parcel = *
reinterpret_cast<uint16_t*
>(pc);
42 DisassembleInstruction(instr);
43 return instr.length();
45 uint32_t parcel = LoadUnaligned(
reinterpret_cast<uint32_t*
>(pc));
47 DisassembleInstruction(instr);
48 return instr.length();
53 void DisassembleInstruction(Instr instr);
54 void DisassembleInstruction(CInstr instr);
55 void DisassembleLUI(Instr instr);
56 void DisassembleAUIPC(Instr instr);
57 void DisassembleJAL(Instr instr);
58 void DisassembleJALR(Instr instr);
59 void DisassembleBRANCH(Instr instr);
60 void DisassembleLOAD(Instr instr);
61 void DisassembleSTORE(Instr instr);
62 void DisassembleOPIMM(Instr instr);
63 void DisassembleOPIMM32(Instr instr);
64 void DisassembleOP(Instr instr);
65 void DisassembleOP_0(Instr instr);
66 void DisassembleOP_SUB(Instr instr);
67 void DisassembleOP_MULDIV(Instr instr);
68 void DisassembleOP_SHADD(Instr instr);
69 void DisassembleOP_MINMAXCLMUL(Instr instr);
70 void DisassembleOP_ROTATE(Instr instr);
71 void DisassembleOP_BCLRBEXT(Instr instr);
72 void DisassembleOP32(Instr instr);
73 void DisassembleOP32_0(Instr instr);
74 void DisassembleOP32_SUB(Instr instr);
75 void DisassembleOP32_MULDIV(Instr instr);
76 void DisassembleOP32_SHADD(Instr instr);
77 void DisassembleOP32_ADDUW(Instr instr);
78 void DisassembleOP32_ROTATE(Instr instr);
79 void DisassembleMISCMEM(Instr instr);
80 void DisassembleSYSTEM(Instr instr);
81 void DisassembleAMO(Instr instr);
82 void DisassembleAMO32(Instr instr);
83 void DisassembleAMO64(Instr instr);
84 void DisassembleLOADFP(Instr instr);
85 void DisassembleSTOREFP(Instr instr);
86 void DisassembleFMADD(Instr instr);
87 void DisassembleFMSUB(Instr instr);
88 void DisassembleFNMADD(Instr instr);
89 void DisassembleFNMSUB(Instr instr);
90 void DisassembleOPFP(Instr instr);
92 void UnknownInstruction(Instr instr);
93 void UnknownInstruction(CInstr instr);
95 void Print(
const char*
format, Instr instr, ExtensionSet extension);
96 void Print(
const char*
format, CInstr instr, ExtensionSet extension);
97 const char* PrintOption(
const char*
format, Instr instr);
98 const char* PrintOption(
const char*
format, CInstr instr);
103 intptr_t
len = Utils::VSNPrint(buffer_ + buffer_pos_,
107 buffer_[buffer_pos_] =
'\0';
110 const ExtensionSet extensions_;
116void RISCVDisassembler::DisassembleInstruction(Instr instr) {
117 switch (instr.opcode()) {
119 DisassembleLUI(instr);
122 DisassembleAUIPC(instr);
125 DisassembleJAL(instr);
128 DisassembleJALR(instr);
131 DisassembleBRANCH(instr);
134 DisassembleLOAD(instr);
137 DisassembleSTORE(instr);
140 DisassembleOPIMM(instr);
143 DisassembleOPIMM32(instr);
146 DisassembleOP(instr);
149 DisassembleOP32(instr);
152 DisassembleMISCMEM(instr);
155 DisassembleSYSTEM(instr);
158 DisassembleAMO(instr);
161 DisassembleLOADFP(instr);
164 DisassembleSTOREFP(instr);
167 DisassembleFMADD(instr);
170 DisassembleFMSUB(instr);
173 DisassembleFNMADD(instr);
176 DisassembleFNMSUB(instr);
179 DisassembleOPFP(instr);
182 if ((instr.encoding() == 0) ||
183 (instr.encoding() ==
static_cast<uint32_t
>(-1))) {
184 Print(
"trap", instr,
RV_I);
187 UnknownInstruction(instr);
191void RISCVDisassembler::DisassembleInstruction(CInstr instr) {
192 switch (instr.opcode()) {
194 Print(
"lw 'rd, 'spload4imm(sp)", instr,
RV_C);
198 Print(
"flw 'frd, 'spload4imm(sp)", instr,
RV_C |
RV_F);
202 Print(
"ld 'rd, 'spload8imm(sp)", instr,
RV_C);
206 Print(
"fld 'frd, 'spload8imm(sp)", instr,
RV_C |
RV_D);
209 Print(
"sw 'rs2, 'spstore4imm(sp)", instr,
RV_C);
213 Print(
"fsw 'frs2, 'spstore4imm(sp)", instr,
RV_C |
RV_F);
217 Print(
"sd 'rs2, 'spstore8imm(sp)", instr,
RV_C);
221 Print(
"fsd 'frs2, 'spstore8imm(sp)", instr,
RV_C |
RV_D);
224 Print(
"lw 'rdp, 'mem4imm('rs1p)", instr,
RV_C);
228 Print(
"flw 'frdp, 'mem4imm('rs1p)", instr,
RV_C |
RV_F);
232 Print(
"ld 'rdp, 'mem8imm('rs1p)", instr,
RV_C);
236 Print(
"fld 'frdp, 'mem8imm('rs1p)", instr,
RV_C |
RV_D);
239 Print(
"sw 'rs2p, 'mem4imm('rs1p)", instr,
RV_C);
243 Print(
"fsw 'frs2p, 'mem4imm('rs1p)", instr,
RV_C |
RV_F);
247 Print(
"sd 'rs2p, 'mem8imm('rs1p)", instr,
RV_C);
251 Print(
"fsd 'frs2p, 'mem8imm('rs1p)", instr,
RV_C |
RV_F);
254 Print(
"j 'jimm", instr,
RV_C);
258 Print(
"jal 'jimm", instr,
RV_C);
262 if ((instr.encoding() & (
C_JALR ^
C_JR)) != 0) {
263 if ((instr.rs1() ==
ZR) && (instr.rs2() ==
ZR)) {
264 Print(
"ebreak", instr,
RV_C);
265 }
else if (instr.rs2() ==
ZR) {
266 Print(
"jalr 'rs1", instr,
RV_C);
268 Print(
"add 'rd, 'rs1, 'rs2", instr,
RV_C);
271 if (instr.rd() !=
ZR && instr.rs2() !=
ZR) {
272 Print(
"mv 'rd, 'rs2", instr,
RV_C);
273 }
else if (instr.rs2() !=
ZR) {
274 UnknownInstruction(instr);
275 }
else if (instr.rs1() ==
RA) {
276 Print(
"ret", instr,
RV_C);
278 Print(
"jr 'rs1", instr,
RV_C);
283 Print(
"beqz 'rs1p, 'bimm", instr,
RV_C);
286 Print(
"bnez 'rs1p, 'bimm", instr,
RV_C);
289 Print(
"li 'rd, 'iimm", instr,
RV_C);
292 if (instr.rd() ==
SP) {
293 Print(
"addi 'rd, 'rs1, 'i16imm", instr,
RV_C);
295 Print(
"lui 'rd, 'uimm", instr,
RV_C);
299 if ((instr.rd() ==
ZR) && (instr.rs1() ==
ZR) && (instr.i_imm() == 0)) {
300 Print(
"nop", instr,
RV_C);
302 Print(
"addi 'rd, 'rs1, 'iimm", instr,
RV_C);
307 if (instr.i_imm() == 0) {
308 Print(
"sext.w 'rd, 'rs1", instr,
RV_C);
310 Print(
"addiw 'rd, 'rs1, 'iimm", instr,
RV_C);
315 if (instr.i4spn_imm() == 0) {
316 UnknownInstruction(instr);
318 Print(
"addi 'rdp, sp, 'i4spnimm", instr,
RV_C);
322 if (instr.i_imm() == 0) {
323 UnknownInstruction(instr);
325 Print(
"slli 'rd, 'rs1, 'iimm", instr,
RV_C);
331 if (instr.i_imm() == 0) {
332 UnknownInstruction(instr);
334 Print(
"srli 'rs1p, 'rs1p, 'iimm", instr,
RV_C);
338 if (instr.i_imm() == 0) {
339 UnknownInstruction(instr);
341 Print(
"srai 'rs1p, 'rs1p, 'iimm", instr,
RV_C);
345 Print(
"andi 'rs1p, 'rs1p, 'iimm", instr,
RV_C);
350 Print(
"and 'rs1p, 'rs1p, 'rs2p", instr,
RV_C);
353 Print(
"or 'rs1p, 'rs1p, 'rs2p", instr,
RV_C);
356 Print(
"xor 'rs1p, 'rs1p, 'rs2p", instr,
RV_C);
359 Print(
"sub 'rs1p, 'rs1p, 'rs2p", instr,
RV_C);
363 Print(
"addw 'rs1p, 'rs1p, 'rs2p", instr,
RV_C);
366 Print(
"subw 'rs1p, 'rs1p, 'rs2p", instr,
RV_C);
370 UnknownInstruction(instr);
374 UnknownInstruction(instr);
378 if ((instr.encoding() == 0) ||
379 (instr.encoding() ==
static_cast<uint16_t
>(-1))) {
380 Print(
"trap", instr,
RV_C);
383 UnknownInstruction(instr);
387void RISCVDisassembler::DisassembleLUI(Instr instr) {
388 Print(
"lui 'rd, 'uimm", instr,
RV_I);
391void RISCVDisassembler::DisassembleAUIPC(Instr instr) {
392 Print(
"auipc 'rd, 'uimm", instr,
RV_I);
395void RISCVDisassembler::DisassembleJAL(Instr instr) {
396 if (instr.rd() ==
ZR) {
397 Print(
"j 'jimm", instr,
RV_I);
398 }
else if (instr.rd() ==
RA) {
399 Print(
"jal 'jimm", instr,
RV_I);
401 Print(
"jal 'rd, 'jimm", instr,
RV_I);
405void RISCVDisassembler::DisassembleJALR(Instr instr) {
406 if (instr.rd() ==
ZR) {
407 if ((instr.rs1() ==
RA) && (instr.itype_imm() == 0)) {
408 Print(
"ret", instr,
RV_I);
409 }
else if (instr.itype_imm() == 0) {
410 Print(
"jr 'rs1", instr,
RV_I);
412 Print(
"jr 'iimm('rs1)", instr,
RV_I);
414 }
else if (instr.rd() ==
RA) {
415 if (instr.itype_imm() == 0) {
416 Print(
"jalr 'rs1", instr,
RV_I);
418 Print(
"jalr 'iimm('rs1)", instr,
RV_I);
421 if (instr.itype_imm() == 0) {
422 Print(
"jalr 'rd, 'rs1", instr,
RV_I);
424 Print(
"jalr 'rd, 'iimm('rs1)", instr,
RV_I);
429void RISCVDisassembler::DisassembleBRANCH(Instr instr) {
430 switch (instr.funct3()) {
432 if (instr.rs2() ==
ZR) {
433 Print(
"beqz 'rs1, 'bimm", instr,
RV_I);
435 Print(
"beq 'rs1, 'rs2, 'bimm", instr,
RV_I);
439 if (instr.rs2() ==
ZR) {
440 Print(
"bnez 'rs1, 'bimm", instr,
RV_I);
442 Print(
"bne 'rs1, 'rs2, 'bimm", instr,
RV_I);
446 if (instr.rs2() ==
ZR) {
447 Print(
"bltz 'rs1, 'bimm", instr,
RV_I);
448 }
else if (instr.rs1() ==
ZR) {
449 Print(
"bgtz 'rs2, 'bimm", instr,
RV_I);
451 Print(
"blt 'rs1, 'rs2, 'bimm", instr,
RV_I);
455 if (instr.rs2() ==
ZR) {
456 Print(
"bgez 'rs1, 'bimm", instr,
RV_I);
457 }
else if (instr.rs1() ==
ZR) {
458 Print(
"blez 'rs2, 'bimm", instr,
RV_I);
460 Print(
"ble 'rs2, 'rs1, 'bimm", instr,
RV_I);
464 Print(
"bltu 'rs1, 'rs2, 'bimm", instr,
RV_I);
467 Print(
"bleu 'rs2, 'rs1, 'bimm", instr,
RV_I);
470 UnknownInstruction(instr);
474void RISCVDisassembler::DisassembleLOAD(Instr instr) {
475 switch (instr.funct3()) {
477 Print(
"lb 'rd, 'iimm('rs1)", instr,
RV_I);
480 Print(
"lh 'rd, 'iimm('rs1)", instr,
RV_I);
483 Print(
"lw 'rd, 'iimm('rs1)", instr,
RV_I);
486 Print(
"lbu 'rd, 'iimm('rs1)", instr,
RV_I);
489 Print(
"lhu 'rd, 'iimm('rs1)", instr,
RV_I);
493 Print(
"lwu 'rd, 'iimm('rs1)", instr,
RV_I);
496 Print(
"ld 'rd, 'iimm('rs1)", instr,
RV_I);
500 UnknownInstruction(instr);
504void RISCVDisassembler::DisassembleLOADFP(Instr instr) {
505 switch (instr.funct3()) {
507 Print(
"flw 'frd, 'iimm('rs1)", instr,
RV_F);
510 Print(
"fld 'frd, 'iimm('rs1)", instr,
RV_D);
513 UnknownInstruction(instr);
517void RISCVDisassembler::DisassembleSTORE(Instr instr) {
518 switch (instr.funct3()) {
520 Print(
"sb 'rs2, 'simm('rs1)", instr,
RV_I);
523 Print(
"sh 'rs2, 'simm('rs1)", instr,
RV_I);
526 Print(
"sw 'rs2, 'simm('rs1)", instr,
RV_I);
530 Print(
"sd 'rs2, 'simm('rs1)", instr,
RV_I);
534 UnknownInstruction(instr);
538void RISCVDisassembler::DisassembleSTOREFP(Instr instr) {
539 switch (instr.funct3()) {
541 Print(
"fsw 'frs2, 'simm('rs1)", instr,
RV_F);
544 Print(
"fsd 'frs2, 'simm('rs1)", instr,
RV_D);
547 UnknownInstruction(instr);
551void RISCVDisassembler::DisassembleOPIMM(Instr instr) {
552 switch (instr.funct3()) {
554 if ((instr.rd() ==
ZR) && (instr.rs1() ==
ZR) &&
555 (instr.itype_imm() == 0)) {
556 Print(
"nop", instr,
RV_I);
557 }
else if (instr.itype_imm() == 0) {
558 Print(
"mv 'rd, 'rs1", instr,
RV_I);
559 }
else if (instr.rs1() ==
ZR) {
560 Print(
"li 'rd, 'iimm", instr,
RV_I);
562 Print(
"addi 'rd, 'rs1, 'iimm", instr,
RV_I);
566 Print(
"slti 'rd, 'rs1, 'iimm", instr,
RV_I);
569 if (instr.itype_imm() == 1) {
570 Print(
"seqz 'rd, 'rs1", instr,
RV_I);
572 Print(
"sltiu 'rd, 'rs1, 'iimm", instr,
RV_I);
576 if (instr.itype_imm() == -1) {
577 Print(
"not 'rd, 'rs1", instr,
RV_I);
579 Print(
"xori 'rd, 'rs1, 'iimm", instr,
RV_I);
583 Print(
"ori 'rd, 'rs1, 'iimm", instr,
RV_I);
586 Print(
"andi 'rd, 'rs1, 'iimm", instr,
RV_I);
589 if (instr.funct7() ==
COUNT) {
590 if (instr.shamt() == 0b00000) {
591 Print(
"clz 'rd, 'rs1", instr,
RV_Zbb);
592 }
else if (instr.shamt() == 0b00001) {
593 Print(
"ctz 'rd, 'rs1", instr,
RV_Zbb);
594 }
else if (instr.shamt() == 0b00010) {
595 Print(
"cpop 'rd, 'rs1", instr,
RV_Zbb);
596 }
else if (instr.shamt() == 0b00100) {
597 Print(
"sext.b 'rd, 'rs1", instr,
RV_Zbb);
598 }
else if (instr.shamt() == 0b00101) {
599 Print(
"sext.h 'rd, 'rs1", instr,
RV_Zbb);
601 UnknownInstruction(instr);
603 }
else if ((instr.funct7() & 0b1111110) ==
BCLRBEXT) {
604 Print(
"bclri 'rd, 'rs1, 'shamt", instr,
RV_Zbs);
605 }
else if ((instr.funct7() & 0b1111110) ==
BINV) {
606 Print(
"binvi 'rd, 'rs1, 'shamt", instr,
RV_Zbs);
607 }
else if ((instr.funct7() & 0b1111110) ==
BSET) {
608 Print(
"bseti 'rd, 'rs1, 'shamt", instr,
RV_Zbs);
610 Print(
"slli 'rd, 'rs1, 'shamt", instr,
RV_I);
614 if ((instr.funct7() & 0b1111110) ==
SRA) {
615 Print(
"srai 'rd, 'rs1, 'shamt", instr,
RV_I);
616 }
else if ((instr.funct7() & 0b1111110) ==
ROTATE) {
617 Print(
"rori 'rd, 'rs1, 'shamt", instr,
RV_Zbb);
618 }
else if (instr.funct7() == 0b0010100) {
619 Print(
"orc.b 'rd, 'rs1", instr,
RV_Zbb);
621 }
else if (instr.funct7() == 0b0110100) {
622 Print(
"rev8 'rd, 'rs1", instr,
RV_Zbb);
624 }
else if (instr.funct7() == 0b0110101) {
625 Print(
"rev8 'rd, 'rs1", instr,
RV_Zbb);
627 }
else if ((instr.funct7() & 0b1111110) ==
BCLRBEXT) {
628 Print(
"bexti 'rd, 'rs1, 'shamt", instr,
RV_Zbs);
630 Print(
"srli 'rd, 'rs1, 'shamt", instr,
RV_I);
634 UnknownInstruction(instr);
638void RISCVDisassembler::DisassembleOPIMM32(Instr instr) {
639 switch (instr.funct3()) {
642 if (instr.itype_imm() == 0) {
643 Print(
"sext.w 'rd, 'rs1", instr,
RV_I);
645 Print(
"addiw 'rd, 'rs1, 'iimm", instr,
RV_I);
649 if (instr.funct7() ==
SLLIUW) {
650 Print(
"slli.uw 'rd, 'rs1, 'shamt", instr,
RV_Zba);
651 }
else if (instr.funct7() ==
COUNT) {
652 if (instr.shamt() == 0b00000) {
653 Print(
"clzw 'rd, 'rs1", instr,
RV_Zbb);
654 }
else if (instr.shamt() == 0b00001) {
655 Print(
"ctzw 'rd, 'rs1", instr,
RV_Zbb);
656 }
else if (instr.shamt() == 0b00010) {
657 Print(
"cpopw 'rd, 'rs1", instr,
RV_Zbb);
659 UnknownInstruction(instr);
662 Print(
"slliw 'rd, 'rs1, 'shamt", instr,
RV_I);
666 if (instr.funct7() ==
SRA) {
667 Print(
"sraiw 'rd, 'rs1, 'shamt", instr,
RV_I);
668 }
else if (instr.funct7() ==
ROTATE) {
669 Print(
"roriw 'rd, 'rs1, 'shamt", instr,
RV_Zbb);
671 Print(
"srliw 'rd, 'rs1, 'shamt", instr,
RV_I);
676 UnknownInstruction(instr);
680void RISCVDisassembler::DisassembleOP(Instr instr) {
681 switch (instr.funct7()) {
683 DisassembleOP_0(instr);
686 DisassembleOP_SUB(instr);
689 DisassembleOP_MULDIV(instr);
692 DisassembleOP_SHADD(instr);
695 DisassembleOP_MINMAXCLMUL(instr);
698 DisassembleOP_ROTATE(instr);
701 DisassembleOP_BCLRBEXT(instr);
704 Print(
"binv 'rd, 'rs1, 'rs2", instr,
RV_Zbs);
707 Print(
"bset 'rd, 'rs1, 'rs2", instr,
RV_Zbs);
711 Print(
"zext.h 'rd, 'rs1", instr,
RV_Zbb);
715 UnknownInstruction(instr);
719void RISCVDisassembler::DisassembleOP_0(Instr instr) {
720 switch (instr.funct3()) {
722 Print(
"add 'rd, 'rs1, 'rs2", instr,
RV_I);
725 Print(
"sll 'rd, 'rs1, 'rs2", instr,
RV_I);
728 if (instr.rs2() ==
ZR) {
729 Print(
"sltz 'rd, 'rs1", instr,
RV_I);
730 }
else if (instr.rs1() ==
ZR) {
731 Print(
"sgtz 'rd, 'rs2", instr,
RV_I);
733 Print(
"slt 'rd, 'rs1, 'rs2", instr,
RV_I);
737 if (instr.rs1() ==
ZR) {
738 Print(
"snez 'rd, 'rs2", instr,
RV_I);
740 Print(
"sltu 'rd, 'rs1, 'rs2", instr,
RV_I);
744 Print(
"xor 'rd, 'rs1, 'rs2", instr,
RV_I);
747 Print(
"srl 'rd, 'rs1, 'rs2", instr,
RV_I);
750 Print(
"or 'rd, 'rs1, 'rs2", instr,
RV_I);
753 Print(
"and 'rd, 'rs1, 'rs2", instr,
RV_I);
756 UnknownInstruction(instr);
760void RISCVDisassembler::DisassembleOP_SUB(Instr instr) {
761 switch (instr.funct3()) {
763 if (instr.rs1() ==
ZR) {
764 Print(
"neg 'rd, 'rs2", instr,
RV_I);
766 Print(
"sub 'rd, 'rs1, 'rs2", instr,
RV_I);
770 Print(
"sra 'rd, 'rs1, 'rs2", instr,
RV_I);
773 Print(
"andn 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
776 Print(
"orn 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
779 Print(
"xnor 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
782 UnknownInstruction(instr);
786void RISCVDisassembler::DisassembleOP_MULDIV(Instr instr) {
787 switch (instr.funct3()) {
789 Print(
"mul 'rd, 'rs1, 'rs2", instr,
RV_M);
792 Print(
"mulh 'rd, 'rs1, 'rs2", instr,
RV_M);
795 Print(
"mulhsu 'rd, 'rs1, 'rs2", instr,
RV_M);
798 Print(
"mulhu 'rd, 'rs1, 'rs2", instr,
RV_M);
801 Print(
"div 'rd, 'rs1, 'rs2", instr,
RV_M);
804 Print(
"divu 'rd, 'rs1, 'rs2", instr,
RV_M);
807 Print(
"rem 'rd, 'rs1, 'rs2", instr,
RV_M);
810 Print(
"remu 'rd, 'rs1, 'rs2", instr,
RV_M);
813 UnknownInstruction(instr);
817void RISCVDisassembler::DisassembleOP_SHADD(Instr instr) {
818 switch (instr.funct3()) {
820 Print(
"sh1add 'rd, 'rs1, 'rs2", instr,
RV_Zba);
823 Print(
"sh2add 'rd, 'rs1, 'rs2", instr,
RV_Zba);
826 Print(
"sh3add 'rd, 'rs1, 'rs2", instr,
RV_Zba);
829 UnknownInstruction(instr);
833void RISCVDisassembler::DisassembleOP_MINMAXCLMUL(Instr instr) {
834 switch (instr.funct3()) {
836 Print(
"max 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
839 Print(
"maxu 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
842 Print(
"min 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
845 Print(
"minu 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
848 Print(
"clmul 'rd, 'rs1, 'rs2", instr,
RV_Zbc);
851 Print(
"clmulh 'rd, 'rs1, 'rs2", instr,
RV_Zbc);
854 Print(
"clmulr 'rd, 'rs1, 'rs2", instr,
RV_Zbc);
857 UnknownInstruction(instr);
861void RISCVDisassembler::DisassembleOP_ROTATE(Instr instr) {
862 switch (instr.funct3()) {
864 Print(
"ror 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
867 Print(
"rol 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
870 UnknownInstruction(instr);
874void RISCVDisassembler::DisassembleOP_BCLRBEXT(Instr instr) {
875 switch (instr.funct3()) {
877 Print(
"bclr 'rd, 'rs1, 'rs2", instr,
RV_Zbs);
880 Print(
"bext 'rd, 'rs1, 'rs2", instr,
RV_Zbs);
883 UnknownInstruction(instr);
887void RISCVDisassembler::DisassembleOP32(Instr instr) {
888 switch (instr.funct7()) {
890 DisassembleOP32_0(instr);
893 DisassembleOP32_SUB(instr);
896 DisassembleOP32_MULDIV(instr);
899 DisassembleOP32_SHADD(instr);
902 DisassembleOP32_ADDUW(instr);
905 DisassembleOP32_ROTATE(instr);
908 UnknownInstruction(instr);
912void RISCVDisassembler::DisassembleOP32_0(Instr instr) {
913 switch (instr.funct3()) {
916 Print(
"addw 'rd, 'rs1, 'rs2", instr,
RV_I);
919 Print(
"sllw 'rd, 'rs1, 'rs2", instr,
RV_I);
922 Print(
"srlw 'rd, 'rs1, 'rs2", instr,
RV_I);
927 UnknownInstruction(instr);
931void RISCVDisassembler::DisassembleOP32_SUB(Instr instr) {
932 switch (instr.funct3()) {
935 if (instr.rs1() ==
ZR) {
936 Print(
"negw 'rd, 'rs2", instr,
RV_I);
938 Print(
"subw 'rd, 'rs1, 'rs2", instr,
RV_I);
942 Print(
"sraw 'rd, 'rs1, 'rs2", instr,
RV_I);
946 UnknownInstruction(instr);
950void RISCVDisassembler::DisassembleOP32_MULDIV(Instr instr) {
951 switch (instr.funct3()) {
954 Print(
"mulw 'rd, 'rs1, 'rs2", instr,
RV_M);
957 Print(
"divw 'rd, 'rs1, 'rs2", instr,
RV_M);
960 Print(
"divuw 'rd, 'rs1, 'rs2", instr,
RV_M);
963 Print(
"remw 'rd, 'rs1, 'rs2", instr,
RV_M);
966 Print(
"remuw 'rd, 'rs1, 'rs2", instr,
RV_M);
970 UnknownInstruction(instr);
974void RISCVDisassembler::DisassembleOP32_SHADD(Instr instr) {
975 switch (instr.funct3()) {
977 Print(
"sh1add.uw 'rd, 'rs1, 'rs2", instr,
RV_Zba);
980 Print(
"sh2add.uw 'rd, 'rs1, 'rs2", instr,
RV_Zba);
983 Print(
"sh3add.uw 'rd, 'rs1, 'rs2", instr,
RV_Zba);
986 UnknownInstruction(instr);
990void RISCVDisassembler::DisassembleOP32_ADDUW(Instr instr) {
991 switch (instr.funct3()) {
994 Print(
"add.uw 'rd, 'rs1, 'rs2", instr,
RV_Zba);
997 Print(
"zext.h 'rd, 'rs1", instr,
RV_Zbb);
1001 UnknownInstruction(instr);
1005void RISCVDisassembler::DisassembleOP32_ROTATE(Instr instr) {
1006 switch (instr.funct3()) {
1008 Print(
"rorw 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
1011 Print(
"rolw 'rd, 'rs1, 'rs2", instr,
RV_Zbb);
1014 UnknownInstruction(instr);
1018void RISCVDisassembler::DisassembleMISCMEM(Instr instr) {
1019 switch (instr.funct3()) {
1021 Print(
"fence'predsucc", instr,
RV_I);
1024 Print(
"fence.i", instr,
RV_I);
1027 UnknownInstruction(instr);
1031void RISCVDisassembler::DisassembleSYSTEM(Instr instr) {
1032 switch (instr.funct3()) {
1034 switch (instr.funct12()) {
1036 if (instr.rs1() ==
ZR) {
1037 Print(
"ecall", instr,
RV_I);
1039 Print(
"SimulatorPrintObject 'rs1", instr,
RV_I);
1043 Print(
"ebreak", instr,
RV_I);
1046 UnknownInstruction(instr);
1050 if (instr.rd() ==
ZR) {
1051 Print(
"csrw 'csr, 'rs1", instr,
RV_I);
1053 Print(
"csrrw 'rd, 'csr, 'rs1", instr,
RV_I);
1057 if (instr.rs1() ==
ZR) {
1058 Print(
"csrr 'rd, 'csr", instr,
RV_I);
1059 }
else if (instr.rd() ==
ZR) {
1060 Print(
"csrs 'csr, 'rs1", instr,
RV_I);
1062 Print(
"csrrs 'rd, 'csr, 'rs1", instr,
RV_I);
1066 if (instr.rd() ==
ZR) {
1067 Print(
"csrc 'csr, 'rs1", instr,
RV_I);
1069 Print(
"csrrc 'rd, 'csr, 'rs1", instr,
RV_I);
1073 if (instr.rd() ==
ZR) {
1074 Print(
"csrwi 'csr, 'zimm", instr,
RV_I);
1076 Print(
"csrrwi 'rd, 'csr, 'zimm", instr,
RV_I);
1080 if (instr.rd() ==
ZR) {
1081 Print(
"csrsi 'csr, 'zimm", instr,
RV_I);
1083 Print(
"csrrsi 'rd, 'csr, 'zimm", instr,
RV_I);
1087 if (instr.rd() ==
ZR) {
1088 Print(
"csrci 'csr, 'zimm", instr,
RV_I);
1090 Print(
"csrrci 'rd, 'csr, 'zimm", instr,
RV_I);
1094 UnknownInstruction(instr);
1098void RISCVDisassembler::DisassembleAMO(Instr instr) {
1099 switch (instr.funct3()) {
1101 DisassembleAMO32(instr);
1104 DisassembleAMO64(instr);
1107 UnknownInstruction(instr);
1111void RISCVDisassembler::DisassembleAMO32(Instr instr) {
1112 switch (instr.funct5()) {
1114 Print(
"lr.w'order 'rd, ('rs1)", instr,
RV_A);
1117 Print(
"sc.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1120 Print(
"amoswap.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1123 Print(
"amoadd.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1126 Print(
"amoxor.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1129 Print(
"amoand.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1132 Print(
"amoor.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1135 Print(
"amomin.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1138 Print(
"amomax.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1141 Print(
"amominu.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1144 Print(
"amomaxu.w'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1147 UnknownInstruction(instr);
1151void RISCVDisassembler::DisassembleAMO64(Instr instr) {
1152 switch (instr.funct5()) {
1155 Print(
"lr.d'order 'rd, ('rs1)", instr,
RV_A);
1158 Print(
"sc.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1161 Print(
"amoswap.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1164 Print(
"amoadd.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1167 Print(
"amoxor.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1170 Print(
"amoand.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1173 Print(
"amoor.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1176 Print(
"amomin.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1179 Print(
"amomax.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1182 Print(
"amominu.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1185 Print(
"amomaxu.d'order 'rd, 'rs2, ('rs1)", instr,
RV_A);
1189 UnknownInstruction(instr);
1193void RISCVDisassembler::DisassembleFMADD(Instr instr) {
1194 switch (instr.funct2()) {
1196 Print(
"fmadd.s 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_F);
1199 Print(
"fmadd.d 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_D);
1202 UnknownInstruction(instr);
1206void RISCVDisassembler::DisassembleFMSUB(Instr instr) {
1207 switch (instr.funct2()) {
1209 Print(
"fmsub.s 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_F);
1212 Print(
"fmsub.d 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_D);
1215 UnknownInstruction(instr);
1219void RISCVDisassembler::DisassembleFNMADD(Instr instr) {
1220 switch (instr.funct2()) {
1222 Print(
"fnmadd.s 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_F);
1225 Print(
"fnmadd.d 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_D);
1228 UnknownInstruction(instr);
1232void RISCVDisassembler::DisassembleFNMSUB(Instr instr) {
1233 switch (instr.funct2()) {
1235 Print(
"fnmsub.s 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_F);
1238 Print(
"fnmsub.d 'frd, 'frs1, 'frs2, 'frs3'round", instr,
RV_D);
1241 UnknownInstruction(instr);
1245void RISCVDisassembler::DisassembleOPFP(Instr instr) {
1246 switch (instr.funct7()) {
1248 Print(
"fadd.s 'frd, 'frs1, 'frs2'round", instr,
RV_F);
1251 Print(
"fsub.s 'frd, 'frs1, 'frs2'round", instr,
RV_F);
1254 Print(
"fmul.s 'frd, 'frs1, 'frs2'round", instr,
RV_F);
1257 Print(
"fdiv.s 'frd, 'frs1, 'frs2'round", instr,
RV_F);
1260 Print(
"fsqrt.s 'frd, 'frs1'round", instr,
RV_F);
1263 switch (instr.funct3()) {
1265 if (instr.frs1() == instr.frs2()) {
1266 Print(
"fmv.s 'frd, 'frs1", instr,
RV_F);
1268 Print(
"fsgnj.s 'frd, 'frs1, 'frs2", instr,
RV_F);
1272 if (instr.frs1() == instr.frs2()) {
1273 Print(
"fneg.s 'frd, 'frs1", instr,
RV_F);
1275 Print(
"fsgnjn.s 'frd, 'frs1, 'frs2", instr,
RV_F);
1279 if (instr.frs1() == instr.frs2()) {
1280 Print(
"fabs.s 'frd, 'frs1", instr,
RV_F);
1282 Print(
"fsgnjx.s 'frd, 'frs1, 'frs2", instr,
RV_F);
1286 UnknownInstruction(instr);
1291 switch (instr.funct3()) {
1293 Print(
"fmin.s 'frd, 'frs1, 'frs2", instr,
RV_F);
1296 Print(
"fmax.s 'frd, 'frs1, 'frs2", instr,
RV_F);
1299 UnknownInstruction(instr);
1304 switch (instr.funct3()) {
1306 Print(
"feq.s 'rd, 'frs1, 'frs2", instr,
RV_F);
1309 Print(
"flt.s 'rd, 'frs1, 'frs2", instr,
RV_F);
1312 Print(
"fle.s 'rd, 'frs1, 'frs2", instr,
RV_F);
1315 UnknownInstruction(instr);
1320 switch (instr.funct3()) {
1322 Print(
"fclass.s 'rd, 'frs1", instr,
RV_F);
1325 Print(
"fmv.x.w 'rd, 'frs1", instr,
RV_F);
1328 UnknownInstruction(instr);
1332 switch (
static_cast<FcvtRs2>(instr.rs2())) {
1334 Print(
"fcvt.w.s 'rd, 'frs1'round", instr,
RV_F);
1337 Print(
"fcvt.wu.s 'rd, 'frs1'round", instr,
RV_F);
1341 Print(
"fcvt.l.s 'rd, 'frs1'round", instr,
RV_F);
1344 Print(
"fcvt.lu.s 'rd, 'frs1'round", instr,
RV_F);
1348 UnknownInstruction(instr);
1352 switch (
static_cast<FcvtRs2>(instr.rs2())) {
1354 Print(
"fcvt.s.w 'frd, 'rs1'round", instr,
RV_F);
1357 Print(
"fcvt.s.wu 'frd, 'rs1'round", instr,
RV_F);
1361 Print(
"fcvt.s.l 'frd, 'rs1'round", instr,
RV_F);
1364 Print(
"fcvt.s.lu 'frd, 'rs1'round", instr,
RV_F);
1368 UnknownInstruction(instr);
1372 Print(
"fmv.w.x 'frd, 'rs1", instr,
RV_F);
1375 Print(
"fadd.d 'frd, 'frs1, 'frs2'round", instr,
RV_D);
1378 Print(
"fsub.d 'frd, 'frs1, 'frs2'round", instr,
RV_D);
1381 Print(
"fmul.d 'frd, 'frs1, 'frs2'round", instr,
RV_D);
1384 Print(
"fdiv.d 'frd, 'frs1, 'frs2'round", instr,
RV_D);
1387 Print(
"fsqrt.d 'frd, 'frs1'round", instr,
RV_D);
1390 switch (instr.funct3()) {
1392 if (instr.frs1() == instr.frs2()) {
1393 Print(
"fmv.d 'frd, 'frs1", instr,
RV_D);
1395 Print(
"fsgnj.d 'frd, 'frs1, 'frs2", instr,
RV_D);
1399 if (instr.frs1() == instr.frs2()) {
1400 Print(
"fneg.d 'frd, 'frs1", instr,
RV_D);
1402 Print(
"fsgnjn.d 'frd, 'frs1, 'frs2", instr,
RV_D);
1406 if (instr.frs1() == instr.frs2()) {
1407 Print(
"fabs.d 'frd, 'frs1", instr,
RV_D);
1409 Print(
"fsgnjx.d 'frd, 'frs1, 'frs2", instr,
RV_D);
1413 UnknownInstruction(instr);
1418 switch (instr.funct3()) {
1420 Print(
"fmin.d 'frd, 'frs1, 'frs2", instr,
RV_D);
1423 Print(
"fmax.d 'frd, 'frs1, 'frs2", instr,
RV_D);
1426 UnknownInstruction(instr);
1431 switch (instr.rs2()) {
1433 Print(
"fcvt.s.d 'frd, 'frs1'round", instr,
RV_D);
1436 UnknownInstruction(instr);
1441 switch (instr.rs2()) {
1443 Print(
"fcvt.d.s 'frd, 'frs1'round", instr,
RV_D);
1446 UnknownInstruction(instr);
1451 switch (instr.funct3()) {
1453 Print(
"feq.d 'rd, 'frs1, 'frs2", instr,
RV_D);
1456 Print(
"flt.d 'rd, 'frs1, 'frs2", instr,
RV_D);
1459 Print(
"fle.d 'rd, 'frs1, 'frs2", instr,
RV_D);
1462 UnknownInstruction(instr);
1467 switch (instr.funct3()) {
1469 Print(
"fclass.d 'rd, 'frs1", instr,
RV_D);
1473 Print(
"fmv.x.d 'rd, 'frs1", instr,
RV_D);
1477 UnknownInstruction(instr);
1481 switch (
static_cast<FcvtRs2>(instr.rs2())) {
1483 Print(
"fcvt.w.d 'rd, 'frs1'round", instr,
RV_D);
1486 Print(
"fcvt.wu.d 'rd, 'frs1'round", instr,
RV_D);
1490 Print(
"fcvt.l.d 'rd, 'frs1'round", instr,
RV_D);
1493 Print(
"fcvt.lu.d 'rd, 'frs1'round", instr,
RV_D);
1497 UnknownInstruction(instr);
1501 switch (
static_cast<FcvtRs2>(instr.rs2())) {
1503 Print(
"fcvt.d.w 'frd, 'rs1'round", instr,
RV_D);
1506 Print(
"fcvt.d.wu 'frd, 'rs1'round", instr,
RV_D);
1510 Print(
"fcvt.d.l 'frd, 'rs1'round", instr,
RV_D);
1513 Print(
"fcvt.d.lu 'frd, 'rs1'round", instr,
RV_D);
1517 UnknownInstruction(instr);
1522 Print(
"fmv.d.x 'frd, 'rs1", instr,
RV_D);
1526 UnknownInstruction(instr);
1530void RISCVDisassembler::UnknownInstruction(Instr instr) {
1531 if (instr.encoding() == 0) {
1532 Print(
"trap", instr,
RV_I);
1534 Print(
"unknown", instr, ExtensionSet::Empty());
1538void RISCVDisassembler::UnknownInstruction(CInstr instr) {
1539 if (instr.encoding() == 0) {
1540 Print(
"trap", instr,
RV_I);
1542 Print(
"unknown", instr, ExtensionSet::Empty());
1546void RISCVDisassembler::Print(
const char*
format,
1551 while (
format[0] !=
'\0') {
1563void RISCVDisassembler::Print(
const char*
format,
1568 while (
format[0] !=
'\0') {
1580#define STRING_STARTS_WITH(string, compare_string) \
1581 (strncmp(string, compare_string, strlen(compare_string)) == 0)
1583const char* RISCVDisassembler::PrintOption(
const char*
format, Instr instr) {
1584 if (STRING_STARTS_WITH(
format,
"rd")) {
1587 }
else if (STRING_STARTS_WITH(
format,
"rs1")) {
1590 }
else if (STRING_STARTS_WITH(
format,
"rs2")) {
1593 }
else if (STRING_STARTS_WITH(
format,
"shamt")) {
1594 Printf(
"0x%x", instr.shamt());
1596 }
else if (STRING_STARTS_WITH(
format,
"jimm")) {
1597 Printf(
"%+" Pd,
static_cast<intptr_t
>(instr.jtype_imm()));
1599 }
else if (STRING_STARTS_WITH(
format,
"uimm")) {
1601 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.utype_imm()));
1603 }
else if (STRING_STARTS_WITH(
format,
"iimm")) {
1604 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.itype_imm()));
1606 }
else if (STRING_STARTS_WITH(
format,
"simm")) {
1607 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.stype_imm()));
1609 }
else if (STRING_STARTS_WITH(
format,
"bimm")) {
1610 Printf(
"%+" Pd,
static_cast<intptr_t
>(instr.btype_imm()));
1612 }
else if (STRING_STARTS_WITH(
format,
"zimm")) {
1613 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.zimm()));
1615 }
else if (STRING_STARTS_WITH(
format,
"csr")) {
1616 Printf(
"0x%" Px,
static_cast<intptr_t
>(instr.csr()));
1618 }
else if (STRING_STARTS_WITH(
format,
"order")) {
1619 switch (instr.memory_order()) {
1620 case std::memory_order_relaxed:
1622 case std::memory_order_acquire:
1625 case std::memory_order_release:
1628 case std::memory_order_acq_rel:
1635 }
else if (STRING_STARTS_WITH(
format,
"round")) {
1636 switch (instr.rounding()) {
1656 Printf(
"<invalid rounding mode>");
1659 }
else if (STRING_STARTS_WITH(
format,
"predsucc")) {
1675 }
else if (STRING_STARTS_WITH(
format,
"frd")) {
1678 }
else if (STRING_STARTS_WITH(
format,
"frs1")) {
1681 }
else if (STRING_STARTS_WITH(
format,
"frs2")) {
1684 }
else if (STRING_STARTS_WITH(
format,
"frs3")) {
1693const char* RISCVDisassembler::PrintOption(
const char*
format, CInstr instr) {
1694 if (STRING_STARTS_WITH(
format,
"rdp")) {
1697 }
else if (STRING_STARTS_WITH(
format,
"rs1p")) {
1700 }
else if (STRING_STARTS_WITH(
format,
"rs2p")) {
1703 }
else if (STRING_STARTS_WITH(
format,
"rd")) {
1706 }
else if (STRING_STARTS_WITH(
format,
"rs1")) {
1709 }
else if (STRING_STARTS_WITH(
format,
"rs2")) {
1712 }
else if (STRING_STARTS_WITH(
format,
"frdp")) {
1715 }
else if (STRING_STARTS_WITH(
format,
"frs1p")) {
1718 }
else if (STRING_STARTS_WITH(
format,
"frs2p")) {
1721 }
else if (STRING_STARTS_WITH(
format,
"frd")) {
1724 }
else if (STRING_STARTS_WITH(
format,
"frs1")) {
1727 }
else if (STRING_STARTS_WITH(
format,
"frs2")) {
1730 }
else if (STRING_STARTS_WITH(
format,
"spload4imm")) {
1731 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.spload4_imm()));
1733 }
else if (STRING_STARTS_WITH(
format,
"spload8imm")) {
1734 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.spload8_imm()));
1736 }
else if (STRING_STARTS_WITH(
format,
"spstore4imm")) {
1737 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.spstore4_imm()));
1739 }
else if (STRING_STARTS_WITH(
format,
"spstore8imm")) {
1740 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.spstore8_imm()));
1742 }
else if (STRING_STARTS_WITH(
format,
"mem4imm")) {
1743 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.mem4_imm()));
1745 }
else if (STRING_STARTS_WITH(
format,
"mem8imm")) {
1746 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.mem8_imm()));
1748 }
else if (STRING_STARTS_WITH(
format,
"jimm")) {
1749 Printf(
"%+" Pd,
static_cast<intptr_t
>(instr.j_imm()));
1751 }
else if (STRING_STARTS_WITH(
format,
"bimm")) {
1752 Printf(
"%+" Pd,
static_cast<intptr_t
>(instr.b_imm()));
1754 }
else if (STRING_STARTS_WITH(
format,
"iimm")) {
1755 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.i_imm()));
1757 }
else if (STRING_STARTS_WITH(
format,
"uimm")) {
1759 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.u_imm()));
1761 }
else if (STRING_STARTS_WITH(
format,
"i16imm")) {
1762 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.i16_imm()));
1764 }
else if (STRING_STARTS_WITH(
format,
"i4spnimm")) {
1765 Printf(
"%" Pd,
static_cast<intptr_t
>(instr.i4spn_imm()));
1776 intptr_t human_size,
1777 int* out_instr_size,
1781 RISCVDisassembler decoder(human_buffer, human_size,
1782 FLAG_use_compressed_instructions ?
RV_GC :
RV_G);
1783 int instr_size = decoder.Disassemble(pc);
1784 if (instr_size == 2) {
1786 *
reinterpret_cast<uint16_t*
>(pc));
1787 }
else if (instr_size == 4) {
1791 if (out_instr_size !=
nullptr) {
1792 *out_instr_size = instr_size;
1796 if (!
code.IsNull()) {
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
static void DecodeInstruction(char *hex_buffer, intptr_t hex_size, char *human_buffer, intptr_t human_size, int *out_instr_len, const Code &code, Object **object, uword pc)
static int SNPrint(char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static const uint8_t buffer[]
uint32_t uint32_t * format
static constexpr Extension RV_F(3)
bool IsCInstruction(uint16_t parcel)
static constexpr Extension RV_Zbs(9)
static constexpr ExtensionSet RV_GC
const char *const fpu_reg_names[kNumberOfFpuRegisters]
static constexpr Extension RV_Zbc(8)
bool DecodeLoadObjectFromPoolOrThread(uword pc, const Code &code, Object *obj)
static T LoadUnaligned(const T *ptr)
static constexpr Extension RV_A(2)
const char *const cpu_reg_names[kNumberOfCpuRegisters]
static constexpr Extension RV_Zba(6)
static constexpr Extension RV_M(1)
static constexpr Extension RV_C(5)
static constexpr ExtensionSet RV_G
static constexpr Extension RV_D(4)
static constexpr Extension RV_I(0)
static constexpr Extension RV_Zbb(7)