]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix ldbl-128ibm ceill, floorl inlining of ceil, floor.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 18 Sep 2018 13:24:14 +0000 (13:24 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 18 Sep 2018 13:24:14 +0000 (13:24 +0000)
The ldbl-128ibm implementations of ceill and floorl call the
corresponding double functions.  This patch fixes those
implementations to call those functions as ceil and floor rather than
as __ceil and __floor, so that the proper inlining takes place when
possible, while including local asm redirections for when the
functions are not inlined since NO_MATH_REDIRECT applies to the double
functions as well as to the long double ones.

Tested with build-many-glibcs.py for all its powerpc configurations.

* sysdeps/ieee754/ldbl-128ibm/s_ceill.c (ceil): Redirect to
__ceil.
(__ceill): Call ceil instead of __ceil.
* sysdeps/ieee754/ldbl-128ibm/s_floorl.c (floor): Redirect to
__floor.
(__floorl): Call floor instead of __floor.

ChangeLog
sysdeps/ieee754/ldbl-128ibm/s_ceill.c
sysdeps/ieee754/ldbl-128ibm/s_floorl.c

index b2a3a1f686f9d4d330f4b4f479c72a0e4778846e..5f588784cb319c7c6441253ed25b230a8921cf3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-09-18  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/ieee754/ldbl-128ibm/s_ceill.c (ceil): Redirect to
+       __ceil.
+       (__ceill): Call ceil instead of __ceil.
+       * sysdeps/ieee754/ldbl-128ibm/s_floorl.c (floor): Redirect to
+       __floor.
+       (__floorl): Call floor instead of __floor.
+
 2018-09-17  Joseph Myers  <joseph@codesourcery.com>
 
        * include/math.h [!_ISOMAC && !(__FINITE_MATH_ONLY__ &&
index 800835411a2273ac2ab221b1a071b23a59527e5f..6ca13766bed2c48d365d6a0f940d7c197ebcd73c 100644 (file)
@@ -24,6 +24,8 @@
 #include <float.h>
 #include <ieee754.h>
 
+double ceil (double) asm ("__ceil");
+
 
 long double
 __ceill (long double x)
@@ -37,7 +39,7 @@ __ceill (long double x)
                        && __builtin_isless (__builtin_fabs (xh),
                                             __builtin_inf ()), 1))
     {
-      hi = __ceil (xh);
+      hi = ceil (xh);
       if (hi != xh)
        {
          /* The high part is not an integer; the low part does not
@@ -48,7 +50,7 @@ __ceill (long double x)
       else
        {
          /* The high part is a nonzero integer.  */
-         lo = __ceil (xl);
+         lo = ceil (xl);
          xh = hi;
          xl = lo;
          ldbl_canonicalize_int (&xh, &xl);
index f33b6ad701d3cca5ad315ffc5a35c3ca11dd4b2b..8767bac917620da60c6308d3a1622f0a43450efd 100644 (file)
@@ -24,6 +24,8 @@
 #include <float.h>
 #include <ieee754.h>
 
+double floor (double) asm ("__floor");
+
 
 long double
 __floorl (long double x)
@@ -37,7 +39,7 @@ __floorl (long double x)
                        && __builtin_isless (__builtin_fabs (xh),
                                             __builtin_inf ()), 1))
     {
-      hi = __floor (xh);
+      hi = floor (xh);
       if (hi != xh)
        {
          /* The high part is not an integer; the low part does not
@@ -48,7 +50,7 @@ __floorl (long double x)
       else
        {
          /* The high part is a nonzero integer.  */
-         lo = __floor (xl);
+         lo = floor (xl);
          xh = hi;
          xl = lo;
          ldbl_canonicalize_int (&xh, &xl);