[llvm] [RISCV] Use simm8 instead of uimm8 for pli.b (PR #153913)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 16 10:37:03 PDT 2025


================
@@ -1199,6 +1200,14 @@ struct RISCVOperand final : public MCParsedAsmOperand {
     addExpr(Inst, getImm(), isRV64Imm());
   }
 
+  void addSImm8UnsignedOperands(MCInst &Inst, unsigned N) const {
+    assert(N == 1 && "Invalid number of operands!");
+    int64_t Imm;
+    [[maybe_unused]] bool IsConstant = evaluateConstantImm(getImm(), Imm);
+    assert(IsConstant);
+    Inst.addOperand(MCOperand::createImm(SignExtend64<8>(Imm)));
----------------
topperc wrote:

I'm doing a fixup here so the immediate in the MCInst is always in canonical form.

https://github.com/llvm/llvm-project/pull/153913


More information about the llvm-commits mailing list