1 /* { dg-do run { target { powerpc*-*-* } } } */
2 /* { dg-require-effective-target p9vector_hw } */
3 /* { dg-options "-mdejagnu-cpu=power9" } */
10 test_nan (__ieee128
*p
)
12 __ieee128 source
= *p
;
16 0x20 Test for +Infinity
17 0x10 Test for -Infinity
20 0x02 Test for +Denormal
21 0x01 Test for -Denormal
23 return scalar_test_data_class (source
, 0x40);
29 /* NaN is represented with the maximum biased exponent value and a
30 * non-zero fraction value. The sign bit ignored. If the
31 * high-order bit of the fraction field is 0, then the NaN is a
32 * Signaling NaN. Otherwise, it is a Quiet NaN. */
33 __int128 signal_significand
= (__int128
) 0xffffffff;
34 __int128 quiet_significand
= (((__int128
) 0x1) << 112) | 0xffffffff;
35 __int128 a_number_significand
= (((__int128
) 0x1) << 112);
36 unsigned long long int nan_exponent
= 0x7fff;
37 unsigned long long int a_number_exponent
= 16383;
39 __ieee128 signaling_nan
=
40 scalar_insert_exp (signal_significand
, nan_exponent
);
42 scalar_insert_exp (quiet_significand
, nan_exponent
);
44 scalar_insert_exp (a_number_significand
, a_number_exponent
);
46 if (!test_nan (&signaling_nan
))
48 if (!test_nan (&quiet_nan
))
50 if (test_nan (&a_number
))