[PATCH] D102918: [RISCV] Avoid undef result due to promotion of FPOWI exponent

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 08:47:51 PDT 2021


bjope added a comment.

In D102918#2773820 <https://reviews.llvm.org/D102918#2773820>, @craig.topper wrote:

> Where is it documented that larger than i32 is undefined? I see this in ISDOpcodes.def
>
> For FPOWI, the result is undefined if if the integer operand doesn't fit into 32 bits.
>
> That sounds more like it’s talking about the range of the value than the type. So why isn’t it ok to sign extend  i32 to i64?

Right, one could argue that the value fits if doing a sign-extend. Then this patch might be a bit harsh as it regress the RISCV lowering without actually having depended on that noone folded the FPOWI to undef (as that only would be allowed if the value potentially could be out-of-range).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102918



More information about the llvm-commits mailing list