Skip to content

Commit

Permalink
[RISCV] Update DecoderMethod and MCOperandPredicate of spimm. (llvm#7…
Browse files Browse the repository at this point in the history
…6061)

he spimm operand is an immediate whose only 4-5th bit could be setted
and not based on rlist operand
  • Loading branch information
yetingk authored Dec 27, 2023
1 parent 8ddb0fc commit 256bf56
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,8 @@ static DecodeStatus decodeRegReg(MCInst &Inst, uint32_t Insn, uint64_t Address,
return MCDisassembler::Success;
}

// spimm is based on rlist now.
static DecodeStatus decodeZcmpSpimm(MCInst &Inst, unsigned Imm,
uint64_t Address, const void *Decoder) {
// TODO: check if spimm matches rlist
Inst.addOperand(MCOperand::createImm(Imm));
return MCDisassembler::Success;
}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def spimm : Operand<OtherVT> {
int64_t Imm;
if (!MCOp.evaluateAsConstantImm(Imm))
return false;
return isShiftedUInt<5, 4>(Imm);
return isShiftedUInt<2, 4>(Imm);
}];
}

Expand Down

0 comments on commit 256bf56

Please sign in to comment.