@@ -506,10 +506,12 @@ static DecodeStatus decodeXTHeadMemPair(MCInst &Inst, uint32_t Insn,
506506 const MCDisassembler *Decoder);
507507
508508static DecodeStatus decodeZcmpRlist (MCInst &Inst, uint32_t Imm,
509- uint64_t Address, const void *Decoder);
509+ uint64_t Address,
510+ const MCDisassembler *Decoder);
510511
511512static DecodeStatus decodeXqccmpRlistS0 (MCInst &Inst, uint32_t Imm,
512- uint64_t Address, const void *Decoder);
513+ uint64_t Address,
514+ const MCDisassembler *Decoder);
513515
514516static DecodeStatus decodeZcmpSpimm (MCInst &Inst, uint32_t Imm,
515517 uint64_t Address, const void *Decoder);
@@ -624,16 +626,20 @@ static DecodeStatus decodeXTHeadMemPair(MCInst &Inst, uint32_t Insn,
624626}
625627
626628static DecodeStatus decodeZcmpRlist (MCInst &Inst, uint32_t Imm,
627- uint64_t Address, const void *Decoder) {
628- if (Imm < RISCVZC::RA)
629+ uint64_t Address,
630+ const MCDisassembler *Decoder) {
631+ bool IsRVE = Decoder->getSubtargetInfo ().hasFeature (RISCV::FeatureStdExtE);
632+ if (Imm < RISCVZC::RA || (IsRVE && Imm >= RISCVZC::RA_S0_S2))
629633 return MCDisassembler::Fail;
630634 Inst.addOperand (MCOperand::createImm (Imm));
631635 return MCDisassembler::Success;
632636}
633637
634638static DecodeStatus decodeXqccmpRlistS0 (MCInst &Inst, uint32_t Imm,
635- uint64_t Address, const void *Decoder) {
636- if (Imm < RISCVZC::RA_S0)
639+ uint64_t Address,
640+ const MCDisassembler *Decoder) {
641+ bool IsRVE = Decoder->getSubtargetInfo ().hasFeature (RISCV::FeatureStdExtE);
642+ if (Imm < RISCVZC::RA_S0 || (IsRVE && Imm >= RISCVZC::RA_S0_S2))
637643 return MCDisassembler::Fail;
638644 Inst.addOperand (MCOperand::createImm (Imm));
639645 return MCDisassembler::Success;
0 commit comments