aboutsummaryrefslogtreecommitdiff
path: root/include/float.h
AgeCommit message (Collapse)Author
2017-11-07Handle more _FloatN, _FloatNx types in include/float.h.Joseph Myers
Continuing the preparation for additional _FloatN / _FloatNx type support, this patch adds support in include/float.h. This header defines macros for _Float128 properties when using compilers before GCC 7 that lack those macros in <float.h>. For testing _Float32 / _Float64 / _Float32x / _Float64x functions with older compilers, such macros need to be defined for those types as well; for the older compilers, those types will always be typedefs for another type, so the definitions can be in terms of the macros for that other type. Tested for x86_64. * include/float.h [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MANT_DIG): New macro. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32] (FLT32_TRUE_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MANT_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64] (FLT64_TRUE_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MANT_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT32X] (FLT32X_TRUE_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MANT_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_DECIMAL_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_DIG): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MIN_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MIN_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MAX_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MAX_10_EXP): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MAX): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __GLIBC_USE (IEC_60559_TYPES_EXT) && __HAVE_FLOAT64X] (FLT64X_TRUE_MIN): Likewise.
2017-10-17Use __f128 to define FLT128_* constants in include/float.h for old GCC.Joseph Myers
When using compilers before GCC 7, include/float.h provides fallback definitions of FLT128_* constants. These definitions use 'Q' constant suffixes, which works for configurations with _Float128 ABI-distinct from long double, but not where it has the same ABI as long double. This patch changes the definitions to use the __f128 macro from <bits/floatn.h>, so allowing them to work in the non-distinct _Float128 case (where they are used in building glibc tests, not for building glibc itself) as well. Tested (a) with build-many-glibcs.py with GCC 6 (installed stripped shared libraries unchanged by the patch); (b) with build-many-glibcs.py with GCC 6 together with the main patch to enable float128 aliases; (c) for x86_64 with both GCC 6 and GCC 7. * include/float.h [!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (FLT128_MAX): Define using __f128. [!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (FLT128_EPSILON): Likewise. [!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (FLT128_MIN): Likewise. [!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (FLT128_TRUE_MIN): Likewise.
2017-06-23Include libc-header-start.h in include/float.hGabriel F. T. Gomes
The file include/float.h uses the macro __GLIBC_USE to test for TS 18661-3 support. Such macro is provided by bits/libc-header-start.h, so include it to get the definition. Tested for powerpc64le and s390x. * include/float.h: Include libc-header-start.h to get the definition of __GLIBC_USE.
2017-06-12Allow macros prefixed with FLT128 in include/float.hGabriel F. T. Gomes
TS 18661-3 specifies that macros prefixed with FLTN_ can be defined in float.h, only if __STDC_WANT_IEC_60559_TYPES_EXT__ is defined as a macro before the inclusion of float.h. Since GCC 7.0, these macros are provided under this condition, however, for older versions of GCC, these macros are not provided at all. This patch allows the definitions of such macros in include/float.h for older compilers, if the condition above is met, and even if _ISOMAC is defined. * include/float.h: Allow the definition of macros prefixed with FLT128 even if _ISOMAC is defined, but provided that __STDC_WANT_IEC_60559_TYPES_EXT__ is defined as a macro.
2017-05-15float128: Add private _Float128 declarations for libm.Paul E. Murphy
Add the necessary bits to the private headers to support building the _Float128 libm functions. A local override for float.h is provided to include the missing *FLT128 macros implied by TS 18661-3 for this type when compiling prior to GCC 7. * include/complex.h (__kernel_casinhf128): New declaration. * include/float.h: New file. * include/math.h (__finitef128): Add a hidden def. (__isinff128): Likewise. (__isnanf128): Likewise. (__fpclassify): Likewise. (__issignalling): Likewise. (__expf128): Likewise. (__expm1f128): Likewise. * sysdeps/generic/fix-fp-int-convert-overflow.h: (FIX_FLT128_LONG_CONVERT_OVERFLOW): New macro. (FIX_FLT128_LLONG_CONVERT_OVERFLOW): Likewise. * sysdeps/generic/math-type-macros-float128.h: New file. * sysdeps/generic/math_private.h: Include bits/floatn.h and math_private_calls.h for _Float128. (__isinff128): New inline implementation used when GCC < 7.0, since in this case __builtin_isinf_sign is broken. (fabsf128): New inline implementation that calls the builtin. (__EXPR_FLT128): New macro. (min_of_type): Optionally include _Float128 types too. * sysdeps/generic/math_private_calls.h (__kernel_sincos): Declare for _Float128. (__kernel_rem_pio2): Likewise. * sysdeps/ieee754/ldbl-opt/s_sin.c: (__DECL_SIMD_sincos_disablef128): New macro.