[Bug target/103605] [PowerPC] fmin/fmax should be inlined always with xsmindp/xsmaxdp

pc at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 26 20:45:45 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103605

--- Comment #5 from pc at gcc dot gnu.org ---
I modified the testcase from comment #3 to clear-before and check-after
FE_INVALID exception bit for each operation:
--
$ /opt/gcc-nightly/trunk/bin/gcc -O2 -o xsmindp-test xsmindp-test.c xsmindp.c
-lm && ./xsmindp-test a b
(src1, src2): fmin:I b-in:I asm:I
(+3.0, +3.0): +3.0;0 +3.0;0 +3.0;0
(+3.0,  NAN): +3.0;0 +nan;0 +3.0;0
( NAN, +3.0): +3.0;0 +3.0;0 +3.0;0
( NAN,  NAN): +nan;0 +nan;0 +nan;0
(+3.0, SNAN): +nan;1 +nan;1 +nan;1
(SNAN, +3.0): +nan;1 +3.0;1 +nan;1
(SNAN, SNAN): +nan;1 +nan;1 +nan;1
$ /opt/gcc-nightly/trunk/bin/gcc -O2 -ffast-math -o xsmindp-test xsmindp-test.c
xsmindp.c -lm && ./xsmindp-test a b
(src1, src2): fmin:I b-in:I asm:I
(+3.0, +3.0): +3.0;0 +3.0;0 +3.0;0
(+3.0,  NAN): +nan;0 +nan;0 +3.0;0
( NAN, +3.0): +3.0;0 +3.0;0 +3.0;0
( NAN,  NAN): +nan;0 +nan;0 +nan;0
(+3.0, SNAN): +nan;1 +nan;1 +nan;1
(SNAN, +3.0): +3.0;1 +3.0;1 +nan;1
(SNAN, SNAN): +nan;1 +nan;1 +nan;1
--
Without -ffast-math, fmin() matches xsmindp.
With -ffast-math, fmin() matches xsmincdp.


More information about the Gcc-bugs mailing list