+2018-05-11 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+
+ * bits/floatn-common.h: Define __HAVE_FLOAT128_UNLIKE_LDBL.
+ * math/math.h: Restrict the prototype definition for the functions
+ issignaling(_Float128) and iszero(_Float128); and template
+ __iseqsig_type<_Float128>, from __HAVE_DISTINCT_FLOAT128 to
+ __HAVE_FLOAT128_UNLIKE_LDBL.
+ * sysdeps/powerpc/bits/floatn.h [__HAVE_FLOAT128
+ && (!__GNUC_PREREQ (7, 0) || defined __cplusplus)
+ && __LDBL_MANT_DIG__ == 113]: Use long double suffix for
+ __f128() constants; define the type _Float128 as long double;
+ and reuse long double in __CFLOAT128.
+
2018-05-11 Joseph Myers <joseph@codesourcery.com>
* sysdeps/generic/math_private.h: Do not include
#define __HAVE_DISTINCT_FLOAT64X 0
#define __HAVE_DISTINCT_FLOAT128X __HAVE_FLOAT128X
+/* Defined to 1 if the corresponding _FloatN type is not binary compatible
+ with the corresponding ISO C type in the current compilation unit as
+ opposed to __HAVE_DISTINCT_FLOATN, which indicates the default types built
+ in glibc. */
+#define __HAVE_FLOAT128_UNLIKE_LDBL (__HAVE_DISTINCT_FLOAT128 \
+ && __LDBL_MANT_DIG__ != 113)
+
/* Defined to 1 if any _FloatN or _FloatNx types that are not
ABI-distinct are however distinct types at the C language level (so
for the purposes of __builtin_types_compatible_p and _Generic). */
return __issignalingl (__val);
# endif
}
-# if __HAVE_DISTINCT_FLOAT128
+# if __HAVE_FLOAT128_UNLIKE_LDBL
+/* When using an IEEE 128-bit long double, _Float128 is defined as long double
+ in C++. */
inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
# endif
} /* extern C++ */
return __fpclassifyl (__val) == FP_ZERO;
# endif
}
-# if __HAVE_DISTINCT_FLOAT128
+# if __HAVE_FLOAT128_UNLIKE_LDBL
+ /* When using an IEEE 128-bit long double, _Float128 is defined as long double
+ in C++. */
inline int
iszero (_Float128 __val)
{
}
};
-# if __HAVE_DISTINCT_FLOAT128
+# if __HAVE_FLOAT128_UNLIKE_LDBL
+ /* When using an IEEE 128-bit long double, _Float128 is defined as long double
+ in C++. */
template<> struct __iseqsig_type<_Float128>
{
static int __call (_Float128 __x, _Float128 __y) throw ()
#endif
/* Defined to 1 if __HAVE_FLOAT128 is 1 and the type is ABI-distinct
- from the default float, double and long double types in this glibc. */
+ from the default float, double and long double types in this glibc, i.e.
+ calls to the binary128 functions go to *f128 symbols instead of *l. */
#if __HAVE_FLOAT128
# define __HAVE_DISTINCT_FLOAT128 1
#else
# if __HAVE_FLOAT128
# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
/* The literal suffix (f128) exist for powerpc only since GCC 7.0. */
-# define __f128(x) x##q
+# if __LDBL_MANT_DIG__ == 113
+# define __f128(x) x##l
+# else
+# define __f128(x) x##q
+# endif
# else
# define __f128(x) x##f128
# endif
/* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1. */
# if __HAVE_FLOAT128
-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
-/* Add a typedef for older GCC compilers which don't natively support
+# if __LDBL_MANT_DIG__ == 113 && defined __cplusplus
+typedef long double _Float128;
+# define __CFLOAT128 _Complex long double
+# elif !__GNUC_PREREQ (7, 0) || defined __cplusplus
+/* The type _Float128 exist for powerpc only since GCC 7.0. */
+typedef __float128 _Float128;
+/* Add a typedef for older GCC and C++ compilers which don't natively support
_Complex _Float128. */
typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
# define __CFLOAT128 __cfloat128
/* The remaining of this file provides support for older compilers. */
# if __HAVE_FLOAT128
-
-/* The type _Float128 exist for powerpc only since GCC 7.0. */
-# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
-typedef __float128 _Float128;
-# endif
-
/* Builtin __builtin_huge_valf128 doesn't exist before GCC 7.0. */
# if !__GNUC_PREREQ (7, 0)
# define __builtin_huge_valf128() ((_Float128) __builtin_huge_val ())