From 5db7d705db472f47a349fe342a8d7150ec922786 Mon Sep 17 00:00:00 2001 From: Tulio Magno Quites Machado Filho Date: Fri, 11 May 2018 18:05:03 -0300 Subject: powerpc: Fix the compiler type used with C++ when -mabi=ieeelongdouble When compiling C++ code with -mabi=ieeelongdouble, KCtype is unavailable and the long double type should be used instead. This is also providing macro __HAVE_FLOAT128_UNLIKE_LDBL in order to identify the kind of long double type is being used in the current compilation unit. Notice that bits/floatn.h cannot benefit from the new macro due to order of header inclusion. * 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. Signed-off-by: Tulio Magno Quites Machado Filho --- bits/floatn-common.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bits') diff --git a/bits/floatn-common.h b/bits/floatn-common.h index 070cdd0..1d8958a 100644 --- a/bits/floatn-common.h +++ b/bits/floatn-common.h @@ -56,6 +56,13 @@ #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). */ -- cgit v1.1