Skip to content

Commit 19e0233

Browse files
committed
[RISCV] Make decodeXqccmpRlistS0 defer to decodeZcmpRlist after checking for S0 being included. NFC
This reduces code duplication.
1 parent 24dfcc0 commit 19e0233

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,9 @@ static DecodeStatus decodeZcmpRlist(MCInst &Inst, uint32_t Imm,
658658
static DecodeStatus decodeXqccmpRlistS0(MCInst &Inst, uint32_t Imm,
659659
uint64_t Address,
660660
const MCDisassembler *Decoder) {
661-
bool IsRVE = Decoder->getSubtargetInfo().hasFeature(RISCV::FeatureStdExtE);
662-
if (Imm < RISCVZC::RA_S0 || (IsRVE && Imm >= RISCVZC::RA_S0_S2))
661+
if (Imm < RISCVZC::RA_S0)
663662
return MCDisassembler::Fail;
664-
Inst.addOperand(MCOperand::createImm(Imm));
665-
return MCDisassembler::Success;
663+
return decodeZcmpRlist(Inst, Imm, Address, Decoder);
666664
}
667665

668666
// Add implied SP operand for C.*SP compressed instructions. The SP operand

0 commit comments

Comments
 (0)