From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
To: <libc-alpha@sourceware.org>
Subject: [PATCH v2 5/5] Remove conditional on LDBL_MANT_DIG from e_lgammal_r.c
Date: Mon, 11 Sep 2017 01:17:00 -0000 [thread overview]
Message-ID: <20170911011654.28743-6-gabriel@inconstante.eti.br> (raw)
In-Reply-To: <20170911011654.28743-1-gabriel@inconstante.eti.br>
New since v1.
-- 8< --
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.
---
sysdeps/ieee754/ldbl-128/e_lgammal_r.c | 6 +-----
sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index bef2601bce..a80c9eaf33 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -73,11 +73,7 @@
#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);
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
index 2e0c27e36b..84d66c4f5b 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -24,11 +24,7 @@
#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;
@@ -728,7 +724,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);
--
2.13.5
next prev parent reply other threads:[~2017-09-11 1:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 1:17 [PATCH v2 0/5] Fixes for gcc enabling -mfloat128 by default Gabriel F. T. Gomes
2017-09-11 1:17 ` [PATCH v2 3/5] ldbl-128ibm: Copy implementations from ldbl-128 instead of including them Gabriel F. T. Gomes
2017-09-11 14:41 ` Joseph Myers
2017-09-11 1:17 ` [PATCH v2 1/5] powerpc64le: Add -mfloat128 to tst-strtod-nan-locale testcase Gabriel F. T. Gomes
2017-09-11 1:17 ` [PATCH v2 2/5] powerpc: Add redirection for finitef128, isinf128, and isnanf128 Gabriel F. T. Gomes
2017-09-11 1:17 ` Gabriel F. T. Gomes [this message]
2017-09-11 1:18 ` [PATCH v2 4/5] ldbl-128ibm: Automatic replacing of _Float128 and L() Gabriel F. T. Gomes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170911011654.28743-6-gabriel@inconstante.eti.br \
--to=gabriel@inconstante.eti.br \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).