Skip to content

Commit 256bf56

Browse files
authored
[RISCV] Update DecoderMethod and MCOperandPredicate of spimm. (#76061)
he spimm operand is an immediate whose only 4-5th bit could be setted and not based on rlist operand
1 parent 8ddb0fc commit 256bf56

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,8 @@ static DecodeStatus decodeRegReg(MCInst &Inst, uint32_t Insn, uint64_t Address,
462462
return MCDisassembler::Success;
463463
}
464464

465-
// spimm is based on rlist now.
466465
static DecodeStatus decodeZcmpSpimm(MCInst &Inst, unsigned Imm,
467466
uint64_t Address, const void *Decoder) {
468-
// TODO: check if spimm matches rlist
469467
Inst.addOperand(MCOperand::createImm(Imm));
470468
return MCDisassembler::Success;
471469
}

llvm/lib/Target/RISCV/RISCVInstrInfoZc.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def spimm : Operand<OtherVT> {
6969
int64_t Imm;
7070
if (!MCOp.evaluateAsConstantImm(Imm))
7171
return false;
72-
return isShiftedUInt<5, 4>(Imm);
72+
return isShiftedUInt<2, 4>(Imm);
7373
}];
7474
}
7575

0 commit comments

Comments
 (0)