[PATCH] D131771: [RISCV] : Add support for immediate operands.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 09:28:50 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h:219
   OPERAND_UIMM3,
+
   OPERAND_UIMM4,
----------------
Stray blank line?


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoV.td:31
   let DecoderMethod = "decodeUImmOperand<"#VTypeINum#">";
+  let OperandType = "OPERAND_VI" # VTypeINum;
+  let OperandNamespace = "RISCVOp";
----------------
VI -> VTYPEI


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoV.td:41
 
-def VTypeIOp10 : VTypeIOp<10>;
-def VTypeIOp11 : VTypeIOp<11>;
+def VTypeIOp10 : VTypeIOp<10>, ImmLeaf<XLenVT, [{return isUInt<10>(Imm);}]>;
+def VTypeIOp11 : VTypeIOp<11>, ImmLeaf<XLenVT, [{return isUInt<11>(Imm);}]>;
----------------
This is never used in a pattern, why does it need ImmLeaf?


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoV.td:101
+
+def simm5_plus1_nonzero : Operand<XLenVT>, ImmLeaf<XLenVT,
+  [{return Imm != 0 && ((isInt<5>(Imm) && Imm != -16) || Imm == 16);}]> {
----------------
I don't think there are any instruction that uses this as an operand. Why do we need this change?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131771/new/

https://reviews.llvm.org/D131771



More information about the llvm-commits mailing list