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

--- Comment #7 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to pc from comment #5)
> 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.

Nice test case! We probably can note this matching to xs{min,max}dp as one
small "Programming Note" in ISA document.

Reply via email to