1 /* Excess precision tests. Test excess precision is removed when
4 /* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */
9 extern void abort (void);
10 extern void exit (int);
12 volatile float f1
= 1.0f
;
13 volatile float f2
= 0x1.0p
-30f
;
14 volatile float f3
= 0x1.0p
-60f
;
15 volatile double d1
= 1.0;
16 volatile double d2
= 0x1.0p
-30;
17 volatile double d3
= 0x1.0p
-60;
18 volatile float fadd1
= 1.0f
+ 0x1.0p
-30f
;
19 volatile double dadd2
= 1.0 + 0x1.0p
-30 + 0x1.0p
-60;
20 volatile double dh
= 0x1.0p
-24;
21 volatile float fha
= 1.0f
+ 0x1.0p
-23f
;
37 /* Verify rounding direct to float without double rounding. */
47 double d
= d1
+ d2
+ d3
;
54 volatile int i1
= 0x40000001;
55 volatile unsigned int u1
= 0x80000001u
;
56 volatile long long ll1
= 0x4000000000000001ll
;
57 volatile unsigned long long ull1
= 0x8000000000000001ull
;
62 if ((float)(f1
+ f2
) != fadd1
)
64 if ((double)(d1
+ d2
+ d3
) != dadd2
)
66 if ((double)(f1
+ f2
+ f3
) != dadd2
)
68 if ((float)i1
!= 0x1.0p30f
)
70 if ((float)u1
!= 0x1.0p31f
)
72 if ((float)ll1
!= 0x1.0p62f
)
74 if ((float)ull1
!= 0x1.0p63f
)
76 if ((double)ll1
!= 0x1.0p62
)
78 if ((double)ull1
!= 0x1.0p63
)
90 check_double (double d
)
97 check_float_nonproto (f
)
105 check_double_nonproto (d
)
113 check_double_va (int i
, ...)
117 if (va_arg (ap
, double) != dadd2
)
125 check_float (f1
+ f2
);
126 check_double (d1
+ d2
+ d3
);
127 check_double (f1
+ f2
+ f3
);
128 check_float_nonproto (f1
+ f2
);
129 check_double_nonproto (d1
+ d2
+ d3
);
130 check_double_nonproto (f1
+ f2
+ f3
);
131 check_double_va (0, d1
+ d2
+ d3
);
132 check_double_va (0, f1
+ f2
+ f3
);
142 return_double1 (void)
148 return_double2 (void)
156 if (return_float () != fadd1
)
158 if (return_double1 () != dadd2
)
160 if (return_double2 () != dadd2
)
164 volatile float flt_min
= FLT_MIN
;
165 volatile double dbl_min
= DBL_MIN
;
166 volatile float flt_max
= FLT_MAX
;
167 volatile double dbl_max
= DBL_MAX
;
172 /* Classification macros convert to the semantic type. signbit and
173 comparison macros do not. */
174 if (!__builtin_isinf (flt_max
* flt_max
))
176 if (!__builtin_isinf (dbl_max
* dbl_max
))
178 if (__builtin_isnormal (flt_max
* flt_max
))
180 if (__builtin_isnormal (dbl_max
* dbl_max
))
182 if (__builtin_isfinite (flt_max
* flt_max
))
184 if (__builtin_isfinite (dbl_max
* dbl_max
))
186 if (!__builtin_isgreater (flt_min
* flt_min
, 0.0f
))
188 if (!__builtin_isgreaterequal (flt_min
* flt_min
, 0.0f
))
190 if (!__builtin_isless (0.0f
, flt_min
* flt_min
))
192 if (__builtin_islessequal (flt_min
* flt_min
, 0.0f
))
194 if (!__builtin_islessgreater (flt_min
* flt_min
, 0.0f
))
196 if (!__builtin_isgreater (dbl_min
* dbl_min
, 0.0))
198 if (!__builtin_isgreaterequal (dbl_min
* dbl_min
, 0.0))
200 if (!__builtin_isless (0.0, dbl_min
* dbl_min
))
202 if (__builtin_islessequal (dbl_min
* dbl_min
, 0.0))
204 if (!__builtin_islessgreater (dbl_min
* dbl_min
, 0.0))