aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-02-08 21:11:49 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-02-08 21:11:49 +0000
commit3b2f60328eb4a9f9d776ee63931a3538eafe596a (patch)
treea06c3d3691096beb2cefe7b186c1c6adf2a73687
parent5ab621c3476fef993f94975c826fd0fe3339c3e2 (diff)
downloadglibc-3b2f60328eb4a9f9d776ee63931a3538eafe596a.tar.xz
glibc-3b2f60328eb4a9f9d776ee63931a3538eafe596a.zip
Build most libm-test support code once per type.
libm-test-driver.c contains various functions used in the course of libm testing, which are built as part of each test using this machinery. Currently, these functions get built for three tests for each type (e.g. test-float, test-ifloat, test-float-finite), plus the vector function tests. All these tests are huge and thus slow to build; the output of gen-libm-test.pl totals around 40 MB across all functions. To make the individual tests built from the Makefile smaller, it makes sense to split these tests up so the tests for each function are built separately (thus, three tests for each (function, type) pair, plus vector tests built only for functions that actually have vector versions). This improves parallelism and means that if tests fail, the summary of failed tests makes it more obvious where the problem might be without needing to look in the .out files to see which functions' tests failed (though architecture maintainers still need to keep libm-test-ulps up to date to avoid spurious failures of little interest). Simply including libm-test-driver.c as-is in such individual-function tests does not work because of unused static check_* functions (those functions only being used for the types of the outputs of the function under test). It also means the common code gets built over 1000 times instead of nine (plus vector tests). To avoid that issue, this patch splits out the bulk of the libm-test-driver.c code into a separate file libm-test-support.c (with a few functions made non-static). That separate file is built only once for each floating-point type (so at present three times, or twice on architectures with long double = double). Definitions needed in both libm-test-support.c and libm-test-driver.c go in libm-test-support.h (it's possible some of those are in fact only needed in one of the two files). libm-test-driver.c keeps definitions of a limited number of variables used to configure how libm-test-support.c behaves, various macros and structures needed by individual-function tests, and the main function. This move is also consistent in spirit with the move away from test-skeleton.c having all the test support code, to a small support/test-driver.c included in individual tests with most of the code built separately. Tested for x86_64 and x86. * math/libm-test-support.c: New file. Content from math/libm-test-driver.c. * math/libm-test-support.h: Likewise. * math/libm-test-support-double.c: New file. * math/libm-test-support-float.c: Likewise. * math/libm-test-support-ldouble.c: Likewise. * math/libm-test-driver.c: Remove main comment and header includes. Include libm-test-support.h. [!_GNU_SOURCE] (_GNU_SOURCE): Do not define. (flag_test_errno): Remove static. (flag_test_exceptions): Likewise. (flag_test_finite): Likewise. (flag_test_inline): Likewise. (flag_test_mathvec): Likewise. (test_msg): Likewise. (NO_EXCEPTION): Remove. (INVALID_EXCEPTION): Likewise. (DIVIDE_BY_ZERO_EXCEPTION): Likewise. (OVERFLOW_EXCEPTION): Likewise. (UNDERFLOW_EXCEPTION): Likewise. (INEXACT_EXCEPTION): Likewise. (INVALID_EXCEPTION_OK): Likewise. (DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise. (OVERFLOW_EXCEPTION_OK): Likewise. (UNDERFLOW_EXCEPTION_OK): Likewise. (NO_INEXACT_EXCEPTION): Likewise. (EXCEPTIONS_OK): Likewise. (IGNORE_ZERO_INF_SIGN): Likewise. (TEST_NAN_SIGN): Likewise. (TEST_NAN_PAYLOAD): Likewise. (NO_TEST_INLINE): Likewise. (XFAIL_TEST): Likewise. (ERRNO_UNCHANGED): Likewise. (ERRNO_EDOM): Likewise. (ERRNO_ERANGE): Likewise. (IGNORE_RESULT): Likewise. (NON_FINITE): Likewise. (TEST_SNAN): Likewise. (NO_TEST_MATHVEC): Likewise. (__CONCATX): Likewise. (TYPE_MIN): Likewise. (TYPE_TRUE_MIN): Likewise. (TYPE_MAX): Likewise. (MIN_EXP): Likewise. (MAX_EXP): Likewise. (MANT_DIG): Likewise. (FSTR_MAX): Likewise. (ulp_idx): Likewise. (qtype_str): Remove static. (TEST_COND_binary32): Remove. (TEST_COND_binary64): Likewise. (TEST_COND_binary128): Likewise. (TEST_COND_ibm128): Likewise. (TEST_COND_intel96): Likewise. (TEST_COND_m68k96): Likewise. (TEST_COND_ibm128_libgcc): Likewise. (XFAIL_IBM128_LIBGCC): Likewise. (PAYLOAD_DIG): Likewise. (UNDERFLOW_EXCEPTION_FLOAT): Likewise. (UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise. (UNDERFLOW_EXCEPTION_DOUBLE): Likewise. (UNDERFLOW_EXCEPTION_OK_DOUBLE): Likewise. (UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise. (UNDERFLOW_EXCEPTION_BEFORE_ROUNDING): Likewise. (TEST_COND_long32): Likewise. (TEST_COND_long64): Likewise. (TEST_COND_before_rounding): Likewise. (TEST_COND_after_rounding): Likewise. (ulps_file_name): Likewise. (ulps_file): Likewise. (output_ulps): Likewise. (output_dir): Likewise. (noErrors): Likewise. (noTests): Likewise. (noExcTests): Likewise. (noErrnoTests): Likewise. (verbose): Likewise. (output_max_error): Likewise. (output_points): Likewise. (ignore_max_ulp): Likewise. (max_error): Likewise. (real_max_error): Likewise. (imag_max_error): Likewise. (prev_max_error): Likewise. (prev_real_max_error): Likewise. (prev_imag_max_error): Likewise. (max_valid_error): Likewise. (TYPE_DECIMAL_DIG): Likewise. (TYPE_HEX_DIG): Likewise. (fmt_ftostr): Likewise. (compare_ulp_data): Likewise. (find_ulps): Likewise. (init_max_error): Likewise. (set_max_error): Likewise. (print_float): Likewise. (print_screen): Likewise. (print_screen_max_error): Likewise. (update_stats): Likewise. (print_function_ulps): Likewise. (print_complex_function_ulps): Likewise. (fpstack_test): Likewise. (print_max_error): Likewise. (print_complex_max_error): Likewise. (test_single_exception): Likewise. (test_exceptions): Likewise. (test_single_errno): Likewise. (test_errno): Likewise. (ULPDIFF): Likewise. (ulp): Likewise. (check_float_internal): Likewise. (check_float): Likewise. (check_complex): Likewise. (check_int): Likewise. (check_long): Likewise. (check_bool): Likewise. (check_longlong): Likewise. (check_intmax_t): Likewise. (check_uintmax_t): Likewise. (enable_test): Likewise. (matherr): Likewise. (initialize): Likewise. (options): Likewise. (doc): Remove static. (argp): Likewise. (parse_opt): Remove. (check_ulp): Likewise. (libm_test_init): Likewise. (libm_test_finish): Likewise. * math/Makefile (libm-test-support): New variable. (test-extras): Add libm-test-support files. (extra-test-objs): Likewise. (CFLAGS-libm-test-support-float.c): New variable. (CFLAGS-libm-test-support-double.c): Likewise. (CFLAGS-libm-test-support-ldouble.c): Likewise. ($(addprefix $(objpfx),$(libm-tests)): Depend on appropriate libm-test-support objects.
-rw-r--r--ChangeLog139
-rw-r--r--math/Makefile18
-rw-r--r--math/libm-test-driver.c1328
-rw-r--r--math/libm-test-support-double.c20
-rw-r--r--math/libm-test-support-float.c20
-rw-r--r--math/libm-test-support-ldouble.c20
-rw-r--r--math/libm-test-support.c1209
-rw-r--r--math/libm-test-support.h185
8 files changed, 1622 insertions, 1317 deletions
diff --git a/ChangeLog b/ChangeLog
index ce4d411f50..f6ad6de519 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,142 @@
+2017-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * math/libm-test-support.c: New file. Content from
+ math/libm-test-driver.c.
+ * math/libm-test-support.h: Likewise.
+ * math/libm-test-support-double.c: New file.
+ * math/libm-test-support-float.c: Likewise.
+ * math/libm-test-support-ldouble.c: Likewise.
+ * math/libm-test-driver.c: Remove main comment and header
+ includes. Include libm-test-support.h.
+ [!_GNU_SOURCE] (_GNU_SOURCE): Do not define.
+ (flag_test_errno): Remove static.
+ (flag_test_exceptions): Likewise.
+ (flag_test_finite): Likewise.
+ (flag_test_inline): Likewise.
+ (flag_test_mathvec): Likewise.
+ (test_msg): Likewise.
+ (NO_EXCEPTION): Remove.
+ (INVALID_EXCEPTION): Likewise.
+ (DIVIDE_BY_ZERO_EXCEPTION): Likewise.
+ (OVERFLOW_EXCEPTION): Likewise.
+ (UNDERFLOW_EXCEPTION): Likewise.
+ (INEXACT_EXCEPTION): Likewise.
+ (INVALID_EXCEPTION_OK): Likewise.
+ (DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
+ (OVERFLOW_EXCEPTION_OK): Likewise.
+ (UNDERFLOW_EXCEPTION_OK): Likewise.
+ (NO_INEXACT_EXCEPTION): Likewise.
+ (EXCEPTIONS_OK): Likewise.
+ (IGNORE_ZERO_INF_SIGN): Likewise.
+ (TEST_NAN_SIGN): Likewise.
+ (TEST_NAN_PAYLOAD): Likewise.
+ (NO_TEST_INLINE): Likewise.
+ (XFAIL_TEST): Likewise.
+ (ERRNO_UNCHANGED): Likewise.
+ (ERRNO_EDOM): Likewise.
+ (ERRNO_ERANGE): Likewise.
+ (IGNORE_RESULT): Likewise.
+ (NON_FINITE): Likewise.
+ (TEST_SNAN): Likewise.
+ (NO_TEST_MATHVEC): Likewise.
+ (__CONCATX): Likewise.
+ (TYPE_MIN): Likewise.
+ (TYPE_TRUE_MIN): Likewise.
+ (TYPE_MAX): Likewise.
+ (MIN_EXP): Likewise.
+ (MAX_EXP): Likewise.
+ (MANT_DIG): Likewise.
+ (FSTR_MAX): Likewise.
+ (ulp_idx): Likewise.
+ (qtype_str): Remove static.
+ (TEST_COND_binary32): Remove.
+ (TEST_COND_binary64): Likewise.
+ (TEST_COND_binary128): Likewise.
+ (TEST_COND_ibm128): Likewise.
+ (TEST_COND_intel96): Likewise.
+ (TEST_COND_m68k96): Likewise.
+ (TEST_COND_ibm128_libgcc): Likewise.
+ (XFAIL_IBM128_LIBGCC): Likewise.
+ (PAYLOAD_DIG): Likewise.
+ (UNDERFLOW_EXCEPTION_FLOAT): Likewise.
+ (UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise.
+ (UNDERFLOW_EXCEPTION_DOUBLE): Likewise.
+ (UNDERFLOW_EXCEPTION_OK_DOUBLE): Likewise.
+ (UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise.
+ (UNDERFLOW_EXCEPTION_BEFORE_ROUNDING): Likewise.
+ (TEST_COND_long32): Likewise.
+ (TEST_COND_long64): Likewise.
+ (TEST_COND_before_rounding): Likewise.
+ (TEST_COND_after_rounding): Likewise.
+ (ulps_file_name): Likewise.
+ (ulps_file): Likewise.
+ (output_ulps): Likewise.
+ (output_dir): Likewise.
+ (noErrors): Likewise.
+ (noTests): Likewise.
+ (noExcTests): Likewise.
+ (noErrnoTests): Likewise.
+ (verbose): Likewise.
+ (output_max_error): Likewise.
+ (output_points): Likewise.
+ (ignore_max_ulp): Likewise.
+ (max_error): Likewise.
+ (real_max_error): Likewise.
+ (imag_max_error): Likewise.
+ (prev_max_error): Likewise.
+ (prev_real_max_error): Likewise.
+ (prev_imag_max_error): Likewise.
+ (max_valid_error): Likewise.
+ (TYPE_DECIMAL_DIG): Likewise.
+ (TYPE_HEX_DIG): Likewise.
+ (fmt_ftostr): Likewise.
+ (compare_ulp_data): Likewise.
+ (find_ulps): Likewise.
+ (init_max_error): Likewise.
+ (set_max_error): Likewise.
+ (print_float): Likewise.
+ (print_screen): Likewise.
+ (print_screen_max_error): Likewise.
+ (update_stats): Likewise.
+ (print_function_ulps): Likewise.
+ (print_complex_function_ulps): Likewise.
+ (fpstack_test): Likewise.
+ (print_max_error): Likewise.
+ (print_complex_max_error): Likewise.
+ (test_single_exception): Likewise.
+ (test_exceptions): Likewise.
+ (test_single_errno): Likewise.
+ (test_errno): Likewise.
+ (ULPDIFF): Likewise.
+ (ulp): Likewise.
+ (check_float_internal): Likewise.
+ (check_float): Likewise.
+ (check_complex): Likewise.
+ (check_int): Likewise.
+ (check_long): Likewise.
+ (check_bool): Likewise.
+ (check_longlong): Likewise.
+ (check_intmax_t): Likewise.
+ (check_uintmax_t): Likewise.
+ (enable_test): Likewise.
+ (matherr): Likewise.
+ (initialize): Likewise.
+ (options): Likewise.
+ (doc): Remove static.
+ (argp): Likewise.
+ (parse_opt): Remove.
+ (check_ulp): Likewise.
+ (libm_test_init): Likewise.
+ (libm_test_finish): Likewise.
+ * math/Makefile (libm-test-support): New variable.
+ (test-extras): Add libm-test-support files.
+ (extra-test-objs): Likewise.
+ (CFLAGS-libm-test-support-float.c): New variable.
+ (CFLAGS-libm-test-support-double.c): Likewise.
+ (CFLAGS-libm-test-support-ldouble.c): Likewise.
+ ($(addprefix $(objpfx),$(libm-tests)): Depend on appropriate
+ libm-test-support objects.
+
2017-02-08 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
* math/Makefile (libm-calls): Move w_exp...
diff --git a/math/Makefile b/math/Makefile
index 0f59123ce9..e5e4412886 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -203,6 +203,9 @@ libm-tests = $(foreach t,$(types),test-$(t) test-$(t)-finite test-i$(t)) \
libm-tests.o = $(addsuffix .o,$(libm-tests))
tests += $(libm-tests)
+libm-test-support = $(foreach t,$(types),libm-test-support-$(t))
+test-extras += $(libm-test-support)
+extra-test-objs += $(addsuffix .o, $(libm-test-support))
libm-vec-test-wrappers = $(addsuffix -wrappers, $(libm-vec-tests))
test-extras += $(libm-vec-test-wrappers)
extra-test-objs += $(addsuffix .o, $(libm-vec-test-wrappers))
@@ -290,10 +293,13 @@ libm-test-finite-cflags = $(libm-test-no-inline-cflags) \
-U__FINITE_MATH_ONLY__ -D__FINITE_MATH_ONLY__=1
CFLAGS-test-float.c = $(libm-test-no-inline-cflags)
CFLAGS-test-float-finite.c = $(libm-test-finite-cflags)
+CFLAGS-libm-test-support-float.c = $(libm-test-no-inline-cflags)
CFLAGS-test-double.c = $(libm-test-no-inline-cflags)
CFLAGS-test-double-finite.c = $(libm-test-finite-cflags)
+CFLAGS-libm-test-support-double.c = $(libm-test-no-inline-cflags)
CFLAGS-test-ldouble.c = $(libm-test-no-inline-cflags)
CFLAGS-test-ldouble-finite.c = $(libm-test-finite-cflags)
+CFLAGS-libm-test-support-ldouble.c = $(libm-test-no-inline-cflags)
CFLAGS-test-tgmath.c = -fno-builtin
# The following testcase uses very long lines (>3 million), so it may take a
# while to compile it. See: http://llvm.org/bugs/show_bug.cgi?id=14106 and
@@ -374,6 +380,18 @@ ifneq (no,$(PERL))
$(addprefix $(objpfx), $(libm-tests.o)): $(addprefix $(objpfx),\
$(libm-tests-generated))
+$(addprefix $(objpfx),\
+ $(filter test-float% test-ifloat%,\
+ $(libm-tests))): $(objpfx)libm-test-support-float.o
+
+$(addprefix $(objpfx),\
+ $(filter test-double% test-idouble%,\
+ $(libm-tests))): $(objpfx)libm-test-support-double.o
+
+$(addprefix $(objpfx),\
+ $(filter test-ldouble% test-ildouble%,\
+ $(libm-tests))): $(objpfx)libm-test-support-ldouble.o
+
# Run the math programs to automatically generate ULPs files.
.PHONY: regen-ulps
diff --git a/math/libm-test-driver.c b/math/libm-test-driver.c
index 7773de19bc..1539cd7e4d 100644
--- a/math/libm-test-driver.c
+++ b/math/libm-test-driver.c
@@ -1,4 +1,4 @@
-/* Support code for testing libm functions.
+/* Support code for testing libm functions (driver).
Copyright (C) 1997-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -16,103 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* Part of testsuite for libm.
-
- libm-test.inc is processed by a perl script. The resulting file has to
- be included by a master file that defines:
-
- Macros:
- FUNC(function): converts general function name (like cos) to
- name with correct suffix (e.g. cosl or cosf)
- FLOAT: floating point type to test
- chooses one of the parameters as delta for testing
- equality
- PREFIX A macro which defines the prefix for common macros for the
- type (i.e LDBL, DBL, or FLT).
- LIT A function which appends the correct suffix to a literal.
- TYPE_STR A macro which defines a stringitized name of the type.
- FTOSTR This macro defines a function similar in type to strfromf
- which converts a FLOAT to a string. */
-
-/* Parameter handling is primitive in the moment:
- --verbose=[0..3] for different levels of output:
- 0: only error count
- 1: basic report on failed tests (default)
- 2: full report on all tests
- -v for full output (equals --verbose=3)
- -u for generation of an ULPs file
- */
-
-/* "Philosophy":
-
- This suite tests some aspects of the correct implementation of
- mathematical functions in libm. Some simple, specific parameters
- are tested for correctness but there's no exhaustive
- testing. Handling of specific inputs (e.g. infinity, not-a-number)
- is also tested. Correct handling of exceptions is checked
- against. These implemented tests should check all cases that are
- specified in ISO C99.
-
- NaN values: The payload of NaNs is set in inputs for functions
- where it is significant, and is examined in the outputs of some
- functions.
-
- Inline functions: Inlining functions should give an improvement in
- speed - but not in precission. The inlined functions return
- reasonable values for a reasonable range of input values. The
- result is not necessarily correct for all values and exceptions are
- not correctly raised in all cases. Problematic input and return
- values are infinity, not-a-number and minus zero. This suite
- therefore does not check these specific inputs and the exception
- handling for inlined mathematical functions - just the "reasonable"
- values are checked.
-
- Beware: The tests might fail for any of the following reasons:
- - Tests are wrong
- - Functions are wrong
- - Floating Point Unit not working properly
- - Compiler has errors
-
- With e.g. gcc 2.7.2.2 the test for cexp fails because of a compiler error.
-
-
- To Do: All parameter should be numbers that can be represented as
- exact floating point values. Currently some values cannot be
- represented exactly and therefore the result is not the expected
- result. For this we will use 36 digits so that numbers can be
- represented exactly. */
-
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#include <complex.h>
-#include <math.h>
-#include <float.h>
-#include <fenv.h>
-#include <limits.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <argp.h>
-#include <tininess.h>
-#include <math-tests.h>
-#include <math-tests-arch.h>
-#include <nan-high-order-bit.h>
-
-/* This header defines func_ulps, func_real_ulps and func_imag_ulps
- arrays. */
-#include "libm-test-ulps.h"
+#include "libm-test-support.h"
/* Flags set by the including file. */
-static const int flag_test_errno = TEST_ERRNO;
-static const int flag_test_exceptions = TEST_EXCEPTIONS;
-static const int flag_test_finite = TEST_FINITE;
-static const int flag_test_inline = TEST_INLINE;
-static const int flag_test_mathvec = TEST_MATHVEC;
+const int flag_test_errno = TEST_ERRNO;
+const int flag_test_exceptions = TEST_EXCEPTIONS;
+const int flag_test_finite = TEST_FINITE;
+const int flag_test_inline = TEST_INLINE;
+const int flag_test_mathvec = TEST_MATHVEC;
#define STRX(x) #x
#define STR(x) STRX (x)
@@ -129,7 +40,7 @@ static const int flag_test_mathvec = TEST_MATHVEC;
#else
# define TEST_MSG "testing " STR_FLOAT " (without inline functions)\n"
#endif
-static const char test_msg[] = TEST_MSG;
+const char test_msg[] = TEST_MSG;
/* Allow platforms without all rounding modes to test properly,
assuming they provide an __FE_UNDEFINED in <bits/fenv.h> which
@@ -147,146 +58,16 @@ static const char test_msg[] = TEST_MSG;
# define FE_DOWNWARD __FE_UNDEFINED
#endif
-/* Possible exceptions */
-#define NO_EXCEPTION 0x0
-#define INVALID_EXCEPTION 0x1
-#define DIVIDE_BY_ZERO_EXCEPTION 0x2
-#define OVERFLOW_EXCEPTION 0x4
-#define UNDERFLOW_EXCEPTION 0x8
-#define INEXACT_EXCEPTION 0x10
-/* The next flags signals that those exceptions are allowed but not required. */
-#define INVALID_EXCEPTION_OK 0x20
-#define DIVIDE_BY_ZERO_EXCEPTION_OK 0x40
-#define OVERFLOW_EXCEPTION_OK 0x80
-#define UNDERFLOW_EXCEPTION_OK 0x100
-/* For "inexact" exceptions, the default is allowed but not required
- unless INEXACT_EXCEPTION or NO_INEXACT_EXCEPTION is specified. */
-#define NO_INEXACT_EXCEPTION 0x200
-#define EXCEPTIONS_OK INVALID_EXCEPTION_OK+DIVIDE_BY_ZERO_EXCEPTION_OK
-/* Some special test flags, passed together with exceptions. */
-#define IGNORE_ZERO_INF_SIGN 0x400
-#define TEST_NAN_SIGN 0x800
-#define TEST_NAN_PAYLOAD 0x1000
-#define NO_TEST_INLINE 0x2000
-#define XFAIL_TEST 0x4000
-/* Indicate errno settings required or disallowed. */
-#define ERRNO_UNCHANGED 0x8000
-#define ERRNO_EDOM 0x10000
-#define ERRNO_ERANGE 0x20000
-/* Flags generated by gen-libm-test.pl, not entered here manually. */
-#define IGNORE_RESULT 0x40000
-#define NON_FINITE 0x80000
-#define TEST_SNAN 0x100000
-#define NO_TEST_MATHVEC 0x200000
-
#define TEST_NAN_PAYLOAD_CANONICALIZE (SNAN_TESTS_PRESERVE_PAYLOAD \
? TEST_NAN_PAYLOAD \
: 0)
-#define __CONCATX(a,b) __CONCAT(a,b)
-
-#define TYPE_MIN __CONCATX (PREFIX, _MIN)
-#define TYPE_TRUE_MIN __CONCATX (PREFIX, _TRUE_MIN)
-#define TYPE_MAX __CONCATX (PREFIX, _MAX)
-#define MIN_EXP __CONCATX (PREFIX, _MIN_EXP)
-#define MAX_EXP __CONCATX (PREFIX, _MAX_EXP)
-#define MANT_DIG __CONCATX (PREFIX, _MANT_DIG)
-
-/* Maximum character buffer to store a stringitized FLOAT value. */
-#define FSTR_MAX (128)
-
#if TEST_INLINE
-static const int ulp_idx = __CONCATX (ULP_I_, PREFIX);
-static const char qtype_str[] = "i" TYPE_STR;
-#else
-static const int ulp_idx = __CONCATX (ULP_, PREFIX);
-static const char qtype_str[] = TYPE_STR;
-#endif
-
-/* Format specific test macros. */
-#define TEST_COND_binary32 (MANT_DIG == 24 \
- && MIN_EXP == -125 \
- && MAX_EXP == 128)
-
-#define TEST_COND_binary64 (MANT_DIG == 53 \
- && MIN_EXP == -1021 \
- && MAX_EXP == 1024)
-
-#define TEST_COND_binary128 (MANT_DIG == 113 \
- && MIN_EXP == -16381 \
- && MAX_EXP == 16384)
-
-#define TEST_COND_ibm128 (MANT_DIG == 106)
-
-#define TEST_COND_intel96 (MANT_DIG == 64 \
- && MIN_EXP == -16381 \
- && MAX_EXP == 16384)
-
-#define TEST_COND_m68k96 (MANT_DIG == 64 \
- && MIN_EXP == -16382 \
- && MAX_EXP == 16384)
-
-/* The condition ibm128-libgcc is used instead of ibm128 to mark tests
- where in principle the glibc code is OK but the tests fail because
- of limitations of the libgcc support for that format (e.g. GCC bug
- 59666, in non-default rounding modes). */
-#define TEST_COND_ibm128_libgcc TEST_COND_ibm128
-
-/* Mark a test as expected to fail for ibm128-libgcc. This is used
- via XFAIL_ROUNDING_IBM128_LIBGCC, which gen-libm-test.pl transforms
- appropriately for each rounding mode. */
-#define XFAIL_IBM128_LIBGCC (TEST_COND_ibm128_libgcc ? XFAIL_TEST : 0)
-
-/* Number of bits in NaN payload. */
-#if TEST_COND_ibm128
-# define PAYLOAD_DIG (DBL_MANT_DIG - 2)
-#else
-# define PAYLOAD_DIG (MANT_DIG - 2)
-#endif
-
-/* Values underflowing only for float. */
-#if TEST_COND_binary32
-# define UNDERFLOW_EXCEPTION_FLOAT UNDERFLOW_EXCEPTION
-# define UNDERFLOW_EXCEPTION_OK_FLOAT UNDERFLOW_EXCEPTION_OK
-#else
-# define UNDERFLOW_EXCEPTION_FLOAT 0
-# define UNDERFLOW_EXCEPTION_OK_FLOAT 0
-#endif
-
-/* Values underflowing only for double or types with a larger least
- positive normal value. */
-#if TEST_COND_binary32 || TEST_COND_binary64 || TEST_COND_ibm128
-# define UNDERFLOW_EXCEPTION_DOUBLE UNDERFLOW_EXCEPTION
-# define UNDERFLOW_EXCEPTION_OK_DOUBLE UNDERFLOW_EXCEPTION_OK
-#else
-# define UNDERFLOW_EXCEPTION_DOUBLE 0
-# define UNDERFLOW_EXCEPTION_OK_DOUBLE 0
-#endif
-
-/* Values underflowing only for IBM long double or types with a larger least
- positive normal value. */
-#if TEST_COND_binary32 || TEST_COND_ibm128
-# define UNDERFLOW_EXCEPTION_LDOUBLE_IBM UNDERFLOW_EXCEPTION
+const char qtype_str[] = "i" TYPE_STR;
#else
-# define UNDERFLOW_EXCEPTION_LDOUBLE_IBM 0
+const char qtype_str[] = TYPE_STR;
#endif
-/* Values underflowing on architectures detecting tininess before
- rounding, but not on those detecting tininess after rounding. */
-#define UNDERFLOW_EXCEPTION_BEFORE_ROUNDING (TININESS_AFTER_ROUNDING \
- ? 0 \
- : UNDERFLOW_EXCEPTION)
-
-#if LONG_MAX == 0x7fffffff
-# define TEST_COND_long32 1
-# define TEST_COND_long64 0
-#else
-# define TEST_COND_long32 0
-# define TEST_COND_long64 1
-#endif
-#define TEST_COND_before_rounding (!TININESS_AFTER_ROUNDING)
-#define TEST_COND_after_rounding TININESS_AFTER_ROUNDING
-
/* Various constants derived from pi. We must supply them precalculated for
accuracy. They are written as a series of postfix operations to keep
them concise yet somewhat readable. */
@@ -313,21 +94,6 @@ static const char qtype_str[] = TYPE_STR;
/* e */
#define lit_e LITM (M_E)
-#define ulps_file_name "ULPs" /* Name of the ULPs file. */
-static FILE *ulps_file; /* File to document difference. */
-static int output_ulps; /* Should ulps printed? */
-static char *output_dir; /* Directory where generated files will be written. */
-
-static int noErrors; /* number of errors */
-static int noTests; /* number of tests (without testing exceptions) */
-static int noExcTests; /* number of tests for exception flags */
-static int noErrnoTests;/* number of tests for errno values */
-
-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? */
-
#define plus_zero LIT (0.0)
#define minus_zero LIT (-0.0)
#define plus_infty FUNC (__builtin_inf) ()
@@ -343,