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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 18:11:19 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:7187
+  return Subtarget.getRealMinVLen() *
+             VT.getSizeInBits().getKnownMinValue() / 64 >=
+         EGS * VT.getScalarSizeInBits();
----------------
4vtomat wrote:
> craig.topper wrote:
> > craig.topper wrote:
> > > Use `RVVBitsPerBlock` instead of 64
> > Please add extra parentheses to `Subtarget.getRealMinVLen() * VT.getSizeInBits().getKnownMinValue() / 64` to make the operator precedence clear
> The reason I didn't add parentheses between `VT.getSizeInBits().getKnownMinValue() / 64` is because if I do so, I need to case `VT.getSizeInBits().getKnownMinValue()` to either `double` or `float` since it could be fractional. Do you think it's better to do it this way?
Use `(Subtarget.getRealMinVLen() * VT.getSizeInBits().getKnownMinValue()) / 64`. It's the operator precedence the compiler will use for the current code. I just don't want to think about the operator precedence when reading the code.


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