@@ -534,15 +534,25 @@ static DecodeStatus decodeRTZArg(MCInst &Inst, uint32_t Imm, int64_t Address,
534
534
return MCDisassembler::Success;
535
535
}
536
536
537
- static DecodeStatus decodeXTHeadMemPair (MCInst &Inst, uint32_t Insn,
538
- uint64_t Address,
539
- const MCDisassembler *Decoder);
540
-
541
537
static DecodeStatus decodeZcmpRlist (MCInst &Inst, uint32_t Imm,
542
538
uint64_t Address,
543
- const MCDisassembler *Decoder);
539
+ const MCDisassembler *Decoder) {
540
+ bool IsRVE = Decoder->getSubtargetInfo ().hasFeature (RISCV::FeatureStdExtE);
541
+ if (Imm < RISCVZC::RA || (IsRVE && Imm >= RISCVZC::RA_S0_S2))
542
+ return MCDisassembler::Fail;
543
+ Inst.addOperand (MCOperand::createImm (Imm));
544
+ return MCDisassembler::Success;
545
+ }
544
546
545
547
static DecodeStatus decodeXqccmpRlistS0 (MCInst &Inst, uint32_t Imm,
548
+ uint64_t Address,
549
+ const MCDisassembler *Decoder) {
550
+ if (Imm < RISCVZC::RA_S0)
551
+ return MCDisassembler::Fail;
552
+ return decodeZcmpRlist (Inst, Imm, Address, Decoder);
553
+ }
554
+
555
+ static DecodeStatus decodeXTHeadMemPair (MCInst &Inst, uint32_t Insn,
546
556
uint64_t Address,
547
557
const MCDisassembler *Decoder);
548
558
@@ -592,24 +602,6 @@ static DecodeStatus decodeXTHeadMemPair(MCInst &Inst, uint32_t Insn,
592
602
return S;
593
603
}
594
604
595
- static DecodeStatus decodeZcmpRlist (MCInst &Inst, uint32_t Imm,
596
- uint64_t Address,
597
- const MCDisassembler *Decoder) {
598
- bool IsRVE = Decoder->getSubtargetInfo ().hasFeature (RISCV::FeatureStdExtE);
599
- if (Imm < RISCVZC::RA || (IsRVE && Imm >= RISCVZC::RA_S0_S2))
600
- return MCDisassembler::Fail;
601
- Inst.addOperand (MCOperand::createImm (Imm));
602
- return MCDisassembler::Success;
603
- }
604
-
605
- static DecodeStatus decodeXqccmpRlistS0 (MCInst &Inst, uint32_t Imm,
606
- uint64_t Address,
607
- const MCDisassembler *Decoder) {
608
- if (Imm < RISCVZC::RA_S0)
609
- return MCDisassembler::Fail;
610
- return decodeZcmpRlist (Inst, Imm, Address, Decoder);
611
- }
612
-
613
605
// Add implied SP operand for C.*SP compressed instructions. The SP operand
614
606
// isn't explicitly encoded in the instruction.
615
607
void RISCVDisassembler::addSPOperands (MCInst &MI) const {
0 commit comments