static int output_max_error; /* Should the maximal errors printed? */
static int output_points; /* Should the single function results printed? */
static int ignore_max_ulp; /* Should we ignore max_ulp? */
+static int test_ibm128; /* Is argument or result IBM long double? */
static FLOAT max_error, real_max_error, imag_max_error;
}
void
-init_max_error (const char *name, int exact)
+init_max_error (const char *name, int exact, int testing_ibm128)
{
max_error = 0;
real_max_error = 0;
imag_max_error = 0;
+ test_ibm128 = testing_ibm128;
prev_max_error = find_ulps (name, func_ulps,
sizeof (func_ulps) / sizeof (func_ulps[0]));
prev_real_max_error = find_ulps (name, func_real_ulps,
prev_imag_max_error = find_ulps (name, func_imag_ulps,
(sizeof (func_imag_ulps)
/ sizeof (func_imag_ulps[0])));
-#if TEST_COND_ibm128
- /* The documented accuracy of IBM long double division is 3ulp (see
- libgcc/config/rs6000/ibm-ldouble-format), so do not require
- better accuracy for libm functions that are exactly defined for
- other formats. */
- max_valid_error = exact ? 3 : 16;
-#else
- max_valid_error = exact ? 0 : 9;
-#endif
+ if (testing_ibm128)
+ /* The documented accuracy of IBM long double division is 3ulp
+ (see libgcc/config/rs6000/ibm-ldouble-format), so do not
+ require better accuracy for libm functions that are exactly
+ defined for other formats. */
+ max_valid_error = exact ? 3 : 16;
+ else
+ max_valid_error = exact ? 0 : 9;
prev_max_error = (prev_max_error <= max_valid_error
? prev_max_error
: max_valid_error);
arithmetic. */
#ifdef FE_UNDERFLOW
if ((exception & UNDERFLOW_EXCEPTION_OK) == 0
- && !(TEST_COND_ibm128
+ && !(test_ibm128
&& (exception & UNDERFLOW_EXCEPTION) == 0))
test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
FE_UNDERFLOW, "Underflow");
#endif
#ifdef FE_INEXACT
if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0
- && !(TEST_COND_ibm128
+ && !(test_ibm128
&& (exception & NO_INEXACT_EXCEPTION) != 0))
test_single_exception (test_name, exception, INEXACT_EXCEPTION,
FE_INEXACT, "Inexact");