@@ -194,12 +194,24 @@ static DecodeStatus DecodeFPR128RegisterClass(MCInst &Inst, uint32_t RegNo,
194
194
return MCDisassembler::Success;
195
195
}
196
196
197
+ static DecodeStatus DecodeGPRX1RegisterClass (MCInst &Inst,
198
+ const MCDisassembler *Decoder) {
199
+ Inst.addOperand (MCOperand::createReg (RISCV::X1));
200
+ return MCDisassembler::Success;
201
+ }
202
+
197
203
static DecodeStatus DecodeSPRegisterClass (MCInst &Inst,
198
204
const MCDisassembler *Decoder) {
199
205
Inst.addOperand (MCOperand::createReg (RISCV::X2));
200
206
return MCDisassembler::Success;
201
207
}
202
208
209
+ static DecodeStatus DecodeGPRX5RegisterClass (MCInst &Inst,
210
+ const MCDisassembler *Decoder) {
211
+ Inst.addOperand (MCOperand::createReg (RISCV::X5));
212
+ return MCDisassembler::Success;
213
+ }
214
+
203
215
static DecodeStatus DecodeGPRNoX0RegisterClass (MCInst &Inst, uint32_t RegNo,
204
216
uint64_t Address,
205
217
const MCDisassembler *Decoder) {
@@ -408,6 +420,18 @@ static DecodeStatus decodeVMaskReg(MCInst &Inst, uint32_t RegNo,
408
420
return MCDisassembler::Success;
409
421
}
410
422
423
+ static DecodeStatus decodeImmThreeOperand (MCInst &Inst,
424
+ const MCDisassembler *Decoder) {
425
+ Inst.addOperand (MCOperand::createImm (3 ));
426
+ return MCDisassembler::Success;
427
+ }
428
+
429
+ static DecodeStatus decodeImmFourOperand (MCInst &Inst,
430
+ const MCDisassembler *Decoder) {
431
+ Inst.addOperand (MCOperand::createImm (4 ));
432
+ return MCDisassembler::Success;
433
+ }
434
+
411
435
template <unsigned N>
412
436
static DecodeStatus decodeUImmOperand (MCInst &Inst, uint32_t Imm,
413
437
int64_t Address,
@@ -579,46 +603,6 @@ static DecodeStatus decodeXqccmpRlistS0(MCInst &Inst, uint32_t Imm,
579
603
return decodeZcmpRlist (Inst, Imm, Address, Decoder);
580
604
}
581
605
582
- static DecodeStatus decodeCSSPushPopchk (MCInst &Inst, uint16_t Insn,
583
- uint64_t Address,
584
- const MCDisassembler *Decoder) {
585
- uint32_t Rs1 = fieldFromInstruction (Insn, 7 , 5 );
586
- [[maybe_unused]] DecodeStatus Result =
587
- DecodeGPRX1X5RegisterClass (Inst, Rs1, Address, Decoder);
588
- assert (Result == MCDisassembler::Success && " Invalid register" );
589
- return MCDisassembler::Success;
590
- }
591
-
592
- static DecodeStatus decodeXTHeadMemPair (MCInst &Inst, uint32_t Insn,
593
- uint64_t Address,
594
- const MCDisassembler *Decoder) {
595
- DecodeStatus S = MCDisassembler::Success;
596
- uint32_t Rd1 = fieldFromInstruction (Insn, 7 , 5 );
597
- uint32_t Rs1 = fieldFromInstruction (Insn, 15 , 5 );
598
- uint32_t Rd2 = fieldFromInstruction (Insn, 20 , 5 );
599
- uint32_t UImm2 = fieldFromInstruction (Insn, 25 , 2 );
600
- if (!Check (S, DecodeGPRRegisterClass (Inst, Rd1, Address, Decoder)))
601
- return MCDisassembler::Fail;
602
- if (!Check (S, DecodeGPRRegisterClass (Inst, Rd2, Address, Decoder)))
603
- return MCDisassembler::Fail;
604
- if (!Check (S, DecodeGPRRegisterClass (Inst, Rs1, Address, Decoder)))
605
- return MCDisassembler::Fail;
606
- [[maybe_unused]] DecodeStatus Result =
607
- decodeUImmOperand<2 >(Inst, UImm2, Address, Decoder);
608
- assert (Result == MCDisassembler::Success && " Invalid immediate" );
609
-
610
- // Disassemble the final operand which is implicit.
611
- unsigned Opcode = Inst.getOpcode ();
612
- bool IsWordOp = (Opcode == RISCV::TH_LWD || Opcode == RISCV::TH_LWUD ||
613
- Opcode == RISCV::TH_SWD);
614
- if (IsWordOp)
615
- Inst.addOperand (MCOperand::createImm (3 ));
616
- else
617
- Inst.addOperand (MCOperand::createImm (4 ));
618
-
619
- return S;
620
- }
621
-
622
606
#include " RISCVGenDisassemblerTables.inc"
623
607
624
608
namespace {
0 commit comments