about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2018-05-11 18:05:03 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2018-05-11 18:05:03 -0300
commit5db7d705db472f47a349fe342a8d7150ec922786 (patch)
treebd3d1a77f9d27ccacca0dcdb13313fd8a191b2ce /math
parentb4d5b8b02133e0c317e6c836b51bbee3b00877b8 (diff)
downloadglibc-5db7d705db472f47a349fe342a8d7150ec922786.tar.gz
glibc-5db7d705db472f47a349fe342a8d7150ec922786.tar.xz
glibc-5db7d705db472f47a349fe342a8d7150ec922786.zip
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 <tuliom@linux.ibm.com>
Diffstat (limited to 'math')
-rw-r--r--math/math.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/math/math.h b/math/math.h
index 2e2696854b..87240336e0 100644
--- a/math/math.h
+++ b/math/math.h
@@ -989,7 +989,9 @@ issignaling (long double __val)
   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++ */
@@ -1027,7 +1029,9 @@ iszero (long double __val)
   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)
 {
@@ -1517,7 +1521,9 @@ template<> struct __iseqsig_type<long double>
   }
 };
 
-#  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 ()