[clang] [llvm] [RISCV] Add Support of RISCV Zibimm Experimental Extension (PR #127463)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 16:53:11 PDT 2025


================
@@ -350,6 +350,18 @@ static DecodeStatus decodeUImmNonZeroOperand(MCInst &Inst, uint32_t Imm,
   return decodeUImmOperand<N>(Inst, Imm, Address, Decoder);
 }
 
+template <unsigned N>
+static DecodeStatus decodeUImmZibimmOperand(MCInst &Inst, uint32_t Imm,
+                                            int64_t Address,
+                                            const MCDisassembler *Decoder) {
+  assert(isUInt<N>(Imm) && "Invalid immediate");
+  if (Imm)
+    Inst.addOperand(MCOperand::createImm(Imm));
----------------
topperc wrote:

`Inst.addOperand(MCOperand::createImm(Imm ? Imm : -1))`

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


More information about the llvm-commits mailing list