]> sourceware.org Git - glibc.git/commitdiff
Remove conditional on LDBL_MANT_DIG from e_lgammal_r.c
authorGabriel F. T. Gomes <gabriel@inconstante.eti.br>
Sun, 10 Sep 2017 13:31:47 +0000 (10:31 -0300)
committerGabriel F. T. Gomes <gabriel@inconstante.eti.br>
Thu, 21 Sep 2017 20:37:40 +0000 (17:37 -0300)
The IEEE 754 implementation of lgammal in sysdeps/ieee754/ldbl-128/ used
to be shared by IBM's implementation in sysdeps/ieee754/ldbl-128ibm/ (by
an inclusion of the source file).  In order for the algorithm to work
for IBM's implementation, a check for LDBL_MANT_DIG was required. Since
the source file is no longer shared, the requirement for the check is
gone.  This patch removes the conditionals.

Tested for powerpc64le and s390x.

* sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r):
Remove conditionals on LDBL_MANT_DIG.
* sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
(__ieee754_lgammal_r): Likewise.

ChangeLog
sysdeps/ieee754/ldbl-128/e_lgammal_r.c
sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c

index 2698267b412be785441270b611e12db13e482e06..d3c4468389b9cc651bfb56fb6ebb6ad9d863a63f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+       * sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r):
+       Remove conditionals on LDBL_MANT_DIG.
+       * sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+       (__ieee754_lgammal_r): Likewise.
+
 2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
        * sysdeps/ieee754/ldbl-128ibm/e_expl.c: Remove definitions of
index bef2601bce7043ba93bb9542d78608105cf89a7d..a80c9eaf33eba0c1f3ba1fd2809fbca1070a5fba 100644 (file)
 #include <float.h>
 
 static const _Float128 PIL = L(3.1415926535897932384626433832795028841972E0);
-#if LDBL_MANT_DIG == 106
-static const _Float128 MAXLGM = L(0x5.d53649e2d469dbc1f01e99fd66p+1012);
-#else
 static const _Float128 MAXLGM = L(1.0485738685148938358098967157129705071571E4928);
-#endif
 static const _Float128 one = 1;
 static const _Float128 huge = LDBL_MAX;
 
@@ -777,7 +773,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 
   if (x < 0)
     {
-      if (x < -2 && x > (LDBL_MANT_DIG == 106 ? -48 : -50))
+      if (x < -2 && x > -50)
        return __lgamma_negl (x, signgamp);
       q = -x;
       p = __floorl (q);
index 474773e81d8fcef52fb38c17dcb438b5a5ebf64b..f881b8c0a4a1dd7c065f5a3a7a4750c69140d9ea 100644 (file)
 #include <float.h>
 
 static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
-#if LDBL_MANT_DIG == 106
 static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
-#else
-static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
-#endif
 static const long double one = 1;
 static const long double huge = LDBL_MAX;
 
@@ -727,7 +723,7 @@ __ieee754_lgammal_r (long double x, int *signgamp)
 
   if (x < 0)
     {
-      if (x < -2 && x > (LDBL_MANT_DIG == 106 ? -48 : -50))
+      if (x < -2 && x > -48)
        return __lgamma_negl (x, signgamp);
       q = -x;
       p = __floorl (q);
This page took 0.082708 seconds and 5 git commands to generate.