diff mbox series

[v2,02/10] ldbl-128ibm: simplify iscanonical.h

Message ID 20200327211801.31234-3-murphyp@linux.vnet.ibm.com
State Committed
Delegated to: Tulio Magno Quites Machado Filho
Headers show
Series IEEE binary128 long double on powerpc64le | expand

Commit Message

Paul E. Murphy March 27, 2020, 9:17 p.m. UTC
The test for enabling _Float128 or IEEE 128 long double can be
greatly simplified knowing that there is no ibm128, thus we require
no special cases, and everything is canonical.

This reverts the changes to ldbl-128ibm iscanonical.h from commit
8dbfea3a2094798a52cebddde01d255483f49665 and extends the check
for __NO_LONG_DOUBLE_MATH to include a check for float128 redirects
to long double.
---
 sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Tulio Magno Quites Machado Filho April 3, 2020, 8:12 p.m. UTC | #1
"Paul E. Murphy via Libc-alpha" <libc-alpha@sourceware.org> writes:

> The test for enabling _Float128 or IEEE 128 long double can be
> greatly simplified knowing that there is no ibm128, thus we require
> no special cases, and everything is canonical.
>
> This reverts the changes to ldbl-128ibm iscanonical.h from commit
> 8dbfea3a2094798a52cebddde01d255483f49665 and extends the check
> for __NO_LONG_DOUBLE_MATH to include a check for float128 redirects
> to long double.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Paul E Murphy April 6, 2020, 4:46 p.m. UTC | #2
Pushed.  Thanks!

On 4/3/20 3:12 PM, Tulio Magno Quites Machado Filho wrote:
> "Paul E. Murphy via Libc-alpha" <libc-alpha@sourceware.org> writes:
> 
>> The test for enabling _Float128 or IEEE 128 long double can be
>> greatly simplified knowing that there is no ibm128, thus we require
>> no special cases, and everything is canonical.
>>
>> This reverts the changes to ldbl-128ibm iscanonical.h from commit
>> 8dbfea3a2094798a52cebddde01d255483f49665 and extends the check
>> for __NO_LONG_DOUBLE_MATH to include a check for float128 redirects
>> to long double.
> 
> Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
>
diff mbox series

Patch

diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
index 70da85f2cb..b2021b5d64 100644
--- a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
+++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
@@ -20,15 +20,11 @@ 
 # error "Never use <bits/iscanonical.h> directly; include <math.h> instead."
 #endif
 
-#ifdef __NO_LONG_DOUBLE_MATH
+#if defined (__NO_LONG_DOUBLE_MATH) || __LONG_DOUBLE_USES_FLOAT128 == 1
 # define iscanonical(x) ((void) (__typeof (x)) (x), 1)
 #else
-# if __LONG_DOUBLE_USES_FLOAT128 == 1
-# define __iscanonicall(x) ((void) (__typeof (x)) (x), 1)
-# else
 extern int __iscanonicall (long double __x)
      __THROW __attribute__ ((__const__));
-# endif
 # define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1)
 # define __iscanonical(x) ((void) (__typeof (x)) (x), 1)
 # if __HAVE_DISTINCT_FLOAT128
@@ -54,9 +50,7 @@  extern "C++" {
 inline int iscanonical (float __val) { return __iscanonicalf (__val); }
 inline int iscanonical (double __val) { return __iscanonical (__val); }
 inline int iscanonical (long double __val) { return __iscanonicall (__val); }
-/* When using an IEEE 128-bit long double, _Float128 is defined as long double
-   in C++.  */
-#  if __HAVE_DISTINCT_FLOAT128 && __HAVE_FLOAT128_UNLIKE_LDBL
+#  if __HAVE_DISTINCT_FLOAT128
 inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
 #  endif
 }