[Bug target/98140] Reused register by xsmincdp leads to wrong NaN propagation on Power9
alexander.grund@tu-dresden.de
gcc-bugzilla@gcc.gnu.org
Fri Dec 4 16:09:53 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98140
--- Comment #1 from Alexander Grund <alexander.grund@tu-dresden.de> ---
It looks like this was fixed in 10.1 by this commit
https://github.com/gcc-mirror/gcc/commit/37e0df8a9be5a8232f4ccb73cdadb02121ba523f
However the codegen looks worse:
390: 20 00 9e c3 lfs f28,32(r30)
394: 00 e0 9e ff fcmpu cr7,f30,f28
398: 10 00 9c 41 blt cr7,3a8
39c: 40 00 9e c3 lfs f28,64(r30)
3a0: 58 e0 1e f0 xscmpgtdp vs0,vs30,vs28
3a4: 30 e0 9e f3 xxsel vs28,vs30,vs28,vs0
When switching an (a > b) ? b : a to an xsmincdp, the arguments must be swapped
to honor the NaN rules. This would allow this to be used for the `HONOR_NANS
(compare_mode)` case. However it still ignores signed zeros. Maybe xsmindp
would be a better fit as it preserves the signed zeros. Only downside I see is
that it converts sNan to qNan which may be an issue.
More information about the Gcc-bugs
mailing list