[PATCH] D138844: [PowerPC] Materialize floats in the range [-16.0, 15.0].
Stefan Pintilie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 21 08:20:04 PST 2022
stefanp added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:17182
+ return true;
+ return Imm.isZero();
+ }
----------------
lei wrote:
> Previous behavour is "fallthrough" which will result in a return of `Imm.isPosZero()`. Do we not want the defalut to be same as before?
> Previous behavour is "fallthrough" which will result in a return of `Imm.isPosZero()`. Do we not want the defalut to be same as before?
Actually we can now handle negative zero as well for the types `f32` and `f64` due to this:
```
def : Pat<(f64 (fpimm0neg)),
(f64 (XSNEGDP (XXLXORdpz)))>;
def : Pat<(f32 (fpimm0neg)),
(f32 (COPY_TO_REGCLASS (XSNEGDP (XXLXORdpz)), VSSRC))>;
```
So, we can safely check for all zeros instead of just positive zero.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138844/new/
https://reviews.llvm.org/D138844
More information about the llvm-commits
mailing list