This adds test support for float128, and lays some groundwork for future
_FloatN types.
* math/gen-libm-test.pl (@all_floats): Add ifloat128 and float128.
(%all_floats_pfx): Add macro prefix for float128 (FLT128).
* math/libm-test-exp10.inc (pow10_test): Do not test for _FloatN,
* math/libm-test-isfinite.inc (finite_test): Likewise.
* math/libm-test-lgamma.inc (gamma_test): Likewise.
* math/libm-test-nexttoward.inc (nexttoward_test): Likewise.
(nexttoward_test_data}: Likewise.
* math/libm-test-remainder.inc (drem_test): Likewise.
* math/libm-test-scalb.inc (scalb_test): Likewise.
(scalb_test_data): Likewise.
* math/libm-test-significand.inc (significand_test): Likewise.
(significand_test_data): Likewise.
* math/libm-test-support.c (check_complex): Replace __complex__
FLOAT with CFLOAT to get the support for old compiler.
* math/libm-test-support.h (check_complex): Likewise.
* math/test-double.h (CFLOAT, TEST_FLOATN): New macros.
* math/test-float.h (CFLOAT, TEST_FLOATN): Likewise.
* math/test-ldouble.h (CFLOAT, TEST_FLOATN): Likewise.
* math/test-float128.h: New file.
* math/test-math-floatn.h: New file.
In order to support float128 tests, the calls to snprintf, which does
not support the type __float128, are replaced with calls to
strfrom{f,d,l}.
Tested for powerpc64le, s390, and x64_64.
TS 18661-1 defines SNAN macros for signaling NaN values, suitable for
use in static initializers. This patch adds them to glibc's <math.h>
(provided you are building with GCC 3.3 or later; no attempt is made
to provide any kind of nonconforming fallback for older compilers
without the __builtin_nans functions).
Tested for x86_64 and x86.
* math/math.h
[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANF):
New macro.
[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNAN):
Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANL):
Likewise.
* manual/arith.texi (Infinity and NaN): Document SNANF, SNAN and
SNANL.
* math/test-double.h (snan_value_MACRO): New macro.
* math/test-float.h (snan_value_MACRO): Likewise.
* math/test-ldouble.h (snan_value_MACRO): Likewise.
* math/libm-test.inc (issignaling_test_data): Add tests of
snan_value_MACRO.
Use gen-libm-test.pl to generate a list of macros
mapping to libm-test-ulps.h as this simplifies adding new
types without having to modify a growing number of
static headers each time a type is added.
This also removes the final usage of the TEST_(DOUBLE|FLOAT|LDOUBLE)
macros. Thus, they too are removed.
This is useful in situations where the long double type is
less precise than the type under test. This adds a new
wrapper macro LITM(x) to each type to append the proper
suffix onto macro constants found in math.h.
Attempt to creatively redefine the macros
to choose tests based on the format being
tested, not the type.
Note, TS 18661 does not define any printf
modifiers, so we need to be a little more
verbose about constructing strings to
output.
libm-test.inc has a macro BUILD_COMPLEX to construct a complex number
with given real and imaginary parts while allowing properly for signed
zeroes, infinities and NaNs (which don't work properly with a simple
real + I * imag, in the absence of compiler support for imaginary
types), using assignment to __real__ and __imag__ parts of the number.
C11 defines CMPLX* macros for this purpose, which GCC 4.7 and above
provide suitable built-in functions for. This patch redefines
BUILD_COMPLEX in terms of the standard macros.
Tested for x86_64 and x86.
* math/libm-test.inc (BUILD_COMPLEX): Remove macro.
* math/test-double.h (BUILD_COMPLEX): New macro.
* math/test-float.h (BUILD_COMPLEX): Likewise.
* math/test-ldouble.h (BUILD_COMPLEX): Likewise.