[PATCH] D122860: [RISCV][RVV] Add FPRndModeOp to PseudoVFCVT instructions

ShihPo Hung via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 1 09:31:47 PDT 2022


arcbbb marked 2 inline comments as done.
arcbbb added a comment.

In D122860#3479271 <https://reviews.llvm.org/D122860#3479271>, @rogfer01 wrote:

> Thanks @arcbbb.
>
> Just to understand the design principle behind these patches: adding `FRM` as `Use` to the `v*cvt` instructions (like we did in D121087 <https://reviews.llvm.org/D121087> ) would not help us to implement `floor` and `ceil`. I imagine one option could be adding specific pseudos for round up and round down and then a later pass could set the rounding mode and restore it later. However, this would not give great code generation and it adds even more instructions to our already large number of pseudos. So your approach goes by adding a new operand with the rounding mode, similar to the scalar operations, and in D123371 <https://reviews.llvm.org/D123371> you propose a pass that adjusts the `FRM` register.
>
> I hope I got it right :)

Many thanks for your summary. It states much better than mine.



================
Comment at: llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h:99
+
+  HasFPRndModeOpShift = UsesMaskPolicyShift + 1,
+  HasFPRndModeOpMask = 1 << HasFPRndModeOpShift,
----------------
rogfer01 wrote:
> Could you add a comment explaining what this flag means?
> 
> What I understand is that for "vfcvt" instructions we annotate the rounding mode. It'll be commonly dynamic except for cases when we want to explicitly round up or down.
Thanks for the reminding!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122860



More information about the llvm-commits mailing list