[PATCH] D122678: [RISCV] Add support for vp.fptosi where the result is a mask type.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 23:51:33 PDT 2022


craig.topper added a comment.

In D122678#3418380 <https://reviews.llvm.org/D122678#3418380>, @rogfer01 wrote:

> In D122678#3416853 <https://reviews.llvm.org/D122678#3416853>, @craig.topper wrote:
>
>> In D122678#3416821 <https://reviews.llvm.org/D122678#3416821>, @rogfer01 wrote:
>>
>>> I must be missing something very obvious: wouldn't `2.0` round to `2` and then give us `i1 0` because its LSB is 0?
>>
>> 2.0 is out of range for the integer so it is UB and produces poison.
>
> Ah right! Thanks. I'd say to remove the extra masking, checking other targets don't seem to bother.
>
> Just curious why you chose a narrowing conversion rather than a regular one, perhaps you want to reduce the register pressure for the result or the expectation is that it'll be faster?

I copied from the regular FP_TO_SINT code. Which is also where I got the AND since it went through TRUNCATE lowering.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122678



More information about the llvm-commits mailing list