unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob d00507901c0239ff6363181528d73024bfa83b45 3210 bytes (raw)
name: gnu/packages/patches/glibc-2-26-0058.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 
From f725563967c1f277e0f02bb1516fe9ebfa4737bf Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
Date: Sun, 10 Sep 2017 10:31:47 -0300
Subject: [PATCH 58/90] Remove conditional on LDBL_MANT_DIG from e_lgammal_r.c

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.

(cherry picked from commit 9ac3c68218b5bcbc40ae9e27b0b13f5e1c81f84c)

diff --git a/ChangeLog b/ChangeLog
index 21e923c2f7..846601bc21 100644
--- 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
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 474773e81d..f881b8c0a4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -23,11 +23,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;
 
@@ -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);

debug log:

solving d00507901 ...
found d00507901 in https://yhetil.org/guix-patches/87ine0pjiu.fsf@fastmail.com/ ||
	https://yhetil.org/guix-patches/87d148pe57.fsf@fastmail.com/

applying [1/1] https://yhetil.org/guix-patches/87ine0pjiu.fsf@fastmail.com/
diff --git a/gnu/packages/patches/glibc-2-26-0058.patch b/gnu/packages/patches/glibc-2-26-0058.patch
new file mode 100644
index 000000000..d00507901

1:41: trailing whitespace.
 
1:42: space before tab in indent.
 	* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Remove definitions of
1:49: trailing whitespace.
 
1:58: trailing whitespace.
 
1:60: trailing whitespace.
 
Checking patch gnu/packages/patches/glibc-2-26-0058.patch...
Applied patch gnu/packages/patches/glibc-2-26-0058.patch cleanly.
warning: squelched 5 whitespace errors
warning: 10 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/87d148pe57.fsf@fastmail.com/ for d00507901
index at:
100644 d00507901c0239ff6363181528d73024bfa83b45	gnu/packages/patches/glibc-2-26-0058.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).