aboutsummaryrefslogtreecommitdiff
path: root/math/libm-test-support.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/libm-test-support.c')
-rw-r--r--math/libm-test-support.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/math/libm-test-support.c b/math/libm-test-support.c
index 2e4f9ef..e59f15b 100644
--- a/math/libm-test-support.c
+++ b/math/libm-test-support.c
@@ -135,6 +135,7 @@ static int verbose;
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;
@@ -212,11 +213,12 @@ find_ulps (const char *name, const struct ulp_data *data, size_t nmemb)
}
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,
@@ -225,15 +227,14 @@ init_max_error (const char *name, int exact)
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);
@@ -518,14 +519,14 @@ test_exceptions (const char *test_name, int exception)
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");