[PATCH] D138809: [RISCV] Support vector crypto extension LLVM IR

Brandon Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 23:16:22 PDT 2023


4vtomat added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:1551
       return selectVSETVLI(Node);
+    case Intrinsic::riscv_vrol: {
+      SDValue Merge = Node->getOperand(1);
----------------
craig.topper wrote:
> This seems unnecessarily complex. https://reviews.llvm.org/D155439 already did this for non-intrinsics using an SDNodeXForm in tablegen
Oh, that's much better, thanks!


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:7261
+  case Intrinsic::riscv_vsm4r_vs: {
+    assert(isValidEGW(4, Op.getSimpleValueType()) &&
+           isValidEGW(4, Op->getOperand(1).getSimpleValueType()) &&
----------------
craig.topper wrote:
> This assert isn't helpful to compiler users. It's not part of release builds.
Oh, ok. I just changed it to report_fatal_error~


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:7340
+  defm : VPatBinaryV_VV_VX<"int_riscv_vrol", "PseudoVROL", AllIntegerVectors>;
+  defm : VPatBinaryV_VV_VX_VI<"int_riscv_vror", "PseudoVROR", AllIntegerVectors>;
+  defm : VPatBinaryW_VV_VX_VI<"int_riscv_vwsll", "PseudoVWSLL", AllWidenableIntVectors>;
----------------
craig.topper wrote:
> VPatBinaryV_VV_VX_VI defaults simm5, but vror.vi uses uimm6.
Oh, I forgot this instruction has different encoding of immediate, thanks!


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td:678
+multiclass VPatBinaryV_VI_NoMask<string intrinsic, string instruction,
+                          list<VTypeInfo> vtilist, Operand imm_type = timm5> {
+  foreach vti = vtilist in
----------------
craig.topper wrote:
> timm5 uses isInt<5>, but I think you want isUInt<5>?
Oh, correct, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138809



More information about the llvm-commits mailing list