1 /* { dg-do compile } */
2 /* { dg-options "-march=celledp -O1" } */
3 /* { dg-final { scan-assembler "dfceq" } } */
5 /* GCC previously transformed an "a <= b" test into "! (a > b)" when
6 compiling with -march=celledp, so that the dfcgt instruction can be
7 used to implement the comparison.
9 However, this transformation violates the IEEE-754 standard in the
10 presence of NaN values. If either a or b is a NaN, a <= b should
11 evaluate to false according to IEEE rules. However, after the
12 transformation, a > b as implemented by dfcgt itself returns false,
13 so the transformed test returns true.
15 Note that the equivalent transformation is valid for single-
16 precision floating-point values on the Cell SPU, because the format
17 does not have NaNs. It is invalid for double-precision, even on
20 int test (double a
, double b
) __attribute__ ((noinline
));
21 int test (double a
, double b
)