@@ -534,15 +534,25 @@ static DecodeStatus decodeRTZArg(MCInst &Inst, uint32_t Imm, int64_t Address,
534534 return MCDisassembler::Success;
535535}
536536
537- static DecodeStatus decodeXTHeadMemPair (MCInst &Inst, uint32_t Insn,
538- uint64_t Address,
539- const MCDisassembler *Decoder);
540-
541537static DecodeStatus decodeZcmpRlist (MCInst &Inst, uint32_t Imm,
542538 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+ }
544546
545547static 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,
546556 uint64_t Address,
547557 const MCDisassembler *Decoder);
548558
@@ -592,24 +602,6 @@ static DecodeStatus decodeXTHeadMemPair(MCInst &Inst, uint32_t Insn,
592602 return S;
593603}
594604
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-
613605// Add implied SP operand for C.*SP compressed instructions. The SP operand
614606// isn't explicitly encoded in the instruction.
615607void RISCVDisassembler::addSPOperands (MCInst &MI) const {
0 commit comments