From dc258ce62ae0bbb456c6a855dbb6b384ecf7e988 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 3 Aug 2017 13:59:17 +0200
Subject: [PATCH 01/90] getaddrinfo: Release resolver context on error in
 gethosts [BZ #21885]

(cherry picked from commit 964263bb8d650f1681665c55704fb01a8e725621)
---
 ChangeLog                   | 6 ++++++
 NEWS                        | 6 ++++++
 sysdeps/posix/getaddrinfo.c | 2 ++
 3 files changed, 14 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 8dbfc7eaff..28ce9c8479 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-03  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #21885]
+	* sysdeps/posix/getaddrinfo.c (gethosts): Release resolver context
+	on memory allocation failure.
+
 2017-08-02  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
 	* version.h (RELEASE): Set to "stable"
diff --git a/NEWS b/NEWS
index 8295f20c0a..9a64579658 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,12 @@ See the end for copying conditions.
 Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
 using `glibc' in the "product" field.
 
+Version 2.26.1
+
+The following bugs are resolved with this release:
+
+  [21885] getaddrinfo: Release resolver context on error in gethosts
+
 Version 2.26
 
 Major new features:
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index efa7118498..699411cc92 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -255,6 +255,8 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
       break;								      \
     if (!scratch_buffer_grow (tmpbuf))					      \
       {									      \
+	__resolv_context_enable_inet6 (res_ctx, res_enable_inet6);	      \
+	__resolv_context_put (res_ctx);					      \
 	result = -EAI_MEMORY;						      \
 	goto free_and_return;						      \
       }									      \
-- 
2.14.1


From 665ce88d68fd13c5c4cbaf2808434c618745137c Mon Sep 17 00:00:00 2001
From: Aurelien Jarno <aurelien@aurel32.net>
Date: Thu, 3 Aug 2017 22:33:19 +0000
Subject: [PATCH 02/90] i686/multiarch: Regenerate ulps
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This comes from running “make regen-ulps” on an AMD Opteron 2378 CPU.

Changelog:
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated.
(cherry picked from commit 144bdab050bdd78c327d98a79b15c5b164e1d56f)
---
 ChangeLog                                      |  4 ++++
 sysdeps/i386/i686/fpu/multiarch/libm-test-ulps | 14 +++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 28ce9c8479..3478699b10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated.
+
 2017-08-03  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #21885]
diff --git a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
index 81dd1a09ea..053f5ec972 100644
--- a/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
+++ b/sysdeps/i386/i686/fpu/multiarch/libm-test-ulps
@@ -58,7 +58,7 @@ double: 1
 float128: 2
 idouble: 1
 ifloat128: 2
-ildouble: 4
+ildouble: 5
 ldouble: 3
 
 Function: "asin":
@@ -1154,8 +1154,8 @@ float128: 4
 idouble: 3
 ifloat: 3
 ifloat128: 4
-ildouble: 7
-ldouble: 7
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "clog10_upward":
 double: 1
@@ -2013,8 +2013,8 @@ double: 3
 float: 4
 idouble: 3
 ifloat: 4
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
 
 Function: "hypot":
 double: 1
@@ -2205,8 +2205,8 @@ float128: 8
 idouble: 3
 ifloat: 4
 ifloat128: 8
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
 
 Function: "log":
 double: 1
-- 
2.14.1


From a4e5aa1a443cfad09bc98f9bb527995371a53a88 Mon Sep 17 00:00:00 2001
From: Aurelien Jarno <aurelien@aurel32.net>
Date: Thu, 3 Aug 2017 22:35:48 +0000
Subject: [PATCH 03/90] Fix the return type of the getentropy stub

The return type of the getentropy stub is wrongly defined as ssize_t,
while both the <sys/random.h> header and the Linux implementation
define it as int. This patch fixes that.

Changelog:
	* stdlib/getentropy.c (getentropy): Change return type to int.
(cherry picked from commit 2b34e2716f1e84b2c3457ffc868c3dc775b55845)
---
 ChangeLog           | 4 ++++
 stdlib/getentropy.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3478699b10..4357ad1eb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-03  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* stdlib/getentropy.c (getentropy): Change return type to int.
+
 2017-08-03  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated.
diff --git a/stdlib/getentropy.c b/stdlib/getentropy.c
index a71d4cd8f5..a88bbf8de3 100644
--- a/stdlib/getentropy.c
+++ b/stdlib/getentropy.c
@@ -21,7 +21,7 @@
 
 /* Write LENGTH bytes of randomness starting at BUFFER.  Return 0 on
    success and -1 on failure.  */
-ssize_t
+int
 getentropy (void *buffer, size_t length)
 {
   __set_errno (ENOSYS);
-- 
2.14.1


From 799859f6635d68487ea2472bd79d96a7639a1ab1 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 6 Aug 2017 10:44:30 -0700
Subject: [PATCH 04/90] x86-64: Use _dl_runtime_resolve_opt only with AVX512F
 [BZ #21871]

On AVX machines with XGETBV (ECX == 1) like Skylake processors,

(gdb) disass _dl_runtime_resolve_avx_opt
Dump of assembler code for function _dl_runtime_resolve_avx_opt:
   0x0000000000015890 <+0>:	push   %rax
   0x0000000000015891 <+1>:	push   %rcx
   0x0000000000015892 <+2>:	push   %rdx
   0x0000000000015893 <+3>:	mov    $0x1,%ecx
   0x0000000000015898 <+8>:	xgetbv
   0x000000000001589b <+11>:	mov    %eax,%r11d
   0x000000000001589e <+14>:	pop    %rdx
   0x000000000001589f <+15>:	pop    %rcx
   0x00000000000158a0 <+16>:	pop    %rax
   0x00000000000158a1 <+17>:	and    $0x4,%r11d
   0x00000000000158a5 <+21>:	bnd je 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.

is slower than:

(gdb) disass _dl_runtime_resolve_avx_slow
Dump of assembler code for function _dl_runtime_resolve_avx_slow:
   0x0000000000015850 <+0>:	vorpd  %ymm0,%ymm1,%ymm8
   0x0000000000015854 <+4>:	vorpd  %ymm2,%ymm3,%ymm9
   0x0000000000015858 <+8>:	vorpd  %ymm4,%ymm5,%ymm10
   0x000000000001585c <+12>:	vorpd  %ymm6,%ymm7,%ymm11
   0x0000000000015860 <+16>:	vorpd  %ymm8,%ymm9,%ymm9
   0x0000000000015865 <+21>:	vorpd  %ymm10,%ymm11,%ymm10
   0x000000000001586a <+26>:	vpcmpeqd %xmm8,%xmm8,%xmm8
   0x000000000001586f <+31>:	vorpd  %ymm9,%ymm10,%ymm10
   0x0000000000015874 <+36>:	vptest %ymm10,%ymm8
   0x0000000000015879 <+41>:	bnd jae 0x158b0 <_dl_runtime_resolve_avx>
   0x000000000001587c <+44>:	vzeroupper
   0x000000000001587f <+47>:	bnd jmpq 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.
(gdb)

since xgetbv takes much more cycles than single cycle operations like
vpord/vvpcmpeq/ptest.  _dl_runtime_resolve_opt should be used only with
AVX512 where AVX512 instructions lead to lower CPU frequency on Skylake
server.

	[BZ #21871]
	* sysdeps/x86/cpu-features.c (init_cpu_features): Set
	bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.

(cherry picked from commit d2cf37c0a2a375cf2fde69f1afbcc49e45368fc4)
---
 ChangeLog                  | 6 ++++++
 sysdeps/x86/cpu-features.c | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4357ad1eb8..764c827161 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #21871]
+	* sysdeps/x86/cpu-features.c (init_cpu_features): Set
+	bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.
+
 2017-08-03  Aurelien Jarno  <aurelien@aurel32.net>
 
 	* stdlib/getentropy.c (getentropy): Change return type to int.
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 1d087ea732..6f900840d4 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -244,10 +244,13 @@ init_cpu_features (struct cpu_features *cpu_features)
 	  |= bit_arch_Prefer_No_AVX512;
 
       /* To avoid SSE transition penalty, use _dl_runtime_resolve_slow.
-         If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt.  */
+         If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt.
+	 Use _dl_runtime_resolve_opt only with AVX512F since it is
+	 slower than _dl_runtime_resolve_slow with AVX.  */
       cpu_features->feature[index_arch_Use_dl_runtime_resolve_slow]
 	|= bit_arch_Use_dl_runtime_resolve_slow;
-      if (cpu_features->max_cpuid >= 0xd)
+      if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
+	  && cpu_features->max_cpuid >= 0xd)
 	{
 	  unsigned int eax;
 
-- 
2.14.1


From 82efa1ffd43bed1494d20a4b86f6b15ac6bb5545 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 17 Jul 2017 10:59:59 -0300
Subject: [PATCH 05/90] posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780)

Different than other architectures hppa-linux-gnu define different values
for ENOTSUP and EOPNOTSUPP, where the later is a Linux specific one.
This leads to tst-preadwritev{64}v2 tests failures:

$ ./testrun.sh misc/tst-preadvwritev2
error: tst-preadvwritev2-common.c:35: preadv2 failure did not set errno to ENOTSUP (223)
error: 1 test failures

The straightforward fix is to return the POSIX defined ENOTSUP on all
p{read,write}v{64}v2 implementations instead of Linux specific one.

Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on
hppa-linux-gnu (although due the installed kernel on my testing system
the pwritev{64}v2 with an invalid flag still fails due a known kernel
issue [1]).

	[BZ #21780]
	* sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
	EOPNOTSUPP.
	* sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
	* sysdeps/posix/pwritev2.c (pwritev2): Likewise.
	* sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
	* sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
	* sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
	* sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
	* sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.

[1] https://sourceware.org/ml/libc-alpha/2017-06/msg00726.html

Cherry-pick of 852d63120783fae5bf85a067320dc4ba1ed59f11
---
 ChangeLog                             | 13 +++++++++++++
 sysdeps/posix/preadv2.c               |  2 +-
 sysdeps/posix/preadv64v2.c            |  2 +-
 sysdeps/posix/pwritev2.c              |  2 +-
 sysdeps/posix/pwritev64v2.c           |  2 +-
 sysdeps/unix/sysv/linux/preadv2.c     |  4 ++--
 sysdeps/unix/sysv/linux/preadv64v2.c  |  4 ++--
 sysdeps/unix/sysv/linux/pwritev2.c    |  4 ++--
 sysdeps/unix/sysv/linux/pwritev64v2.c |  4 ++--
 9 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 764c827161..459062cc20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-08-09  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	[BZ #21780]
+	* sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
+	EOPNOTSUPP.
+	* sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
+	* sysdeps/posix/pwritev2.c (pwritev2): Likewise.
+	* sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
+	* sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
+	* sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
+	* sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
+	* sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.
+
 2017-08-06  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #21871]
diff --git a/sysdeps/posix/preadv2.c b/sysdeps/posix/preadv2.c
index 2a7cf11e27..d27f7028ed 100644
--- a/sysdeps/posix/preadv2.c
+++ b/sysdeps/posix/preadv2.c
@@ -28,7 +28,7 @@ preadv2 (int fd, const struct iovec *vector, int count, OFF_T offset,
 {
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
 
diff --git a/sysdeps/posix/preadv64v2.c b/sysdeps/posix/preadv64v2.c
index e084f3f9e1..ce7cb40bf2 100644
--- a/sysdeps/posix/preadv64v2.c
+++ b/sysdeps/posix/preadv64v2.c
@@ -25,7 +25,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, OFF_T offset,
 {
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
 
diff --git a/sysdeps/posix/pwritev2.c b/sysdeps/posix/pwritev2.c
index 5b7650c4fc..7ec8cbc407 100644
--- a/sysdeps/posix/pwritev2.c
+++ b/sysdeps/posix/pwritev2.c
@@ -28,7 +28,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, OFF_T offset,
 {
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
 
diff --git a/sysdeps/posix/pwritev64v2.c b/sysdeps/posix/pwritev64v2.c
index 0f2f9ef863..be98aeed9d 100644
--- a/sysdeps/posix/pwritev64v2.c
+++ b/sysdeps/posix/pwritev64v2.c
@@ -26,7 +26,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, OFF_T offset,
 {
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
 
diff --git a/sysdeps/unix/sysv/linux/preadv2.c b/sysdeps/unix/sysv/linux/preadv2.c
index 11fe85eaa8..137e2dd791 100644
--- a/sysdeps/unix/sysv/linux/preadv2.c
+++ b/sysdeps/unix/sysv/linux/preadv2.c
@@ -32,7 +32,7 @@ preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
 # ifdef __NR_preadv2
   ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count,
 				   LO_HI_LONG (offset), flags);
-  if (result >= 0 || errno != ENOSYS)
+  if (result >= 0)
     return result;
 # endif
   /* Trying to emulate the preadv2 syscall flags is troublesome:
@@ -46,7 +46,7 @@ preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
 
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
   return preadv (fd, vector, count, offset);
diff --git a/sysdeps/unix/sysv/linux/preadv64v2.c b/sysdeps/unix/sysv/linux/preadv64v2.c
index 9d7f8c9893..8f413253f4 100644
--- a/sysdeps/unix/sysv/linux/preadv64v2.c
+++ b/sysdeps/unix/sysv/linux/preadv64v2.c
@@ -30,7 +30,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
 #ifdef __NR_preadv64v2
   ssize_t result = SYSCALL_CANCEL (preadv64v2, fd, vector, count,
 				   LO_HI_LONG (offset), flags);
-  if (result >= 0 || errno != ENOSYS)
+  if (result >= 0)
     return result;
 #endif
   /* Trying to emulate the preadv2 syscall flags is troublesome:
@@ -44,7 +44,7 @@ preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
 
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
   return preadv64 (fd, vector, count, offset);
diff --git a/sysdeps/unix/sysv/linux/pwritev2.c b/sysdeps/unix/sysv/linux/pwritev2.c
index 72f0471f96..8e5032fe2f 100644
--- a/sysdeps/unix/sysv/linux/pwritev2.c
+++ b/sysdeps/unix/sysv/linux/pwritev2.c
@@ -28,7 +28,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
 # ifdef __NR_pwritev2
   ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count,
 				   LO_HI_LONG (offset), flags);
-  if (result >= 0 || errno != ENOSYS)
+  if (result >= 0)
     return result;
 # endif
   /* Trying to emulate the pwritev2 syscall flags is troublesome:
@@ -42,7 +42,7 @@ pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
 
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
   return pwritev (fd, vector, count, offset);
diff --git a/sysdeps/unix/sysv/linux/pwritev64v2.c b/sysdeps/unix/sysv/linux/pwritev64v2.c
index def9a0bc57..d2800c6657 100644
--- a/sysdeps/unix/sysv/linux/pwritev64v2.c
+++ b/sysdeps/unix/sysv/linux/pwritev64v2.c
@@ -30,7 +30,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
 #ifdef __NR_pwritev64v2
   ssize_t result = SYSCALL_CANCEL (pwritev64v2, fd, vector, count,
 				   LO_HI_LONG (offset), flags);
-  if (result >= 0 || errno != ENOSYS)
+  if (result >= 0)
     return result;
 #endif
   /* Trying to emulate the pwritev2 syscall flags is troublesome:
@@ -44,7 +44,7 @@ pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
 
   if (flags != 0)
     {
-      __set_errno (EOPNOTSUPP);
+      __set_errno (ENOTSUP);
       return -1;
     }
   return pwritev64 (fd, vector, count, offset);
-- 
2.14.1


From 302434688d925134065498b4a5574f6ee6bfb9fd Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 10 Aug 2017 09:10:36 +0200
Subject: [PATCH 06/90] nss: Call __resolv_context_put before early return in
 get*_r [BZ #21932]

This corrects an oversight introduced in commit
352f4ff9a268b81ef5d4b2413f582565806e4790 (resolv: Introduce struct
resolv_context).

(cherry picked from commit 3016149819268b14660f791b971910ccc2cc13e5)
---
 ChangeLog         |  6 ++++++
 NEWS              |  1 +
 nss/getXXbyYY_r.c | 10 +++++++++-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 459062cc20..3127648626 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-09  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #21932]
+	* nss/getXXbyYY_r.c (REENTRANT_NAME): Call __resolv_context_put
+	before early return.
+
 2017-08-09  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	[BZ #21780]
diff --git a/NEWS b/NEWS
index 9a64579658..ec6cf34122 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Version 2.26.1
 The following bugs are resolved with this release:
 
   [21885] getaddrinfo: Release resolver context on error in gethosts
+  [21932] Unpaired __resolv_context_get in generic get*_r implementation
 
 Version 2.26
 
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index 6c547ea1ca..bce80e05dd 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -234,6 +234,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
 				      H_ERRNO_VAR_P))
     {
     case -1:
+# ifdef NEED__RES
+      __resolv_context_put (res_ctx);
+# endif
       return errno;
     case 1:
 #ifdef NEED_H_ERRNO
@@ -253,7 +256,12 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
       nscd_status = NSCD_NAME (ADD_VARIABLES, resbuf, buffer, buflen, result
 			       H_ERRNO_VAR);
       if (nscd_status >= 0)
-	return nscd_status;
+	{
+# ifdef NEED__RES
+	  __resolv_context_put (res_ctx);
+# endif
+	  return nscd_status;
+	}
     }
 #endif
 
-- 
2.14.1


From c55ad6452e2d63ebf6fcaabb00bfd27aae02ffb6 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 10 Aug 2017 15:58:28 +0200
Subject: [PATCH 07/90] malloc: Avoid optimizer warning with GCC 7 and -O3

(cherry picked from commit eac43cbb8d808a40004aa0a4a286f5c5155beccb)
---
 ChangeLog       |  5 +++++
 malloc/malloc.c | 20 ++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3127648626..5ea9b8baa7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-10  Florian Weimer  <fweimer@redhat.com>
+
+	* malloc/malloc.c (get_max_fast): Reimplement as an inline
+	function which calls __builtin_unreachable.
+
 2017-08-09  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #21932]
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 54e406bcb6..e3ff778113 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -1658,6 +1658,9 @@ typedef struct malloc_chunk *mfastbinptr;
 #define arena_is_corrupt(A)	(((A)->flags & ARENA_CORRUPTION_BIT))
 #define set_arena_corrupt(A)	((A)->flags |= ARENA_CORRUPTION_BIT)
 
+/* Maximum size of memory handled in fastbins.  */
+static INTERNAL_SIZE_T global_max_fast;
+
 /*
    Set value of max_fast.
    Use impossibly small value if 0.
@@ -1668,8 +1671,20 @@ typedef struct malloc_chunk *mfastbinptr;
 #define set_max_fast(s) \
   global_max_fast = (((s) == 0)						      \
                      ? SMALLBIN_WIDTH : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK))
-#define get_max_fast() global_max_fast
 
+static inline INTERNAL_SIZE_T
+get_max_fast (void)
+{
+  /* Tell the GCC optimizers that global_max_fast is never larger
+     than MAX_FAST_SIZE.  This avoids out-of-bounds array accesses in
+     _int_malloc after constant propagation of the size parameter.
+     (The code never executes because malloc preserves the
+     global_max_fast invariant, but the optimizers may not recognize
+     this.)  */
+  if (global_max_fast > MAX_FAST_SIZE)
+    __builtin_unreachable ();
+  return global_max_fast;
+}
 
 /*
    ----------- Internal state representation and initialization -----------
@@ -1797,9 +1812,6 @@ static struct malloc_par mp_ =
 #endif
 };
 
-/* Maximum size of memory handled in fastbins.  */
-static INTERNAL_SIZE_T global_max_fast;
-
 /*
    Initialize a malloc_state struct.
 
-- 
2.14.1


From 2aa1a7a8f8b9b7879bc6eb1c34d1580f992c406d Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 11 Aug 2017 15:48:14 +0200
Subject: [PATCH 08/90] assert: Suppress pedantic warning caused by statement
 expression [BZ #21242]

(cherry picked from commit 8b2c63e4e2ad1fd161f80004ed30624f2a37b57b)
---
 ChangeLog       |  7 +++++++
 NEWS            |  1 +
 assert/assert.h | 12 +++++++++---
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5ea9b8baa7..0057c0902a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-11  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #21242]
+	* assert/assert.h [__GNUC__ && !__STRICT_ANSI__] (assert):
+	Suppress pedantic warning resulting from statement expression.
+	(__ASSERT_FUNCTION): Add missing __extension__.
+
 2017-08-10  Florian Weimer  <fweimer@redhat.com>
 
 	* malloc/malloc.c (get_max_fast): Reimplement as an inline
diff --git a/NEWS b/NEWS
index ec6cf34122..d57c4052cf 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Version 2.26.1
 
 The following bugs are resolved with this release:
 
+  [21242] assert: Suppress pedantic warning caused by statement expression
   [21885] getaddrinfo: Release resolver context on error in gethosts
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
 
diff --git a/assert/assert.h b/assert/assert.h
index 22f019537c..6801cfeb10 100644
--- a/assert/assert.h
+++ b/assert/assert.h
@@ -91,13 +91,19 @@ __END_DECLS
      ? __ASSERT_VOID_CAST (0)						\
      : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
 # else
+/* The first occurrence of EXPR is not evaluated due to the sizeof,
+   but will trigger any pedantic warnings masked by the __extension__
+   for the second occurrence.  The explicit comparison against zero is
+   required to support function pointers and bit fields in this
+   context, and to suppress the evaluation of variable length
+   arrays.  */
 #  define assert(expr)							\
-    ({									\
+  ((void) sizeof ((expr) == 0), __extension__ ({			\
       if (expr)								\
         ; /* empty */							\
       else								\
         __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION);	\
-    })
+    }))
 # endif
 
 # ifdef	__USE_GNU
@@ -113,7 +119,7 @@ __END_DECLS
    C9x has a similar variable called __func__, but prefer the GCC one since
    it demangles C++ function names.  */
 # if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
-#   define __ASSERT_FUNCTION	__PRETTY_FUNCTION__
+#   define __ASSERT_FUNCTION	__extension__ __PRETTY_FUNCTION__
 # else
 #  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
 #   define __ASSERT_FUNCTION	__func__
-- 
2.14.1


From 645b7635ba8fd58062245419e8bb668ab90cd3ec Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Mon, 7 Aug 2017 09:14:14 -0300
Subject: [PATCH 09/90] powerpc: Restrict xssqrtqp operands to Vector Registers
 (bug 21941)

POWER ISA 3.0 introduces the xssqrtqp instructions, which expects
operands to be in Vector Registers (Altivec/VMX), even though this
instruction belongs to the Vector-Scalar Instruction Set.

In GCC's Extended Assembly for POWER, the 'wq' register constraint is
provided for use with IEEE 754 128-bit floating-point values.  However,
this constraint does not limit the register allocation to Vector
Registers (Altivec/VMX) and could assign a Vector-Scalar Register (VSX)
to the operands of the instruction.

This patch changes the register constraint used in sqrtf128 from 'wq' to
'v', in order to request a Vector Register (Altivec/VMX) for use with
the xssqrtqp instruction.

Tested for powerpc64le and --with-cpu=power9.

	[BZ #21941]
	* sysdeps/powerpc/fpu/math_private.h (__ieee754_sqrtf128): Since
	xssqrtqp requires operands to be in Vector Registers
	(Altivec/VMX), replace the register constraint 'wq' with 'v'.
	* sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
	(__ieee754_sqrtf128): Likewise.

(cherry picked from commit 4d98ace9de3183309cb394cd0110eda5ad2d2531)
---
 ChangeLog                                           | 9 +++++++++
 sysdeps/powerpc/fpu/math_private.h                  | 2 +-
 sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0057c0902a..6886cd9361 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-08-10  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	[BZ #21941]
+	* sysdeps/powerpc/fpu/math_private.h (__ieee754_sqrtf128): Since
+	xssqrtqp requires operands to be in Vector Registers
+	(Altivec/VMX), replace the register constraint 'wq' with 'v'.
+	* sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
+	(__ieee754_sqrtf128): Likewise.
+
 2017-08-11  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #21242]
diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h
index d8fd4923ac..396fd0562e 100644
--- a/sysdeps/powerpc/fpu/math_private.h
+++ b/sysdeps/powerpc/fpu/math_private.h
@@ -30,7 +30,7 @@ extern __always_inline _Float128
 __ieee754_sqrtf128 (_Float128 __x)
 {
   _Float128 __z;
-  asm ("xssqrtqp %0,%1" : "=wq" (__z) : "wq" (__x));
+  asm ("xssqrtqp %0,%1" : "=v" (__z) : "v" (__x));
   return __z;
 }
 #endif
diff --git a/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c b/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
index 769d3f8922..59fd8269f5 100644
--- a/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
+++ b/sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c
@@ -30,7 +30,7 @@ __float128
 __ieee754_sqrtf128 (__float128 a)
 {
   __float128 z;
-  asm ("xssqrtqp %0,%1" : "=wq" (z) : "wq" (a));
+  asm ("xssqrtqp %0,%1" : "=v" (z) : "v" (a));
   return z;
 }
 strong_alias (__ieee754_sqrtf128, __sqrtf128_finite)
-- 
2.14.1


From c2921b17a37e887b8a5ca9d84b875b9ba702b79c Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Mon, 21 Aug 2017 14:23:27 +0200
Subject: [PATCH 10/90] Do not use __builtin_types_compatible_p in C++ mode
 (bug 21930)

The logic to define isinf for float128 depends on the availability of
__builtin_types_compatible_p, which is only available in C mode,
however, the conditionals do not check for C or C++ mode.  This lead to
an error in libstdc++ configure, as reported by bug 21930.

This patch adds a conditional for C mode in the definition of isinf for
float128.  No definition is provided in C++ mode, since libstdc++
headers undefine isinf.

Tested for powerpc64le (glibc test suite and libstdc++-v3 configure).

	[BZ #21930]
	* math/math.h (isinf): Check if in C or C++ mode before using
	__builtin_types_compatible_p, since this is a C mode feature.

(cherry picked from commit 47a67213a9f51c5f8816d240500b10db605d8b77)
---
 ChangeLog   | 6 ++++++
 NEWS        | 1 +
 math/math.h | 8 ++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6886cd9361..415fa3cc79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-18  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	[BZ #21930]
+	* math/math.h (isinf): Check if in C or C++ mode before using
+	__builtin_types_compatible_p, since this is a C mode feature.
+
 2017-08-10  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	[BZ #21941]
diff --git a/NEWS b/NEWS
index d57c4052cf..75b82c899e 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
 
   [21242] assert: Suppress pedantic warning caused by statement expression
   [21885] getaddrinfo: Release resolver context on error in gethosts
+  [21930] Do not use __builtin_types_compatible_p in C++ mode
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
 
 Version 2.26
diff --git a/math/math.h b/math/math.h
index e21708045a..dea8dbe1ae 100644
--- a/math/math.h
+++ b/math/math.h
@@ -442,8 +442,12 @@ enum
 
 /* Return nonzero value if X is positive or negative infinity.  */
 # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
-     && !defined __SUPPORT_SNAN__
-   /* __builtin_isinf_sign is broken for float128 only before GCC 7.0.  */
+     && !defined __SUPPORT_SNAN__ && !defined __cplusplus
+   /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
+      use the helper function, __isinff128, with older compilers.  This is
+      only provided for C mode, because in C++ mode, GCC has no support
+      for __builtin_types_compatible_p (and when in C++ mode, this macro is
+      not used anyway, because libstdc++ headers undefine it).  */
 #  define isinf(x) \
     (__builtin_types_compatible_p (__typeof (x), _Float128) \
      ? __isinff128 (x) : __builtin_isinf_sign (x))
-- 
2.14.1


From 5e989c36934d0f0cf13b7a53ef2fa440bce39210 Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Mon, 14 Aug 2017 17:51:51 -0300
Subject: [PATCH 11/90] Do not use generic selection in C++ mode

The logic to protect the use of generic selection (_Generic) does not
check for C or C++ mode, however, generic selection is a C-only
feature.

Tested for powerpc64le.

	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): Define to 0, if
	in C++ mode.

(cherry picked from commit 6913ad65e00bb32417ad39c41d292b976171e27e)
---
 ChangeLog        |  5 +++++
 misc/sys/cdefs.h | 19 ++++++++++---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 415fa3cc79..23c00aed09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-18  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): Define to 0, if
+	in C++ mode.
+
 2017-08-18  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	[BZ #21930]
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 06523bfe9c..0c808216a4 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -464,17 +464,18 @@
 # define __glibc_macro_warning(msg)
 #endif
 
-/* Support for generic selection (ISO C11) is available in GCC since
-   version 4.9.  Previous versions do not provide generic selection,
-   even though they might set __STDC_VERSION__ to 201112L, when in
-   -std=c11 mode.  Thus, we must check for !defined __GNUC__ when
-   testing __STDC_VERSION__ for generic selection support.
+/* Generic selection (ISO C11) is a C-only feature, available in GCC
+   since version 4.9.  Previous versions do not provide generic
+   selection, even though they might set __STDC_VERSION__ to 201112L,
+   when in -std=c11 mode.  Thus, we must check for !defined __GNUC__
+   when testing __STDC_VERSION__ for generic selection support.
    On the other hand, Clang also defines __GNUC__, so a clang-specific
    check is required to enable the use of generic selection.  */
-#if __GNUC_PREREQ (4, 9) \
-    || __glibc_clang_has_extension (c_generic_selections) \
-    || (!defined __GNUC__ && defined __STDC_VERSION__ \
-	&& __STDC_VERSION__ >= 201112L)
+#if !defined __cplusplus \
+    && (__GNUC_PREREQ (4, 9) \
+	|| __glibc_clang_has_extension (c_generic_selections) \
+	|| (!defined __GNUC__ && defined __STDC_VERSION__ \
+	    && __STDC_VERSION__ >= 201112L))
 # define __HAVE_GENERIC_SELECTION 1
 #else
 # define __HAVE_GENERIC_SELECTION 0
-- 
2.14.1


From fb9a781e9d62c5d7a1f4196915cdfb7c6db59a0c Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Mon, 21 Aug 2017 16:13:49 +0200
Subject: [PATCH 12/90] assert: Support types without operator== (int) [BZ
 #21972]

(cherry picked from commit b5889d25e9bf944a89fdd7bcabf3b6c6f6bb6f7c)
---
 ChangeLog                | 11 +++++++
 NEWS                     |  1 +
 assert/Makefile          | 11 ++++++-
 assert/assert.h          | 16 ++++++----
 assert/tst-assert-c++.cc | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
 assert/tst-assert-g++.cc | 19 ++++++++++++
 6 files changed, 129 insertions(+), 7 deletions(-)
 create mode 100644 assert/tst-assert-c++.cc
 create mode 100644 assert/tst-assert-g++.cc

diff --git a/ChangeLog b/ChangeLog
index 23c00aed09..8bc3ad9a46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-08-21  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #21972]
+	* assert/assert.h (assert): Use static_cast (bool) for C++.
+	Use the ternary operator in the warning branch for GNU C.
+	* assert/Makefile (tests): Add tst-assert-c++, tst-assert-g++.
+	(CFLAGS-tst-assert-c++.o): Compile in C++11 mode.
+	(CFLAGS-tst-assert-g++.o): Compile in GnU C++11 mode.
+	(LDLIBS-tst-assert-c++, LDLIBS-tst-assert-g++): Link with libstdc++.
+	* assert/tst-assert-c++.cc, assert/tst-assert-g++.cc: New files.
+
 2017-08-18  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): Define to 0, if
diff --git a/NEWS b/NEWS
index 75b82c899e..1996e5fbef 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ The following bugs are resolved with this release:
   [21885] getaddrinfo: Release resolver context on error in gethosts
   [21930] Do not use __builtin_types_compatible_p in C++ mode
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
+  [21972] assert macro requires operator== (int) for its argument type
 
 Version 2.26
 
diff --git a/assert/Makefile b/assert/Makefile
index 1c3be9b01f..9ec1be81a9 100644
--- a/assert/Makefile
+++ b/assert/Makefile
@@ -25,6 +25,15 @@ include ../Makeconfig
 headers	:= assert.h
 
 routines := assert assert-perr __assert
-tests := test-assert test-assert-perr
+tests := test-assert test-assert-perr tst-assert-c++ tst-assert-g++
 
 include ../Rules
+
+ifeq ($(have-cxx-thread_local),yes)
+CFLAGS-tst-assert-c++.o = -std=c++11
+LDLIBS-tst-assert-c++ = -lstdc++
+CFLAGS-tst-assert-g++.o = -std=gnu++11
+LDLIBS-tst-assert-g++ = -lstdc++
+else
+tests-unsupported += tst-assert-c++ tst-assert-g++
+endif
diff --git a/assert/assert.h b/assert/assert.h
index 6801cfeb10..640c95c063 100644
--- a/assert/assert.h
+++ b/assert/assert.h
@@ -85,7 +85,12 @@ __END_DECLS
 /* When possible, define assert so that it does not add extra
    parentheses around EXPR.  Otherwise, those added parentheses would
    suppress warnings we'd expect to be detected by gcc's -Wparentheses.  */
-# if !defined __GNUC__ || defined __STRICT_ANSI__
+# if defined __cplusplus
+#  define assert(expr)							\
+     (static_cast <bool> (expr)						\
+      ? void (0)							\
+      : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
+# elif !defined __GNUC__ || defined __STRICT_ANSI__
 #  define assert(expr)							\
     ((expr)								\
      ? __ASSERT_VOID_CAST (0)						\
@@ -93,12 +98,11 @@ __END_DECLS
 # else
 /* The first occurrence of EXPR is not evaluated due to the sizeof,
    but will trigger any pedantic warnings masked by the __extension__
-   for the second occurrence.  The explicit comparison against zero is
-   required to support function pointers and bit fields in this
-   context, and to suppress the evaluation of variable length
-   arrays.  */
+   for the second occurrence.  The ternary operator is required to
+   support function pointers and bit fields in this context, and to
+   suppress the evaluation of variable length arrays.  */
 #  define assert(expr)							\
-  ((void) sizeof ((expr) == 0), __extension__ ({			\
+  ((void) sizeof ((expr) ? 1 : 0), __extension__ ({			\
       if (expr)								\
         ; /* empty */							\
       else								\
diff --git a/assert/tst-assert-c++.cc b/assert/tst-assert-c++.cc
new file mode 100644
index 0000000000..12a5e690cb
--- /dev/null
+++ b/assert/tst-assert-c++.cc
@@ -0,0 +1,78 @@
+/* Tests for interactions between C++ and assert.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+
+/* The C++ standard requires that if the assert argument is a constant
+   subexpression, then the assert itself is one, too.  */
+constexpr int
+check_constexpr ()
+{
+  return (assert (true), 1);
+}
+
+/* Objects of this class can be contextually converted to bool, but
+   cannot be compared to int.  */
+struct no_int
+{
+  no_int () = default;
+  no_int (const no_int &) = delete;
+
+  explicit operator bool () const
+  {
+    return true;
+  }
+
+  bool operator! () const; /* No definition.  */
+  template <class T> bool operator== (T) const; /* No definition.  */
+  template <class T> bool operator!= (T) const; /* No definition.  */
+};
+
+/* This class tests that operator== is not used by assert.  */
+struct bool_and_int
+{
+  bool_and_int () = default;
+  bool_and_int (const no_int &) = delete;
+
+  explicit operator bool () const
+  {
+    return true;
+  }
+
+  bool operator! () const; /* No definition.  */
+  template <class T> bool operator== (T) const; /* No definition.  */
+  template <class T> bool operator!= (T) const; /* No definition.  */
+};
+
+static int
+do_test ()
+{
+  {
+    no_int value;
+    assert (value);
+  }
+
+  {
+    bool_and_int value;
+    assert (value);
+  }
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/assert/tst-assert-g++.cc b/assert/tst-assert-g++.cc
new file mode 100644
index 0000000000..8c06402825
--- /dev/null
+++ b/assert/tst-assert-g++.cc
@@ -0,0 +1,19 @@
+/* Tests for interactions between C++ and assert.  GNU C++11 version.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <tst-assert-c++.cc>
-- 
2.14.1


From 3aeab55ee17ca527e4597bc8397c0434c3f8b34e Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Mon, 21 Aug 2017 15:45:57 -0300
Subject: [PATCH 13/90] Add missing bug fixes to NEWS

---
 NEWS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/NEWS b/NEWS
index 1996e5fbef..0534c5296e 100644
--- a/NEWS
+++ b/NEWS
@@ -10,9 +10,12 @@ Version 2.26.1
 The following bugs are resolved with this release:
 
   [21242] assert: Suppress pedantic warning caused by statement expression
+  [21780] posix: Set p{read,write}v2 to return ENOTSUP
+  [21871] x86-64: Use _dl_runtime_resolve_opt only with AVX512F
   [21885] getaddrinfo: Release resolver context on error in gethosts
   [21930] Do not use __builtin_types_compatible_p in C++ mode
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
+  [21941] powerpc: Restrict xssqrtqp operands to Vector Registers
   [21972] assert macro requires operator== (int) for its argument type
 
 Version 2.26
-- 
2.14.1


From 77db8772bd3f6f2bbad697dcf46861ce310f5b95 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 10 Aug 2017 16:06:52 +0200
Subject: [PATCH 14/90] __inet6_scopeid_pton: Remove attribute_hidden,
 internal_function

The hidden attribute was overridden by libc_hidden_proto on GNU/Linux.
It is incorrect because the function is used from nscd.

internal_function is not supposed to be used across DSO boundaries,
so this commit removes it (again, due to the use in nscd).

(cherry picked from commit f87cc2bfba9b844da48a63441c6099342b1551c7)
---
 ChangeLog                 | 7 +++++++
 inet/inet6_scopeid_pton.c | 2 +-
 inet/net-internal.h       | 3 +--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8bc3ad9a46..ad05da8ade 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-10  Florian Weimer  <fweimer@redhat.com>
+
+	* inet/net-internal.h (__inet6_scopeid_pton): Remove
+	attribute_hidden, internal_function.
+	* inet/inet6_scopeid_pton.c (__inet6_scopeid_pton): Remove
+	internal_function.
+
 2017-08-21  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #21972]
diff --git a/inet/inet6_scopeid_pton.c b/inet/inet6_scopeid_pton.c
index e09b1cb34d..cc8803fa10 100644
--- a/inet/inet6_scopeid_pton.c
+++ b/inet/inet6_scopeid_pton.c
@@ -28,7 +28,7 @@
 
 /* Parse SOURCE as a scope ID for ADDRESS.  Return 0 on success and -1
    on error.  */
-internal_function int
+int
 __inet6_scopeid_pton (const struct in6_addr *address, const char *scope,
                       uint32_t *result)
 {
diff --git a/inet/net-internal.h b/inet/net-internal.h
index 2b2632c7ba..b2135893e8 100644
--- a/inet/net-internal.h
+++ b/inet/net-internal.h
@@ -25,8 +25,7 @@
 #include <sys/time.h>
 
 int __inet6_scopeid_pton (const struct in6_addr *address,
-                          const char *scope, uint32_t *result)
-  internal_function attribute_hidden;
+                          const char *scope, uint32_t *result);
 libc_hidden_proto (__inet6_scopeid_pton)
 
 
-- 
2.14.1


From 6043d77a47de297b62084c1c261cdada082bf09c Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Mon, 28 Aug 2017 19:49:18 +0200
Subject: [PATCH 15/90] ldd: never run file directly

(cherry picked from commit eedca9772e99c72ab4c3c34e43cc764250aa3e3c)
---
 ChangeLog       |  6 ++++++
 NEWS            |  9 +++++++++
 elf/ldd.bash.in | 14 +-------------
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ad05da8ade..fa27c6f66f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-16  Andreas Schwab  <schwab@suse.de>
+
+	[BZ #16750]
+	CVE-2009-5064
+	* elf/ldd.bash.in: Never run file directly.
+
 2017-08-10  Florian Weimer  <fweimer@redhat.com>
 
 	* inet/net-internal.h (__inet6_scopeid_pton): Remove
diff --git a/NEWS b/NEWS
index 0534c5296e..756e849643 100644
--- a/NEWS
+++ b/NEWS
@@ -7,8 +7,17 @@ using `glibc' in the "product" field.
 
 Version 2.26.1
 
+Security related changes:
+
+  CVE-2009-5064: The ldd script would sometimes run the program under
+  examination directly, without preventing code execution through the
+  dynamic linker.  (The glibc project disputes that this is a security
+  vulnerability; only trusted binaries must be examined using the ldd
+  script.)
+
 The following bugs are resolved with this release:
 
+  [16750] ldd: Never run file directly.
   [21242] assert: Suppress pedantic warning caused by statement expression
   [21780] posix: Set p{read,write}v2 to return ENOTSUP
   [21871] x86-64: Use _dl_runtime_resolve_opt only with AVX512F
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index 7dd1fccf24..686785e235 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -164,18 +164,6 @@ warning: you do not have execution permission for" "\`$file'" >&2
       fi
     done
     case $ret in
-    0)
-      # If the program exits with exit code 5, it means the process has been
-      # invoked with __libc_enable_secure.  Fall back to running it through
-      # the dynamic linker.
-      try_trace "$file"
-      rc=$?
-      if [ $rc = 5 ]; then
-	try_trace "$RTLD" "$file"
-	rc=$?
-      fi
-      [ $rc = 0 ] || result=1
-      ;;
     1)
       # This can be a non-ELF binary or no binary at all.
       nonelf "$file" || {
@@ -183,7 +171,7 @@ warning: you do not have execution permission for" "\`$file'" >&2
 	result=1
       }
       ;;
-    2)
+    0|2)
       try_trace "$RTLD" "$file" || result=1
       ;;
     *)
-- 
2.14.1


From ef8566d72af5e03c1b82cf02efb794268a347f8c Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Mon, 14 Aug 2017 13:46:15 -0300
Subject: [PATCH 16/90] Provide a C++ version of issignaling that does not use
 __MATH_TG

The macro __MATH_TG contains the logic to select between long double and
_Float128, when these types are ABI-distinct.  This logic relies on
__builtin_types_compatible_p, which is not available in C++ mode.

On the other hand, C++ function overloading provides the means to
distinguish between the floating-point types.  The overloading
resolution will match the correct parameter regardless of type
qualifiers, i.e.: const and volatile.

Tested for powerpc64le, s390x, and x86_64.

	* math/math.h [defined __cplusplus] (issignaling): Provide a C++
	definition for issignaling that does not rely on __MATH_TG,
	since __MATH_TG uses __builtin_types_compatible_p, which is only
	available in C mode.
	(CFLAGS-test-math-issignaling.cc): New variable.
	* math/Makefile [CXX] (tests): Add test-math-issignaling.
	* math/test-math-issignaling.cc: New test for C++ implementation
	of type-generic issignaling.
	* sysdeps/powerpc/powerpc64le/Makefile [subdir == math]
	(CXXFLAGS-test-math-issignaling.cc): Add -mfloat128 to the build
	options of test-math-issignaling on powerpc64le.

(cherry picked from commit a16e8bc08edca84d507715c66d6cddbbc7ed3b62)
---
 ChangeLog                            |  14 +++++
 math/Makefile                        |   3 +-
 math/math.h                          |  19 +++++-
 math/test-math-issignaling.cc        | 113 +++++++++++++++++++++++++++++++++++
 sysdeps/powerpc/powerpc64le/Makefile |   1 +
 5 files changed, 148 insertions(+), 2 deletions(-)
 create mode 100644 math/test-math-issignaling.cc

diff --git a/ChangeLog b/ChangeLog
index fa27c6f66f..527026ba5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2017-08-22  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* math/math.h [defined __cplusplus] (issignaling): Provide a C++
+	definition for issignaling that does not rely on __MATH_TG,
+	since __MATH_TG uses __builtin_types_compatible_p, which is only
+	available in C mode.
+	(CFLAGS-test-math-issignaling.cc): New variable.
+	* math/Makefile [CXX] (tests): Add test-math-issignaling.
+	* math/test-math-issignaling.cc: New test for C++ implementation
+	of type-generic issignaling.
+	* sysdeps/powerpc/powerpc64le/Makefile [subdir == math]
+	(CXXFLAGS-test-math-issignaling.cc): Add -mfloat128 to the build
+	options of test-math-issignaling on powerpc64le.
+
 2017-08-16  Andreas Schwab  <schwab@suse.de>
 
 	[BZ #16750]
diff --git a/math/Makefile b/math/Makefile
index e09b0c0545..0130fcf38b 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -203,7 +203,7 @@ tests-static = test-fpucw-static test-fpucw-ieee-static \
 	       test-signgam-ullong-static test-signgam-ullong-init-static
 
 ifneq (,$(CXX))
-tests += test-math-isinff test-math-iszero
+tests += test-math-isinff test-math-iszero test-math-issignaling
 endif
 
 ifneq (no,$(PERL))
@@ -350,6 +350,7 @@ CFLAGS-test-signgam-ullong-init-static.c = -std=c99
 
 CFLAGS-test-math-isinff.cc = -std=gnu++11
 CFLAGS-test-math-iszero.cc = -std=gnu++11
+CFLAGS-test-math-issignaling.cc = -std=gnu++11
 
 CFLAGS-test-iszero-excess-precision.c = -fexcess-precision=standard
 CFLAGS-test-iseqsig-excess-precision.c = -fexcess-precision=standard
diff --git a/math/math.h b/math/math.h
index dea8dbe1ae..add86af724 100644
--- a/math/math.h
+++ b/math/math.h
@@ -474,7 +474,24 @@ enum
 # include <bits/iscanonical.h>
 
 /* Return nonzero value if X is a signaling NaN.  */
-# define issignaling(x) __MATH_TG ((x), __issignaling, (x))
+# ifndef __cplusplus
+#  define issignaling(x) __MATH_TG ((x), __issignaling, (x))
+# else
+   /* In C++ mode, __MATH_TG cannot be used, because it relies on
+      __builtin_types_compatible_p, which is a C-only builtin.  On the
+      other hand, overloading provides the means to distinguish between
+      the floating-point types.  The overloading resolution will match
+      the correct parameter (regardless of type qualifiers (i.e.: const
+      and volatile).  */
+extern "C++" {
+inline int issignaling (float __val) { return __issignalingf (__val); }
+inline int issignaling (double __val) { return __issignaling (__val); }
+inline int issignaling (long double __val) { return __issignalingl (__val); }
+#  if __HAVE_DISTINCT_FLOAT128
+inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
+#  endif
+} /* extern C++ */
+# endif
 
 /* Return nonzero value if X is subnormal.  */
 # define issubnormal(x) (fpclassify (x) == FP_SUBNORMAL)
diff --git a/math/test-math-issignaling.cc b/math/test-math-issignaling.cc
new file mode 100644
index 0000000000..22ae9e1bca
--- /dev/null
+++ b/math/test-math-issignaling.cc
@@ -0,0 +1,113 @@
+/* Test for the C++ implementation of issignaling.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define _GNU_SOURCE 1
+#include <math.h>
+#include <stdio.h>
+
+#include <limits>
+
+/* There is no signaling_NaN for _Float128 in std::numeric_limits.
+   Include ieee754_float128.h and use the bitfields in the union
+   ieee854_float128.ieee_nan to build a signaling NaN.  */
+#if __HAVE_DISTINCT_FLOAT128
+# include <ieee754_float128.h>
+#endif
+
+static bool errors;
+
+static void
+check (int actual, int expected, const char *actual_expr, int line)
+{
+  if (actual != expected)
+    {
+      errors = true;
+      printf ("%s:%d: error: %s\n", __FILE__, line, actual_expr);
+      printf ("%s:%d:   expected: %d\n", __FILE__, line, expected);
+      printf ("%s:%d:   actual: %d\n", __FILE__, line, actual);
+    }
+}
+
+#define CHECK(actual, expected) \
+  check ((actual), (expected), #actual, __LINE__)
+
+template <class T>
+static void
+check_type ()
+{
+  typedef std::numeric_limits<T> limits;
+  CHECK (issignaling (T{0}), 0);
+  if (limits::has_infinity)
+    {
+      CHECK (issignaling (limits::infinity ()), 0);
+      CHECK (issignaling (-limits::infinity ()), 0);
+    }
+  if (limits::has_quiet_NaN)
+    CHECK (issignaling (limits::quiet_NaN ()), 0);
+  if (limits::has_signaling_NaN)
+    CHECK (issignaling (limits::signaling_NaN ()), 1);
+}
+
+#if __HAVE_DISTINCT_FLOAT128
+static void
+check_float128 ()
+{
+  ieee854_float128 q;
+
+  q.d = 0;
+  CHECK (issignaling (q.d), 0);
+
+  /* Infinity.  */
+  q.ieee.negative = 0;
+  q.ieee.exponent = 0x7FFF;
+  q.ieee.mantissa0 = 0x0000;
+  q.ieee.mantissa1 = 0x00000000;
+  q.ieee.mantissa2 = 0x00000000;
+  q.ieee.mantissa3 = 0x00000000;
+  CHECK (issignaling (q.d), 0);
+
+  /* Quiet NaN.  */
+  q.ieee_nan.quiet_nan = 1;
+  q.ieee_nan.mantissa0 = 0x0000;
+  CHECK (issignaling (q.d), 0);
+
+  /* Still a quiet NaN.  */
+  q.ieee_nan.quiet_nan = 1;
+  q.ieee_nan.mantissa0 = 0x4000;
+  CHECK (issignaling (q.d), 0);
+
+  /* Signaling NaN.  */
+  q.ieee_nan.quiet_nan = 0;
+  q.ieee_nan.mantissa0 = 0x4000;
+  CHECK (issignaling (q.d), 1);
+}
+#endif
+
+static int
+do_test (void)
+{
+  check_type<float> ();
+  check_type<double> ();
+  check_type<long double> ();
+#if __HAVE_DISTINCT_FLOAT128
+  check_float128 ();
+#endif
+  return errors;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile
index 77617b670a..19adbfa1c1 100644
--- a/sysdeps/powerpc/powerpc64le/Makefile
+++ b/sysdeps/powerpc/powerpc64le/Makefile
@@ -16,6 +16,7 @@ $(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128
 $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128
 $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += -mfloat128
 CFLAGS-libm-test-support-float128.c += -mfloat128
+CFLAGS-test-math-issignaling.cc += -mfloat128
 $(objpfx)test-float128% $(objpfx)test-ifloat128%: \
   gnulib-tests += $(f128-loader-link)
 endif
-- 
2.14.1


From 35dded99a89db873b06270ca7f21245a0faf712a Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Wed, 23 Aug 2017 10:16:54 -0300
Subject: [PATCH 17/90] Fix the C++ version of issignaling when
 __NO_LONG_DOUBLE_MATH is defined

When __NO_LONG_DOUBLE_MATH is defined, __issignalingl is not available,
thus issignaling with long double argument should call __issignaling,
instead.

Tested for powerpc64le.

	* math/math.h [defined __cplusplus] (issignaling): In the long
	double case, call __issignalingl only if __NO_LONG_DOUBLE_MATH
	is not defined.  Call __issignaling, otherwise.

(cherry picked from commit 3d7b66f66cb223e899a7ebc0f4c20f13e711c9e0)
---
 ChangeLog   |  6 ++++++
 math/math.h | 10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 527026ba5d..04b56b555c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-24  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* math/math.h [defined __cplusplus] (issignaling): In the long
+	double case, call __issignalingl only if __NO_LONG_DOUBLE_MATH
+	is not defined.  Call __issignaling, otherwise.
+
 2017-08-22  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	* math/math.h [defined __cplusplus] (issignaling): Provide a C++
diff --git a/math/math.h b/math/math.h
index add86af724..60dfa31592 100644
--- a/math/math.h
+++ b/math/math.h
@@ -486,7 +486,15 @@ enum
 extern "C++" {
 inline int issignaling (float __val) { return __issignalingf (__val); }
 inline int issignaling (double __val) { return __issignaling (__val); }
-inline int issignaling (long double __val) { return __issignalingl (__val); }
+inline int
+issignaling (long double __val)
+{
+#  ifdef __NO_LONG_DOUBLE_MATH
+  return __issignaling (__val);
+#  else
+  return __issignalingl (__val);
+#  endif
+}
 #  if __HAVE_DISTINCT_FLOAT128
 inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
 #  endif
-- 
2.14.1


From 58270c0049404ef2f878fdd45df55f17f0b8c1f7 Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Tue, 22 Aug 2017 16:34:42 -0300
Subject: [PATCH 18/90] Provide a C++ version of iszero that does not use
 __MATH_TG (bug 21930)

When signaling nans are enabled (with -fsignaling-nans), the C++ version
of iszero uses the fpclassify macro, which is defined with __MATH_TG.
However, when support for float128 is available, __MATH_TG uses the
builtin __builtin_types_compatible_p, which is only available in C mode.

This patch refactors the C++ version of iszero so that it uses function
overloading to select between the floating-point types, instead of
relying on fpclassify and __MATH_TG.

Tested for powerpc64le, s390x, x86_64, and with build-many-glibcs.py.

	[BZ #21930]
	* math/math.h [defined __cplusplus && defined __SUPPORT_SNAN__]
	(iszero): New C++ implementation that does not use
	fpclassify/__MATH_TG/__builtin_types_compatible_p, when
	signaling nans are enabled, since __builtin_types_compatible_p
	is a C-only feature.
	* math/test-math-iszero.cc: When __HAVE_DISTINCT_FLOAT128 is
	defined, include ieee754_float128.h for access to the union and
	member ieee854_float128.ieee.
	[__HAVE_DISTINCT_FLOAT128] (do_test): Call check_float128.
	[__HAVE_DISTINCT_FLOAT128] (check_float128): New function.
	* sysdeps/powerpc/powerpc64le/Makefile [subdir == math]
	(CXXFLAGS-test-math-iszero.cc): Add -mfloat128 to the build
	options of test-math-zero on powerpc64le.

(cherry picked from commit 42496114ec0eb7d6d039d05d4262e109951c600c)
---
 ChangeLog                            | 17 ++++++++
 math/math.h                          | 33 +++++++++++++--
 math/test-math-iszero.cc             | 79 ++++++++++++++++++++++++++++++++++++
 sysdeps/powerpc/powerpc64le/Makefile |  3 +-
 4 files changed, 127 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 04b56b555c..23ded7f03d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2017-08-28  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	[BZ #21930]
+	* math/math.h [defined __cplusplus && defined __SUPPORT_SNAN__]
+	(iszero): New C++ implementation that does not use
+	fpclassify/__MATH_TG/__builtin_types_compatible_p, when
+	signaling nans are enabled, since __builtin_types_compatible_p
+	is a C-only feature.
+	* math/test-math-iszero.cc: When __HAVE_DISTINCT_FLOAT128 is
+	defined, include ieee754_float128.h for access to the union and
+	member ieee854_float128.ieee.
+	[__HAVE_DISTINCT_FLOAT128] (do_test): Call check_float128.
+	[__HAVE_DISTINCT_FLOAT128] (check_float128): New function.
+	* sysdeps/powerpc/powerpc64le/Makefile [subdir == math]
+	(CXXFLAGS-test-math-iszero.cc): Add -mfloat128 to the build
+	options of test-math-zero on powerpc64le.
+
 2017-08-24  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	* math/math.h [defined __cplusplus] (issignaling): In the long
diff --git a/math/math.h b/math/math.h
index 60dfa31592..7c0fc6dbb3 100644
--- a/math/math.h
+++ b/math/math.h
@@ -513,15 +513,40 @@ inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
 #  endif
 # else	/* __cplusplus */
 extern "C++" {
+#  ifdef __SUPPORT_SNAN__
+inline int
+iszero (float __val)
+{
+  return __fpclassifyf (__val) == FP_ZERO;
+}
+inline int
+iszero (double __val)
+{
+  return __fpclassify (__val) == FP_ZERO;
+}
+inline int
+iszero (long double __val)
+{
+#   ifdef __NO_LONG_DOUBLE_MATH
+  return __fpclassify (__val) == FP_ZERO;
+#   else
+  return __fpclassifyl (__val) == FP_ZERO;
+#   endif
+}
+#   if __HAVE_DISTINCT_FLOAT128
+inline int
+iszero (_Float128 __val)
+{
+  return __fpclassifyf128 (__val) == FP_ZERO;
+}
+#   endif
+#  else
 template <class __T> inline bool
 iszero (__T __val)
 {
-#  ifdef __SUPPORT_SNAN__
-  return fpclassify (__val) == FP_ZERO;
-#  else
   return __val == 0;
-#  endif
 }
+#  endif
 } /* extern C++ */
 # endif	/* __cplusplus */
 #endif /* Use IEC_60559_BFP_EXT.  */
diff --git a/math/test-math-iszero.cc b/math/test-math-iszero.cc
index 027e972654..5c07261626 100644
--- a/math/test-math-iszero.cc
+++ b/math/test-math-iszero.cc
@@ -22,6 +22,13 @@
 
 #include <limits>
 
+/* Support for _Float128 in std::numeric_limits is limited.
+   Include ieee754_float128.h and use the bitfields in the union
+   ieee854_float128.ieee_nan to build corner-case inputs.  */
+#if __HAVE_DISTINCT_FLOAT128
+# include <ieee754_float128.h>
+#endif
+
 static bool errors;
 
 static void
@@ -72,12 +79,84 @@ check_type ()
          std::numeric_limits<T>::has_denorm == std::denorm_absent);
 }
 
+#if __HAVE_DISTINCT_FLOAT128
+static void
+check_float128 ()
+{
+  ieee854_float128 q;
+
+  q.d = 0.0Q;
+  CHECK (iszero (q.d), 1);
+  q.d = -0.0Q;
+  CHECK (iszero (q.d), 1);
+  q.d = 1.0Q;
+  CHECK (iszero (q.d), 0);
+  q.d = -1.0Q;
+  CHECK (iszero (q.d), 0);
+
+  /* Normal min.  */
+  q.ieee.negative = 0;
+  q.ieee.exponent = 0x0001;
+  q.ieee.mantissa0 = 0x0000;
+  q.ieee.mantissa1 = 0x00000000;
+  q.ieee.mantissa2 = 0x00000000;
+  q.ieee.mantissa3 = 0x00000000;
+  CHECK (iszero (q.d), 0);
+  q.ieee.negative = 1;
+  CHECK (iszero (q.d), 0);
+
+  /* Normal max.  */
+  q.ieee.negative = 0;
+  q.ieee.exponent = 0x7FFE;
+  q.ieee.mantissa0 = 0xFFFF;
+  q.ieee.mantissa1 = 0xFFFFFFFF;
+  q.ieee.mantissa2 = 0xFFFFFFFF;
+  q.ieee.mantissa3 = 0xFFFFFFFF;
+  CHECK (iszero (q.d), 0);
+  q.ieee.negative = 1;
+  CHECK (iszero (q.d), 0);
+
+  /* Infinity.  */
+  q.ieee.negative = 0;
+  q.ieee.exponent = 0x7FFF;
+  q.ieee.mantissa0 = 0x0000;
+  q.ieee.mantissa1 = 0x00000000;
+  q.ieee.mantissa2 = 0x00000000;
+  q.ieee.mantissa3 = 0x00000000;
+  CHECK (iszero (q.d), 0);
+
+  /* Quiet NaN.  */
+  q.ieee_nan.quiet_nan = 1;
+  q.ieee_nan.mantissa0 = 0x0000;
+  CHECK (iszero (q.d), 0);
+
+  /* Signaling NaN.  */
+  q.ieee_nan.quiet_nan = 0;
+  q.ieee_nan.mantissa0 = 0x4000;
+  CHECK (iszero (q.d), 0);
+
+  /* Denormal min.  */
+  q.ieee.negative = 0;
+  q.ieee.exponent = 0x0000;
+  q.ieee.mantissa0 = 0x0000;
+  q.ieee.mantissa1 = 0x00000000;
+  q.ieee.mantissa2 = 0x00000000;
+  q.ieee.mantissa3 = 0x00000001;
+  CHECK (iszero (q.d), 0);
+  q.ieee.negative = 1;
+  CHECK (iszero (q.d), 0);
+}
+#endif
+
 static int
 do_test (void)
 {
   check_type<float> ();
   check_type<double> ();
   check_type<long double> ();
+#if __HAVE_DISTINCT_FLOAT128
+  check_float128 ();
+#endif
   return errors;
 }
 
diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile
index 19adbfa1c1..dea2290736 100644
--- a/sysdeps/powerpc/powerpc64le/Makefile
+++ b/sysdeps/powerpc/powerpc64le/Makefile
@@ -17,7 +17,8 @@ $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -
 $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += -mfloat128
 CFLAGS-libm-test-support-float128.c += -mfloat128
 CFLAGS-test-math-issignaling.cc += -mfloat128
-$(objpfx)test-float128% $(objpfx)test-ifloat128%: \
+CFLAGS-test-math-iszero.cc += -mfloat128
+$(objpfx)test-float128% $(objpfx)test-ifloat128% $(objpfx)test-math-iszero: \
   gnulib-tests += $(f128-loader-link)
 endif
 
-- 
2.14.1


From 947e2e0a9410c18eb44144456c7fe8e7c0e2a999 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Tue, 22 Aug 2017 00:30:51 +0000
Subject: [PATCH 19/90] Fix position of tests-unsupported definition in
 assert/Makefile.

tests-unsupported has to be defined before the inclusion of Rules in a
subdirectory Makefile; otherwise it is ineffective.  This patch fixes
the ordering in assert/Makefile, where a recent test addition put
tests-unsupported too late (resulting in build failures when the C++
compiler was missing or broken, and thereby showing up the unrelated
bug 21987).

Incidentally, I don't see why these tests depend on
$(have-cxx-thread_local) rather than just a working C++ compiler.

Tested in such a configuration (broken compiler/libstdc++) with
build-many-glibcs.py.

	* assert/Makefile [$(have-cxx-thread_local)]: Move conditional
	variable definitions above inclusion of ../Rules.

(cherry picked from commit 75dfe623df945db7dd3c12a206d743c45c16b5ed)
---
 ChangeLog       | 5 +++++
 assert/Makefile | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 23ded7f03d..87fa54c57b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-22  Joseph Myers  <joseph@codesourcery.com>
+
+	* assert/Makefile [$(have-cxx-thread_local)]: Move conditional
+	variable definitions above inclusion of ../Rules.
+
 2017-08-28  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	[BZ #21930]
diff --git a/assert/Makefile b/assert/Makefile
index 9ec1be81a9..222ab516f0 100644
--- a/assert/Makefile
+++ b/assert/Makefile
@@ -27,8 +27,6 @@ headers	:= assert.h
 routines := assert assert-perr __assert
 tests := test-assert test-assert-perr tst-assert-c++ tst-assert-g++
 
-include ../Rules
-
 ifeq ($(have-cxx-thread_local),yes)
 CFLAGS-tst-assert-c++.o = -std=c++11
 LDLIBS-tst-assert-c++ = -lstdc++
@@ -37,3 +35,5 @@ LDLIBS-tst-assert-g++ = -lstdc++
 else
 tests-unsupported += tst-assert-c++ tst-assert-g++
 endif
+
+include ../Rules
-- 
2.14.1


From 4fdd75e4463801b9d8f329769df1a26145560656 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Tue, 8 Aug 2017 18:48:05 +0200
Subject: [PATCH 20/90] getaddrinfo: Remove unreachable return statement from
 gaih_inet

(cherry picked from commit 0df595b23a829c9169ec418a19eef9006b4ae801)
---
 ChangeLog                   |  5 +++++
 sysdeps/posix/getaddrinfo.c | 10 +++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 87fa54c57b..591c753fcc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-08  Florian Weimer  <fweimer@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Remove unreachable
+	return statement.
+
 2017-08-22  Joseph Myers  <joseph@codesourcery.com>
 
 	* assert/Makefile [$(have-cxx-thread_local)]: Move conditional
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 699411cc92..09f85fc472 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -420,13 +420,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    alloca_account (sizeof (struct gaih_servtuple),
 				    alloca_used);
 
-		  if ((rc = gaih_inet_serv (service->name,
-					    tp, req, newp, tmpbuf)))
-		    {
-		      if (rc)
-			continue;
-		      return rc;
-		    }
+		  if (gaih_inet_serv (service->name,
+				      tp, req, newp, tmpbuf) != 0)
+		    continue;
 
 		  *pst = newp;
 		  pst = &(newp->next);
-- 
2.14.1


From 5253749232749adb535d9b2bf7d43173b191ebef Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Mon, 4 Sep 2017 11:44:10 +0200
Subject: [PATCH 21/90] Synchronize support/ infrastructure with master

This commit updates the support/ subdirectory to
commit 65329bd233db9d1b8b94e90734a564705b619260
on the master branch.
---
 support/namespace.h      | 11 ++++++++---
 support/support_chroot.c | 32 +++++++++++++++++++++++---------
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/support/namespace.h b/support/namespace.h
index 859c2fda3f..9eddb1a0e9 100644
--- a/support/namespace.h
+++ b/support/namespace.h
@@ -66,7 +66,9 @@ struct support_chroot_configuration
 {
   /* File contents.  The files are not created if the field is
      NULL.  */
-  const char *resolv_conf;
+  const char *resolv_conf;      /* /etc/resolv.conf.  */
+  const char *hosts;            /* /etc/hosts.  */
+  const char *host_conf;        /* /etc/host.conf.  */
 };
 
 /* The result of the creation of a chroot.  */
@@ -78,8 +80,11 @@ struct support_chroot
   /* Path to the chroot directory.  */
   char *path_chroot;
 
-  /* Path to the /etc/resolv.conf file.  */
-  char *path_resolv_conf;
+  /* Paths to files in the chroot.  These are absolute and outside of
+     the chroot.  */
+  char *path_resolv_conf;       /* /etc/resolv.conf.  */
+  char *path_hosts;             /* /etc/hosts.  */
+  char *path_host_conf;         /* /etc/host.conf.  */
 };
 
 /* Create a chroot environment.  The returned data should be freed
diff --git a/support/support_chroot.c b/support/support_chroot.c
index c0807b313a..f3ef551b05 100644
--- a/support/support_chroot.c
+++ b/support/support_chroot.c
@@ -24,6 +24,23 @@
 #include <support/test-driver.h>
 #include <support/xunistd.h>
 
+/* If CONTENTS is not NULL, write it to the file at DIRECTORY/RELPATH,
+   and store the name in *ABSPATH.  If CONTENTS is NULL, store NULL in
+   *ABSPATH.  */
+static void
+write_file (const char *directory, const char *relpath, const char *contents,
+            char **abspath)
+{
+  if (contents != NULL)
+    {
+      *abspath = xasprintf ("%s/%s", directory, relpath);
+      add_temp_file (*abspath);
+      support_write_file_string (*abspath, contents);
+    }
+  else
+    *abspath = NULL;
+}
+
 struct support_chroot *
 support_chroot_create (struct support_chroot_configuration conf)
 {
@@ -39,15 +56,10 @@ support_chroot_create (struct support_chroot_configuration conf)
   xmkdir (path_etc, 0777);
   add_temp_file (path_etc);
 
-  if (conf.resolv_conf != NULL)
-    {
-      /* Create an empty resolv.conf file.  */
-      chroot->path_resolv_conf = xasprintf ("%s/resolv.conf", path_etc);
-      add_temp_file (chroot->path_resolv_conf);
-      support_write_file_string (chroot->path_resolv_conf, conf.resolv_conf);
-    }
-  else
-    chroot->path_resolv_conf = NULL;
+  write_file (path_etc, "resolv.conf", conf.resolv_conf,
+              &chroot->path_resolv_conf);
+  write_file (path_etc, "hosts", conf.hosts, &chroot->path_hosts);
+  write_file (path_etc, "host.conf", conf.host_conf, &chroot->path_host_conf);
 
   free (path_etc);
 
@@ -67,5 +79,7 @@ support_chroot_free (struct support_chroot *chroot)
 {
   free (chroot->path_chroot);
   free (chroot->path_resolv_conf);
+  free (chroot->path_hosts);
+  free (chroot->path_host_conf);
   free (chroot);
 }
-- 
2.14.1


From bdd8422cfb1fe04cb20617495156fb232b00d23c Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 1 Sep 2017 08:56:46 +0200
Subject: [PATCH 22/90] getaddrinfo: Use &errno has the errno pointer

Similar code in nss/getXXbyYY_r.c is already using &errno as the
argument.

(cherry picked from commit 924b121c5978689001ae28cf1c8497371dad4f71)
---
 ChangeLog                   |  6 ++++++
 sysdeps/posix/getaddrinfo.c | 23 ++++++++++-------------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 591c753fcc..04304bb929 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gethosts): Use errno directly.
+	(getcanonname): Likewise.
+	(gaih_inet): Likewise.
+
 2017-08-08  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Remove unreachable
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 09f85fc472..1a16820b7e 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -247,11 +247,10 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
   char *localcanon = NULL;						      \
   no_data = 0;								      \
   while (1) {								      \
-    rc = 0;								      \
     status = DL_CALL_FCT (fct, (name, _family, &th,			      \
 				tmpbuf->data, tmpbuf->length,		      \
-				&rc, &herrno, NULL, &localcanon));	      \
-    if (rc != ERANGE || herrno != NETDB_INTERNAL)			      \
+				&errno, &herrno, NULL, &localcanon));	      \
+    if (errno != ERANGE || herrno != NETDB_INTERNAL)			      \
       break;								      \
     if (!scratch_buffer_grow (tmpbuf))					      \
       {									      \
@@ -261,11 +260,11 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
 	goto free_and_return;						      \
       }									      \
   }									      \
-  if (status == NSS_STATUS_SUCCESS && rc == 0)				      \
+  if (status == NSS_STATUS_SUCCESS && errno == 0)			      \
     h = &th;								      \
   else									      \
     h = NULL;								      \
-  if (rc != 0)								      \
+  if (errno != 0)							      \
     {									      \
       if (herrno == NETDB_INTERNAL)					      \
 	{								      \
@@ -335,9 +334,8 @@ getcanonname (service_user *nip, struct gaih_addrtuple *at, const char *name)
     {
       char buf[256];
       int herrno;
-      int rc;
       if (DL_CALL_FCT (cfct, (at->name ?: name, buf, sizeof (buf),
-			      &s, &rc, &herrno)) != NSS_STATUS_SUCCESS)
+			      &s, &errno, &herrno)) != NSS_STATUS_SUCCESS)
 	/* If the canonical name cannot be determined, use the passed
 	   string.  */
 	s = (char *) name;
@@ -353,7 +351,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
   const struct gaih_typeproto *tp = gaih_inet_typeproto;
   struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
   struct gaih_addrtuple *at = NULL;
-  int rc;
   bool got_ipv6 = false;
   const char *canon = NULL;
   const char *orig_name = name;
@@ -395,7 +392,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      st = (struct gaih_servtuple *)
 		alloca_account (sizeof (struct gaih_servtuple), alloca_used);
 
-	      if ((rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf)))
+	      int rc = gaih_inet_serv (service->name, tp, req, st, tmpbuf);
+	      if (__glibc_unlikely (rc != 0))
 		return rc;
 	    }
 	  else
@@ -495,7 +493,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	    idn_flags |= IDNA_USE_STD3_ASCII_RULES;
 
 	  char *p = NULL;
-	  rc = __idna_to_ascii_lz (name, &p, idn_flags);
+	  int rc = __idna_to_ascii_lz (name, &p, idn_flags);
 	  if (rc != IDNA_SUCCESS)
 	    {
 	      /* No need to jump to free_and_return here.  */
@@ -793,15 +791,14 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
 		  while (1)
 		    {
-		      rc = 0;
 		      status = DL_CALL_FCT (fct4, (name, pat,
 						   tmpbuf->data, tmpbuf->length,
-						   &rc, &herrno,
+						   &errno, &herrno,
 						   NULL));
 		      if (status == NSS_STATUS_SUCCESS)
 			break;
 		      if (status != NSS_STATUS_TRYAGAIN
-			  || rc != ERANGE || herrno != NETDB_INTERNAL)
+			  || errno != ERANGE || herrno != NETDB_INTERNAL)
 			{
 			  if (herrno == TRY_AGAIN)
 			    no_data = EAI_AGAIN;
-- 
2.14.1


From 701f7873da013fb19d9120317322cd78333e63c2 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 1 Sep 2017 08:57:07 +0200
Subject: [PATCH 23/90] getaddrinfo: Use &h_errno has the h_errno pointer

This simplifies the code because it is not necessary to propagate the
temporary h_errno value to the thread-local variable.  It also increases
compatibility with NSS modules which update only one of the two places.

(cherry picked from commit 53250a21b81474ef4e78090a4a9a63d8471e1091)
---
 ChangeLog                   |  6 ++++++
 sysdeps/posix/getaddrinfo.c | 46 ++++++++++++++++++---------------------------
 2 files changed, 24 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 04304bb929..d53c8fe083 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gethosts): Use h_errno directly.
+	(getcanonname): Likewise.
+	(gaih_inet): Likewise.
+
 2017-09-01  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gethosts): Use errno directly.
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 1a16820b7e..076e1fa62b 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -241,7 +241,6 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
 
 #define gethosts(_family, _type) \
  {									      \
-  int herrno;								      \
   struct hostent th;							      \
   struct hostent *h;							      \
   char *localcanon = NULL;						      \
@@ -249,8 +248,8 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
   while (1) {								      \
     status = DL_CALL_FCT (fct, (name, _family, &th,			      \
 				tmpbuf->data, tmpbuf->length,		      \
-				&errno, &herrno, NULL, &localcanon));	      \
-    if (errno != ERANGE || herrno != NETDB_INTERNAL)			      \
+				&errno, &h_errno, NULL, &localcanon));	      \
+    if (errno != ERANGE || h_errno != NETDB_INTERNAL)			      \
       break;								      \
     if (!scratch_buffer_grow (tmpbuf))					      \
       {									      \
@@ -266,18 +265,17 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
     h = NULL;								      \
   if (errno != 0)							      \
     {									      \
-      if (herrno == NETDB_INTERNAL)					      \
+      if (h_errno == NETDB_INTERNAL)					      \
 	{								      \
-	  __set_h_errno (herrno);					      \
 	  __resolv_context_enable_inet6 (res_ctx, res_enable_inet6);	      \
 	  __resolv_context_put (res_ctx);				      \
 	  result = -EAI_SYSTEM;						      \
 	  goto free_and_return;						      \
 	}								      \
-      if (herrno == TRY_AGAIN)						      \
+      if (h_errno == TRY_AGAIN)						      \
 	no_data = EAI_AGAIN;						      \
       else								      \
-	no_data = herrno == NO_DATA;					      \
+	no_data = h_errno == NO_DATA;					      \
     }									      \
   else if (h != NULL)							      \
     {									      \
@@ -333,9 +331,8 @@ getcanonname (service_user *nip, struct gaih_addrtuple *at, const char *name)
   if (cfct != NULL)
     {
       char buf[256];
-      int herrno;
       if (DL_CALL_FCT (cfct, (at->name ?: name, buf, sizeof (buf),
-			      &s, &errno, &herrno)) != NSS_STATUS_SUCCESS)
+			      &s, &errno, &h_errno)) != NSS_STATUS_SUCCESS)
 	/* If the canonical name cannot be determined, use the passed
 	   string.  */
 	s = (char *) name;
@@ -594,14 +591,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      int rc;
 	      struct hostent th;
 	      struct hostent *h;
-	      int herrno;
 
 	      while (1)
 		{
 		  rc = __gethostbyname2_r (name, AF_INET, &th,
 					   tmpbuf->data, tmpbuf->length,
-					   &h, &herrno);
-		  if (rc != ERANGE || herrno != NETDB_INTERNAL)
+					   &h, &h_errno);
+		  if (rc != ERANGE || h_errno != NETDB_INTERNAL)
 		    break;
 		  if (!scratch_buffer_grow (tmpbuf))
 		    {
@@ -626,12 +622,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		}
 	      else
 		{
-		  if (herrno == NETDB_INTERNAL)
-		    {
-		      __set_h_errno (herrno);
-		      result = -EAI_SYSTEM;
-		    }
-		  else if (herrno == TRY_AGAIN)
+		  if (h_errno == NETDB_INTERNAL)
+		    result = -EAI_SYSTEM;
+		  else if (h_errno == TRY_AGAIN)
 		    result = -EAI_AGAIN;
 		  else
 		    /* We made requests but they turned out no data.
@@ -654,8 +647,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	    {
 	      /* Try to use nscd.  */
 	      struct nscd_ai_result *air = NULL;
-	      int herrno;
-	      int err = __nscd_getai (name, &air, &herrno);
+	      int err = __nscd_getai (name, &air, &h_errno);
 	      if (air != NULL)
 		{
 		  /* Transform into gaih_addrtuple list.  */
@@ -746,9 +738,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		goto free_and_return;
 	      else if (__nss_not_use_nscd_hosts == 0)
 		{
-		  if (herrno == NETDB_INTERNAL && errno == ENOMEM)
+		  if (h_errno == NETDB_INTERNAL && errno == ENOMEM)
 		    result = -EAI_MEMORY;
-		  else if (herrno == TRY_AGAIN)
+		  else if (h_errno == TRY_AGAIN)
 		    result = -EAI_AGAIN;
 		  else
 		    result = -EAI_SYSTEM;
@@ -787,23 +779,21 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
 	      if (fct4 != NULL)
 		{
-		  int herrno;
-
 		  while (1)
 		    {
 		      status = DL_CALL_FCT (fct4, (name, pat,
 						   tmpbuf->data, tmpbuf->length,
-						   &errno, &herrno,
+						   &errno, &h_errno,
 						   NULL));
 		      if (status == NSS_STATUS_SUCCESS)
 			break;
 		      if (status != NSS_STATUS_TRYAGAIN
-			  || errno != ERANGE || herrno != NETDB_INTERNAL)
+			  || errno != ERANGE || h_errno != NETDB_INTERNAL)
 			{
-			  if (herrno == TRY_AGAIN)
+			  if (h_errno == TRY_AGAIN)
 			    no_data = EAI_AGAIN;
 			  else
-			    no_data = herrno == NO_DATA;
+			    no_data = h_errno == NO_DATA;
 			  break;
 			}
 
-- 
2.14.1


From 8f46c6052408a23a77ecf46aa378120c1a4afe37 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 1 Sep 2017 08:57:28 +0200
Subject: [PATCH 24/90] getaddrinfo: Properly set errno for NSS function lookup
 failure

(cherry picked from commit ad816a5e00ce891a2cea8187638fa0e00f83aaf6)
---
 ChangeLog                   |  5 +++++
 sysdeps/posix/getaddrinfo.c | 16 ++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d53c8fe083..2f959d4c36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Make reporting of NSS
+	function lookup failures more reliable.
+
 2017-09-01  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gethosts): Use h_errno directly.
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 076e1fa62b..eaf8bafcf4 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -923,13 +923,17 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		    }
 		  else
 		    {
+		      /* Could not locate any of the lookup functions.
+			 The NSS lookup code does not consistently set
+			 errno, so we need to supply our own error
+			 code here.  The root cause could either be a
+			 resource allocation failure, or a missing
+			 service function in the DSO (so it should not
+			 be listed in /etc/nsswitch.conf).  Assume the
+			 former, and return EBUSY.  */
 		      status = NSS_STATUS_UNAVAIL;
-		      /* Could not load any of the lookup functions.  Indicate
-		         an internal error if the failure was due to a system
-			 error other than the file not being found.  We use the
-			 errno from the last failed callback.  */
-		      if (errno != 0 && errno != ENOENT)
-			__set_h_errno (NETDB_INTERNAL);
+		     __set_h_errno (NETDB_INTERNAL);
+		     __set_errno (EBUSY);
 		    }
 		}
 
-- 
2.14.1


From 7ab87bccb657b02cac5a3360b11c67aff901de2e Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 1 Sep 2017 08:57:52 +0200
Subject: [PATCH 25/90] getaddrinfo: In gaih_inet, use h_errno for certain
 status values only

h_errno is not set for NSS_STATUS_SUCCESS, so its value might not be
accurate at this point.

(cherry picked from commit a2881ef01450295782b065f2f850f340d5c12c14)
---
 ChangeLog                   | 5 +++++
 sysdeps/posix/getaddrinfo.c | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2f959d4c36..c58cd5ccd0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Only use h_errno if
+	status indicates it is set.
+
 2017-09-01  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Make reporting of NSS
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index eaf8bafcf4..9d9e7e2bf2 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -949,7 +949,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	  __resolv_context_enable_inet6 (res_ctx, res_enable_inet6);
 	  __resolv_context_put (res_ctx);
 
-	  if (h_errno == NETDB_INTERNAL)
+	  /* If we have a failure which sets errno, report it using
+	     EAI_SYSTEM.  */
+	  if ((status == NSS_STATUS_TRYAGAIN || status == NSS_STATUS_UNAVAIL)
+	      && h_errno == NETDB_INTERNAL)
 	    {
 	      result = -EAI_SYSTEM;
 	      goto free_and_return;
-- 
2.14.1


From 7966331555df43bb7e2a55ce5a17a330e57f487f Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Mon, 4 Sep 2017 11:25:34 +0200
Subject: [PATCH 26/90] getaddrinfo: Return EAI_NODATA if gethostbyname2_r
 reports NO_DATA [BZ #21922]

(cherry picked from commit 5f8340f583fe3d4f5734bd2371c5a45ecff2db0d)
---
 ChangeLog                   | 6 ++++++
 NEWS                        | 1 +
 sysdeps/posix/getaddrinfo.c | 8 ++++++++
 3 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c58cd5ccd0..f46bbb7c0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #21922]
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): Report EAI_NODATA error
+	coming from gethostbyname2_r.
+
 2017-09-01  Florian Weimer  <fweimer@redhat.com>
 
 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Only use h_errno if
diff --git a/NEWS b/NEWS
index 756e849643..97eb21e868 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ The following bugs are resolved with this release:
   [21780] posix: Set p{read,write}v2 to return ENOTSUP
   [21871] x86-64: Use _dl_runtime_resolve_opt only with AVX512F
   [21885] getaddrinfo: Release resolver context on error in gethosts
+  [21922] getaddrinfo with AF_INET(6) returns EAI_NONAME, not EAI_NODATA
   [21930] Do not use __builtin_types_compatible_p in C++ mode
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
   [21941] powerpc: Restrict xssqrtqp operands to Vector Registers
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 9d9e7e2bf2..0cf87c224d 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -619,6 +619,14 @@ gaih_inet (const char *name, const struct gaih_service *service,
 			}
 		      *pat = addrmem;
 		    }
+		  else
+		    {
+		      if (h_errno == NO_DATA)
+			result = -EAI_NODATA;
+		      else
+			result = -EAI_NONAME;
+		      goto free_and_return;
+		    }
 		}
 	      else
 		{
-- 
2.14.1


From a71a3374cd8cf53776c33994f69ec184c26f2129 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Mon, 4 Sep 2017 11:27:24 +0200
Subject: [PATCH 27/90] getaddrinfo: Fix error handling in gethosts [BZ #21915]
 [BZ #21922]

The old code uses errno as the primary indicator for success or
failure.  This is wrong because errno is only set for specific
combinations of the status return value and the h_errno variable.

(cherry picked from commit f4a6be2582b8dfe8adfa68da3dd8decf566b3983)
---
 ChangeLog                        |  14 +++++
 NEWS                             |   1 +
 nss/Makefile                     |   7 +++
 nss/tst-nss-files-hosts-erange.c | 109 +++++++++++++++++++++++++++++++++++++++
 resolv/tst-resolv-basic.c        |  78 +++++++++++++++++++---------
 sysdeps/posix/getaddrinfo.c      |  42 +++++++--------
 6 files changed, 206 insertions(+), 45 deletions(-)
 create mode 100644 nss/tst-nss-files-hosts-erange.c

diff --git a/ChangeLog b/ChangeLog
index f46bbb7c0d..3e32d14dbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2017-09-01  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #21915]
+	[BZ #21922]
+	* sysdeps/posix/getaddrinfo.c (gethosts): Look at NSS function
+	result to determine success or failure, not the errno value.
+	* nss/Makefile (tests): Add tst-nss-files-hosts-erange.
+	(tst-nss-files-hosts-erange): Link with -ldl.
+	* nss/tst-nss-files-hosts-erange.c: New file.
+	* nss/tst-resolv-basic.c (response): Handle nodata.example.
+	(do_test): Add NO_DATA tests.
+	* resolv/tst-resolv-basic.c (test_nodata_nxdomain): New function.
+	(do_test): Call it.
+
 2017-09-01  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #21922]
diff --git a/NEWS b/NEWS
index 97eb21e868..8fbf4241d1 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ The following bugs are resolved with this release:
   [21780] posix: Set p{read,write}v2 to return ENOTSUP
   [21871] x86-64: Use _dl_runtime_resolve_opt only with AVX512F
   [21885] getaddrinfo: Release resolver context on error in gethosts
+  [21915] getaddrinfo: incorrect result handling for NSS service modules
   [21922] getaddrinfo with AF_INET(6) returns EAI_NONAME, not EAI_NODATA
   [21930] Do not use __builtin_types_compatible_p in C++ mode
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
diff --git a/nss/Makefile b/nss/Makefile
index d9f6d41181..91b1c21567 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -58,6 +58,11 @@ tests			= test-netdb test-digits-dots tst-nss-getpwent bug17079 \
 			  tst-nss-test5
 xtests			= bug-erange
 
+# Tests which need libdl
+ifeq (yes,$(build-shared))
+tests += tst-nss-files-hosts-erange
+endif
+
 # If we have a thread library then we can test cancellation against
 # some routines like getpwuid_r.
 ifeq (yes,$(have-thread-library))
@@ -154,3 +159,5 @@ $(patsubst %,$(objpfx)%.out,$(tests)) : \
 ifeq (yes,$(have-thread-library))
 $(objpfx)tst-cancel-getpwuid_r: $(shared-thread-library)
 endif
+
+$(objpfx)tst-nss-files-hosts-erange: $(libdl)
diff --git a/nss/tst-nss-files-hosts-erange.c b/nss/tst-nss-files-hosts-erange.c
new file mode 100644
index 0000000000..beb7aa9fa0
--- /dev/null
+++ b/nss/tst-nss-files-hosts-erange.c
@@ -0,0 +1,109 @@
+/* Parse /etc/hosts in multi mode with a trailing long line (bug 21915).
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#include <dlfcn.h>
+#include <errno.h>
+#include <gnu/lib-names.h>
+#include <netdb.h>
+#include <nss.h>
+#include <support/check.h>
+#include <support/check_nss.h>
+#include <support/namespace.h>
+#include <support/test-driver.h>
+#include <support/xunistd.h>
+
+struct support_chroot *chroot_env;
+
+#define X10 "XXXXXXXXXX"
+#define X100 X10 X10 X10 X10 X10 X10 X10 X10 X10 X10
+#define X1000 X100 X100 X100 X100 X100 X100 X100 X100 X100 X100
+
+static void
+prepare (int argc, char **argv)
+{
+  chroot_env = support_chroot_create
+    ((struct support_chroot_configuration)
+     {
+       .resolv_conf = "",
+       .hosts =
+         "127.0.0.1   localhost localhost.localdomain\n"
+         "::1         localhost localhost.localdomain\n"
+         "192.0.2.1   example.com\n"
+         "#" X1000 X100 "\n",
+       .host_conf = "multi on\n",
+     });
+}
+
+static int
+do_test (void)
+{
+  support_become_root ();
+  if (!support_can_chroot ())
+    return EXIT_UNSUPPORTED;
+
+  __nss_configure_lookup ("hosts", "files");
+  if (dlopen (LIBNSS_FILES_SO, RTLD_LAZY) == NULL)
+    FAIL_EXIT1 ("could not load " LIBNSS_DNS_SO ": %s", dlerror ());
+
+  xchroot (chroot_env->path_chroot);
+
+  errno = ERANGE;
+  h_errno = NETDB_INTERNAL;
+  check_hostent ("gethostbyname example.com",
+                 gethostbyname ("example.com"),
+                 "name: example.com\n"
+                 "address: 192.0.2.1\n");
+  errno = ERANGE;
+  h_errno = NETDB_INTERNAL;
+  check_hostent ("gethostbyname2 AF_INET example.com",
+                 gethostbyname2 ("example.com", AF_INET),
+                 "name: example.com\n"
+                 "address: 192.0.2.1\n");
+  {
+    struct addrinfo hints =
+      {
+        .ai_family = AF_UNSPEC,
+        .ai_socktype = SOCK_STREAM,
+        .ai_protocol = IPPROTO_TCP,
+      };
+    errno = ERANGE;
+    h_errno = NETDB_INTERNAL;
+    struct addrinfo *ai;
+    int ret = getaddrinfo ("example.com", "80", &hints, &ai);
+    check_addrinfo ("example.com AF_UNSPEC", ai, ret,
+                    "address: STREAM/TCP 192.0.2.1 80\n");
+    if (ret == 0)
+      freeaddrinfo (ai);
+
+    hints.ai_family = AF_INET;
+    errno = ERANGE;
+    h_errno = NETDB_INTERNAL;
+    ret = getaddrinfo ("example.com", "80", &hints, &ai);
+    check_addrinfo ("example.com AF_INET", ai, ret,
+                    "address: STREAM/TCP 192.0.2.1 80\n");
+    if (ret == 0)
+      freeaddrinfo (ai);
+  }
+
+  support_chroot_free (chroot_env);
+  return 0;
+}
+
+#define PREPARE prepare
+#include <support/test-driver.c>
diff --git a/resolv/tst-resolv-basic.c b/resolv/tst-resolv-basic.c
index 64eedbbd81..66a0e8a165 100644
--- a/resolv/tst-resolv-basic.c
+++ b/resolv/tst-resolv-basic.c
@@ -50,7 +50,7 @@ response (const struct resolv_response_context *ctx,
     qname_compare = qname + 2;
   else
     qname_compare = qname;
-  enum {www, alias, nxdomain, long_name} requested_qname;
+  enum {www, alias, nxdomain, long_name, nodata} requested_qname;
   if (strcmp (qname_compare, "www.example") == 0)
     requested_qname = www;
   else if (strcmp (qname_compare, "alias.example") == 0)
@@ -59,6 +59,8 @@ response (const struct resolv_response_context *ctx,
     requested_qname = nxdomain;
   else if (strcmp (qname_compare, LONG_NAME) == 0)
     requested_qname = long_name;
+  else if (strcmp (qname_compare, "nodata.example") == 0)
+    requested_qname = nodata;
   else
     {
       support_record_failure ();
@@ -87,6 +89,8 @@ response (const struct resolv_response_context *ctx,
       resolv_response_close_record (b);
       resolv_response_open_record (b, "www.example", qclass, qtype, 0);
       break;
+    case nodata:
+      return;
     case nxdomain:
       FAIL_EXIT1 ("unreachable");
     }
@@ -267,6 +271,55 @@ test_bug_21295 (void)
     }
 }
 
+/* Run tests which do not expect any data.  */
+static void
+test_nodata_nxdomain (void)
+{
+  /* Iterate through different address families.  */
+  int families[] = { AF_UNSPEC, AF_INET, AF_INET6, -1 };
+  for (int i = 0; families[i] >= 0; ++i)
+    /* If do_tcp, prepend "t." to the name to trigger TCP
+       fallback.  */
+    for (int do_tcp = 0; do_tcp < 2; ++do_tcp)
+      /* If do_nxdomain, trigger an NXDOMAIN error (DNS failure),
+         otherwise use a NODATA response (empty but successful
+         answer).  */
+      for (int do_nxdomain = 0; do_nxdomain < 2; ++do_nxdomain)
+        {
+          int family = families[i];
+          char *name = xasprintf ("%s%s.example",
+                                  do_tcp ? "t." : "",
+                                  do_nxdomain ? "nxdomain" : "nodata");
+
+          if (family != AF_UNSPEC)
+            {
+              if (do_nxdomain)
+                check_h (name, family, "error: HOST_NOT_FOUND\n");
+              else
+                check_h (name, family, "error: NO_ADDRESS\n");
+            }
+
+          const char *expected;
+          if (do_nxdomain)
+            expected = "error: Name or service not known\n";
+          else
+            expected = "error: No address associated with hostname\n";
+
+          check_ai (name, "80", family, expected);
+
+          struct addrinfo hints =
+            {
+              .ai_family = family,
+              .ai_flags = AI_V4MAPPED | AI_ALL,
+            };
+          check_ai_hints (name, "80", hints, expected);
+          hints.ai_flags |= AI_CANONNAME;
+          check_ai_hints (name, "80", hints, expected);
+
+          free (name);
+        }
+}
+
 static int
 do_test (void)
 {
@@ -439,29 +492,8 @@ do_test (void)
             "address: DGRAM/UDP 2001:db8::4 80\n"
             "address: RAW/IP 2001:db8::4 80\n");
 
-  check_h ("nxdomain.example", AF_INET,
-           "error: HOST_NOT_FOUND\n");
-  check_h ("nxdomain.example", AF_INET6,
-           "error: HOST_NOT_FOUND\n");
-  check_ai ("nxdomain.example", "80", AF_UNSPEC,
-            "error: Name or service not known\n");
-  check_ai ("nxdomain.example", "80", AF_INET,
-            "error: Name or service not known\n");
-  check_ai ("nxdomain.example", "80", AF_INET6,
-            "error: Name or service not known\n");
-
-  check_h ("t.nxdomain.example", AF_INET,
-           "error: HOST_NOT_FOUND\n");
-  check_h ("t.nxdomain.example", AF_INET6,
-           "error: HOST_NOT_FOUND\n");
-  check_ai ("t.nxdomain.example", "80", AF_UNSPEC,
-            "error: Name or service not known\n");
-  check_ai ("t.nxdomain.example", "80", AF_INET,
-            "error: Name or service not known\n");
-  check_ai ("t.nxdomain.example", "80", AF_INET6,
-            "error: Name or service not known\n");
-
   test_bug_21295 ();
+  test_nodata_nxdomain ();
 
   resolv_test_end (aux);
 
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 0cf87c224d..2c4b6d6793 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -242,28 +242,26 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
 #define gethosts(_family, _type) \
  {									      \
   struct hostent th;							      \
-  struct hostent *h;							      \
   char *localcanon = NULL;						      \
   no_data = 0;								      \
-  while (1) {								      \
-    status = DL_CALL_FCT (fct, (name, _family, &th,			      \
-				tmpbuf->data, tmpbuf->length,		      \
-				&errno, &h_errno, NULL, &localcanon));	      \
-    if (errno != ERANGE || h_errno != NETDB_INTERNAL)			      \
-      break;								      \
-    if (!scratch_buffer_grow (tmpbuf))					      \
-      {									      \
-	__resolv_context_enable_inet6 (res_ctx, res_enable_inet6);	      \
-	__resolv_context_put (res_ctx);					      \
-	result = -EAI_MEMORY;						      \
-	goto free_and_return;						      \
-      }									      \
-  }									      \
-  if (status == NSS_STATUS_SUCCESS && errno == 0)			      \
-    h = &th;								      \
-  else									      \
-    h = NULL;								      \
-  if (errno != 0)							      \
+  while (1)								      \
+    {									      \
+      status = DL_CALL_FCT (fct, (name, _family, &th,			      \
+				  tmpbuf->data, tmpbuf->length,		      \
+				  &errno, &h_errno, NULL, &localcanon));      \
+      if (status != NSS_STATUS_TRYAGAIN || h_errno != NETDB_INTERNAL	      \
+	  || errno != ERANGE)						      \
+	break;								      \
+      if (!scratch_buffer_grow (tmpbuf))				      \
+	{								      \
+	  __resolv_context_enable_inet6 (res_ctx, res_enable_inet6);	      \
+	  __resolv_context_put (res_ctx);				      \
+	  result = -EAI_MEMORY;						      \
+	  goto free_and_return;						      \
+	}								      \
+    }									      \
+  if (status == NSS_STATUS_NOTFOUND					      \
+      || status == NSS_STATUS_TRYAGAIN || status == NSS_STATUS_UNAVAIL)	      \
     {									      \
       if (h_errno == NETDB_INTERNAL)					      \
 	{								      \
@@ -277,9 +275,9 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
       else								      \
 	no_data = h_errno == NO_DATA;					      \
     }									      \
-  else if (h != NULL)							      \
+  else if (status == NSS_STATUS_SUCCESS)				      \
     {									      \
-      if (!convert_hostent_to_gaih_addrtuple (req, _family,h, &addrmem))      \
+      if (!convert_hostent_to_gaih_addrtuple (req, _family, &th, &addrmem))   \
 	{								      \
 	  __resolv_context_enable_inet6 (res_ctx, res_enable_inet6);	      \
 	  __resolv_context_put (res_ctx);				      \
-- 
2.14.1


From 85cfe508568530eed2d9cfd34110c21721d1f99e Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 6 Sep 2017 13:43:01 +0200
Subject: [PATCH 28/90] tst-res_use_inet6: Enhance test to cover IPv4-to-IPv6
 address mapping

This requires more control over the response data, so it is now
determined by flags embedded in the query name.

(cherry picked from commit 5e9c4d17feb9910f489ad2915d0b6e00597a0f11)
---
 ChangeLog                  |  12 +++
 resolv/tst-res_use_inet6.c | 231 ++++++++++++++++++++++++++++++++++++---------
 2 files changed, 198 insertions(+), 45 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3e32d14dbf..dd71f6c427 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
+	Enhance tst-res_use_inet6 to test IPv4-to-IPv6 address mapping.
+	* resolv/tst-res_use_inet6.c (response): Process flags embedded in
+	the QNAME.
+	(test_gai): Adjust query names.  Add additional tests.
+	(test_get2_any, test_get2_no_inet6, test_get2_inet6): Split from
+	test_get2.  Adjust query names.  Add additional tests.
+	(test_no_inet6): New function, extracted from threadfunc.
+	(threadfunc): Call test_get2_any, test_get2_inet6, test_no_inet6.
+	Add additional tests.
+
 2017-09-01  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #21915]
diff --git a/resolv/tst-res_use_inet6.c b/resolv/tst-res_use_inet6.c
index 6f3db08892..1522d5c5f5 100644
--- a/resolv/tst-res_use_inet6.c
+++ b/resolv/tst-res_use_inet6.c
@@ -19,18 +19,44 @@
 #include <netdb.h>
 #include <resolv.h>
 #include <string.h>
+#include <support/check.h>
 #include <support/check_nss.h>
 #include <support/resolv_test.h>
 #include <support/xthread.h>
 
+/* Produce a response based on QNAME: Certain characters in the first
+   label of QNAME trigger the inclusion of resource records:
+
+   'a'   A record (IPv4 address)
+   'q'   AAAA record (quad A record, IPv6 address)
+   'm'   record type must match QTYPE (no additional records)
+
+   QTYPE is ignored for record type selection if 'm' is not
+   specified.  */
 static void
 response (const struct resolv_response_context *ctx,
           struct resolv_response_builder *b,
           const char *qname, uint16_t qclass, uint16_t qtype)
 {
-  bool include_both =  strcmp (qname, "both.example") == 0;
-  bool include_a = qtype == T_A || include_both;
-  bool include_aaaa = qtype == T_AAAA || include_both;
+  bool include_a = false;
+  bool include_aaaa = false;
+  bool include_match = false;
+  for (const char *p = qname; *p != '.' && *p != '\0'; ++p)
+    {
+      if (*p == 'a')
+        include_a = true;
+      else if (*p == 'q')
+        include_aaaa = true;
+      else if (*p == 'm')
+        include_match = true;
+    }
+  if (include_match)
+    {
+      if (qtype == T_A)
+        include_aaaa = false;
+      else if (qtype == T_AAAA)
+        include_a = false;
+    }
 
   resolv_response_init (b, (struct resolv_response_flags) {});
   resolv_response_add_question (b, qname, qclass, qtype);
@@ -64,16 +90,21 @@ test_gai (void)
         .ai_protocol = IPPROTO_TCP,
       };
     struct addrinfo *ai;
-    int ret = getaddrinfo ("www1.example", "80", &hints, &ai);
-    check_addrinfo ("getaddrinfo AF_UNSPEC www1.example", ai, ret,
+    int ret = getaddrinfo ("qam.example", "80", &hints, &ai);
+    check_addrinfo ("getaddrinfo AF_UNSPEC qam.example", ai, ret,
                     "address: STREAM/TCP 192.0.2.17 80\n"
                     "address: STREAM/TCP 2001:db8::1 80\n");
     if (ret == 0)
       freeaddrinfo (ai);
-    ret = getaddrinfo ("both.example", "80", &hints, &ai);
+    ret = getaddrinfo ("am.example", "80", &hints, &ai);
+    check_addrinfo ("getaddrinfo AF_UNSPEC am.example", ai, ret,
+                    "address: STREAM/TCP 192.0.2.17 80\n");
+    if (ret == 0)
+      freeaddrinfo (ai);
+    ret = getaddrinfo ("qa.example", "80", &hints, &ai);
     /* Combined A/AAAA responses currently result in address
        duplication.  */
-    check_addrinfo ("getaddrinfo AF_UNSPEC both.example", ai, ret,
+    check_addrinfo ("getaddrinfo AF_UNSPEC qa.example", ai, ret,
                     "address: STREAM/TCP 192.0.2.17 80\n"
                     "address: STREAM/TCP 192.0.2.17 80\n"
                     "address: STREAM/TCP 2001:db8::1 80\n"
@@ -89,13 +120,18 @@ test_gai (void)
         .ai_protocol = IPPROTO_TCP,
       };
     struct addrinfo *ai;
-    int ret = getaddrinfo ("www1.example", "80", &hints, &ai);
-    check_addrinfo ("getaddrinfo AF_INET www1.example", ai, ret,
+    int ret = getaddrinfo ("qam.example", "80", &hints, &ai);
+    check_addrinfo ("getaddrinfo AF_INET qam.example", ai, ret,
+                    "address: STREAM/TCP 192.0.2.17 80\n");
+    if (ret == 0)
+      freeaddrinfo (ai);
+    ret = getaddrinfo ("am.example", "80", &hints, &ai);
+    check_addrinfo ("getaddrinfo AF_INET am.example", ai, ret,
                     "address: STREAM/TCP 192.0.2.17 80\n");
     if (ret == 0)
       freeaddrinfo (ai);
-    ret = getaddrinfo ("both.example", "80", &hints, &ai);
-    check_addrinfo ("getaddrinfo AF_INET both.example", ai, ret,
+    ret = getaddrinfo ("qa.example", "80", &hints, &ai);
+    check_addrinfo ("getaddrinfo AF_INET qa.example", ai, ret,
                     "address: STREAM/TCP 192.0.2.17 80\n");
     if (ret == 0)
       freeaddrinfo (ai);
@@ -108,40 +144,131 @@ test_gai (void)
         .ai_protocol = IPPROTO_TCP,
       };
     struct addrinfo *ai;
-    int ret = getaddrinfo ("www1.example", "80", &hints, &ai);
+    int ret = getaddrinfo ("qa.example", "80", &hints, &ai);
     check_addrinfo ("getaddrinfo (AF_INET6)", ai, ret,
                     "address: STREAM/TCP 2001:db8::1 80\n");
     if (ret == 0)
       freeaddrinfo (ai);
-    ret = getaddrinfo ("both.example", "80", &hints, &ai);
-    check_addrinfo ("getaddrinfo AF_INET6 both.example", ai, ret,
+    ret = getaddrinfo ("am.example", "80", &hints, &ai);
+    check_addrinfo ("getaddrinfo AF_INET6 am.example", ai, ret,
+                    "error: No address associated with hostname\n");
+    if (ret == 0)
+      freeaddrinfo (ai);
+    ret = getaddrinfo ("qam.example", "80", &hints, &ai);
+    check_addrinfo ("getaddrinfo AF_INET6 qam.example", ai, ret,
                     "address: STREAM/TCP 2001:db8::1 80\n");
     if (ret == 0)
       freeaddrinfo (ai);
   }
 }
 
-/* Test that gethostbyname2 is not influenced by RES_USE_INET6.  */
+/* Test that gethostbyname2 is mostly not influenced by
+   RES_USE_INET6.  */
 static void
-test_get2 (void)
+test_get2_any (void)
 {
-  check_hostent ("gethostbyname2 AF_INET www1.example",
-                 gethostbyname2 ("www1.example", AF_INET),
-                 "name: www1.example\n"
+  check_hostent ("gethostbyname2 AF_INET am.example",
+                 gethostbyname2 ("am.example", AF_INET),
+                 "name: am.example\n"
                  "address: 192.0.2.17\n");
-  check_hostent ("gethostbyname2 AF_INET both.example",
-                 gethostbyname2 ("both.example", AF_INET),
-                 "name: both.example\n"
+  check_hostent ("gethostbyname2 AF_INET a.example",
+                 gethostbyname2 ("a.example", AF_INET),
+                 "name: a.example\n"
+                 "address: 192.0.2.17\n");
+  check_hostent ("gethostbyname2 AF_INET qm.example",
+                 gethostbyname2 ("qm.example", AF_INET),
+                 "error: NO_ADDRESS\n");
+  check_hostent ("gethostbyname2 AF_INET q.example",
+                 gethostbyname2 ("q.example", AF_INET),
+                 "error: NO_RECOVERY\n");
+  check_hostent ("gethostbyname2 AF_INET qam.example",
+                 gethostbyname2 ("qam.example", AF_INET),
+                 "name: qam.example\n"
+                 "address: 192.0.2.17\n");
+  check_hostent ("gethostbyname2 AF_INET qa.example",
+                 gethostbyname2 ("qa.example", AF_INET),
+                 "name: qa.example\n"
                  "address: 192.0.2.17\n");
 
-  check_hostent ("gethostbyname2 AF_INET6 www1.example",
-                 gethostbyname2 ("www1.example", AF_INET6),
-                 "name: www1.example\n"
+  check_hostent ("gethostbyname2 AF_INET6 qm.example",
+                 gethostbyname2 ("qm.example", AF_INET6),
+                 "name: qm.example\n"
+                 "address: 2001:db8::1\n");
+  check_hostent ("gethostbyname2 AF_INET6 q.example",
+                 gethostbyname2 ("q.example", AF_INET6),
+                 "name: q.example\n"
                  "address: 2001:db8::1\n");
-  check_hostent ("gethostbyname2 AF_INET6 both.example",
-                 gethostbyname2 ("both.example", AF_INET6),
-                 "name: both.example\n"
+  check_hostent ("gethostbyname2 AF_INET6 qam.example",
+                 gethostbyname2 ("qam.example", AF_INET6),
+                 "name: qam.example\n"
                  "address: 2001:db8::1\n");
+  check_hostent ("gethostbyname2 AF_INET6 qa.example",
+                 gethostbyname2 ("qa.example", AF_INET6),
+                 "name: qa.example\n"
+                 "address: 2001:db8::1\n");
+  /* Additional AF_INET6 tests depend on RES_USE_INET6; see below.  */
+}
+
+/* gethostbyname2 tests with RES_USE_INET6 disabled.  */
+static void
+test_get2_no_inet6 (void)
+{
+  test_get2_any ();
+
+  check_hostent ("gethostbyname2 AF_INET6 am.example",
+                 gethostbyname2 ("am.example", AF_INET6),
+                 "error: NO_ADDRESS\n");
+  check_hostent ("gethostbyname2 AF_INET6 a.example",
+                 gethostbyname2 ("a.example", AF_INET6),
+                 "error: NO_RECOVERY\n");
+}
+
+/* gethostbyname2 tests with RES_USE_INET6 enabled.  */
+static void
+test_get2_inet6 (void)
+{
+  test_get2_any ();
+
+  check_hostent ("gethostbyname2 AF_INET6 am.example",
+                 gethostbyname2 ("am.example", AF_INET6),
+                 "name: am.example\n"
+                 "address: ::ffff:192.0.2.17\n");
+  check_hostent ("gethostbyname2 AF_INET6 a.example",
+                 gethostbyname2 ("a.example", AF_INET6),
+                 "error: NO_RECOVERY\n");
+}
+
+/* Collection of tests which assume no RES_USE_INET6 flag.  */
+static void
+test_no_inet6 (void)
+{
+  check_hostent ("gethostbyname (\"a.example\")",
+                 gethostbyname ("a.example"),
+                 "name: a.example\n"
+                 "address: 192.0.2.17\n");
+  check_hostent ("gethostbyname (\"qa.example\")",
+                 gethostbyname ("qa.example"),
+                 "name: qa.example\n"
+                 "address: 192.0.2.17\n");
+  check_hostent ("gethostbyname (\"am.example\")",
+                 gethostbyname ("am.example"),
+                 "name: am.example\n"
+                 "address: 192.0.2.17\n");
+  check_hostent ("gethostbyname (\"qam.example\")",
+                 gethostbyname ("qam.example"),
+                 "name: qam.example\n"
+                 "address: 192.0.2.17\n");
+  check_hostent ("gethostbyname (\"q.example\")",
+                 gethostbyname ("q.example"),
+                 "error: NO_RECOVERY\n");
+  check_hostent ("gethostbyname (\"qm.example\")",
+                 gethostbyname ("qm.example"),
+                 "error: NO_ADDRESS\n");
+  test_get2_no_inet6 ();
+  test_get2_no_inet6 ();
+  test_gai ();
+  test_get2_no_inet6 ();
+  test_get2_no_inet6 ();
 }
 
 static void *
@@ -153,28 +280,42 @@ threadfunc (void *ignored)
        .response_callback = response
      });
 
-  check_hostent ("gethostbyname (\"www1.example\")",
-                 gethostbyname ("www1.example"),
-                 "name: www1.example\n"
-                 "address: 192.0.2.17\n");
-  check_hostent ("gethostbyname (\"both.example\")",
-                 gethostbyname ("both.example"),
-                 "name: both.example\n"
-                 "address: 192.0.2.17\n");
-  test_get2 ();
-  test_gai ();
+  TEST_VERIFY ((_res.options & RES_USE_INET6) == 0);
+  test_no_inet6 ();
 
   _res.options |= RES_USE_INET6;
-  check_hostent ("gethostbyname (\"www1.example\")",
-                 gethostbyname ("www1.example"),
-                 "name: www1.example\n"
+  check_hostent ("gethostbyname (\"a.inet6.example\")",
+                 gethostbyname ("a.inet6.example"),
+                 "error: NO_RECOVERY\n");
+  check_hostent ("gethostbyname (\"am.inet6.example\")",
+                 gethostbyname ("am.inet6.example"),
+                 "name: am.inet6.example\n"
+                 "address: ::ffff:192.0.2.17\n");
+  check_hostent ("gethostbyname (\"qa.inet6.example\")",
+                 gethostbyname ("qa.inet6.example"),
+                 "name: qa.inet6.example\n"
+                 "address: 2001:db8::1\n");
+  check_hostent ("gethostbyname (\"qam.inet6.example\")",
+                 gethostbyname ("qam.inet6.example"),
+                 "name: qam.inet6.example\n"
                  "address: 2001:db8::1\n");
-  check_hostent ("gethostbyname (\"both.example\")",
-                 gethostbyname ("both.example"),
-                 "name: both.example\n"
+  check_hostent ("gethostbyname (\"q.inet6.example\")",
+                 gethostbyname ("q.inet6.example"),
+                 "name: q.inet6.example\n"
                  "address: 2001:db8::1\n");
-  test_get2 ();
+  check_hostent ("gethostbyname (\"qm.inet6.example\")",
+                 gethostbyname ("qm.inet6.example"),
+                 "name: qm.inet6.example\n"
+                 "address: 2001:db8::1\n");
+  test_get2_inet6 ();
+  test_get2_inet6 ();
   test_gai ();
+  test_get2_inet6 ();
+  test_get2_inet6 ();
+
+  TEST_VERIFY (_res.options & RES_USE_INET6);
+  _res.options &= ~RES_USE_INET6;
+  test_no_inet6 ();
 
   resolv_test_end (obj);
 
-- 
2.14.1


From 3005466abe8fb80ad4ff51865f1e28dd81c43347 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 6 Sep 2017 15:11:44 +0200
Subject: [PATCH 29/90] nss_dns: Remove dead PTR IPv4-to-IPv6 mapping code

(cherry picked from commit c77eb96925b719001237ca7c9e3cef40d795d66b)
---
 ChangeLog                  |  12 +++
 resolv/nss_dns/dns-host.c  |  13 ----
 resolv/tst-res_use_inet6.c | 181 +++++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 186 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dd71f6c427..fa215c2729 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
+	Remove dead PTR IPv4-to-IPv6 mapping code from nss_dns.
+	* resolv/nss_dns/dns-host.c (getanswer_r): Remove dead code.
+	* resolv/tst-res_use_inet6.c (response_ptr_v4, response_ptr_v6):
+	New functions.
+	(response): Call them.  Add 'p', '6' flag processing.
+	(test_reverse): New function.
+	(test_get2_any): Call it.
+	(test_no_inet6): Add 'p' test.
+	(test_inet6): Likewise.
+
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
 	Enhance tst-res_use_inet6 to test IPv4-to-IPv6 address mapping.
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index 7cd54ab504..1e85e4f08f 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -889,19 +889,6 @@ getanswer_r (struct resolv_context *ctx,
 	  /* bind would put multiple PTR records as aliases, but we don't do
 	     that.  */
 	  result->h_name = bp;
-	  if (have_to_map)
-	    {
-	      n = strlen (bp) + 1;	/* for the \0 */
-	      if (__glibc_unlikely (n >= MAXHOSTNAMELEN))
-		{
-		  ++had_error;
-		  break;
-		}
-	      bp += n;
-	      linebuflen -= n;
-	      if (map_v4v6_hostent (result, &bp, &linebuflen))
-		goto too_small;
-	    }
 	  *h_errnop = NETDB_SUCCESS;
 	  return NSS_STATUS_SUCCESS;
 	case T_A:
diff --git a/resolv/tst-res_use_inet6.c b/resolv/tst-res_use_inet6.c
index 1522d5c5f5..d819f921d6 100644
--- a/resolv/tst-res_use_inet6.c
+++ b/resolv/tst-res_use_inet6.c
@@ -16,31 +16,101 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <ctype.h>
 #include <netdb.h>
 #include <resolv.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <support/check.h>
 #include <support/check_nss.h>
 #include <support/resolv_test.h>
+#include <support/support.h>
 #include <support/xthread.h>
 
+/* Handle IPv4 reverse lookup responses.  Product a PTR record
+   A-B-C-D.v4.example.  */
+static void
+response_ptr_v4 (const struct resolv_response_context *ctx,
+                 struct resolv_response_builder *b,
+                 const char *qname, uint16_t qclass, uint16_t qtype)
+{
+  int bytes[4];
+  int offset = -1;
+  TEST_VERIFY (sscanf (qname, "%d.%d.%d.%d.in-addr.arpa%n",
+                       bytes + 0, bytes + 1, bytes + 2, bytes + 3,
+                       &offset) == 4);
+  TEST_VERIFY (offset == strlen (qname));
+  resolv_response_init (b, (struct resolv_response_flags) {});
+  resolv_response_add_question (b, qname, qclass, qtype);
+  resolv_response_section (b, ns_s_an);
+  resolv_response_open_record (b, qname, qclass, T_PTR, 0);
+  char *name = xasprintf ("%d-%d-%d-%d.v4.example",
+                          bytes[3], bytes[2], bytes[1], bytes[0]);
+  resolv_response_add_name (b, name);
+  free (name);
+  resolv_response_close_record (b);
+}
+
+/* Handle IPv6 reverse lookup responses.  Produce a PTR record
+   <32 hex digits>.v6.example. */
+static void
+response_ptr_v6 (const struct resolv_response_context *ctx,
+                 struct resolv_response_builder *b,
+                 const char *qname, uint16_t qclass, uint16_t qtype)
+{
+
+  TEST_VERIFY_EXIT (strlen (qname) > 64);
+
+  char bytes[33];
+  for (int i = 0; i < 64; ++i)
+    if ((i % 2) == 0)
+      {
+        TEST_VERIFY (isxdigit ((unsigned char) qname[i]));
+        bytes[31 - i / 2] = qname[i];
+      }
+    else
+      TEST_VERIFY_EXIT (qname[i] == '.');
+  bytes[32] = '\0';
+
+    resolv_response_init (b, (struct resolv_response_flags) {});
+  resolv_response_add_question (b, qname, qclass, qtype);
+  resolv_response_section (b, ns_s_an);
+  resolv_response_open_record (b, qname, qclass, T_PTR, 0);
+  char *name = xasprintf ("%s.v6.example", bytes);
+  resolv_response_add_name (b, name);
+  free (name);
+  resolv_response_close_record (b);
+}
+
 /* Produce a response based on QNAME: Certain characters in the first
    label of QNAME trigger the inclusion of resource records:
 
    'a'   A record (IPv4 address)
    'q'   AAAA record (quad A record, IPv6 address)
+   'p'   PTR record
    'm'   record type must match QTYPE (no additional records)
+   '6'   stop flag processing if QTYPE == AAAA
+
+   For 'a' and 'q', QTYPE is ignored for record type selection if 'm'
+   is not specified.
 
-   QTYPE is ignored for record type selection if 'm' is not
-   specified.  */
+   in-addr.arpa and ip6.arpa queries are handled separately in
+   response_ptr_v4 and response_ptr_v6.  */
 static void
 response (const struct resolv_response_context *ctx,
           struct resolv_response_builder *b,
           const char *qname, uint16_t qclass, uint16_t qtype)
 {
+  if (strstr (qname, ".in-addr.arpa") != NULL)
+    return response_ptr_v4 (ctx, b, qname, qclass, qtype);
+  else if (strstr (qname, ".ip6.arpa") != NULL)
+    return response_ptr_v6 (ctx, b, qname, qclass, qtype);
+
   bool include_a = false;
   bool include_aaaa = false;
   bool include_match = false;
+  bool include_ptr = false;
   for (const char *p = qname; *p != '.' && *p != '\0'; ++p)
     {
       if (*p == 'a')
@@ -49,6 +119,10 @@ response (const struct resolv_response_context *ctx,
         include_aaaa = true;
       else if (*p == 'm')
         include_match = true;
+      else if (*p == 'p')
+        include_ptr = true;
+      else if (*p == '6' && qtype == T_AAAA)
+        break;
     }
   if (include_match)
     {
@@ -70,11 +144,17 @@ response (const struct resolv_response_context *ctx,
     }
   if (include_aaaa)
     {
-        char ipv6[16]
-          = {0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
-        resolv_response_open_record (b, qname, qclass, T_AAAA, 0);
-        resolv_response_add_data (b, &ipv6, sizeof (ipv6));
-        resolv_response_close_record (b);
+      char ipv6[16]
+        = {0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+      resolv_response_open_record (b, qname, qclass, T_AAAA, 0);
+      resolv_response_add_data (b, &ipv6, sizeof (ipv6));
+      resolv_response_close_record (b);
+    }
+  if (include_ptr)
+    {
+      resolv_response_open_record (b, qname, qclass, T_PTR, 0);
+      resolv_response_add_name (b, "ptr-target.example");
+      resolv_response_close_record (b);
     }
 }
 
@@ -162,6 +242,65 @@ test_gai (void)
   }
 }
 
+/* Test gethostbyaddr and getnameinfo.  The results are independent of
+   RES_USE_INET6.  */
+static void
+test_reverse (void)
+{
+  {
+    char ipv4[4] = { 192, 0, 2, 17 };
+    check_hostent ("gethostbyaddr AF_INET",
+                   gethostbyaddr (ipv4, sizeof (ipv4), AF_INET),
+                   "name: 192-0-2-17.v4.example\n"
+                   "address: 192.0.2.17\n");
+  }
+  {
+    char ipv6[16]
+      = {0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+    check_hostent ("gethostbyaddr AF_INET",
+                   gethostbyaddr (ipv6, sizeof (ipv6), AF_INET6),
+                   "name: 20010db8000000000000000000000001.v6.example\n"
+                   "address: 2001:db8::1\n");
+  }
+
+  {
+    struct sockaddr_in addr =
+      {
+        .sin_family = AF_INET,
+        .sin_addr = { .s_addr = htonl (0xc0000211) },
+        .sin_port = htons (80)
+      };
+    char host[NI_MAXHOST];
+    char service[NI_MAXSERV];
+    int ret = getnameinfo ((struct sockaddr *) &addr, sizeof (addr),
+                           host, sizeof (host), service, sizeof (service),
+                           NI_NUMERICSERV);
+    TEST_VERIFY (ret == 0);
+    TEST_VERIFY (strcmp (host, "192-0-2-17.v4.example") == 0);
+    TEST_VERIFY (strcmp (service, "80") == 0);
+  }
+  {
+    char ipv6[16]
+      = {0x20, 0x01, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+    struct sockaddr_in6 addr =
+      {
+        .sin6_family = AF_INET6,
+        .sin6_port = htons (80),
+      };
+    TEST_VERIFY (sizeof (ipv6) == sizeof (addr.sin6_addr));
+    memcpy (&addr.sin6_addr, ipv6, sizeof (addr.sin6_addr));
+    char host[NI_MAXHOST];
+    char service[NI_MAXSERV];
+    int ret = getnameinfo ((struct sockaddr *) &addr, sizeof (addr),
+                           host, sizeof (host), service, sizeof (service),
+                           NI_NUMERICSERV);
+    TEST_VERIFY (ret == 0);
+    TEST_VERIFY
+      (strcmp (host, "20010db8000000000000000000000001.v6.example") == 0);
+    TEST_VERIFY (strcmp (service, "80") == 0);
+  }
+}
+
 /* Test that gethostbyname2 is mostly not influenced by
    RES_USE_INET6.  */
 static void
@@ -207,6 +346,8 @@ test_get2_any (void)
                  "name: qa.example\n"
                  "address: 2001:db8::1\n");
   /* Additional AF_INET6 tests depend on RES_USE_INET6; see below.  */
+
+  test_reverse ();
 }
 
 /* gethostbyname2 tests with RES_USE_INET6 disabled.  */
@@ -254,6 +395,10 @@ test_no_inet6 (void)
                  gethostbyname ("am.example"),
                  "name: am.example\n"
                  "address: 192.0.2.17\n");
+  check_hostent ("gethostbyname (\"amp.example\")",
+                 gethostbyname ("amp.example"),
+                 "name: amp.example\n"
+                 "address: 192.0.2.17\n");
   check_hostent ("gethostbyname (\"qam.example\")",
                  gethostbyname ("qam.example"),
                  "name: qam.example\n"
@@ -307,6 +452,28 @@ threadfunc (void *ignored)
                  gethostbyname ("qm.inet6.example"),
                  "name: qm.inet6.example\n"
                  "address: 2001:db8::1\n");
+  check_hostent ("gethostbyname (\"amp.inet6.example\")",
+                 gethostbyname ("amp.inet6.example"),
+                 "error: NO_RECOVERY\n");
+  check_hostent ("gethostbyname (\"qmp.inet6.example\")",
+                 gethostbyname ("qmp.inet6.example"),
+                 "name: qmp.inet6.example\n"
+                 "address: 2001:db8::1\n");
+  check_hostent ("gethostbyname (\"ap.inet6.example\")",
+                 gethostbyname ("ap.inet6.example"),
+                 "error: NO_RECOVERY\n");
+  check_hostent ("gethostbyname (\"6ap.inet6.example\")",
+                 gethostbyname ("6ap.inet6.example"),
+                 "name: 6ap.inet6.example\n"
+                 "address: ::ffff:192.0.2.17\n");
+  check_hostent ("gethostbyname (\"am6p.inet6.example\")",
+                 gethostbyname ("am6p.inet6.example"),
+                 "name: am6p.inet6.example\n"
+                 "address: ::ffff:192.0.2.17\n");
+  check_hostent ("gethostbyname (\"qp.inet6.example\")",
+                 gethostbyname ("qp.inet6.example"),
+                 "name: qp.inet6.example\n"
+                 "address: 2001:db8::1\n");
   test_get2_inet6 ();
   test_get2_inet6 ();
   test_gai ();
-- 
2.14.1


From 905a6129147e7ee80e8918e23efe212433b8cce7 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 6 Sep 2017 15:46:54 +0200
Subject: [PATCH 30/90] resolv: Fix memory leak with OOM during resolv.conf
 parsing [BZ #22095]

(cherry picked from commit 5670c4ab256114e869b1df4b05653aa5f909182c)
---
 ChangeLog         | 6 ++++++
 NEWS              | 1 +
 resolv/res_init.c | 5 +++++
 3 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index fa215c2729..ef2041b9e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #22095]
+	* resolv/res_init.c (res_vinit_1): Avoid memory leak in case of
+	dynarray allocation failure.
+
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
 	Remove dead PTR IPv4-to-IPv6 mapping code from nss_dns.
diff --git a/NEWS b/NEWS
index 8fbf4241d1..62959274b3 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,7 @@ The following bugs are resolved with this release:
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
   [21941] powerpc: Restrict xssqrtqp operands to Vector Registers
   [21972] assert macro requires operator== (int) for its argument type
+  [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
 
 Version 2.26
 
diff --git a/resolv/res_init.c b/resolv/res_init.c
index fa46ce7813..4e1f9fe8de 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -446,6 +446,11 @@ res_vinit_1 (FILE *fp, struct resolv_conf_parser *parser)
                     (&parser->nameserver_list);
                   if (p != NULL)
                     *p = sa;
+                  else
+                    {
+                      free (sa);
+                      return false;
+                    }
                 }
               continue;
             }
-- 
2.14.1


From 27233446a62ca35ce0b54566279a99a6774d4210 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 6 Sep 2017 15:47:27 +0200
Subject: [PATCH 31/90] resolv: __resolv_conf_attach must not free passed conf
 object [BZ #22096]

(cherry picked from commit a83047308196e3e54716a39dd85c0a08b198d6bd)
---
 ChangeLog            | 6 ++++++
 NEWS                 | 1 +
 resolv/resolv_conf.c | 5 +----
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ef2041b9e5..e98a4bbf3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #22096]
+	* resolv/resolv_conf.c (__resolv_conf_attach): Do not free conf in
+	case of failure to obtain the global conf object.
+
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #22095]
diff --git a/NEWS b/NEWS
index 62959274b3..9bcb176171 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ The following bugs are resolved with this release:
   [21941] powerpc: Restrict xssqrtqp operands to Vector Registers
   [21972] assert macro requires operator== (int) for its argument type
   [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
+  [22096] resolv: __resolv_conf_attach must not free passed conf object
 
 Version 2.26
 
diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c
index f391d30c27..e0f296d02e 100644
--- a/resolv/resolv_conf.c
+++ b/resolv/resolv_conf.c
@@ -600,10 +600,7 @@ __resolv_conf_attach (struct __res_state *resp, struct resolv_conf *conf)
 
   struct resolv_conf_global *global_copy = get_locked_global ();
   if (global_copy == NULL)
-    {
-      free (conf);
-      return false;
-    }
+    return false;
 
   /* Try to find an unused index in the array.  */
   size_t index;
-- 
2.14.1


From d265b6129184dd94da600187b67cef9125bc58c7 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 6 Sep 2017 11:25:14 +0200
Subject: [PATCH 32/90] __libc_dynarray_emplace_enlarge: Add missing else

Before, arrays of small elements received a starting allocation size of
8, not 16.
---
 ChangeLog                         | 5 +++++
 malloc/dynarray_emplace_enlarge.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e98a4bbf3c..f82fd1f97d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-06  Florian Weimer  <fweimer@redhat.com>
+
+	* malloc/dynarray_emplace_enlarge.c
+	(__libc_dynarray_emplace_enlarge): Add missing else.
+
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #22096]
diff --git a/malloc/dynarray_emplace_enlarge.c b/malloc/dynarray_emplace_enlarge.c
index dfc70017ce..09cd09268b 100644
--- a/malloc/dynarray_emplace_enlarge.c
+++ b/malloc/dynarray_emplace_enlarge.c
@@ -32,7 +32,7 @@ __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
          size.  */
       if (element_size < 4)
         new_allocated = 16;
-      if (element_size < 8)
+      else if (element_size < 8)
         new_allocated = 8;
       else
         new_allocated = 4;
-- 
2.14.1


From 8a1adb593969e099604537804f594efe01e04f6f Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 30 Aug 2017 20:10:56 +0200
Subject: [PATCH 33/90] dynarray: Set errno on overflow-induced allocation
 failure

This allows the caller to return directly on such an error, with an
appropriate errno value.

(cherry picked from commit 5898f4548efdcd7c0fd437a74eeb80facc51a117)
---
 ChangeLog                         |  8 ++++++++
 malloc/dynarray_emplace_enlarge.c |  8 ++++++--
 malloc/dynarray_resize.c          |  7 ++++++-
 malloc/tst-dynarray.c             | 29 +++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f82fd1f97d..87cc2f4865 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-08-30  Florian Weimer  <fweimer@redhat.com>
+
+	* malloc/dynarray_emplace_enlarge.c
+	(__libc_dynarray_emplace_enlarge): Set errno on overflow.
+	* malloc/dynarray_resize.c (__libc_dynarray_resize): Likewise.
+	* malloc/tst-dynarray.c (test_long_overflow): New function.
+	(do_test): Call it.
+
 2017-09-06  Florian Weimer  <fweimer@redhat.com>
 
 	* malloc/dynarray_emplace_enlarge.c
diff --git a/malloc/dynarray_emplace_enlarge.c b/malloc/dynarray_emplace_enlarge.c
index 09cd09268b..a15245f4cb 100644
--- a/malloc/dynarray_emplace_enlarge.c
+++ b/malloc/dynarray_emplace_enlarge.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <dynarray.h>
+#include <errno.h>
 #include <malloc-internal.h>
 #include <stdlib.h>
 #include <string.h>
@@ -43,8 +44,11 @@ __libc_dynarray_emplace_enlarge (struct dynarray_header *list,
     {
       new_allocated = list->allocated + list->allocated / 2 + 1;
       if (new_allocated <= list->allocated)
-        /* Overflow.  */
-        return false;
+        {
+          /* Overflow.  */
+          __set_errno (ENOMEM);
+          return false;
+        }
     }
 
   size_t new_size;
diff --git a/malloc/dynarray_resize.c b/malloc/dynarray_resize.c
index e6dc9fbc68..63c981bf61 100644
--- a/malloc/dynarray_resize.c
+++ b/malloc/dynarray_resize.c
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <dynarray.h>
+#include <errno.h>
 #include <malloc-internal.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,7 +39,11 @@ __libc_dynarray_resize (struct dynarray_header *list, size_t size,
 
   size_t new_size_bytes;
   if (check_mul_overflow_size_t (size, element_size, &new_size_bytes))
-    return false;
+    {
+      /* Overflow.  */
+      __set_errno (ENOMEM);
+      return false;
+    }
   void *new_array;
   if (list->array == scratch)
     {
diff --git a/malloc/tst-dynarray.c b/malloc/tst-dynarray.c
index 2206d75e31..d11f7bb8a3 100644
--- a/malloc/tst-dynarray.c
+++ b/malloc/tst-dynarray.c
@@ -18,6 +18,9 @@
 
 #include "tst-dynarray-shared.h"
 
+#include <errno.h>
+#include <stdint.h>
+
 #define DYNARRAY_STRUCT dynarray_long
 #define DYNARRAY_ELEMENT long
 #define DYNARRAY_PREFIX dynarray_long_
@@ -463,6 +466,31 @@ test_long_init (void)
   }
 }
 
+/* Test overflow in resize.  */
+static void
+test_long_overflow (void)
+{
+  {
+    struct dynarray_long dyn;
+    dynarray_long_init (&dyn);
+    errno = EINVAL;
+    TEST_VERIFY (!dynarray_long_resize
+                 (&dyn, (SIZE_MAX / sizeof (long)) + 1));
+    TEST_VERIFY (errno == ENOMEM);
+    TEST_VERIFY (dynarray_long_has_failed (&dyn));
+  }
+
+  {
+    struct dynarray_long_noscratch dyn;
+    dynarray_long_noscratch_init (&dyn);
+    errno = EINVAL;
+    TEST_VERIFY (!dynarray_long_noscratch_resize
+                 (&dyn, (SIZE_MAX / sizeof (long)) + 1));
+    TEST_VERIFY (errno == ENOMEM);
+    TEST_VERIFY (dynarray_long_noscratch_has_failed (&dyn));
+  }
+}
+
 /* Test NUL-terminated string construction with the add function and
    the simple finalize function.  */
 static void
@@ -538,6 +566,7 @@ do_test (void)
   test_int ();
   test_str ();
   test_long_init ();
+  test_long_overflow ();
   test_zstr ();
   return 0;
 }
-- 
2.14.1


From dca8b177f6bb521638f4d8a845b4cb10348137c9 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 31 Aug 2017 06:28:31 -0700
Subject: [PATCH 34/90] Place $(elf-objpfx)sofini.os last [BZ #22051]

Since sofini.os terminates .eh_frame section, it should be placed last.

	[BZ #22051]
	* Makerules (build-module-helper-objlist): Filter out
	$(elf-objpfx)sofini.os.
	(build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is
	needed.

(cherry picked from commit ecd0747df388f3925d4839740b0abcf43d0a9fb2)
---
 ChangeLog | 8 ++++++++
 Makerules | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 87cc2f4865..f9e423dbb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-08-31  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #22051]
+	* Makerules (build-module-helper-objlist): Filter out
+	$(elf-objpfx)sofini.os.
+	(build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is
+	needed.
+
 2017-08-30  Florian Weimer  <fweimer@redhat.com>
 
 	* malloc/dynarray_emplace_enlarge.c
diff --git a/Makerules b/Makerules
index 9bb707c168..828a445f24 100644
--- a/Makerules
+++ b/Makerules
@@ -686,14 +686,17 @@ $(build-module-helper) -o $@ $(shlib-lds-flags) \
 $(call after-link,$@)
 endef
 
+# sofini.os must be placed last since it terminates .eh_frame section.
 build-module-helper-objlist = \
 	$(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\
 		   $(filter-out %.lds $(map-file) $(+preinit) $(+postinit) \
+				$(elf-objpfx)sofini.os \
 				$(link-libc-deps),$^))
 
 build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so)
 build-shlib-objlist = $(build-module-helper-objlist) \
-		      $(LDLIBS-$(@F:lib%.so=%).so)
+		      $(LDLIBS-$(@F:lib%.so=%).so) \
+		      $(filter $(elf-objpfx)sofini.os,$^)
 
 # Don't try to use -lc when making libc.so itself.
 # Also omits crti.o and crtn.o, which we do not want
-- 
2.14.1


From 86553be84d071aee8464b2c2fa03858d12118852 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 7 Sep 2017 13:56:58 -0700
Subject: [PATCH 35/90] Use "static const char domain[] ="

	* resolv/tst-resolv-qtypes.c (domain): Changed to
	"const char domain[] =".

(cherry picked from commit 78bfa877b36e8f33c99cbe9a16eb73f5a2adc0c8)
---
 ChangeLog                  | 5 +++++
 resolv/tst-resolv-qtypes.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f9e423dbb3..96c461c441 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* resolv/tst-resolv-qtypes.c (domain): Changed to
+	"const char domain[] =".
+
 2017-08-31  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #22051]
diff --git a/resolv/tst-resolv-qtypes.c b/resolv/tst-resolv-qtypes.c
index 06ea3dbd14..da3325f80c 100644
--- a/resolv/tst-resolv-qtypes.c
+++ b/resolv/tst-resolv-qtypes.c
@@ -50,7 +50,7 @@ response (const struct resolv_response_context *ctx,
   resolv_response_close_record (b);
 }
 
-static const char * const domain = "www.example.com";
+static const char domain[] = "www.example.com";
 
 static int
 wrap_res_query (int type, unsigned char *answer, int answer_length)
-- 
2.14.1


From 5f5532caf820f47f714d09766082f1e070c12cfb Mon Sep 17 00:00:00 2001
From: Markus Trippelsdorf <markus@trippelsdorf.de>
Date: Fri, 8 Sep 2017 19:57:12 +0000
Subject: [PATCH 36/90] Update x86_64 ulps for AMD Ryzen.

	* sysdeps/x86_64/fpu/libm-test-ulps: Update for AMD Ryzen.

(cherry picked from commit 4c03a696800e3bb4b433626a65c4fef465dcc98b)
---
 ChangeLog                         | 4 ++++
 sysdeps/x86_64/fpu/libm-test-ulps | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96c461c441..c180f8dbca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-09-08  Markus Trippelsdorf  <markus@trippelsdorf.de>
+
+	* sysdeps/x86_64/fpu/libm-test-ulps: Update for AMD Ryzen.
+
 2017-09-07  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* resolv/tst-resolv-qtypes.c (domain): Changed to
diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps
index c347642044..1e28aaa9f1 100644
--- a/sysdeps/x86_64/fpu/libm-test-ulps
+++ b/sysdeps/x86_64/fpu/libm-test-ulps
@@ -1733,10 +1733,10 @@ ldouble: 3
 
 Function: Imaginary part of "ctan_upward":
 double: 2
-float: 1
+float: 2
 float128: 5
 idouble: 2
-ifloat: 1
+ifloat: 2
 ifloat128: 5
 ildouble: 3
 ldouble: 3
-- 
2.14.1


From 56ce01906ecb0a3e04411f8ceb60b27f4877f070 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 23 Aug 2017 08:22:52 -0700
Subject: [PATCH 37/90] string/stratcliff.c: Replace int with size_t [BZ
 #21982]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix GCC 7 errors when string/stratcliff.c is compiled with -O3:

stratcliff.c: In function ‘do_test’:
cc1: error: assuming signed overflow does not occur when assuming that (X - c) <= X is always true [-Werror=strict-overflow]

	[BZ #21982]
	* string/stratcliff.c (do_test): Declare size, nchars, inner,
	middle and outer with size_t instead of int.  Repleace %d and
	%Zd with %zu in printf.  Update "MAX (0, nchars - 128)" and
	"MAX (outer, nchars - 64)" to support unsigned outer and
	nchars.  Also exit loop when outer == 0.

(cherry picked from commit 376b40a27a6783ea7f73ae577be320df66aeb36d)
---
 ChangeLog           |   9 ++
 string/stratcliff.c | 276 +++++++++++++++++++++++++++++++---------------------
 2 files changed, 176 insertions(+), 109 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c180f8dbca..84721f6265 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-09-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #21982]
+	* string/stratcliff.c (do_test): Declare size, nchars, inner,
+	middle and outer with size_t instead of int.  Repleace %d and
+	%Zd with %zu in printf.  Update "MAX (0, nchars - 128)" and
+	"MAX (outer, nchars - 64)" to support unsigned outer and
+	nchars.  Also exit loop when outer == 0.
+
 2017-09-08  Markus Trippelsdorf  <markus@trippelsdorf.de>
 
 	* sysdeps/x86_64/fpu/libm-test-ulps: Update for AMD Ryzen.
diff --git a/string/stratcliff.c b/string/stratcliff.c
index e28b0c5058..4320336c9a 100644
--- a/string/stratcliff.c
+++ b/string/stratcliff.c
@@ -58,8 +58,8 @@
 int
 do_test (void)
 {
-  int size = sysconf (_SC_PAGESIZE);
-  int nchars = size / sizeof (CHAR);
+  size_t size = sysconf (_SC_PAGESIZE);
+  size_t nchars = size / sizeof (CHAR);
   CHAR *adr;
   CHAR *dest;
   int result = 0;
@@ -80,7 +80,17 @@ do_test (void)
     }
   else
     {
-      int inner, middle, outer;
+      size_t inner, middle, outer, nchars64, max128;
+
+      if (nchars > 64)
+	nchars64 = nchars - 64;
+      else
+	nchars64 = 0;
+
+      if (nchars > 128)
+	max128 = nchars - 128;
+      else
+	max128 = 0;
 
       mprotect (adr, size, PROT_NONE);
       mprotect (adr + 2 * nchars, size, PROT_NONE);
@@ -93,59 +103,65 @@ do_test (void)
       MEMSET (adr, L('T'), nchars);
 
       /* strlen/wcslen test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	  for (inner = MAX (outer, nchars64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
 	      if (STRLEN (&adr[outer]) != (size_t) (inner - outer))
 		{
-		  printf ("%s flunked for outer = %d, inner = %d\n",
+		  printf ("%s flunked for outer = %zu, inner = %zu\n",
 			  STRINGIFY (STRLEN), outer, inner);
 		  result = 1;
 		}
 
 	      adr[inner] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* strnlen/wcsnlen test */
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars; outer >= max128; --outer)
 	{
-	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	  for (inner = MAX (outer, nchars64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
 	      if (STRNLEN (&adr[outer], inner - outer + 1)
 		  != (size_t) (inner - outer))
 		{
-		  printf ("%s flunked for outer = %d, inner = %d\n",
+		  printf ("%s flunked for outer = %zu, inner = %zu\n",
 			  STRINGIFY (STRNLEN), outer, inner);
 		  result = 1;
 		}
 
 	      adr[inner] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars; outer >= max128; --outer)
 	{
-	  for (inner = MAX (outer, nchars - 64); inner <= nchars; ++inner)
+	  for (inner = MAX (outer, nchars64); inner <= nchars; ++inner)
 	    {
 	      if (STRNLEN (&adr[outer], inner - outer)
 		  != (size_t) (inner - outer))
 		{
-		  printf ("%s flunked bounded for outer = %d, inner = %d\n",
+		  printf ("%s flunked bounded for outer = %zu, inner = %zu\n",
 			  STRINGIFY (STRNLEN), outer, inner);
 		  result = 1;
 		}
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* strchr/wcschr test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	  for (middle = MAX (outer, nchars64); middle < nchars; ++middle)
 	    {
 	      for (inner = middle; inner < nchars; ++inner)
 		{
@@ -158,8 +174,8 @@ do_test (void)
 		      || (inner != middle
 			  && (cp - &adr[outer]) != middle - outer))
 		    {
-		      printf ("%s flunked for outer = %d, middle = %d, "
-			      "inner = %d\n",
+		      printf ("%s flunked for outer = %zu, middle = %zu, "
+			      "inner = %zu\n",
 			      STRINGIFY (STRCHR), outer, middle, inner);
 		      result = 1;
 		    }
@@ -168,6 +184,8 @@ do_test (void)
 		  adr[middle] = L('T');
 		}
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* Special test.  */
@@ -180,9 +198,9 @@ do_test (void)
 	}
 
       /* strrchr/wcsrchr test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	  for (middle = MAX (outer, nchars64); middle < nchars; ++middle)
 	    {
 	      for (inner = middle; inner < nchars; ++inner)
 		{
@@ -195,8 +213,8 @@ do_test (void)
 		      || (inner != middle
 			  && (cp - &adr[outer]) != middle - outer))
 		    {
-		      printf ("%s flunked for outer = %d, middle = %d, "
-			      "inner = %d\n",
+		      printf ("%s flunked for outer = %zu, middle = %zu, "
+			      "inner = %zu\n",
 			      STRINGIFY (STRRCHR), outer, middle, inner);
 		      result = 1;
 		    }
@@ -205,12 +223,14 @@ do_test (void)
 		  adr[middle] = L('T');
 		}
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* memchr test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	  for (middle = MAX (outer, nchars64); middle < nchars; ++middle)
 	    {
 	      adr[middle] = L('V');
 
@@ -218,32 +238,36 @@ do_test (void)
 
 	      if (cp - &adr[outer] != middle - outer)
 		{
-		  printf ("%s flunked for outer = %d, middle = %d\n",
+		  printf ("%s flunked for outer = %zu, middle = %zu\n",
 			  STRINGIFY (MEMCHR), outer, middle);
 		  result = 1;
 		}
 
 	      adr[middle] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars; outer >= max128; --outer)
 	{
 	  CHAR *cp = MEMCHR (&adr[outer], L('V'), nchars - outer);
 
 	  if (cp != NULL)
 	    {
-	      printf ("%s flunked for outer = %d\n",
+	      printf ("%s flunked for outer = %zu\n",
 		      STRINGIFY (MEMCHR), outer);
 	      result = 1;
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* These functions only exist for single-byte characters.  */
 #ifndef WCSTEST
       /* rawmemchr test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	  for (middle = MAX (outer, nchars64); middle < nchars; ++middle)
 	    {
 	      adr[middle] = L('V');
 
@@ -251,19 +275,21 @@ do_test (void)
 
 	      if (cp - &adr[outer] != middle - outer)
 		{
-		  printf ("%s flunked for outer = %d, middle = %d\n",
+		  printf ("%s flunked for outer = %zu, middle = %zu\n",
 			  STRINGIFY (rawmemchr), outer, middle);
 		  result = 1;
 		}
 
 	      adr[middle] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* memrchr test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	  for (middle = MAX (outer, nchars64); middle < nchars; ++middle)
 	    {
 	      adr[middle] = L('V');
 
@@ -271,44 +297,50 @@ do_test (void)
 
 	      if (cp - &adr[outer] != middle - outer)
 		{
-		  printf ("%s flunked for outer = %d, middle = %d\n",
+		  printf ("%s flunked for outer = %zu, middle = %zu\n",
 			  STRINGIFY (memrchr), outer, middle);
 		  result = 1;
 		}
 
 	      adr[middle] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars; outer >= max128; --outer)
 	{
 	  CHAR *cp = memrchr (&adr[outer], L('V'), nchars - outer);
 
 	  if (cp != NULL)
 	    {
-	      printf ("%s flunked for outer = %d\n",
+	      printf ("%s flunked for outer = %zu\n",
 		      STRINGIFY (memrchr), outer);
 	      result = 1;
 	    }
+	  if (outer == 0)
+	    break;
 	}
 #endif
 
       /* strcpy/wcscpy test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	  for (inner = MAX (outer, nchars64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
 	      if (STRCPY (dest, &adr[outer]) != dest
 		  || STRLEN (dest) != (size_t) (inner - outer))
 		{
-		  printf ("%s flunked for outer = %d, inner = %d\n",
+		  printf ("%s flunked for outer = %zu, inner = %zu\n",
 			  STRINGIFY (STRCPY), outer, inner);
 		  result = 1;
 		}
 
 	      adr[inner] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* strcmp/wcscmp tests */
@@ -322,14 +354,14 @@ do_test (void)
 
 	    if (STRCMP (adr + middle, dest + nchars - outer) <= 0)
 	      {
-		printf ("%s 1 flunked for outer = %d, middle = %d\n",
+		printf ("%s 1 flunked for outer = %zu, middle = %zu\n",
 			STRINGIFY (STRCMP), outer, middle);
 		result = 1;
 	      }
 
 	    if (STRCMP (dest + nchars - outer, adr + middle) >= 0)
 	      {
-		printf ("%s 2 flunked for outer = %d, middle = %d\n",
+		printf ("%s 2 flunked for outer = %zu, middle = %zu\n",
 			STRINGIFY (STRCMP), outer, middle);
 		result = 1;
 	      }
@@ -348,16 +380,16 @@ do_test (void)
 	      {
 		if (STRNCMP (adr + middle, dest + nchars - outer, inner) != 0)
 		  {
-		    printf ("%s 1 flunked for outer = %d, middle = %d, "
-			    "inner = %d\n",
+		    printf ("%s 1 flunked for outer = %zu, middle = %zu, "
+			    "inner = %zu\n",
 			    STRINGIFY (STRNCMP), outer, middle, inner);
 		    result = 1;
 		  }
 
 		if (STRNCMP (dest + nchars - outer, adr + middle, inner) != 0)
 		  {
-		    printf ("%s 2 flunked for outer = %d, middle = %d, "
-			    "inner = %d\n",
+		    printf ("%s 2 flunked for outer = %zu, middle = %zu, "
+			    "inner = %zu\n",
 			    STRINGIFY (STRNCMP), outer, middle, inner);
 		    result = 1;
 		  }
@@ -365,14 +397,14 @@ do_test (void)
 
 	    if (STRNCMP (adr + middle, dest + nchars - outer, outer) >= 0)
 	      {
-		printf ("%s 1 flunked for outer = %d, middle = %d, full\n",
+		printf ("%s 1 flunked for outer = %zu, middle = %zu, full\n",
 			STRINGIFY (STRNCMP), outer, middle);
 		result = 1;
 	      }
 
 	    if (STRNCMP (dest + nchars - outer, adr + middle, outer) <= 0)
 	      {
-		printf ("%s 2 flunked for outer = %d, middle = %d, full\n",
+		printf ("%s 2 flunked for outer = %zu, middle = %zu, full\n",
 			STRINGIFY (STRNCMP), outer, middle);
 		result = 1;
 	      }
@@ -380,7 +412,7 @@ do_test (void)
 
       /* strncpy/wcsncpy tests */
       adr[nchars - 1] = L('T');
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars; outer >= max128; --outer)
 	{
 	  size_t len;
 
@@ -389,17 +421,19 @@ do_test (void)
 	      if (STRNCPY (dest, &adr[outer], len) != dest
 		  || MEMCMP (dest, &adr[outer], len) != 0)
 		{
-		  printf ("outer %s flunked for outer = %d, len = %Zd\n",
+		  printf ("outer %s flunked for outer = %zu, len = %zu\n",
 			  STRINGIFY (STRNCPY), outer, len);
 		  result = 1;
 		}
 	    }
+	  if (outer == 0)
+	    break;
 	}
       adr[nchars - 1] = L('\0');
 
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	  for (inner = MAX (outer, nchars64); inner < nchars; ++inner)
 	    {
 	      size_t len;
 
@@ -413,8 +447,8 @@ do_test (void)
 		      || (inner - outer < len
 			  && STRLEN (dest) != (inner - outer)))
 		    {
-		      printf ("%s flunked for outer = %d, inner = %d, "
-			      "len = %Zd\n",
+		      printf ("%s flunked for outer = %zu, inner = %zu, "
+			      "len = %zu\n",
 			      STRINGIFY (STRNCPY), outer, inner, len);
 		      result = 1;
 		    }
@@ -424,8 +458,8 @@ do_test (void)
 		      || (inner - outer < len
 			  && STRLEN (dest + 1) != (inner - outer)))
 		    {
-		      printf ("%s+1 flunked for outer = %d, inner = %d, "
-			      "len = %Zd\n",
+		      printf ("%s+1 flunked for outer = %zu, inner = %zu, "
+			      "len = %zu\n",
 			      STRINGIFY (STRNCPY), outer, inner, len);
 		      result = 1;
 		    }
@@ -433,29 +467,33 @@ do_test (void)
 
 	      adr[inner] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* stpcpy/wcpcpy test */
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (inner = MAX (outer, nchars - 64); inner < nchars; ++inner)
+	  for (inner = MAX (outer, nchars64); inner < nchars; ++inner)
 	    {
 	      adr[inner] = L('\0');
 
 	      if ((STPCPY (dest, &adr[outer]) - dest) != inner - outer)
 		{
-		  printf ("%s flunked for outer = %d, inner = %d\n",
+		  printf ("%s flunked for outer = %zu, inner = %zu\n",
 			  STRINGIFY (STPCPY), outer, inner);
 		  result = 1;
 		}
 
 	      adr[inner] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* stpncpy/wcpncpy test */
       adr[nchars - 1] = L('T');
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars; outer >= max128; --outer)
 	{
 	  size_t len;
 
@@ -464,17 +502,19 @@ do_test (void)
 	      if (STPNCPY (dest, &adr[outer], len) != dest + len
 		  || MEMCMP (dest, &adr[outer], len) != 0)
 		{
-		  printf ("outer %s flunked for outer = %d, len = %Zd\n",
+		  printf ("outer %s flunked for outer = %zu, len = %zu\n",
 			  STRINGIFY (STPNCPY), outer, len);
 		  result = 1;
 		}
 	    }
+	  if (outer == 0)
+	    break;
 	}
       adr[nchars - 1] = L('\0');
 
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
+      for (outer = nchars - 1; outer >= max128; --outer)
 	{
-	  for (middle = MAX (outer, nchars - 64); middle < nchars; ++middle)
+	  for (middle = MAX (outer, nchars64); middle < nchars; ++middle)
 	    {
 	      adr[middle] = L('\0');
 
@@ -483,8 +523,8 @@ do_test (void)
 		  if ((STPNCPY (dest, &adr[outer], inner) - dest)
 		      != MIN (inner, middle - outer))
 		    {
-		      printf ("%s flunked for outer = %d, middle = %d, "
-			      "inner = %d\n",
+		      printf ("%s flunked for outer = %zu, middle = %zu, "
+			      "inner = %zu\n",
 			      STRINGIFY (STPNCPY), outer, middle, inner);
 		      result = 1;
 		    }
@@ -492,66 +532,84 @@ do_test (void)
 
 	      adr[middle] = L('T');
 	    }
+	  if (outer == 0)
+	    break;
 	}
 
       /* memcpy/wmemcpy test */
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
-	for (inner = 0; inner < nchars - outer; ++inner)
-	  if (MEMCPY (dest, &adr[outer], inner) !=  dest)
-	    {
-	      printf ("%s flunked for outer = %d, inner = %d\n",
-		      STRINGIFY (MEMCPY), outer, inner);
-	      result = 1;
-	    }
+      for (outer = nchars; outer >= max128; --outer)
+	{
+	  for (inner = 0; inner < nchars - outer; ++inner)
+	    if (MEMCPY (dest, &adr[outer], inner) !=  dest)
+	      {
+		printf ("%s flunked for outer = %zu, inner = %zu\n",
+			STRINGIFY (MEMCPY), outer, inner);
+		result = 1;
+	      }
+	  if (outer == 0)
+	    break;
+	}
 
       /* mempcpy/wmempcpy test */
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
-	for (inner = 0; inner < nchars - outer; ++inner)
-	  if (MEMPCPY (dest, &adr[outer], inner) !=  dest + inner)
-	    {
-	      printf ("%s flunked for outer = %d, inner = %d\n",
-		      STRINGIFY (MEMPCPY), outer, inner);
-	      result = 1;
-	    }
+      for (outer = nchars; outer >= max128; --outer)
+	{
+	  for (inner = 0; inner < nchars - outer; ++inner)
+	    if (MEMPCPY (dest, &adr[outer], inner) !=  dest + inner)
+	      {
+		printf ("%s flunked for outer = %zu, inner = %zu\n",
+			STRINGIFY (MEMPCPY), outer, inner);
+		result = 1;
+	      }
+	  if (outer == 0)
+	    break;
+	}
 
       /* This function only exists for single-byte characters.  */
 #ifndef WCSTEST
       /* memccpy test */
       memset (adr, '\0', nchars);
-      for (outer = nchars; outer >= MAX (0, nchars - 128); --outer)
-	for (inner = 0; inner < nchars - outer; ++inner)
-	  if (memccpy (dest, &adr[outer], L('\1'), inner) != NULL)
-	    {
-	      printf ("memccpy flunked full copy for outer = %d, inner = %d\n",
-		      outer, inner);
-	      result = 1;
-	    }
-      for (outer = nchars - 1; outer >= MAX (0, nchars - 128); --outer)
-	for (middle = 0; middle < nchars - outer; ++middle)
-	  {
-	    memset (dest, L('\2'), middle + 1);
-	    for (inner = 0; inner < middle; ++inner)
+      for (outer = nchars; outer >= max128; --outer)
+	{
+	  for (inner = 0; inner < nchars - outer; ++inner)
+	    if (memccpy (dest, &adr[outer], L('\1'), inner) != NULL)
 	      {
-		adr[outer + inner] = L('\1');
-
-		if (memccpy (dest, &adr[outer], '\1', middle + 128)
-		    !=  dest + inner + 1)
-		  {
-		    printf ("\
-memccpy flunked partial copy for outer = %d, middle = %d, inner = %d\n",
-			    outer, middle, inner);
-		    result = 1;
-		  }
-		else if (dest[inner + 1] != L('\2'))
-		  {
-		    printf ("\
-memccpy copied too much for outer = %d, middle = %d, inner = %d\n",
-			    outer, middle, inner);
-		    result = 1;
-		  }
-		adr[outer + inner] = L('\0');
+		printf ("memccpy flunked full copy for outer = %zu, inner = %zu\n",
+			outer, inner);
+		result = 1;
 	      }
-	  }
+	  if (outer == 0)
+	    break;
+	}
+      for (outer = nchars - 1; outer >= max128; --outer)
+	{
+	  for (middle = 0; middle < nchars - outer; ++middle)
+	    {
+	      memset (dest, L('\2'), middle + 1);
+	      for (inner = 0; inner < middle; ++inner)
+		{
+		  adr[outer + inner] = L('\1');
+
+		  if (memccpy (dest, &adr[outer], '\1', middle + 128)
+		      !=  dest + inner + 1)
+		    {
+		      printf ("\
+			      memccpy flunked partial copy for outer = %zu, middle = %zu, inner = %zu\n",
+			      outer, middle, inner);
+		      result = 1;
+		    }
+		  else if (dest[inner + 1] != L('\2'))
+		    {
+		      printf ("\
+			      memccpy copied too much for outer = %zu, middle = %zu, inner = %zu\n",
+			      outer, middle, inner);
+		      result = 1;
+		    }
+		  adr[outer + inner] = L('\0');
+		}
+	    }
+	  if (outer == 0)
+	    break;
+	}
 #endif
     }
 
-- 
2.14.1


From 2422c6032fd5e95b1c29df5b8671455ead51314e Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Thu, 3 Aug 2017 15:39:21 +0930
Subject: [PATCH 38/90] tst-tlsopt-powerpc as a shared lib

This makes the __tls_get_addr_opt test run as a shared library, and so
actually test that DTPMOD64/DTPREL64 pairs are processed by ld.so to
support the __tls_get_adfr_opt call stub fast return.  After a
2017-01-24 patch (binutils f0158f4416) ld.bfd no longer emitted
unnecessary dynamic relocations against local thread variables,
instead setting up the __tls_index GOT entries for the call stub fast
return.  This meant tst-tlsopt-powerpc passed but did not check ld.so
relocation support.  After a 2017-07-16 patch (binutils 676ee2b5fa)
ld.bfd no longer set up the __tls_index GOT entries for the call stub
fast return, and tst-tlsopt-powerpc failed.

Compiling mod-tlsopt-powerpc.c with -DSHARED exposed a bug in
powerpc64/tls-macros.h, which defines a __TLS_GET_ADDR macro that
clashes with one defined in dl-tls.h.  The tls-macros.h version is
only used in that file, so delete it and expand.

	* sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from
	tst-tlsopt-powerpc.c with function name change and no test harness.
	* sysdeps/powerpc/tst-tlsopt-powerpc.c: Remove body of test.
	Call tls_get_addr_opt_test.
	* sysdeps/powerpc/Makefile (LDFLAGS-tst-tlsopt-powerpc): Don't define.
	(modules-names): Add mod-tlsopt-powerpc.
	(mod-tlsopt-powerpc.so-no-z-defs): Define.
	(tst-tlsopt-powerpc): Depend on .so.
	* sysdeps/powerpc/powerpc64/tls-macros.h (__TLS_GET_ADDR): Don't
	define.  Expand use in TLS_GD and TLS_LD.

(cherry picked from commit e98c925fa4f6486447eb20676755dbf9eb36a110)
---
 ChangeLog                              | 13 +++++++++
 sysdeps/powerpc/Makefile               |  6 +++--
 sysdeps/powerpc/mod-tlsopt-powerpc.c   | 49 ++++++++++++++++++++++++++++++++++
 sysdeps/powerpc/powerpc64/tls-macros.h |  6 ++---
 sysdeps/powerpc/tst-tlsopt-powerpc.c   | 44 ++----------------------------
 5 files changed, 70 insertions(+), 48 deletions(-)
 create mode 100644 sysdeps/powerpc/mod-tlsopt-powerpc.c

diff --git a/ChangeLog b/ChangeLog
index 84721f6265..b53d8830a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-08-03  Alan Modra  <amodra@gmail.com>
+
+	* sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from
+	tst-tlsopt-powerpc.c with function name change and no test harness.
+	* sysdeps/powerpc/tst-tlsopt-powerpc.c: Remove body of test.
+	Call tls_get_addr_opt_test.
+	* sysdeps/powerpc/Makefile (LDFLAGS-tst-tlsopt-powerpc): Don't define.
+	(modules-names): Add mod-tlsopt-powerpc.
+	(mod-tlsopt-powerpc.so-no-z-defs): Define.
+	(tst-tlsopt-powerpc): Depend on .so.
+	* sysdeps/powerpc/powerpc64/tls-macros.h (__TLS_GET_ADDR): Don't
+	define.  Expand use in TLS_GD and TLS_LD.
+
 2017-09-11  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #21982]
diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile
index 0d9206bec4..6aa683b03f 100644
--- a/sysdeps/powerpc/Makefile
+++ b/sysdeps/powerpc/Makefile
@@ -8,9 +8,11 @@ sysdep-dl-routines += dl-machine hwcapinfo
 sysdep_routines += dl-machine hwcapinfo
 # extra shared linker files to link only into dl-allobjs.so
 sysdep-rtld-routines += dl-machine hwcapinfo
-# Don't optimize GD tls sequence to LE.
-LDFLAGS-tst-tlsopt-powerpc += -Wl,--no-tls-optimize
+
+modules-names += mod-tlsopt-powerpc
+mod-tlsopt-powerpc.so-no-z-defs = yes
 tests += tst-tlsopt-powerpc
+$(objpfx)tst-tlsopt-powerpc: $(objpfx)mod-tlsopt-powerpc.so
 
 ifneq (no,$(multi-arch))
 tests-static += tst-tlsifunc-static
diff --git a/sysdeps/powerpc/mod-tlsopt-powerpc.c b/sysdeps/powerpc/mod-tlsopt-powerpc.c
new file mode 100644
index 0000000000..ee0db12a73
--- /dev/null
+++ b/sysdeps/powerpc/mod-tlsopt-powerpc.c
@@ -0,0 +1,49 @@
+/* shared library to test for __tls_get_addr optimization.  */
+#include <stdio.h>
+
+#include "../../elf/tls-macros.h"
+#include "dl-tls.h"
+
+/* common 'int' variable in TLS.  */
+COMMON_INT_DEF(foo);
+
+
+int
+tls_get_addr_opt_test (void)
+{
+  int result = 0;
+
+  /* Get variable using general dynamic model.  */
+  int *ap = TLS_GD (foo);
+  if (*ap != 0)
+    {
+      printf ("foo = %d\n", *ap);
+      result = 1;
+    }
+
+  tls_index *tls_arg;
+#ifdef __powerpc64__
+  register unsigned long thread_pointer __asm__ ("r13");
+  asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
+#else
+  register unsigned long thread_pointer __asm__ ("r2");
+  asm ("bcl 20,31,1f\n1:\t"
+       "mflr %0\n\t"
+       "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t"
+       "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t"
+       "addi %0,%0,foo@got@tlsgd" : "=b" (tls_arg));
+#endif
+
+  if (tls_arg->ti_module != 0)
+    {
+      printf ("tls_index not optimized, binutils too old?\n");
+      result = 1;
+    }
+  else if (tls_arg->ti_offset + thread_pointer != (unsigned long) ap)
+    {
+      printf ("tls_index->ti_offset wrong value\n");
+      result = 1;
+    }
+
+  return result;
+}
diff --git a/sysdeps/powerpc/powerpc64/tls-macros.h b/sysdeps/powerpc/powerpc64/tls-macros.h
index 42a95ec5c1..79a0b2579c 100644
--- a/sysdeps/powerpc/powerpc64/tls-macros.h
+++ b/sysdeps/powerpc/powerpc64/tls-macros.h
@@ -18,13 +18,11 @@
      __result;								      \
   })
 
-#define __TLS_GET_ADDR "__tls_get_addr"
-
 /* PowerPC64 Local Dynamic TLS access.  */
 #define TLS_LD(x)							      \
   ({ int * __result;							      \
      asm ("addi  3,2," #x "@got@tlsld\n\t"				      \
-	  "bl    " __TLS_GET_ADDR "\n\t"				      \
+	  "bl    __tls_get_addr\n\t"					      \
 	  "nop   \n\t"							      \
 	  "addis %0,3," #x "@dtprel@ha\n\t"				      \
 	  "addi  %0,%0," #x "@dtprel@l"					      \
@@ -36,7 +34,7 @@
 #define TLS_GD(x)							      \
   ({ register int *__result __asm__ ("r3");				      \
      asm ("addi  3,2," #x "@got@tlsgd\n\t"				      \
-	  "bl    " __TLS_GET_ADDR "\n\t"				      \
+	  "bl    __tls_get_addr\n\t"					      \
 	  "nop   "							      \
 	  : "=r" (__result) :						      \
 	  : __TLS_CALL_CLOBBERS);					      \
diff --git a/sysdeps/powerpc/tst-tlsopt-powerpc.c b/sysdeps/powerpc/tst-tlsopt-powerpc.c
index 8ae928a3f4..cc682b2ed0 100644
--- a/sysdeps/powerpc/tst-tlsopt-powerpc.c
+++ b/sysdeps/powerpc/tst-tlsopt-powerpc.c
@@ -1,51 +1,11 @@
 /* glibc test for __tls_get_addr optimization.  */
-#include <stdio.h>
-
-#include "../../elf/tls-macros.h"
-#include "dl-tls.h"
-
-/* common 'int' variable in TLS.  */
-COMMON_INT_DEF(foo);
-
 
 static int
 do_test (void)
 {
-  int result = 0;
-
-  /* Get variable using general dynamic model.  */
-  int *ap = TLS_GD (foo);
-  if (*ap != 0)
-    {
-      printf ("foo = %d\n", *ap);
-      result = 1;
-    }
-
-  tls_index *tls_arg;
-#ifdef __powerpc64__
-  register unsigned long thread_pointer __asm__ ("r13");
-  asm ("addi %0,2,foo@got@tlsgd" : "=r" (tls_arg));
-#else
-  register unsigned long thread_pointer __asm__ ("r2");
-  asm ("bcl 20,31,1f\n1:\t"
-       "mflr %0\n\t"
-       "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t"
-       "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t"
-       "addi %0,%0,foo@got@tlsgd" : "=b" (tls_arg));
-#endif
-
-  if (tls_arg->ti_module != 0)
-    {
-      printf ("tls_index not optimized, binutils too old?\n");
-      result = 1;
-    }
-  else if (tls_arg->ti_offset + thread_pointer != (unsigned long) ap)
-    {
-      printf ("tls_index->ti_offset wrong value\n");
-      result = 1;
-    }
+  extern int tls_get_addr_opt_test (void);
 
-  return result;
+  return tls_get_addr_opt_test ();
 }
 
 #include <support/test-driver.c>
-- 
2.14.1


From ac6113cb0146494af7ecacbbdc6957ce501a40ec Mon Sep 17 00:00:00 2001
From: Martin Sebor <msebor@redhat.com>
Date: Tue, 22 Aug 2017 09:35:23 -0600
Subject: [PATCH 39/90] Declare ifunc resolver to return a pointer to the same
 type as the target function to help GCC detect incompatibilities between the
 two when it's enhanced to do so.

(cherry picked from commit ee4e992ebe5f9712faedeefe8958b67d61eaa0f2)
---
 ChangeLog              | 5 +++++
 include/libc-symbols.h | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index b53d8830a2..ec9b9f5edb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-22  Martin Sebor  <msebor@redhat.com>
+
+	* include/libc-symbols.h (__ifunc_resolver): Declare resolver
+	to return a pointer to the same type as the target function.
+
 2017-08-03  Alan Modra  <amodra@gmail.com>
 
 	* sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 3310e3a678..c50f9adec2 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -782,7 +782,8 @@ for linking")
 
 /* Helper / base  macros for indirect function symbols.  */
 #define __ifunc_resolver(type_name, name, expr, arg, init, classifier)	\
-  classifier inhibit_stack_protector void *name##_ifunc (arg)					\
+  classifier inhibit_stack_protector					\
+  __typeof (type_name) *name##_ifunc (arg)				\
   {									\
     init ();								\
     __typeof (type_name) *res = expr;					\
-- 
2.14.1


From 37d4262a7a35886cf8ac856457bbad8c0498c8d6 Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
Date: Tue, 22 Aug 2017 14:01:07 -0300
Subject: [PATCH 40/90] Fix remaining return type of ifunc resolver declaration

Since Martin Sebor's commit

commit ee4e992ebe5f9712faedeefe8958b67d61eaa0f2
Author: Martin Sebor <msebor@redhat.com>
Date:   Tue Aug 22 09:35:23 2017 -0600

    Declare ifunc resolver to return a pointer to the same type as the target
    function to help GCC detect incompatibilities between the two when it's
    enhanced to do so.

builds for powerpc64le fail in the declaration of some ifunc resolvers,
because the ifunc is declared with unmatching return types.  One of the
declarations comes from the __ifunc_resolver macro, which was patched by
the aforementioned commit:

    /* Helper / base  macros for indirect function symbols.  */
    #define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
      classifier inhibit_stack_protector                                   \
      __typeof (type_name) *name##_ifunc (arg)                             \

whereas the other comes from the unpatched __ifunc macro when
HAVE_GCC_IFUNC is not defined:

    # define __ifunc(type_name, name, expr, arg, init)                     \
      extern __typeof (type_name) name;                                    \
      void *name##_ifunc (arg) __asm__ (#name);                            \

This patch changes the return type of the ifunc resolver in the __ifunc
macro, so that it matches the return type of the target function,
similarly to what the aforementioned commit does.

Tested for powerpc64le and s390x with unpatched GCC.

	* include/libc-symbols.h: [!defined HAVE_GCC_IFUNC] (__ifunc):
	Change the return type of the ifunc resolver to match the return
	type of the target function.

(cherry picked from commit b513da7e80febbbfb8e58282075018652b6f7273)
---
 ChangeLog              | 6 ++++++
 include/libc-symbols.h | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ec9b9f5edb..6b09c61d5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-22  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* include/libc-symbols.h: [!defined HAVE_GCC_IFUNC] (__ifunc):
+	Change the return type of the ifunc resolver to match the return
+	type of the target function.
+
 2017-08-22  Martin Sebor  <msebor@redhat.com>
 
 	* include/libc-symbols.h (__ifunc_resolver): Declare resolver
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index c50f9adec2..5bf57703a9 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -810,7 +810,7 @@ for linking")
 
 # define __ifunc(type_name, name, expr, arg, init)			\
   extern __typeof (type_name) name;					\
-  void *name##_ifunc (arg) __asm__ (#name);				\
+  __typeof (type_name) *name##_ifunc (arg) __asm__ (#name);		\
   __ifunc_resolver (type_name, name, expr, arg, init,)			\
  __asm__ (".type " #name ", %gnu_indirect_function");
 
-- 
2.14.1


From d37c951fde57e8acb320a9a7d437ba50a1fc3c8a Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
Date: Wed, 20 Sep 2017 15:10:26 -0300
Subject: [PATCH 41/90] Let fpclassify use the builtin when optimizing for size
 in C++ mode (bug 22146)

When optimization for size is on (-Os), fpclassify does not use the
type-generic __builtin_fpclassify builtin, instead it uses __MATH_TG.
However, when library support for float128 is available, __MATH_TG uses
__builtin_types_compatible_p, which is not available in C++ mode.

On the other hand, libstdc++ undefines (in cmath) many macros from
math.h, including fpclassify, so that it can provide its own functions.
However, during its configure tests, libstdc++ just tests for the
availability of the macros (it does not undefine them, nor does it
provide its own functions).

Finally, when libstdc++ is configured with optimization for size
enabled, its configure tests include math.h and get the definition of
fpclassify that uses __MATH_TG (and __builtin_types_compatible_p).
Since libstdc++ does not undefine the macros during its configure tests,
they fail.

This patch lets fpclassify use the builtin in C++ mode, even when
optimization for size is on.  This allows the configure test in
libstdc++ to work.

Tested for powerpc64le and x86_64.

	[BZ #22146]
	math/math.h: Let fpclassify use the builtin in C++ mode, even
	when optimazing for size.

(cherry picked from commit c5c4a626098ec884b8527356abdf2a4bb7b6bf27)
---
 ChangeLog   | 6 ++++++
 NEWS        | 1 +
 math/math.h | 8 +++++++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6b09c61d5a..382674d5a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-22  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	[BZ #22146]
+	math/math.h: Let fpclassify use the builtin in C++ mode, even
+	when optimazing for size.
+
 2017-08-22  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	* include/libc-symbols.h: [!defined HAVE_GCC_IFUNC] (__ifunc):
diff --git a/NEWS b/NEWS
index 9bcb176171..48e2064380 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,7 @@ The following bugs are resolved with this release:
   [21972] assert macro requires operator== (int) for its argument type
   [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
   [22096] resolv: __resolv_conf_attach must not free passed conf object
+  [22146] Let fpclassify use the builtin when optimizing for size in C++ mode
 
 Version 2.26
 
diff --git a/math/math.h b/math/math.h
index 7c0fc6dbb3..f9348ec3ea 100644
--- a/math/math.h
+++ b/math/math.h
@@ -402,7 +402,13 @@ enum
 
 /* Return number of classification appropriate for X.  */
 # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__			      \
-     && !defined __OPTIMIZE_SIZE__
+     && (!defined __OPTIMIZE_SIZE__ || defined __cplusplus)
+     /* The check for __cplusplus allows the use of the builtin, even
+	when optimization for size is on.  This is provided for
+	libstdc++, only to let its configure test work when it is built
+	with -Os.  No further use of this definition of fpclassify is
+	expected in C++ mode, since libstdc++ provides its own version
+	of fpclassify in cmath (which undefines fpclassify).  */
 #  define fpclassify(x) __builtin_fpclassify (FP_NAN, FP_INFINITE,	      \
      FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x)
 # else
-- 
2.14.1


From 548cc83c38a91852b1e44045ead3d20ccd5db4cf Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Thu, 28 Sep 2017 01:59:02 +0000
Subject: [PATCH 42/90] Fix nearbyint arithmetic moved before feholdexcept (bug
 22225).

In <https://sourceware.org/ml/libc-alpha/2013-05/msg00722.html> I
remarked on the possibility of arithmetic in various nearbyint
implementations being scheduled before feholdexcept calls, resulting
in spurious "inexact" exceptions.

I'm now actually observing this occurring in glibc built for ARM with
GCC 7 (in fact, both copies of the same addition/subtraction sequence
being combined and moved out before the conditionals and
feholdexcept/fesetenv pairs), resulting in test failures.

This patch makes the nearbyint implementations with this particular
feholdexcept / arithmetic / fesetenv pattern consistently use
math_opt_barrier on the function argument when first used in
arithmetic, and also consistently use math_force_eval before fesetenv
(the latter was generally already done, but the dbl-64/wordsize-64
implementation used math_opt_barrier instead, and as
math_opt_barrier's intended effect is through its output value being
used, such a use that doesn't use the return value is suspect).

Tested for x86_64 (--disable-multi-arch so more of these
implementations get used), and for ARM in a configuration where I saw
the problem scheduling.

	[BZ #22225]
	* sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use
	math_opt_barrier on argument when doing arithmetic on it.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c (__nearbyint):
	Likewise.  Use math_force_eval not math_opt_barrier after
	arithmetic.
	* sysdeps/ieee754/flt-32/s_nearbyintf.c (__nearbyintf): Use
	math_opt_barrier on argument when doing arithmetic on it.
	* sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl):
	Likewise.

(cherry picked from commit f124cb381116b5809de198327690ad0bd8d1478e)
---
 ChangeLog                                        | 13 +++++++++++++
 sysdeps/ieee754/dbl-64/s_nearbyint.c             |  4 ++--
 sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c |  8 ++++----
 sysdeps/ieee754/flt-32/s_nearbyintf.c            |  4 ++--
 sysdeps/ieee754/ldbl-128/s_nearbyintl.c          |  4 ++--
 5 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 382674d5a3..992722acdb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-09-28  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #22225]
+	* sysdeps/ieee754/dbl-64/s_nearbyint.c (__nearbyint): Use
+	math_opt_barrier on argument when doing arithmetic on it.
+	* sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c (__nearbyint):
+	Likewise.  Use math_force_eval not math_opt_barrier after
+	arithmetic.
+	* sysdeps/ieee754/flt-32/s_nearbyintf.c (__nearbyintf): Use
+	math_opt_barrier on argument when doing arithmetic on it.
+	* sysdeps/ieee754/ldbl-128/s_nearbyintl.c (__nearbyintl):
+	Likewise.
+
 2017-09-22  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
 	[BZ #22146]
diff --git a/sysdeps/ieee754/dbl-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/s_nearbyint.c
index dec0c5d6ee..6e3f8316b1 100644
--- a/sysdeps/ieee754/dbl-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/s_nearbyint.c
@@ -48,7 +48,7 @@ __nearbyint (double x)
       if (j0 < 0)
 	{
 	  libc_feholdexcept (&env);
-	  w = TWO52[sx] + x;
+	  w = TWO52[sx] + math_opt_barrier (x);
 	  t = w - TWO52[sx];
 	  math_force_eval (t);
 	  libc_fesetenv (&env);
@@ -65,7 +65,7 @@ __nearbyint (double x)
 	return x;                       /* x is integral */
     }
   libc_feholdexcept (&env);
-  w = TWO52[sx] + x;
+  w = TWO52[sx] + math_opt_barrier (x);
   t = w - TWO52[sx];
   math_force_eval (t);
   libc_fesetenv (&env);
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
index 8293819981..7d135b54e4 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c
@@ -42,9 +42,9 @@ __nearbyint(double x)
 	if(__builtin_expect(j0<52, 1)) {
 	    if(j0<0) {
 		libc_feholdexcept (&env);
-		double w = TWO52[sx]+x;
+		double w = TWO52[sx] + math_opt_barrier (x);
 		double t =  w-TWO52[sx];
-		math_opt_barrier(t);
+		math_force_eval (t);
 		libc_fesetenv (&env);
 		return __copysign (t, x);
 	    }
@@ -53,9 +53,9 @@ __nearbyint(double x)
 	    else return x;		/* x is integral */
 	}
 	libc_feholdexcept (&env);
-	double w = TWO52[sx]+x;
+	double w = TWO52[sx] + math_opt_barrier (x);
 	double t = w-TWO52[sx];
-	math_opt_barrier (t);
+	math_force_eval (t);
 	libc_fesetenv (&env);
 	return t;
 }
diff --git a/sysdeps/ieee754/flt-32/s_nearbyintf.c b/sysdeps/ieee754/flt-32/s_nearbyintf.c
index 5aebefafcf..b06df6b3c8 100644
--- a/sysdeps/ieee754/flt-32/s_nearbyintf.c
+++ b/sysdeps/ieee754/flt-32/s_nearbyintf.c
@@ -37,7 +37,7 @@ __nearbyintf(float x)
 	if(j0<23) {
 	    if(j0<0) {
 		libc_feholdexceptf (&env);
-		w = TWO23[sx]+x;
+		w = TWO23[sx] + math_opt_barrier (x);
 		t =  w-TWO23[sx];
 		math_force_eval (t);
 		libc_fesetenvf (&env);
@@ -50,7 +50,7 @@ __nearbyintf(float x)
 	    else return x;		/* x is integral */
 	}
 	libc_feholdexceptf (&env);
-	w = TWO23[sx]+x;
+	w = TWO23[sx] + math_opt_barrier (x);
 	t = w-TWO23[sx];
 	math_force_eval (t);
 	libc_fesetenvf (&env);
diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index 1565a8183f..98a33d24a7 100644
--- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -45,7 +45,7 @@ _Float128 __nearbyintl(_Float128 x)
 	if(j0<112) {
 	    if(j0<0) {
 		feholdexcept (&env);
-	        w = TWO112[sx]+x;
+	        w = TWO112[sx] + math_opt_barrier (x);
 	        t = w-TWO112[sx];
 		math_force_eval (t);
 	        fesetenv (&env);
@@ -58,7 +58,7 @@ _Float128 __nearbyintl(_Float128 x)
 	    else return x;		/* x is integral */
 	}
 	feholdexcept (&env);
-	w = TWO112[sx]+x;
+	w = TWO112[sx] + math_opt_barrier (x);
 	t = w-TWO112[sx];
 	math_force_eval (t);
 	fesetenv (&env);
-- 
2.14.1


From fdf58ebc60ce0eb459fd616241b52872b3571ac1 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Sat, 30 Sep 2017 00:48:07 +0000
Subject: [PATCH 43/90] Add missing bug fixes to list in NEWS file.

---
 NEWS | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NEWS b/NEWS
index 48e2064380..8e468c0369 100644
--- a/NEWS
+++ b/NEWS
@@ -28,9 +28,13 @@ The following bugs are resolved with this release:
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
   [21941] powerpc: Restrict xssqrtqp operands to Vector Registers
   [21972] assert macro requires operator== (int) for its argument type
+  [21982] string: stratcliff.c: error: assuming signed overflow does not
+    occur with -O3
+  [22051] libc: zero terminator in the middle of glibc's .eh_frame
   [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
   [22096] resolv: __resolv_conf_attach must not free passed conf object
   [22146] Let fpclassify use the builtin when optimizing for size in C++ mode
+  [22225] math: nearbyint arithmetic moved before feholdexcept
 
 Version 2.26
 
-- 
2.14.1


From 3f68c5c9b61600f0f85c75bac15b1520d5059359 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Tue, 22 Aug 2017 00:59:43 +0000
Subject: [PATCH 44/90] Fix sparc32 bits/long-double.h (bug 21987).

My refactoring of long double information

commit 0acb8a2a855395c25b1feef2470f4d7ca4bed589
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Dec 14 18:27:56 2016 +0000

    Refactor long double information into bits/long-double.h.

resulted in sparc32 configurations installing the ldbl-opt version of
bits/long-double.h instead of the intended
sysdeps/unix/sysv/linux/sparc version.

For sparc32 by itself, this is not a problem, since the ldbl-opt
version is correct for sparc32.  However, both sparc32 and sparc64 are
supposed to install sets of headers that work for both of them, so
that a single sysroot, whichever order the libraries are built and
installed in, works for both.  The effect of having the wrong version
installed is that you end up with a miscompiled sparc64 libstdc++
which fails glibc's configure tests for the C++ compiler.

This patch moves the header from sysdeps/unix/sysv/linux/sparc to
separate copies of the same file for sparc32 and sparc64, to ensure it
comes before ldbl-opt in the sysdeps directory ordering.

Tested with build-many-glibcs.py for sparc64-linux-gnu and
sparcv9-linux-gnu.

	[BZ #21987]
	* sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Remove file
	and copy to ...
	* sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h:
	... here.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h:
	... and here.

(cherry picked from commit 80f91666fed71fa3dd5eb5618739147cc731bc89)
---
 ChangeLog                                          | 10 +++++++++
 .../linux/sparc/{ => sparc32}/bits/long-double.h   |  0
 .../sysv/linux/sparc/sparc64/bits/long-double.h    | 26 ++++++++++++++++++++++
 3 files changed, 36 insertions(+)
 rename sysdeps/unix/sysv/linux/sparc/{ => sparc32}/bits/long-double.h (100%)
 create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h

diff --git a/ChangeLog b/ChangeLog
index 992722acdb..cc763ac065 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-08-22  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #21987]
+	* sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Remove file
+	and copy to ...
+	* sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h:
+	... here.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h:
+	... and here.
+
 2017-09-28  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #22225]
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/long-double.h b/sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h
similarity index 100%
rename from sysdeps/unix/sysv/linux/sparc/bits/long-double.h
rename to sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h
new file mode 100644
index 0000000000..094e05124b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h
@@ -0,0 +1,26 @@
+/* Properties of long double type.  SPARC version.
+   Copyright (C) 2016-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License  published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <bits/wordsize.h>
+
+#if !defined __NO_LONG_DOUBLE_MATH && __WORDSIZE == 32
+# define __LONG_DOUBLE_MATH_OPTIONAL   1
+# ifndef __LONG_DOUBLE_128__
+#  define __NO_LONG_DOUBLE_MATH        1
+# endif
+#endif
-- 
2.14.1


From 3b10c5d2abb0392d5ecfd865e2eb911ac109e36f Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
Date: Mon, 2 Oct 2017 14:46:35 -0300
Subject: [PATCH 45/90] Add C++ versions of iscanonical for ldbl-96 and
 ldbl-128ibm (bug 22235)

All representations of floating-point numbers in types with IEC 60559
binary exchange format are canonical.  On the other hand, types with IEC
60559 extended formats, such as those implemented under ldbl-96 and
ldbl-128ibm, contain representations that are not canonical.

TS 18661-1 introduced the type-generic macro iscanonical, which returns
whether a floating-point value is canonical or not.  In Glibc, this
type-generic macro is implemented using the macro __MATH_TG, which, when
support for float128 is enabled, relies on __builtin_types_compatible_p
to select between floating-point types.  However, this use of
iscanonical breaks C++ applications, because the builtin is only
available in C mode.

This patch provides a C++ implementation of iscanonical that relies on
function overloading, rather than builtins, to select between
floating-point types.

Unlike the C++ implementations for iszero and issignaling, this
implementation ignores __NO_LONG_DOUBLE_MATH.  The double type always
matches IEC 60559 double format, which is always canonical.  Thus, when
double and long double are the same (__NO_LONG_DOUBLE_MATH), iscanonical
always returns 1 and is not implemented with __MATH_TG.

Tested for powerpc64, powerpc64le and x86_64.

	[BZ #22235]
	* math/math.h: Trivial fix for unbalanced parentheses in comment.
	* math/Makefile [CXX] (tests): Add test-math-iscanonical.cc.
	(CFLAGS-test-math-iscanonical.cc): New variable.
	* math/test-math-iscanonical.cc: New file.
	* sysdeps/ieee754/ldbl-96/bits/iscanonical.h (iscanonical):
	Provide a C++ implementation based on function overloading,
	rather than using __MATH_TG, which uses C-only builtins.
	* sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h (iscanonical):
	Likewise.
	* sysdeps/powerpc/powerpc64le/Makefile
	(CFLAGS-test-math-iscanonical.cc): New variable.

(cherry picked from commit aa0235dfdebffe9b338deba51f3ba563ee9b433d)
---
 ChangeLog                                      | 15 ++++++++
 NEWS                                           |  1 +
 math/Makefile                                  |  4 ++-
 math/math.h                                    |  2 +-
 math/test-math-iscanonical.cc                  | 48 ++++++++++++++++++++++++++
 sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h | 21 +++++++++--
 sysdeps/ieee754/ldbl-96/bits/iscanonical.h     | 19 +++++++++-
 sysdeps/powerpc/powerpc64le/Makefile           |  1 +
 8 files changed, 106 insertions(+), 5 deletions(-)
 create mode 100644 math/test-math-iscanonical.cc

diff --git a/ChangeLog b/ChangeLog
index cc763ac065..fea4fd0cd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2017-10-03  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	[BZ #22235]
+	* math/math.h: Trivial fix for unbalanced parentheses in comment.
+	* math/Makefile [CXX] (tests): Add test-math-iscanonical.cc.
+	(CFLAGS-test-math-iscanonical.cc): New variable.
+	* math/test-math-iscanonical.cc: New file.
+	* sysdeps/ieee754/ldbl-96/bits/iscanonical.h (iscanonical):
+	Provide a C++ implementation based on function overloading,
+	rather than using __MATH_TG, which uses C-only builtins.
+	* sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h (iscanonical):
+	Likewise.
+	* sysdeps/powerpc/powerpc64le/Makefile
+	(CFLAGS-test-math-iscanonical.cc): New variable.
+
 2017-08-22  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #21987]
diff --git a/NEWS b/NEWS
index 8e468c0369..5b05edeb4f 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,7 @@ The following bugs are resolved with this release:
   [22096] resolv: __resolv_conf_attach must not free passed conf object
   [22146] Let fpclassify use the builtin when optimizing for size in C++ mode
   [22225] math: nearbyint arithmetic moved before feholdexcept
+  [22235] Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm
 
 Version 2.26
 
diff --git a/math/Makefile b/math/Makefile
index 0130fcf38b..2c17c68eda 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -203,7 +203,8 @@ tests-static = test-fpucw-static test-fpucw-ieee-static \
 	       test-signgam-ullong-static test-signgam-ullong-init-static
 
 ifneq (,$(CXX))
-tests += test-math-isinff test-math-iszero test-math-issignaling
+tests += test-math-isinff test-math-iszero test-math-issignaling \
+	 test-math-iscanonical
 endif
 
 ifneq (no,$(PERL))
@@ -351,6 +352,7 @@ CFLAGS-test-signgam-ullong-init-static.c = -std=c99
 CFLAGS-test-math-isinff.cc = -std=gnu++11
 CFLAGS-test-math-iszero.cc = -std=gnu++11
 CFLAGS-test-math-issignaling.cc = -std=gnu++11
+CFLAGS-test-math-iscanonical.cc = -std=gnu++11
 
 CFLAGS-test-iszero-excess-precision.c = -fexcess-precision=standard
 CFLAGS-test-iseqsig-excess-precision.c = -fexcess-precision=standard
diff --git a/math/math.h b/math/math.h
index f9348ec3ea..2b216c6da1 100644
--- a/math/math.h
+++ b/math/math.h
@@ -488,7 +488,7 @@ enum
       other hand, overloading provides the means to distinguish between
       the floating-point types.  The overloading resolution will match
       the correct parameter (regardless of type qualifiers (i.e.: const
-      and volatile).  */
+      and volatile)).  */
 extern "C++" {
 inline int issignaling (float __val) { return __issignalingf (__val); }
 inline int issignaling (double __val) { return __issignaling (__val); }
diff --git a/math/test-math-iscanonical.cc b/math/test-math-iscanonical.cc
new file mode 100644
index 0000000000..aba68acb4f
--- /dev/null
+++ b/math/test-math-iscanonical.cc
@@ -0,0 +1,48 @@
+/* Test for the C++ implementation of iscanonical.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define _GNU_SOURCE 1
+#include <math.h>
+#include <stdio.h>
+
+static bool errors;
+
+template <class T>
+static void
+check_type ()
+{
+  T val = 0;
+
+  /* Check if iscanonical is available in C++ mode (bug 22235).  */
+  if (iscanonical (val) == 0)
+    errors++;
+}
+
+static int
+do_test (void)
+{
+  check_type<float> ();
+  check_type<double> ();
+  check_type<long double> ();
+#if __HAVE_DISTINCT_FLOAT128
+  check_type<_Float128> ();
+#endif
+  return errors;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
index 7ddb368d26..f756857c03 100644
--- a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
+++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h
@@ -37,5 +37,22 @@ extern int __iscanonicall (long double __x)
    conversion, before being discarded; in IBM long double, there are
    encodings that are not consistently handled as corresponding to any
    particular value of the type, and we return 0 for those.  */
-# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
-#endif
+# ifndef __cplusplus
+#  define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+# else
+/* In C++ mode, __MATH_TG cannot be used, because it relies on
+   __builtin_types_compatible_p, which is a C-only builtin.  On the
+   other hand, overloading provides the means to distinguish between
+   the floating-point types.  The overloading resolution will match
+   the correct parameter (regardless of type qualifiers (i.e.: const
+   and volatile)).  */
+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); }
+#  if __HAVE_DISTINCT_FLOAT128
+inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
+#  endif
+}
+# endif /* __cplusplus */
+#endif /* __NO_LONG_DOUBLE_MATH */
diff --git a/sysdeps/ieee754/ldbl-96/bits/iscanonical.h b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
index 4a4f4ad024..cfa36a0c2a 100644
--- a/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
+++ b/sysdeps/ieee754/ldbl-96/bits/iscanonical.h
@@ -34,4 +34,21 @@ extern int __iscanonicall (long double __x)
    conversion, before being discarded; in extended precision, there
    are encodings that are not consistently handled as corresponding to
    any particular value of the type, and we return 0 for those.  */
-#define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+#ifndef __cplusplus
+# define iscanonical(x) __MATH_TG ((x), __iscanonical, (x))
+#else
+/* In C++ mode, __MATH_TG cannot be used, because it relies on
+   __builtin_types_compatible_p, which is a C-only builtin.  On the
+   other hand, overloading provides the means to distinguish between
+   the floating-point types.  The overloading resolution will match
+   the correct parameter (regardless of type qualifiers (i.e.: const
+   and volatile)).  */
+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); }
+# if __HAVE_DISTINCT_FLOAT128
+inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
+# endif
+}
+#endif /* __cplusplus */
diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile
index dea2290736..cf2dbfb673 100644
--- a/sysdeps/powerpc/powerpc64le/Makefile
+++ b/sysdeps/powerpc/powerpc64le/Makefile
@@ -16,6 +16,7 @@ $(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128
 $(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128
 $(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += -mfloat128
 CFLAGS-libm-test-support-float128.c += -mfloat128
+CFLAGS-test-math-iscanonical.cc += -mfloat128
 CFLAGS-test-math-issignaling.cc += -mfloat128
 CFLAGS-test-math-iszero.cc += -mfloat128
 $(objpfx)test-float128% $(objpfx)test-ifloat128% $(objpfx)test-math-iszero: \
-- 
2.14.1


From dd3a7239fddff81ac31373d69978d7aa1902c65f Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 3 Oct 2017 17:41:32 -0700
Subject: [PATCH 46/90] test-math-iscanonical.cc: Replace bool with int
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix GCC 7 compilation error:

test-math-iscanonical.cc: In function ‘void check_type()’:
test-math-iscanonical.cc:33:11: error: use of an operand of type ‘bool’ in ‘operator++’ is deprecated [-Werror=deprecated]
     errors++;
           ^~

Since not all non-zero error counts are errors, return errors != 0
instead.

	* math/test-math-iscanonical.cc (error): Replace bool with int.
	(do_test): Return errors != 0.

(cherry picked from commit cdd4155d6c527c00a89606385859984e35bd2910 and
 commit 758f1bfa2a1bccb52f1b3e97444a367d35aceaee)
---
 ChangeLog                     | 5 +++++
 math/test-math-iscanonical.cc | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fea4fd0cd6..d7a185e99d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* math/test-math-iscanonical.cc (error): Replace bool with int.
+	(do_test): Return errors != 0.
+
 2017-10-03  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
 	[BZ #22235]
diff --git a/math/test-math-iscanonical.cc b/math/test-math-iscanonical.cc
index aba68acb4f..4cfb1c5055 100644
--- a/math/test-math-iscanonical.cc
+++ b/math/test-math-iscanonical.cc
@@ -20,7 +20,7 @@
 #include <math.h>
 #include <stdio.h>
 
-static bool errors;
+static int errors;
 
 template <class T>
 static void
@@ -42,7 +42,7 @@ do_test (void)
 #if __HAVE_DISTINCT_FLOAT128
   check_type<_Float128> ();
 #endif
-  return errors;
+  return errors != 0;
 }
 
 #include <support/test-driver.c>
-- 
2.14.1


From 6e1ea21501eac981204c3cc8212d45998f74983c Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@systemhalted.org>
Date: Thu, 28 Sep 2017 11:05:18 -0600
Subject: [PATCH 47/90] malloc: Fix tcache leak after thread destruction [BZ
 #22111]

The malloc tcache added in 2.26 will leak all of the elements remaining
in the cache and the cache structure itself when a thread exits. The
defect is that we do not set tcache_shutting_down early enough, and the
thread simply recreates the tcache and places the elements back onto a
new tcache which is subsequently lost as the thread exits (unfreed
memory). The fix is relatively simple, move the setting of
tcache_shutting_down earlier in tcache_thread_freeres. We add a test
case which uses mallinfo and some heuristics to look for unaccounted for
memory usage between the start and end of a thread start/join loop. It
is very reliable at detecting that there is a leak given the number of
iterations.  Without the fix the test will consume 122MiB of leaked
memory.

(cherry picked from commit 1e26d35193efbb29239c710a4c46a64708643320)
---
 ChangeLog                       |   9 ++++
 malloc/Makefile                 |   3 ++
 malloc/malloc.c                 |   8 +--
 malloc/tst-malloc-tcache-leak.c | 112 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 129 insertions(+), 3 deletions(-)
 create mode 100644 malloc/tst-malloc-tcache-leak.c

diff --git a/ChangeLog b/ChangeLog
index d7a185e99d..bfcdc1ebbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-10-06  Carlos O'Donell  <carlos@redhat.com>
+
+	[BZ #22111]
+	* malloc/malloc.c (tcache_shutting_down): Use bool type.
+	(tcache_thread_freeres): Set tcache_shutting_down before
+	freeing the tcache.
+	* malloc/Makefile (tests): Add tst-malloc-tcache-leak.
+	* malloc/tst-malloc-tcache-leak.c: New file.
+
 2017-10-04  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* math/test-math-iscanonical.cc (error): Replace bool with int.
diff --git a/malloc/Makefile b/malloc/Makefile
index 3fa395b949..9e23db9343 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -34,6 +34,7 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
 	 tst-interpose-nothread \
 	 tst-interpose-thread \
 	 tst-alloc_buffer \
+	 tst-malloc-tcache-leak \
 
 tests-static := \
 	 tst-interpose-static-nothread \
@@ -242,3 +243,5 @@ tst-dynarray-fail-ENV = MALLOC_TRACE=$(objpfx)tst-dynarray-fail.mtrace
 $(objpfx)tst-dynarray-fail-mem.out: $(objpfx)tst-dynarray-fail.out
 	$(common-objpfx)malloc/mtrace $(objpfx)tst-dynarray-fail.mtrace > $@; \
 	$(evaluate-test)
+
+$(objpfx)tst-malloc-tcache-leak: $(shared-thread-library)
diff --git a/malloc/malloc.c b/malloc/malloc.c
index e3ff778113..01ec1571b9 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2952,7 +2952,7 @@ typedef struct tcache_perthread_struct
   tcache_entry *entries[TCACHE_MAX_BINS];
 } tcache_perthread_struct;
 
-static __thread char tcache_shutting_down = 0;
+static __thread bool tcache_shutting_down = false;
 static __thread tcache_perthread_struct *tcache = NULL;
 
 /* Caller must ensure that we know tc_idx is valid and there's room
@@ -2989,8 +2989,12 @@ tcache_thread_freeres (void)
   if (!tcache)
     return;
 
+  /* Disable the tcache and prevent it from being reinitialized.  */
   tcache = NULL;
+  tcache_shutting_down = true;
 
+  /* Free all of the entries and the tcache itself back to the arena
+     heap for coalescing.  */
   for (i = 0; i < TCACHE_MAX_BINS; ++i)
     {
       while (tcache_tmp->entries[i])
@@ -3002,8 +3006,6 @@ tcache_thread_freeres (void)
     }
 
   __libc_free (tcache_tmp);
-
-  tcache_shutting_down = 1;
 }
 text_set_element (__libc_thread_subfreeres, tcache_thread_freeres);
 
diff --git a/malloc/tst-malloc-tcache-leak.c b/malloc/tst-malloc-tcache-leak.c
new file mode 100644
index 0000000000..22c679b65b
--- /dev/null
+++ b/malloc/tst-malloc-tcache-leak.c
@@ -0,0 +1,112 @@
+/* Bug 22111: Test that threads do not leak their per thread cache.
+   Copyright (C) 2015-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* The point of this test is to start and exit a large number of
+   threads, while at the same time looking to see if the used
+   memory grows with each round of threads run.  If the memory
+   grows above some linear bound we declare the test failed and
+   that the malloc implementation is leaking memory with each
+   thread.  This is a good indicator that the thread local cache
+   is leaking chunks.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <pthread.h>
+#include <assert.h>
+
+#include <support/check.h>
+#include <support/support.h>
+#include <support/xthread.h>
+
+void *
+worker (void *data)
+{
+  void *ret;
+  /* Allocate an arbitrary amount of memory that is known to fit into
+     the thread local cache (tcache).  If we have at least 64 bins
+     (default e.g. TCACHE_MAX_BINS) we should be able to allocate 32
+     bytes and force malloc to fill the tcache.  We are assuming tcahce
+     init happens at the first small alloc, but it might in the future
+     be deferred to some other point.  Therefore to future proof this
+     test we include a full alloc/free/alloc cycle for the thread.  We
+     need a compiler barrier to avoid the removal of the useless
+     alloc/free.  We send some memory back to main to have the memory
+     freed after the thread dies, as just another check that the chunks
+     that were previously in the tcache are still OK to free after
+     thread death.  */
+  ret = xmalloc (32);
+  __asm__ volatile ("" ::: "memory");
+  free (ret);
+  return (void *) xmalloc (32);
+}
+
+static int
+do_test (void)
+{
+  pthread_t *thread;
+  struct mallinfo info_before, info_after;
+  void *retval;
+
+  /* This is an arbitrary choice. We choose a total of THREADS
+     threads created and joined.  This gives us enough iterations to
+     show a leak.  */
+  int threads = 100000;
+
+  /* Avoid there being 0 malloc'd data at this point by allocating the
+     pthread_t required to run the test.  */
+  thread = (pthread_t *) xcalloc (1, sizeof (pthread_t));
+
+  info_before = mallinfo ();
+
+  assert (info_before.uordblks != 0);
+
+  printf ("INFO: %d (bytes) are in use before starting threads.\n",
+          info_before.uordblks);
+
+  for (int loop = 0; loop < threads; loop++)
+    {
+      *thread = xpthread_create (NULL, worker, NULL);
+      retval = xpthread_join (*thread);
+      free (retval);
+    }
+
+  info_after = mallinfo ();
+  printf ("INFO: %d (bytes) are in use after all threads joined.\n",
+          info_after.uordblks);
+
+  /* We need to compare the memory in use before and the memory in use
+     after starting and joining THREADS threads.  We almost always grow
+     memory slightly, but not much. Consider that if even 1-byte leaked
+     per thread we'd have THREADS bytes of additional memory, and in
+     general the in-use at the start of main is quite low.  We will
+     always leak a full malloc chunk, and never just 1-byte, therefore
+     anything above "+ threads" from the start (constant offset) is a
+     leak.  Obviously this assumes no thread-related malloc'd internal
+     libc data structures persist beyond the thread death, and any that
+     did would limit the number of times you could call pthread_create,
+     which is a QoI we'd want to detect and fix.  */
+  if (info_after.uordblks > (info_before.uordblks + threads))
+    FAIL_EXIT1 ("Memory usage after threads is too high.\n");
+
+  /* Did not detect excessive memory usage.  */
+  free (thread);
+  exit (0);
+}
+
+#include <support/test-driver.c>
-- 
2.14.1


From d5c6dea2d5b4b5c64625c5386f6baec7bf2d89b3 Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@systemhalted.org>
Date: Fri, 6 Oct 2017 13:31:05 -0700
Subject: [PATCH 48/90] Update NEWS for bug 22111.

---
 NEWS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NEWS b/NEWS
index 5b05edeb4f..d6d1f90008 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,7 @@ The following bugs are resolved with this release:
   [22051] libc: zero terminator in the middle of glibc's .eh_frame
   [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
   [22096] resolv: __resolv_conf_attach must not free passed conf object
+  [22111] malloc: per thread cache is not returned when thread exits
   [22146] Let fpclassify use the builtin when optimizing for size in C++ mode
   [22225] math: nearbyint arithmetic moved before feholdexcept
   [22235] Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm
-- 
2.14.1


From b21ec6c6b80e316143b0914a5c81e9543bbdcc5b Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Tue, 10 Oct 2017 15:43:52 +0530
Subject: [PATCH 49/90] aarch64: Optimized memcpy for Qualcomm Falkor processor

This is an optimized implementation of the memcpy routine that gives a
significant gain in performance for all sizes of copies on the
Qualcomm Falkor processor.  A detailed rationale of the implementation
is written in a comment in the patch.

This implementation improves time for copies up to 128 bytes by up to
15% and for larger copies by up to 35% in the glibc
microbenchmark. The memcpy-random benchmark sees improvements in all
sizes in the range of 13%-18%.

Here are the full numbers extracted from the glibc microbenchmark
using the commands:

../benchtests/scripts/compare_strings.py benchtests/bench-memcpy.out \
		../benchtests/scripts/benchout_strings.schema.json \
		-base=__memcpy_generic length align1 align2

../benchtests/scripts/compare_strings.py benchtests/bench-memcpy-large.out \
		../benchtests/scripts/benchout_strings.schema.json \
		-base=__memcpy_generic length align1 align2

../benchtests/scripts/compare_strings.py benchtests/bench-memcpy-random.out \
		../benchtests/scripts/benchout_strings.schema.json \
		-base=__memcpy_generic max-size

Function: memcpy
__memcpy_thunderx       __memcpy_falkor __memcpy_generic
Variant: default
================================================================================
length=1,align1=0,align2=0:     33.59 (-115.00%)        15.62 (0.00%)   15.62
length=1,align1=0,align2=0:     16.41 (-10.53%) 14.06 (5.26%)   14.84
length=1,align1=0,align2=0:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=1,align1=0,align2=0:     15.62 (-5.26%)  14.06 (5.26%)   14.84
length=2,align1=0,align2=0:     15.62 (-5.26%)  14.06 (5.26%)   14.84
length=2,align1=1,align2=0:     15.62 (-5.26%)  14.06 (5.26%)   14.84
length=2,align1=0,align2=1:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=1,align2=1:     14.84 (-5.56%)  14.06 (0.00%)   14.06
length=4,align1=0,align2=0:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=4,align1=2,align2=0:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=4,align1=0,align2=2:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=4,align1=2,align2=2:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=8,align1=0,align2=0:     14.84 (-5.56%)  13.28 (5.56%)   14.06
length=8,align1=3,align2=0:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=8,align1=0,align2=3:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=8,align1=3,align2=3:     13.28 (-6.25%)  13.28 (-6.25%)  12.50
length=16,align1=0,align2=0:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=16,align1=4,align2=0:    13.28 (0.00%)   12.50 (5.88%)   13.28
length=16,align1=0,align2=4:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=16,align1=4,align2=4:    13.28 (-6.25%)  12.50 (0.00%)   12.50
length=32,align1=0,align2=0:    14.06 (0.00%)   12.50 (11.11%)  14.06
length=32,align1=5,align2=0:    13.28 (0.00%)   12.50 (5.88%)   13.28
length=32,align1=0,align2=5:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=32,align1=5,align2=5:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=64,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=64,align1=6,align2=0:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=64,align1=0,align2=6:    14.06 (5.26%)   14.06 (5.26%)   14.84
length=64,align1=6,align2=6:    14.84 (-11.77%) 14.06 (-5.88%)  13.28
length=128,align1=0,align2=0:   17.19 (-4.76%)  14.84 (9.52%)   16.41
length=128,align1=7,align2=0:   16.41 (4.55%)   15.62 (9.09%)   17.19
length=128,align1=0,align2=7:   16.41 (0.00%)   14.06 (14.29%)  16.41
length=128,align1=7,align2=7:   16.41 (4.55%)   15.62 (9.09%)   17.19
length=256,align1=0,align2=0:   21.88 (-3.70%)  21.09 (0.00%)   21.09
length=256,align1=8,align2=0:   21.09 (-3.85%)  21.09 (-3.85%)  20.31
length=256,align1=0,align2=8:   20.31 (-4.00%)  20.31 (-4.00%)  19.53
length=256,align1=8,align2=8:   21.88 (-7.69%)  20.31 (0.00%)   20.31
length=512,align1=0,align2=0:   28.91 (-2.78%)  28.91 (-2.78%)  28.12
length=512,align1=9,align2=0:   30.47 (-2.63%)  30.47 (-2.63%)  29.69
length=512,align1=0,align2=9:   29.69 (0.00%)   29.69 (0.00%)   29.69
length=512,align1=9,align2=9:   28.12 (-2.86%)  28.12 (-2.86%)  27.34
length=1024,align1=0,align2=0:  44.53 (0.00%)   44.53 (0.00%)   44.53
length=1024,align1=10,align2=0:         50.00 (0.00%)   50.00 (0.00%)   50.00
length=1024,align1=0,align2=10:         49.22 (1.56%)   50.78 (-1.56%)  50.00
length=1024,align1=10,align2=10:        44.53 (-1.79%)  43.75 (0.00%)   43.75
length=2048,align1=0,align2=0:  77.34 (-1.02%)  76.56 (0.00%)   76.56
length=2048,align1=11,align2=0:         89.84 (0.00%)   89.84 (0.00%)   89.84
length=2048,align1=0,align2=11:         89.84 (0.00%)   89.84 (0.00%)   89.84
length=2048,align1=11,align2=11:        75.78 (0.00%)   75.78 (0.00%)   75.78
length=4096,align1=0,align2=0:  141.41 (-0.56%) 140.62 (0.00%)  140.62
length=4096,align1=12,align2=0:         171.09 (-0.46%) 170.31 (0.00%)  170.31
length=4096,align1=0,align2=12:         170.31 (0.00%)  170.31 (0.00%)  170.31
length=4096,align1=12,align2=12:        140.62 (0.00%)  140.62 (0.00%)  140.62
length=8192,align1=0,align2=0:  278.91 (-0.28%) 275.78 (0.84%)  278.12
length=8192,align1=13,align2=0:         338.28 (0.23%)  335.94 (0.92%)  339.06
length=8192,align1=0,align2=13:         338.28 (0.00%)  455.47 (-34.64%)        338.28
length=8192,align1=13,align2=13:        278.12 (-0.28%) 275.78 (0.56%)  277.34
length=16384,align1=0,align2=0:         535.94 (-0.15%) 531.25 (0.73%)  535.16
length=16384,align1=14,align2=0:        659.38 (0.12%)  659.38 (0.12%)  660.16
length=16384,align1=0,align2=14:        659.38 (0.00%)  657.03 (0.36%)  659.38
length=16384,align1=14,align2=14:       535.16 (0.44%)  532.81 (0.87%)  537.50
length=32768,align1=0,align2=0:         1260.94 (10.68%)        1121.88 (20.53%)        1411.72
length=32768,align1=15,align2=0:        1368.75 (10.02%)        1376.56 (9.50%) 1521.09
length=32768,align1=0,align2=15:        1333.59 (10.91%)        1373.44 (8.25%) 1496.88
length=32768,align1=15,align2=15:       1256.25 (13.96%)        1125.78 (22.90%)        1460.16
length=65536,align1=0,align2=0:         2853.91 (30.11%)        2589.06 (36.60%)        4083.59
length=65536,align1=16,align2=0:        2850.00 (30.14%)        2589.84 (36.52%)        4079.69
length=65536,align1=0,align2=16:        2853.12 (30.60%)        2589.84 (37.00%)        4110.94
length=65536,align1=16,align2=16:       2850.78 (30.07%)        2589.06 (36.49%)        4076.56
length=0,align1=0,align2=0:     15.62 (-5.26%)  16.41 (-10.53%) 14.84
length=0,align1=0,align2=0:     14.84 (-5.56%)  14.84 (-5.56%)  14.06
length=0,align1=0,align2=0:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=0,align1=0,align2=0:     16.41 (-16.67%) 14.84 (-5.56%)  14.06
length=1,align1=0,align2=0:     15.62 (4.76%)   15.62 (4.76%)   16.41
length=1,align1=1,align2=0:     15.62 (0.00%)   14.84 (5.00%)   15.62
length=1,align1=0,align2=1:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=1,align1=1,align2=1:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=0,align2=0:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=2,align2=0:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=2,align1=0,align2=2:     14.84 (-5.56%)  14.06 (0.00%)   14.06
length=2,align1=2,align2=2:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=3,align1=0,align2=0:     14.84 (0.00%)   14.84 (0.00%)   14.84
length=3,align1=3,align2=0:     14.84 (-5.56%)  14.06 (0.00%)   14.06
length=3,align1=0,align2=3:     15.62 (-11.11%) 14.06 (0.00%)   14.06
length=3,align1=3,align2=3:     14.84 (0.00%)   14.06 (5.26%)   14.84
length=4,align1=0,align2=0:     17.97 (-27.78%) 14.06 (0.00%)   14.06
length=4,align1=4,align2=0:     13.28 (5.56%)   14.06 (0.00%)   14.06
length=4,align1=0,align2=4:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=4,align1=4,align2=4:     13.28 (5.56%)   13.28 (5.56%)   14.06
length=5,align1=0,align2=0:     13.28 (5.56%)   13.28 (5.56%)   14.06
length=5,align1=5,align2=0:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=5,align1=0,align2=5:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=5,align1=5,align2=5:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=6,align1=0,align2=0:     14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=6,align1=6,align2=0:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=6,align1=0,align2=6:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=6,align1=6,align2=6:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=7,align1=0,align2=0:     14.84 (-11.77%) 14.06 (-5.88%)  13.28
length=7,align1=7,align2=0:     13.28 (0.00%)   14.06 (-5.88%)  13.28
length=7,align1=0,align2=7:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=7,align1=7,align2=7:     14.06 (0.00%)   14.06 (0.00%)   14.06
length=8,align1=0,align2=0:     14.06 (-5.88%)  13.28 (0.00%)   13.28
length=8,align1=8,align2=0:     14.06 (0.00%)   13.28 (5.56%)   14.06
length=8,align1=0,align2=8:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=8,align1=8,align2=8:     14.06 (-5.88%)  13.28 (0.00%)   13.28
length=9,align1=0,align2=0:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=9,align1=9,align2=0:     13.28 (0.00%)   13.28 (0.00%)   13.28
length=9,align1=0,align2=9:     13.28 (0.00%)   14.06 (-5.88%)  13.28
length=9,align1=9,align2=9:     14.06 (-5.88%)  13.28 (0.00%)   13.28
length=10,align1=0,align2=0:    14.06 (0.00%)   13.28 (5.56%)   14.06
length=10,align1=10,align2=0:   14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=10,align1=0,align2=10:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=10,align1=10,align2=10:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=11,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=11,align1=11,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=11,align1=0,align2=11:   13.28 (0.00%)   13.28 (0.00%)   13.28
length=11,align1=11,align2=11:  13.28 (0.00%)   13.28 (0.00%)   13.28
length=12,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=12,align1=12,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=12,align1=0,align2=12:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=12,align1=12,align2=12:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=13,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=13,align1=13,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=13,align1=0,align2=13:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=13,align1=13,align2=13:  13.28 (0.00%)   13.28 (0.00%)   13.28
length=14,align1=0,align2=0:    13.28 (0.00%)   13.28 (0.00%)   13.28
length=14,align1=14,align2=0:   13.28 (5.56%)   13.28 (5.56%)   14.06
length=14,align1=0,align2=14:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=14,align1=14,align2=14:  14.06 (-5.88%)  13.28 (0.00%)   13.28
length=15,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=15,align1=15,align2=0:   14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=15,align1=0,align2=15:   13.28 (0.00%)   13.28 (0.00%)   13.28
length=15,align1=15,align2=15:  13.28 (0.00%)   14.06 (-5.88%)  13.28
length=16,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=16,align1=16,align2=0:   13.28 (5.56%)   14.06 (0.00%)   14.06
length=16,align1=0,align2=16:   14.84 (-11.77%) 13.28 (0.00%)   13.28
length=16,align1=16,align2=16:  13.28 (-6.25%)  12.50 (0.00%)   12.50
length=17,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=17,align1=17,align2=0:   14.84 (-11.77%) 12.50 (5.88%)   13.28
length=17,align1=0,align2=17:   14.84 (-5.56%)  12.50 (11.11%)  14.06
length=17,align1=17,align2=17:  14.84 (-11.77%) 12.50 (5.88%)   13.28
length=18,align1=0,align2=0:    14.06 (0.00%)   12.50 (11.11%)  14.06
length=18,align1=18,align2=0:   13.28 (5.56%)   12.50 (11.11%)  14.06
length=18,align1=0,align2=18:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=18,align1=18,align2=18:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=19,align1=0,align2=0:    14.06 (-5.88%)  13.28 (0.00%)   13.28
length=19,align1=19,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=19,align1=0,align2=19:   14.84 (-5.56%)  12.50 (11.11%)  14.06
length=19,align1=19,align2=19:  14.06 (-5.88%)  12.50 (5.88%)   13.28
length=20,align1=0,align2=0:    14.84 (-11.77%) 12.50 (5.88%)   13.28
length=20,align1=20,align2=0:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=20,align1=0,align2=20:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=20,align1=20,align2=20:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=21,align1=0,align2=0:    14.84 (-5.56%)  12.50 (11.11%)  14.06
length=21,align1=21,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=21,align1=0,align2=21:   14.84 (-11.77%) 12.50 (5.88%)   13.28
length=21,align1=21,align2=21:  13.28 (5.56%)   13.28 (5.56%)   14.06
length=22,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=22,align1=22,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=22,align1=0,align2=22:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=22,align1=22,align2=22:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=23,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=23,align1=23,align2=0:   14.06 (-5.88%)  13.28 (0.00%)   13.28
length=23,align1=0,align2=23:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=23,align1=23,align2=23:  14.06 (-5.88%)  13.28 (0.00%)   13.28
length=24,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=24,align1=24,align2=0:   14.06 (0.00%)   13.28 (5.56%)   14.06
length=24,align1=0,align2=24:   14.84 (-11.77%) 12.50 (5.88%)   13.28
length=24,align1=24,align2=24:  14.06 (-5.88%)  13.28 (0.00%)   13.28
length=25,align1=0,align2=0:    14.06 (0.00%)   12.50 (11.11%)  14.06
length=25,align1=25,align2=0:   14.06 (0.00%)   13.28 (5.56%)   14.06
length=25,align1=0,align2=25:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=25,align1=25,align2=25:  13.28 (0.00%)   13.28 (0.00%)   13.28
length=26,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=26,align1=26,align2=0:   14.06 (0.00%)   13.28 (5.56%)   14.06
length=26,align1=0,align2=26:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=26,align1=26,align2=26:  14.06 (0.00%)   13.28 (5.56%)   14.06
length=27,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=27,align1=27,align2=0:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=27,align1=0,align2=27:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=27,align1=27,align2=27:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=28,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=28,align1=28,align2=0:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=28,align1=0,align2=28:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=28,align1=28,align2=28:  14.84 (-11.77%) 13.28 (0.00%)   13.28
length=29,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=29,align1=29,align2=0:   13.28 (0.00%)   12.50 (5.88%)   13.28
length=29,align1=0,align2=29:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=29,align1=29,align2=29:  13.28 (5.56%)   12.50 (11.11%)  14.06
length=30,align1=0,align2=0:    14.06 (-5.88%)  12.50 (5.88%)   13.28
length=30,align1=30,align2=0:   13.28 (5.56%)   12.50 (11.11%)  14.06
length=30,align1=0,align2=30:   14.06 (-5.88%)  12.50 (5.88%)   13.28
length=30,align1=30,align2=30:  13.28 (0.00%)   12.50 (5.88%)   13.28
length=31,align1=0,align2=0:    13.28 (0.00%)   12.50 (5.88%)   13.28
length=31,align1=31,align2=0:   14.06 (0.00%)   12.50 (11.11%)  14.06
length=31,align1=0,align2=31:   13.28 (0.00%)   12.50 (5.88%)   13.28
length=31,align1=31,align2=31:  14.06 (0.00%)   12.50 (11.11%)  14.06
length=48,align1=0,align2=0:    14.06 (0.00%)   14.06 (0.00%)   14.06
length=48,align1=3,align2=0:    14.06 (0.00%)   14.06 (0.00%)   14.06
length=48,align1=0,align2=3:    14.06 (-5.88%)  14.06 (-5.88%)  13.28
length=48,align1=3,align2=3:    13.28 (5.56%)   14.06 (0.00%)   14.06
length=80,align1=0,align2=0:    15.62 (-11.11%) 14.84 (-5.56%)  14.06
length=80,align1=5,align2=0:    15.62 (-11.11%) 16.41 (-16.67%) 14.06
length=80,align1=0,align2=5:    14.06 (0.00%)   15.62 (-11.11%) 14.06
length=80,align1=5,align2=5:    15.62 (-5.26%)  17.19 (-15.79%) 14.84
length=96,align1=0,align2=0:    14.06 (0.00%)   14.84 (-5.56%)  14.06
length=96,align1=6,align2=0:    14.84 (-5.56%)  16.41 (-16.67%) 14.06
length=96,align1=0,align2=6:    14.06 (0.00%)   14.84 (-5.56%)  14.06
length=96,align1=6,align2=6:    14.84 (-5.56%)  17.19 (-22.22%) 14.06
length=112,align1=0,align2=0:   17.19 (-4.76%)  14.06 (14.29%)  16.41
length=112,align1=7,align2=0:   17.19 (0.00%)   16.41 (4.55%)   17.19
length=112,align1=0,align2=7:   16.41 (0.00%)   14.84 (9.52%)   16.41
length=112,align1=7,align2=7:   17.19 (0.00%)   17.19 (0.00%)   17.19
length=144,align1=0,align2=0:   17.19 (-10.00%) 17.97 (-15.00%) 15.62
length=144,align1=9,align2=0:   17.19 (-4.76%)  18.75 (-14.29%) 16.41
length=144,align1=0,align2=9:   20.31 (-8.33%)  18.75 (0.00%)   18.75
length=144,align1=9,align2=9:   18.75 (-4.35%)  18.75 (-4.35%)  17.97
length=160,align1=0,align2=0:   18.75 (-4.35%)  17.97 (0.00%)   17.97
length=160,align1=10,align2=0:  18.75 (4.00%)   18.75 (4.00%)   19.53
length=160,align1=0,align2=10:  19.53 (-4.17%)  17.97 (4.17%)   18.75
length=160,align1=10,align2=10:         18.75 (-4.35%)  18.75 (-4.35%)  17.97
length=176,align1=0,align2=0:   18.75 (-4.35%)  17.19 (4.35%)   17.97
length=176,align1=11,align2=0:  19.53 (0.00%)   19.53 (0.00%)   19.53
length=176,align1=0,align2=11:  19.53 (-4.17%)  18.75 (0.00%)   18.75
length=176,align1=11,align2=11:         18.75 (0.00%)   17.97 (4.17%)   18.75
length=192,align1=0,align2=0:   18.75 (0.00%)   17.97 (4.17%)   18.75
length=192,align1=12,align2=0:  21.09 (-8.00%)  18.75 (4.00%)   19.53
length=192,align1=0,align2=12:  18.75 (0.00%)   18.75 (0.00%)   18.75
length=192,align1=12,align2=12:         18.75 (0.00%)   17.97 (4.17%)   18.75
length=208,align1=0,align2=0:   17.97 (0.00%)   20.31 (-13.04%) 17.97
length=208,align1=13,align2=0:  19.53 (7.41%)   21.09 (0.00%)   21.09
length=208,align1=0,align2=13:  23.44 (-11.11%) 21.09 (0.00%)   21.09
length=208,align1=13,align2=13:         21.09 (-3.85%)  21.09 (-3.85%)  20.31
length=224,align1=0,align2=0:   21.09 (-8.00%)  20.31 (-4.00%)  19.53
length=224,align1=14,align2=0:  23.44 (-11.11%) 20.31 (3.70%)   21.09
length=224,align1=0,align2=14:  21.09 (3.57%)   20.31 (7.14%)   21.88
length=224,align1=14,align2=14:         20.31 (0.00%)   19.53 (3.85%)   20.31
length=240,align1=0,align2=0:   20.31 (-4.00%)  19.53 (0.00%)   19.53
length=240,align1=15,align2=0:  22.66 (0.00%)   20.31 (10.34%)  22.66
length=240,align1=0,align2=15:  20.31 (-4.00%)  20.31 (-4.00%)  19.53
length=240,align1=15,align2=15:         21.88 (0.00%)   21.09 (3.57%)   21.88
length=272,align1=0,align2=0:   20.31 (0.00%)   28.12 (-38.46%) 20.31
length=272,align1=17,align2=0:  22.66 (0.00%)   27.34 (-20.69%) 22.66
length=272,align1=0,align2=17:  25.78 (-10.00%) 28.12 (-20.00%) 23.44
length=272,align1=17,align2=17:         22.66 (-3.57%)  27.34 (-25.00%) 21.88
length=288,align1=0,align2=0:   23.44 (-7.14%)  27.34 (-25.00%) 21.88
length=288,align1=18,align2=0:  22.66 (0.00%)   27.34 (-20.69%) 22.66
length=288,align1=0,align2=18:  23.44 (-3.45%)  25.00 (-10.35%) 22.66
length=288,align1=18,align2=18:         22.66 (-3.57%)  21.88 (0.00%)   21.88
length=304,align1=0,align2=0:   21.88 (0.00%)   21.88 (0.00%)   21.88
length=304,align1=19,align2=0:  23.44 (-3.45%)  22.66 (0.00%)   22.66
length=304,align1=0,align2=19:  22.66 (0.00%)   22.66 (0.00%)   22.66
length=304,align1=19,align2=19:         22.66 (-3.57%)  21.88 (0.00%)   21.88
length=320,align1=0,align2=0:   22.66 (-3.57%)  21.88 (0.00%)   21.88
length=320,align1=20,align2=0:  22.66 (0.00%)   22.66 (0.00%)   22.66
length=320,align1=0,align2=20:  22.66 (0.00%)   22.66 (0.00%)   22.66
length=320,align1=20,align2=20:         22.66 (-3.57%)  21.88 (0.00%)   21.88
length=336,align1=0,align2=0:   21.88 (0.00%)   24.22 (-10.71%) 21.88
length=336,align1=21,align2=0:  22.66 (0.00%)   25.00 (-10.35%) 22.66
length=336,align1=0,align2=21:  25.78 (0.00%)   25.00 (3.03%)   25.78
length=336,align1=21,align2=21:         25.00 (0.00%)   23.44 (6.25%)   25.00
length=352,align1=0,align2=0:   24.22 (0.00%)   24.22 (0.00%)   24.22
length=352,align1=22,align2=0:  25.00 (0.00%)   25.00 (0.00%)   25.00
length=352,align1=0,align2=22:  25.00 (-3.23%)  25.00 (-3.23%)  24.22
length=352,align1=22,align2=22:         25.00 (-3.23%)  24.22 (0.00%)   24.22
length=368,align1=0,align2=0:   25.00 (-3.23%)  23.44 (3.23%)   24.22
length=368,align1=23,align2=0:  25.00 (0.00%)   24.22 (3.12%)   25.00
length=368,align1=0,align2=23:  25.00 (-3.23%)  25.00 (-3.23%)  24.22
length=368,align1=23,align2=23:         25.00 (-6.67%)  23.44 (0.00%)   23.44
length=384,align1=0,align2=0:   24.22 (0.00%)   24.22 (0.00%)   24.22
length=384,align1=24,align2=0:  25.00 (0.00%)   24.22 (3.12%)   25.00
length=384,align1=0,align2=24:  25.00 (0.00%)   25.78 (-3.12%)  25.00
length=384,align1=24,align2=24:         24.22 (-3.33%)  23.44 (0.00%)   23.44
length=400,align1=0,align2=0:   25.00 (-3.23%)  26.56 (-9.68%)  24.22
length=400,align1=25,align2=0:  25.78 (-3.12%)  27.34 (-9.38%)  25.00
length=400,align1=0,align2=25:  27.34 (0.00%)   27.34 (0.00%)   27.34
length=400,align1=25,align2=25:         26.56 (0.00%)   25.78 (2.94%)   26.56
length=416,align1=0,align2=0:   26.56 (-3.03%)  25.78 (0.00%)   25.78
length=416,align1=26,align2=0:  28.12 (-2.86%)  27.34 (0.00%)   27.34
length=416,align1=0,align2=26:  27.34 (-2.94%)  28.12 (-5.88%)  26.56
length=416,align1=26,align2=26:         25.78 (0.00%)   26.56 (-3.03%)  25.78
length=432,align1=0,align2=0:   27.34 (-2.94%)  25.78 (2.94%)   26.56
length=432,align1=27,align2=0:  28.12 (-2.86%)  27.34 (0.00%)   27.34
length=432,align1=0,align2=27:  27.34 (0.00%)   28.12 (-2.86%)  27.34
length=432,align1=27,align2=27:         25.78 (0.00%)   25.78 (0.00%)   25.78
length=448,align1=0,align2=0:   26.56 (-3.03%)  25.78 (0.00%)   25.78
length=448,align1=28,align2=0:  27.34 (0.00%)   27.34 (0.00%)   27.34
length=448,align1=0,align2=28:  27.34 (0.00%)   28.12 (-2.86%)  27.34
length=448,align1=28,align2=28:         25.78 (0.00%)   25.78 (0.00%)   25.78
length=464,align1=0,align2=0:   25.78 (0.00%)   28.12 (-9.09%)  25.78
length=464,align1=29,align2=0:  28.12 (-2.86%)  29.69 (-8.57%)  27.34
length=464,align1=0,align2=29:  30.47 (0.00%)   30.47 (0.00%)   30.47
length=464,align1=29,align2=29:         28.12 (0.00%)   27.34 (2.78%)   28.12
length=480,align1=0,align2=0:   29.69 (-5.56%)  28.12 (0.00%)   28.12
length=480,align1=30,align2=0:  31.25 (-2.56%)  29.69 (2.56%)   30.47
length=480,align1=0,align2=30:  29.69 (0.00%)   30.47 (-2.63%)  29.69
length=480,align1=30,align2=30:         28.12 (0.00%)   28.12 (0.00%)   28.12
length=496,align1=0,align2=0:   28.12 (0.00%)   27.34 (2.78%)   28.12
length=496,align1=31,align2=0:  30.47 (-2.63%)  29.69 (0.00%)   29.69
length=496,align1=0,align2=31:  29.69 (0.00%)   30.47 (-2.63%)  29.69
length=496,align1=31,align2=31:         28.12 (-2.86%)  28.12 (-2.86%)  27.34
length=1024,align1=0,align2=0:  44.53 (0.00%)   44.53 (0.00%)   44.53
length=1024,align1=32,align2=0:         44.53 (-1.79%)  44.53 (-1.79%)  43.75
length=1024,align1=0,align2=32:         44.53 (-1.79%)  43.75 (0.00%)   43.75
length=1024,align1=32,align2=32:        43.75 (1.75%)   43.75 (1.75%)   44.53
length=1056,align1=0,align2=0:  46.88 (-1.69%)  46.88 (-1.69%)  46.09
length=1056,align1=33,align2=0:         53.12 (0.00%)   52.34 (1.47%)   53.12
length=1056,align1=0,align2=33:         52.34 (0.00%)   53.12 (-1.49%)  52.34
length=1056,align1=33,align2=33:        46.09 (0.00%)   46.88 (-1.69%)  46.09
length=1088,align1=0,align2=0:  46.88 (-1.69%)  46.09 (0.00%)   46.09
length=1088,align1=34,align2=0:         52.34 (0.00%)   52.34 (0.00%)   52.34
length=1088,align1=0,align2=34:         53.12 (-3.03%)  53.12 (-3.03%)  51.56
length=1088,align1=34,align2=34:        46.09 (0.00%)   46.88 (-1.69%)  46.09
length=1120,align1=0,align2=0:  49.22 (-1.61%)  48.44 (0.00%)   48.44
length=1120,align1=35,align2=0:         54.69 (1.41%)   55.47 (0.00%)   55.47
length=1120,align1=0,align2=35:         57.03 (0.00%)   55.47 (2.74%)   57.03
length=1120,align1=35,align2=35:        48.44 (0.00%)   49.22 (-1.61%)  48.44
length=1152,align1=0,align2=0:  47.66 (1.61%)   48.44 (0.00%)   48.44
length=1152,align1=36,align2=0:         55.47 (-1.43%)  55.47 (-1.43%)  54.69
length=1152,align1=0,align2=36:         58.59 (-1.35%)  55.47 (4.05%)   57.81
length=1152,align1=36,align2=36:        48.44 (0.00%)   49.22 (-1.61%)  48.44
length=1184,align1=0,align2=0:  53.12 (-3.03%)  50.78 (1.52%)   51.56
length=1184,align1=37,align2=0:         61.72 (-2.60%)  57.03 (5.19%)   60.16
length=1184,align1=0,align2=37:         62.50 (-1.27%)  57.03 (7.60%)   61.72
length=1184,align1=37,align2=37:        53.12 (-1.49%)  50.78 (2.99%)   52.34
length=1216,align1=0,align2=0:  53.91 (-4.55%)  50.78 (1.52%)   51.56
length=1216,align1=38,align2=0:         60.94 (0.00%)   57.03 (6.41%)   60.94
length=1216,align1=0,align2=38:         60.16 (0.00%)   57.81 (3.90%)   60.16
length=1216,align1=38,align2=38:        52.34 (-1.52%)  50.00 (3.03%)   51.56
length=1248,align1=0,align2=0:  54.69 (-2.94%)  53.12 (0.00%)   53.12
length=1248,align1=39,align2=0:         64.06 (-1.23%)  60.16 (4.94%)   63.28
length=1248,align1=0,align2=39:         60.94 (-2.63%)  60.16 (-1.32%)  59.38
length=1248,align1=39,align2=39:        53.12 (0.00%)   52.34 (1.47%)   53.12
length=1280,align1=0,align2=0:  52.34 (-1.52%)  52.34 (-1.52%)  51.56
length=1280,align1=40,align2=0:         61.72 (3.66%)   59.38 (7.32%)   64.06
length=1280,align1=0,align2=40:         60.94 (-2.63%)  60.16 (-1.32%)  59.38
length=1280,align1=40,align2=40:        52.34 (-1.52%)  52.34 (-1.52%)  51.56
length=1312,align1=0,align2=0:  54.69 (-1.45%)  55.47 (-2.90%)  53.91
length=1312,align1=41,align2=0:         63.28 (0.00%)   62.50 (1.23%)   63.28
length=1312,align1=0,align2=41:         62.50 (0.00%)   62.50 (0.00%)   62.50
length=1312,align1=41,align2=41:        53.91 (0.00%)   54.69 (-1.45%)  53.91
length=1344,align1=0,align2=0:  54.69 (0.00%)   54.69 (0.00%)   54.69
length=1344,align1=42,align2=0:         62.50 (0.00%)   62.50 (0.00%)   62.50
length=1344,align1=0,align2=42:         62.50 (-1.27%)  62.50 (-1.27%)  61.72
length=1344,align1=42,align2=42:        53.91 (0.00%)   53.91 (0.00%)   53.91
length=1376,align1=0,align2=0:  65.62 (-16.67%) 68.75 (-22.22%) 56.25
length=1376,align1=43,align2=0:         71.88 (-9.52%)  73.44 (-11.90%) 65.62
length=1376,align1=0,align2=43:         72.66 (-12.05%) 74.22 (-14.46%) 64.84
length=1376,align1=43,align2=43:        64.06 (-13.89%) 67.97 (-20.83%) 56.25
length=1408,align1=0,align2=0:  57.03 (-1.39%)  68.75 (-22.22%) 56.25
length=1408,align1=44,align2=0:         65.62 (-1.20%)  73.44 (-13.25%) 64.84
length=1408,align1=0,align2=44:         64.84 (0.00%)   74.22 (-14.46%) 64.84
length=1408,align1=44,align2=44:        56.25 (-1.41%)  68.75 (-23.94%) 55.47
length=1440,align1=0,align2=0:  67.97 (-14.47%) 64.84 (-9.21%)  59.38
length=1440,align1=45,align2=0:         74.22 (-10.47%) 68.75 (-2.33%)  67.19
length=1440,align1=0,align2=45:         72.66 (-6.90%)  69.53 (-2.30%)  67.97
length=1440,align1=45,align2=45:        65.62 (-13.51%) 58.59 (-1.35%)  57.81
length=1472,align1=0,align2=0:  66.41 (-14.86%) 58.59 (-1.35%)  57.81
length=1472,align1=46,align2=0:         73.44 (-9.30%)  67.19 (0.00%)   67.19
length=1472,align1=0,align2=46:         70.31 (-4.65%)  67.97 (-1.16%)  67.19
length=1472,align1=46,align2=46:        57.81 (0.00%)   58.59 (-1.35%)  57.81
length=1504,align1=0,align2=0:  60.94 (0.00%)   60.94 (0.00%)   60.94
length=1504,align1=47,align2=0:         71.09 (-1.11%)  70.31 (0.00%)   70.31
length=1504,align1=0,align2=47:         70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1504,align1=47,align2=47:        60.94 (-1.30%)  60.16 (0.00%)   60.16
length=1536,align1=0,align2=0:  62.50 (-3.90%)  60.16 (0.00%)   60.16
length=1536,align1=48,align2=0:         60.94 (-1.30%)  60.16 (0.00%)   60.16
length=1536,align1=0,align2=48:         61.72 (-3.95%)  60.16 (-1.32%)  59.38
length=1536,align1=48,align2=48:        60.94 (-1.30%)  60.16 (0.00%)   60.16
length=1568,align1=0,align2=0:  80.47 (-27.16%) 63.28 (0.00%)   63.28
length=1568,align1=49,align2=0:         86.72 (-18.09%) 72.66 (1.06%)   73.44
length=1568,align1=0,align2=49:         74.22 (-3.26%)  74.22 (-3.26%)  71.88
length=1568,align1=49,align2=49:        62.50 (0.00%)   61.72 (1.25%)   62.50
length=1600,align1=0,align2=0:  62.50 (-1.27%)  62.50 (-1.27%)  61.72
length=1600,align1=50,align2=0:         73.44 (0.00%)   71.88 (2.13%)   73.44
length=1600,align1=0,align2=50:         72.66 (0.00%)   73.44 (-1.08%)  72.66
length=1600,align1=50,align2=50:        62.50 (-1.27%)  62.50 (-1.27%)  61.72
length=1632,align1=0,align2=0:  64.84 (0.00%)   64.84 (0.00%)   64.84
length=1632,align1=51,align2=0:         75.78 (0.00%)   75.00 (1.03%)   75.78
length=1632,align1=0,align2=51:         78.91 (0.00%)   75.78 (3.96%)   78.91
length=1632,align1=51,align2=51:        64.84 (-2.47%)  64.84 (-2.47%)  63.28
length=1664,align1=0,align2=0:  64.84 (-1.22%)  64.84 (-1.22%)  64.06
length=1664,align1=52,align2=0:         75.78 (0.00%)   75.00 (1.03%)   75.78
length=1664,align1=0,align2=52:         80.47 (-0.98%)  75.78 (4.90%)   79.69
length=1664,align1=52,align2=52:        64.06 (-1.23%)  65.62 (-3.70%)  63.28
length=1696,align1=0,align2=0:  69.53 (-3.49%)  72.66 (-8.14%)  67.19
length=1696,align1=53,align2=0:         80.47 (-0.98%)  82.03 (-2.94%)  79.69
length=1696,align1=0,align2=53:         80.47 (0.96%)   82.03 (-0.96%)  81.25
length=1696,align1=53,align2=53:        68.75 (-2.33%)  72.66 (-8.14%)  67.19
length=1728,align1=0,align2=0:  67.97 (0.00%)   72.66 (-6.90%)  67.97
length=1728,align1=54,align2=0:         80.47 (-0.98%)  82.81 (-3.92%)  79.69
length=1728,align1=0,align2=54:         78.91 (-1.00%)  82.03 (-5.00%)  78.12
length=1728,align1=54,align2=54:        68.75 (0.00%)   72.66 (-5.68%)  68.75
length=1760,align1=0,align2=0:  77.34 (-12.50%) 68.75 (0.00%)   68.75
length=1760,align1=55,align2=0:         91.41 (-8.33%)  79.69 (5.56%)   84.38
length=1760,align1=0,align2=55:         88.28 (-10.78%) 80.47 (-0.98%)  79.69
length=1760,align1=55,align2=55:        77.34 (-11.24%) 68.75 (1.12%)   69.53
length=1792,align1=0,align2=0:  78.12 (-14.94%) 68.75 (-1.15%)  67.97
length=1792,align1=56,align2=0:         88.28 (-4.63%)  79.69 (5.56%)   84.38
length=1792,align1=0,align2=56:         88.28 (-9.71%)  80.47 (0.00%)   80.47
length=1792,align1=56,align2=56:        77.34 (-11.24%) 68.75 (1.12%)   69.53
length=1824,align1=0,align2=0:  72.66 (7.92%)   70.31 (10.89%)  78.91
length=1824,align1=57,align2=0:         85.94 (5.17%)   82.03 (9.48%)   90.62
length=1824,align1=0,align2=57:         82.03 (3.67%)   82.81 (2.75%)   85.16
length=1824,align1=57,align2=57:        70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1856,align1=0,align2=0:  70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1856,align1=58,align2=0:         83.59 (-0.94%)  82.03 (0.94%)   82.81
length=1856,align1=0,align2=58:         178.12 (-115.09%)       82.81 (0.00%)   82.81
length=1856,align1=58,align2=58:        70.31 (-1.12%)  70.31 (-1.12%)  69.53
length=1888,align1=0,align2=0:  73.44 (-1.08%)  78.91 (-8.60%)  72.66
length=1888,align1=59,align2=0:         85.94 (0.00%)   89.84 (-4.55%)  85.94
length=1888,align1=0,align2=59:         84.38 (0.00%)   89.06 (-5.56%)  84.38
length=1888,align1=59,align2=59:        72.66 (-1.09%)  78.12 (-8.70%)  71.88
length=1920,align1=0,align2=0:  72.66 (-1.09%)  78.12 (-8.70%)  71.88
length=1920,align1=60,align2=0:         85.94 (0.00%)   89.84 (-4.55%)  85.94
length=1920,align1=0,align2=60:         85.16 (0.00%)   89.06 (-4.59%)  85.16
length=1920,align1=60,align2=60:        72.66 (-1.09%)  78.91 (-9.78%)  71.88
length=1952,align1=0,align2=0:  75.00 (-1.05%)  75.00 (-1.05%)  74.22
length=1952,align1=61,align2=0:         88.28 (0.00%)   87.50 (0.88%)   88.28
length=1952,align1=0,align2=61:         87.50 (0.00%)   88.28 (-0.89%)  87.50
length=1952,align1=61,align2=61:        74.22 (0.00%)   74.22 (0.00%)   74.22
length=1984,align1=0,align2=0:  75.00 (-1.05%)  73.44 (1.05%)   74.22
length=1984,align1=62,align2=0:         89.06 (-0.89%)  87.50 (0.88%)   88.28
length=1984,align1=0,align2=62:         87.50 (0.00%)   88.28 (-0.89%)  87.50
length=1984,align1=62,align2=62:        74.22 (0.00%)   74.22 (0.00%)   74.22
length=2016,align1=0,align2=0:  77.34 (-1.02%)  76.56 (0.00%)   76.56
length=2016,align1=63,align2=0:         91.41 (-0.86%)  90.62 (0.00%)   90.62
length=2016,align1=0,align2=63:         89.84 (0.00%)   90.62 (-0.87%)  89.84
length=2016,align1=63,align2=63:        77.34 (-1.02%)  76.56 (0.00%)   76.56
length=4096,align1=0,align2=0:  141.41 (-0.56%) 146.88 (-4.44%) 140.62

Function: memcpy
__memcpy_thunderx       __memcpy_falkor __memcpy_generic
Variant: large
================================================================================
length=65543,align1=0,align2=0:         4018.75 (3.09%) 2634.38 (36.47%)        4146.88
length=65551,align1=0,align2=3:         4425.00 (-6.47%)        3134.38 (24.59%)        4156.25
length=65567,align1=3,align2=0:         2909.38 (29.95%)        3134.38 (24.53%)        4153.12
length=65599,align1=3,align2=5:         4415.62 (-6.16%)        3134.38 (24.64%)        4159.38
length=131079,align1=0,align2=0:        5765.62 (30.38%)        5240.62 (36.72%)        8281.25
length=131087,align1=0,align2=3:        8831.25 (-6.56%)        6271.88 (24.32%)        8287.50
length=131103,align1=3,align2=0:        5793.75 (29.05%)        6268.75 (23.23%)        8165.62
length=131135,align1=3,align2=5:        5806.25 (29.97%)        6259.38 (24.50%)        8290.62
length=262151,align1=0,align2=0:        11850.00 (28.91%)       10762.50 (35.43%)       16668.80
length=262159,align1=0,align2=3:        12043.80 (27.72%)       12700.00 (23.78%)       16662.50
length=262175,align1=3,align2=0:        12046.90 (27.90%)       12687.50 (24.07%)       16709.40
length=262207,align1=3,align2=5:        11984.40 (28.08%)       12678.10 (23.91%)       16662.50
length=524295,align1=0,align2=0:        24825.00 (25.00%)       24268.80 (27.34%)       33400.00
length=524303,align1=0,align2=3:        35731.20 (-6.53%)       25678.10 (23.44%)       33540.60
length=524319,align1=3,align2=0:        25893.80 (22.71%)       25725.00 (23.22%)       33503.10
length=524351,align1=3,align2=5:        25887.50 (22.86%)       25690.60 (23.45%)       33559.40
length=1048583,align1=0,align2=0:       50621.90 (0.30%)        50600.00 (0.34%)        50771.90
length=1048591,align1=0,align2=3:       53206.20 (0.54%)        51081.20 (4.51%)        53493.80
length=1048607,align1=3,align2=0:       53221.90 (0.32%)        51975.00 (2.66%)        53393.80
length=1048639,align1=3,align2=5:       53240.60 (0.36%)        51953.10 (2.77%)        53431.20
length=2097159,align1=0,align2=0:       103744.00 (-2.00%)      102447.00 (-1.00%)      102425.00
length=2097167,align1=0,align2=3:       108588.00 (-1.00%)      105159.00 (2.00%)       107606.00
length=2097183,align1=3,align2=0:       107678.00 (0.00%)       105250.00 (2.00%)       108125.00
length=2097215,align1=3,align2=5:       107906.00 (1.00%)       105841.00 (3.00%)       109475.00
length=4194311,align1=0,align2=0:       202994.00 (0.00%)       202500.00 (1.00%)       204809.00
length=4194319,align1=0,align2=3:       213350.00 (0.00%)       205997.00 (3.00%)       213384.00
length=4194335,align1=3,align2=0:       212653.00 (0.00%)       206444.00 (3.00%)       212900.00
length=4194367,align1=3,align2=5:       213044.00 (0.00%)       206084.00 (3.00%)       213847.00
length=8388615,align1=0,align2=0:       401294.00 (0.00%)       401231.00 (0.00%)       401944.00
length=8388623,align1=0,align2=3:       480872.00 (-14.00%)     406444.00 (3.00%)       422900.00
length=8388639,align1=3,align2=0:       422147.00 (0.00%)       407750.00 (3.00%)       422803.00
length=8388671,align1=3,align2=5:       442003.00 (-5.00%)      407125.00 (3.00%)       423509.00
length=16777223,align1=0,align2=0:      799809.00 (0.00%)       800000.00 (0.00%)       801756.00
length=16777231,align1=0,align2=3:      841184.00 (0.00%)       808525.00 (4.00%)       843775.00
length=16777247,align1=3,align2=0:      841166.00 (0.00%)       810147.00 (3.00%)       843147.00
length=16777279,align1=3,align2=5:      972569.00 (-16.00%)     808588.00 (4.00%)       843731.00
length=33554439,align1=0,align2=0:      1842240.00 (-0.01%)     1863590.00 (-1.17%)     1841990.00
length=33554447,align1=0,align2=3:      2103470.00 (-2.74%)     1919460.00 (6.25%)      2047440.00
length=33554463,align1=3,align2=0:      2075690.00 (-1.07%)     1930040.00 (6.02%)      2053720.00
length=33554495,align1=3,align2=5:      2110590.00 (-2.82%)     1924440.00 (6.25%)      2052650.00

Function: memcpy
__memcpy_thunderx       __memcpy_falkor __memcpy_generic
Variant: random
================================================================================
max-size=4096:  44061.90 (5.85%)        38568.20 (17.59%)       46799.90
max-size=8192:  42790.90 (5.27%)        38158.90 (15.52%)       45171.50
max-size=16384:         44912.10 (2.25%)        38710.40 (15.75%)       45945.00
max-size=32768:         43577.90 (1.23%)        37975.10 (13.93%)       44120.00
max-size=65536:         44375.50 (1.04%)        38474.20 (14.20%)       44840.60

	* manual/tunables.texi (Tunable glibc.tune.cpu): Add falkor.
	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add
	memcpy_falkor.
	* sysdeps/aarch64/multiarch/ifunc-impl-list.c (MAX_IFUNC):
	Bump.
	(__libc_ifunc_impl_list): Add __memcpy_falkor.
	* sysdeps/aarch64/multiarch/memcpy.c: Likewise.
	* sysdeps/aarch64/multiarch/memcpy_falkor.S: New file.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (cpu_list):
	Add falkor.
	* sysdeps/unix/sysv/linux/aarch64/cpu-features.h (IS_FALKOR):
	New macro.
---
 ChangeLog                                      |  15 ++
 manual/tunables.texi                           |   2 +-
 sysdeps/aarch64/multiarch/Makefile             |   2 +-
 sysdeps/aarch64/multiarch/ifunc-impl-list.c    |   3 +-
 sysdeps/aarch64/multiarch/memcpy.c             |   7 +-
 sysdeps/aarch64/multiarch/memcpy_falkor.S      | 187 +++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/aarch64/cpu-features.c |   1 +
 sysdeps/unix/sysv/linux/aarch64/cpu-features.h |   3 +
 8 files changed, 216 insertions(+), 4 deletions(-)
 create mode 100644 sysdeps/aarch64/multiarch/memcpy_falkor.S

diff --git a/ChangeLog b/ChangeLog
index bfcdc1ebbf..0ef88b0c87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2017-10-10  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
+	* manual/tunables.texi (Tunable glibc.tune.cpu): Add falkor.
+	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add
+	memcpy_falkor.
+	* sysdeps/aarch64/multiarch/ifunc-impl-list.c (MAX_IFUNC):
+	Bump.
+	(__libc_ifunc_impl_list): Add __memcpy_falkor.
+	* sysdeps/aarch64/multiarch/memcpy.c: Likewise.
+	* sysdeps/aarch64/multiarch/memcpy_falkor.S: New file.
+	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (cpu_list):
+	Add falkor.
+	* sysdeps/unix/sysv/linux/aarch64/cpu-features.h (IS_FALKOR):
+	New macro.
+
 2017-10-06  Carlos O'Donell  <carlos@redhat.com>
 
 	[BZ #22111]
diff --git a/manual/tunables.texi b/manual/tunables.texi
index 4c658bf3df..3c19567a28 100644
--- a/manual/tunables.texi
+++ b/manual/tunables.texi
@@ -267,7 +267,7 @@ This tunable is specific to i386 and x86-64.
 @deftp Tunable glibc.tune.cpu
 The @code{glibc.tune.cpu=xxx} tunable allows the user to tell @theglibc{} to
 assume that the CPU is @code{xxx} where xxx may have one of these values:
-@code{generic}, @code{thunderxt88}.
+@code{generic}, @code{falkor}, @code{thunderxt88}.
 
 This tunable is specific to aarch64.
 @end deftp
diff --git a/sysdeps/aarch64/multiarch/Makefile b/sysdeps/aarch64/multiarch/Makefile
index 78d52c717d..164ba1ae4b 100644
--- a/sysdeps/aarch64/multiarch/Makefile
+++ b/sysdeps/aarch64/multiarch/Makefile
@@ -1,3 +1,3 @@
 ifeq ($(subdir),string)
-sysdep_routines += memcpy_generic memcpy_thunderx
+sysdep_routines += memcpy_generic memcpy_thunderx memcpy_falkor
 endif
diff --git a/sysdeps/aarch64/multiarch/ifunc-impl-list.c b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
index 32056bcec3..8e873b3d9f 100644
--- a/sysdeps/aarch64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
@@ -25,7 +25,7 @@
 #include <stdio.h>
 
 /* Maximum number of IFUNC implementations.  */
-#define MAX_IFUNC	2
+#define MAX_IFUNC	3
 
 size_t
 __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
@@ -40,6 +40,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/aarch64/multiarch/memcpy.c and memmove.c.  */
   IFUNC_IMPL (i, name, memcpy,
 	      IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_thunderx)
+	      IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_falkor)
 	      IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_generic))
   IFUNC_IMPL (i, name, memmove,
 	      IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_thunderx)
diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c
index 9f73efbba7..b395df1c63 100644
--- a/sysdeps/aarch64/multiarch/memcpy.c
+++ b/sysdeps/aarch64/multiarch/memcpy.c
@@ -30,9 +30,14 @@ extern __typeof (__redirect_memcpy) __libc_memcpy;
 
 extern __typeof (__redirect_memcpy) __memcpy_generic attribute_hidden;
 extern __typeof (__redirect_memcpy) __memcpy_thunderx attribute_hidden;
+extern __typeof (__redirect_memcpy) __memcpy_falkor attribute_hidden;
 
 libc_ifunc (__libc_memcpy,
-            IS_THUNDERX (midr) ? __memcpy_thunderx : __memcpy_generic);
+            (IS_THUNDERX (midr)
+	     ? __memcpy_thunderx
+	     : (IS_FALKOR (midr)
+		? __memcpy_falkor
+		: __memcpy_generic)));
 
 # undef memcpy
 strong_alias (__libc_memcpy, memcpy);
diff --git a/sysdeps/aarch64/multiarch/memcpy_falkor.S b/sysdeps/aarch64/multiarch/memcpy_falkor.S
new file mode 100644
index 0000000000..3708281147
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memcpy_falkor.S
@@ -0,0 +1,187 @@
+/* Optimized memcpy for Qualcomm Falkor processor.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* Assumptions:
+ *
+ * ARMv8-a, AArch64, falkor, unaligned accesses.
+ *
+ */
+
+#define dstin	x0
+#define src	x1
+#define count	x2
+#define dst	x3
+#define srcend	x4
+#define dstend	x5
+#define A_l	x6
+#define A_lw	w6
+#define A_h	x7
+#define A_hw	w7
+#define tmp1	x14
+
+/* Copies are split into 3 main cases:
+
+   1. Small copies of up to 32 bytes
+   2. Medium copies of 33..128 bytes which are fully unrolled
+   3. Large copies of more than 128 bytes.
+
+   Large copies align the sourceto a quad word and use an unrolled loop
+   processing 64 bytes per iteration.
+
+   FALKOR-SPECIFIC DESIGN:
+
+   The smallest copies (32 bytes or less) focus on optimal pipeline usage,
+   which is why the redundant copies of 0-3 bytes have been replaced with
+   conditionals, since the former would unnecessarily break across multiple
+   issue groups.  The medium copy group has been enlarged to 128 bytes since
+   bumping up the small copies up to 32 bytes allows us to do that without
+   cost and also allows us the reduce the size of the prep code before loop64.
+
+   All copies are done only via two registers r6 and r7.  This is to ensure
+   that all loads hit a single hardware prefetcher which can get correctly
+   trained to prefetch a single stream.
+
+   The non-temporal stores help optimize cache utilization.
+*/
+
+#if IS_IN (libc)
+ENTRY_ALIGN (__memcpy_falkor, 6)
+
+	cmp	count, 32
+	add	srcend, src, count
+	add	dstend, dstin, count
+	b.ls	L(copy32)
+	ldp	A_l, A_h, [src]
+	cmp	count, 128
+	stp	A_l, A_h, [dstin]
+	b.hi	L(copy_long)
+
+	/* Medium copies: 33..128 bytes.  */
+	sub	tmp1, count, 1
+	ldp	A_l, A_h, [src, 16]
+	stp	A_l, A_h, [dstin, 16]
+	tbz	tmp1, 6, 1f
+	ldp	A_l, A_h, [src, 32]
+	stp	A_l, A_h, [dstin, 32]
+	ldp	A_l, A_h, [src, 48]
+	stp	A_l, A_h, [dstin, 48]
+	ldp	A_l, A_h, [srcend, -64]
+	stp	A_l, A_h, [dstend, -64]
+	ldp	A_l, A_h, [srcend, -48]
+	stp	A_l, A_h, [dstend, -48]
+1:
+	ldp	A_l, A_h, [srcend, -32]
+	stp	A_l, A_h, [dstend, -32]
+	ldp	A_l, A_h, [srcend, -16]
+	stp	A_l, A_h, [dstend, -16]
+	ret
+
+	.p2align 4
+	/* Small copies: 0..32 bytes.  */
+L(copy32):
+	/* 16-32 */
+	cmp	count, 16
+	b.lo	1f
+	ldp	A_l, A_h, [src]
+	stp	A_l, A_h, [dstin]
+	ldp	A_l, A_h, [srcend, -16]
+	stp	A_l, A_h, [dstend, -16]
+	ret
+	.p2align 4
+1:
+	/* 8-15 */
+	tbz	count, 3, 1f
+	ldr	A_l, [src]
+	str	A_l, [dstin]
+	ldr	A_l, [srcend, -8]
+	str	A_l, [dstend, -8]
+	ret
+	.p2align 4
+1:
+	/* 4-7 */
+	tbz	count, 2, 1f
+	ldr	A_lw, [src]
+	str	A_lw, [dstin]
+	ldr	A_lw, [srcend, -4]
+	str	A_lw, [dstend, -4]
+	ret
+	.p2align 4
+1:
+	/* 2-3 */
+	tbz	count, 1, 1f
+	ldrh	A_lw, [src]
+	strh	A_lw, [dstin]
+	ldrh	A_lw, [srcend, -2]
+	strh	A_lw, [dstend, -2]
+	ret
+	.p2align 4
+1:
+	/* 0-1 */
+	tbz	count, 0, 1f
+	ldrb	A_lw, [src]
+	strb	A_lw, [dstin]
+1:
+	ret
+
+	/* Align SRC to 16 bytes and copy; that way at least one of the
+	   accesses is aligned throughout the copy sequence.
+
+	   The count is off by 0 to 15 bytes, but this is OK because we trim
+	   off the last 64 bytes to copy off from the end.  Due to this the
+	   loop never runs out of bounds.  */
+	.p2align 6
+L(copy_long):
+	sub	count, count, 64 + 16
+	and	tmp1, src, 15
+	bic	src, src, 15
+	sub	dst, dstin, tmp1
+	add	count, count, tmp1
+
+L(loop64):
+	ldp	A_l, A_h, [src, 16]!
+	stnp	A_l, A_h, [dst, 16]
+	ldp	A_l, A_h, [src, 16]!
+	subs	count, count, 64
+	stnp	A_l, A_h, [dst, 32]
+	ldp	A_l, A_h, [src, 16]!
+	stnp	A_l, A_h, [dst, 48]
+	ldp	A_l, A_h, [src, 16]!
+	stnp	A_l, A_h, [dst, 64]
+	add	dst, dst, 64
+	b.hi	L(loop64)
+
+	/* Write the last full set of 64 bytes.  The remainder is at most 64
+	   bytes, so it is safe to always copy 64 bytes from the end even if
+	   there is just 1 byte left.  */
+L(last64):
+	ldp	A_l, A_h, [srcend, -64]
+	stnp	A_l, A_h, [dstend, -64]
+	ldp	A_l, A_h, [srcend, -48]
+	stnp	A_l, A_h, [dstend, -48]
+	ldp	A_l, A_h, [srcend, -32]
+	stnp	A_l, A_h, [dstend, -32]
+	ldp	A_l, A_h, [srcend, -16]
+	stnp	A_l, A_h, [dstend, -16]
+	ret
+
+END (__memcpy_falkor)
+libc_hidden_builtin_def (__memcpy_falkor)
+#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
index 0275d11c7f..18f5e60f4c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
@@ -28,6 +28,7 @@ struct cpu_list
 };
 
 static struct cpu_list cpu_list[] = {
+      {"falkor",	0x510FC000},
       {"thunderxt88",	0x430F0A10},
       {"generic", 	0x0}
 };
diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
index c92b650984..73cb53da9a 100644
--- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.h
@@ -41,6 +41,9 @@
 #define IS_THUNDERX(midr) (MIDR_IMPLEMENTOR(midr) == 'C'	\
 			   && MIDR_PARTNUM(midr) == 0x0a1)
 
+#define IS_FALKOR(midr) (MIDR_IMPLEMENTOR(midr) == 'Q'			      \
+                        && MIDR_PARTNUM(midr) == 0xc00)
+
 struct cpu_features
 {
   uint64_t midr_el1;
-- 
2.14.1


From e39de9fa74e81b03c91377a3770d06df9933d645 Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Tue, 10 Oct 2017 15:44:39 +0530
Subject: [PATCH 50/90] memcpy_falkor: Fix code style in comments

---
 ChangeLog                                 |  3 +++
 sysdeps/aarch64/multiarch/memcpy_falkor.S | 11 ++++-------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0ef88b0c87..e1e0cdd9b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-10-10  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+	* sysdeps/aarch64/multiarch/memcpy_falkor.S: Fix code style in
+	comments.
+
 	* manual/tunables.texi (Tunable glibc.tune.cpu): Add falkor.
 	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add
 	memcpy_falkor.
diff --git a/sysdeps/aarch64/multiarch/memcpy_falkor.S b/sysdeps/aarch64/multiarch/memcpy_falkor.S
index 3708281147..dea4f225ee 100644
--- a/sysdeps/aarch64/multiarch/memcpy_falkor.S
+++ b/sysdeps/aarch64/multiarch/memcpy_falkor.S
@@ -20,10 +20,8 @@
 #include <sysdep.h>
 
 /* Assumptions:
- *
- * ARMv8-a, AArch64, falkor, unaligned accesses.
- *
- */
+
+   ARMv8-a, AArch64, falkor, unaligned accesses.  */
 
 #define dstin	x0
 #define src	x1
@@ -53,14 +51,13 @@
    conditionals, since the former would unnecessarily break across multiple
    issue groups.  The medium copy group has been enlarged to 128 bytes since
    bumping up the small copies up to 32 bytes allows us to do that without
-   cost and also allows us the reduce the size of the prep code before loop64.
+   cost and also allows us to reduce the size of the prep code before loop64.
 
    All copies are done only via two registers r6 and r7.  This is to ensure
    that all loads hit a single hardware prefetcher which can get correctly
    trained to prefetch a single stream.
 
-   The non-temporal stores help optimize cache utilization.
-*/
+   The non-temporal stores help optimize cache utilization.  */
 
 #if IS_IN (libc)
 ENTRY_ALIGN (__memcpy_falkor, 6)
-- 
2.14.1


From de84fc77f823051b1df336b7e5c257e4c3de984e Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Mon, 11 Sep 2017 05:50:49 +0530
Subject: [PATCH 51/90] Update translations

---
 ChangeLog |    3 +
 po/fr.po  |    2 +-
 po/sv.po  | 1150 +++++++++++++++++++++++++++++++------------------------------
 3 files changed, 581 insertions(+), 574 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e1e0cdd9b2..2aa1711834 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-10-10  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+	* po/sv.po: Update translations.
+	* po/fr.po: Likewise.
+
 	* sysdeps/aarch64/multiarch/memcpy_falkor.S: Fix code style in
 	comments.
 
diff --git a/po/fr.po b/po/fr.po
index 5a79695125..6764655d25 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -5920,7 +5920,7 @@ msgstr "Le fichier existe"
 #. TRANS also when you rename a file with @code{rename} (@pxref{Renaming Files}).
 #: sysdeps/gnu/errlist.c:211
 msgid "Invalid cross-device link"
-msgstr "Lien croisé de périphéque invalide"
+msgstr "Lien physique inter-périphérique invalide"
 
 #. TRANS The wrong type of device was given to a function that expects a
 #. TRANS particular sort of device.
diff --git a/po/sv.po b/po/sv.po
index 0ebfec5b7f..d10bfad482 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -5,12 +5,12 @@
 # Jan Djärv <jan.h.d@swipnet.se>, 1996, 1998, 2001, 2002, 2003, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015.
 # Göran Uddeborg <goeran@uddeborg.se>, 2016, 2017.
 #
-# $Revision: 1.7 $
+# $Revision: 1.10 $
 msgid ""
 msgstr ""
-"Project-Id-Version: libc 2.25-pre1\n"
-"POT-Creation-Date: 2017-01-11 17:27+0530\n"
-"PO-Revision-Date: 2017-05-30 12:14+0200\n"
+"Project-Id-Version: libc 2.25.90\n"
+"POT-Creation-Date: 2017-07-25 12:32+0530\n"
+"PO-Revision-Date: 2017-08-20 18:21+0200\n"
 "Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
 "Language: sv\n"
@@ -478,19 +478,19 @@ msgstr "FEL I DYNAMISK LÄNKARE!!!"
 msgid "error while loading shared libraries"
 msgstr "fel när delade bibliotek laddades"
 
-#: elf/dl-fptr.c:88 sysdeps/hppa/dl-fptr.c:94
+#: elf/dl-fptr.c:88 sysdeps/hppa/dl-fptr.c:95
 msgid "cannot map pages for fdesc table"
 msgstr "kan inte minnesmappa sidor för fdesc-tabell"
 
-#: elf/dl-fptr.c:192 sysdeps/hppa/dl-fptr.c:207
+#: elf/dl-fptr.c:192 sysdeps/hppa/dl-fptr.c:213
 msgid "cannot map pages for fptr table"
 msgstr "kan inte minnesmappa sidor för fptr-tabell"
 
-#: elf/dl-fptr.c:221 sysdeps/hppa/dl-fptr.c:236
+#: elf/dl-fptr.c:221 sysdeps/hppa/dl-fptr.c:242
 msgid "internal error: symidx out of range of fptr table"
 msgstr "internt fel: symidx är utanför intervallet för fptr-tabellen"
 
-#: elf/dl-hwcaps.c:184 elf/dl-hwcaps.c:196
+#: elf/dl-hwcaps.c:191 elf/dl-hwcaps.c:203
 msgid "cannot create capability list"
 msgstr "kan inte skapa egenskapslista"
 
@@ -670,20 +670,20 @@ msgstr "ogiltig målnamnrymd för dlmopen()"
 msgid "cannot allocate memory in static TLS block"
 msgstr "kan inte allokera minne i statiskt TLS-block"
 
-#: elf/dl-reloc.c:212
+#: elf/dl-reloc.c:206
 msgid "cannot make segment writable for relocation"
 msgstr "kan inte göra segment skrivbart för relokering"
 
-#: elf/dl-reloc.c:283
+#: elf/dl-reloc.c:277
 #, c-format
 msgid "%s: out of memory to store relocation results for %s\n"
 msgstr "%s: slut på minne för att lagra relokeringsresultat för %s\n"
 
-#: elf/dl-reloc.c:299
+#: elf/dl-reloc.c:293
 msgid "cannot restore segment prot after reloc"
 msgstr "kan inte återställa segmenträttigheter efter relokering"
 
-#: elf/dl-reloc.c:330
+#: elf/dl-reloc.c:324
 msgid "cannot apply additional memory protection after relocation"
 msgstr "kan inte applicera extra minnesskydd efter relokering"
 
@@ -959,14 +959,14 @@ msgstr "Försök med \"ldd --help\" för mer information."
 msgid "missing file arguments"
 msgstr "filargument saknas"
 
-#. TRANS No such file or directory.  This is a ``file doesn't exist'' error
+#. TRANS This is a ``file doesn't exist'' error
 #. TRANS for ordinary files that are referenced in contexts where they are
 #. TRANS expected to already exist.
 #: elf/ldd.bash.in:147 sysdeps/gnu/errlist.c:37
 msgid "No such file or directory"
 msgstr "Filen eller katalogen finns inte"
 
-#: elf/ldd.bash.in:150 inet/rcmd.c:475
+#: elf/ldd.bash.in:150 inet/rcmd.c:480
 msgid "not regular file"
 msgstr "inte en normal fil"
 
@@ -1540,68 +1540,68 @@ msgstr "vid insättning i sökträd"
 msgid "cannot generate output file"
 msgstr "kan inte generera utfil"
 
-#: inet/rcmd.c:155
+#: inet/rcmd.c:157
 msgid "rcmd: Cannot allocate memory\n"
 msgstr "rcmd: Kan inte allokera minne\n"
 
-#: inet/rcmd.c:170
+#: inet/rcmd.c:174
 msgid "rcmd: socket: All ports in use\n"
 msgstr "rcmd: uttag (socket): Alla portar används\n"
 
-#: inet/rcmd.c:198
+#: inet/rcmd.c:202
 #, c-format
 msgid "connect to address %s: "
 msgstr "anslut till adress %s: "
 
-#: inet/rcmd.c:211
+#: inet/rcmd.c:215
 #, c-format
 msgid "Trying %s...\n"
 msgstr "Provar %s...\n"
 
-#: inet/rcmd.c:247
+#: inet/rcmd.c:251
 #, c-format
 msgid "rcmd: write (setting up stderr): %m\n"
 msgstr "rcmd: write: (sätter upp standard fel): %m\n"
 
-#: inet/rcmd.c:263
+#: inet/rcmd.c:267
 #, c-format
 msgid "rcmd: poll (setting up stderr): %m\n"
 msgstr "rcmd: poll (sätter upp standard fel): %m\n"
 
-#: inet/rcmd.c:266
+#: inet/rcmd.c:270
 msgid "poll: protocol failure in circuit setup\n"
 msgstr "poll: protokollfel i förbindelseuppsättning\n"
 
-#: inet/rcmd.c:298
+#: inet/rcmd.c:302
 msgid "socket: protocol failure in circuit setup\n"
 msgstr "uttag (socket): protokollfel i förbindelseuppsättning\n"
 
-#: inet/rcmd.c:322
+#: inet/rcmd.c:326
 #, c-format
 msgid "rcmd: %s: short read"
 msgstr "rcmd: %s: läsning gav för lite data"
 
-#: inet/rcmd.c:473
+#: inet/rcmd.c:478
 msgid "lstat failed"
 msgstr "misslyckades ta status (lstat)"
 
-#: inet/rcmd.c:480
+#: inet/rcmd.c:485
 msgid "cannot open"
 msgstr "kan inte öppna"
 
-#: inet/rcmd.c:482
+#: inet/rcmd.c:487
 msgid "fstat failed"
 msgstr "misslyckades ta status (fstat)"
 
-#: inet/rcmd.c:484
+#: inet/rcmd.c:489
 msgid "bad owner"
 msgstr "felaktig ägare"
 
-#: inet/rcmd.c:486
+#: inet/rcmd.c:491
 msgid "writeable by other than owner"
 msgstr "skrivbar för andra än ägaren"
 
-#: inet/rcmd.c:488
+#: inet/rcmd.c:493
 msgid "hard linked somewhere"
 msgstr "hårdlänkad någonstans"
 
@@ -3143,7 +3143,7 @@ msgstr "Okänt systemfel"
 msgid "unable to free arguments"
 msgstr "kan inte avallokera argument"
 
-#: nis/nis_error.h:1 nis/ypclnt.c:817 nis/ypclnt.c:905 posix/regcomp.c:137
+#: nis/nis_error.h:1 nis/ypclnt.c:824 nis/ypclnt.c:913 posix/regcomp.c:137
 #: sysdeps/gnu/errlist.c:21
 msgid "Success"
 msgstr "Lyckat"
@@ -3184,8 +3184,8 @@ msgstr "Generiskt systemfel"
 msgid "First/next chain broken"
 msgstr "Första/Nästa-kedja bruten"
 
-#. TRANS Permission denied; the file permissions do not allow the attempted operation.
-#: nis/nis_error.h:11 nis/ypclnt.c:862 sysdeps/gnu/errlist.c:158
+#. TRANS The file permissions do not allow the attempted operation.
+#: nis/nis_error.h:11 nis/ypclnt.c:869 sysdeps/gnu/errlist.c:158
 msgid "Permission denied"
 msgstr "Åtkomst nekas"
 
@@ -3337,128 +3337,128 @@ msgstr "Kan inte skapa process hos server"
 msgid "Master server busy, full dump rescheduled."
 msgstr "Huvudserver är upptagen, full dump åter schemalagd."
 
-#: nis/nis_local_names.c:121
+#: nis/nis_local_names.c:122
 #, c-format
 msgid "LOCAL entry for UID %d in directory %s not unique\n"
 msgstr "LOCAL-post för UID %d i katalog %s är inte unik\n"
 
-#: nis/nis_print.c:51
+#: nis/nis_print.c:52
 msgid "UNKNOWN"
 msgstr "OKÄND"
 
-#: nis/nis_print.c:109
+#: nis/nis_print.c:110
 msgid "BOGUS OBJECT\n"
 msgstr "SKENOBJEKT\n"
 
-#: nis/nis_print.c:112
+#: nis/nis_print.c:113
 msgid "NO OBJECT\n"
 msgstr "INGET OBJEKT\n"
 
-#: nis/nis_print.c:115
+#: nis/nis_print.c:116
 msgid "DIRECTORY\n"
 msgstr "KATALOG\n"
 
-#: nis/nis_print.c:118
+#: nis/nis_print.c:119
 msgid "GROUP\n"
 msgstr "GRUPP\n"
 
-#: nis/nis_print.c:121
+#: nis/nis_print.c:122
 msgid "TABLE\n"
 msgstr "TABELL\n"
 
-#: nis/nis_print.c:124
+#: nis/nis_print.c:125
 msgid "ENTRY\n"
 msgstr "POST\n"
 
-#: nis/nis_print.c:127
+#: nis/nis_print.c:128
 msgid "LINK\n"
 msgstr "LÄNK\n"
 
-#: nis/nis_print.c:130
+#: nis/nis_print.c:131
 msgid "PRIVATE\n"
 msgstr "PRIVAT\n"
 
-#: nis/nis_print.c:133
+#: nis/nis_print.c:134
 msgid "(Unknown object)\n"
 msgstr "(Okänt objekt)\n"
 
-#: nis/nis_print.c:167
+#: nis/nis_print.c:168
 #, c-format
 msgid "Name : `%s'\n"
 msgstr "Namn: \"%s\"\n"
 
-#: nis/nis_print.c:168
+#: nis/nis_print.c:169
 #, c-format
 msgid "Type : %s\n"
 msgstr "Typ: %s\n"
 
-#: nis/nis_print.c:173
+#: nis/nis_print.c:174
 msgid "Master Server :\n"
 msgstr "Huvudserver:\n"
 
-#: nis/nis_print.c:175
+#: nis/nis_print.c:176
 msgid "Replicate :\n"
 msgstr "Replikera:\n"
 
-#: nis/nis_print.c:176
+#: nis/nis_print.c:177
 #, c-format
 msgid "\tName       : %s\n"
 msgstr "\tNamn       : %s\n"
 
-#: nis/nis_print.c:177
+#: nis/nis_print.c:178
 msgid "\tPublic Key : "
 msgstr "\tPublik nyckel: "
 
-#: nis/nis_print.c:181
+#: nis/nis_print.c:182
 msgid "None.\n"
 msgstr "Ingen.\n"
 
-#: nis/nis_print.c:184
+#: nis/nis_print.c:185
 #, c-format
 msgid "Diffie-Hellmann (%d bits)\n"
 msgstr "Diffie-Hellmann (%d bitar)\n"
 
-#: nis/nis_print.c:189
+#: nis/nis_print.c:190
 #, c-format
 msgid "RSA (%d bits)\n"
 msgstr "RSA (%d bitar)\n"
 
-#: nis/nis_print.c:192
+#: nis/nis_print.c:193
 msgid "Kerberos.\n"
 msgstr "Kerberos.\n"
 
-#: nis/nis_print.c:195
+#: nis/nis_print.c:196
 #, c-format
 msgid "Unknown (type = %d, bits = %d)\n"
 msgstr "Okänd (typ = %d, bitar = %d)\n"
 
-#: nis/nis_print.c:206
+#: nis/nis_print.c:207
 #, c-format
 msgid "\tUniversal addresses (%u)\n"
 msgstr "\tUniversella adresser (%u)\n"
 
-#: nis/nis_print.c:228
+#: nis/nis_print.c:229
 msgid "Time to live : "
 msgstr "Livslängd: "
 
-#: nis/nis_print.c:230
+#: nis/nis_print.c:231
 msgid "Default Access rights :\n"
 msgstr "Standard åtkomsträttigheter:\n"
 
-#: nis/nis_print.c:239
+#: nis/nis_print.c:240
 #, c-format
 msgid "\tType         : %s\n"
 msgstr "\tTyp          : %s\n"
 
-#: nis/nis_print.c:240
+#: nis/nis_print.c:241
 msgid "\tAccess rights: "
 msgstr "\tRättigheter  : "
 
-#: nis/nis_print.c:254
+#: nis/nis_print.c:255
 msgid "Group Flags :"
 msgstr "Gruppflaggor: "
 
-#: nis/nis_print.c:257
+#: nis/nis_print.c:258
 msgid ""
 "\n"
 "Group Members :\n"
@@ -3466,95 +3466,95 @@ msgstr ""
 "\n"
 "Gruppmedlemmar:\n"
 
-#: nis/nis_print.c:269
+#: nis/nis_print.c:270
 #, c-format
 msgid "Table Type          : %s\n"
 msgstr "Tabelltyp           : %s\n"
 
-#: nis/nis_print.c:270
+#: nis/nis_print.c:271
 #, c-format
 msgid "Number of Columns   : %d\n"
 msgstr "Antal kolumner      : %d\n"
 
-#: nis/nis_print.c:271
+#: nis/nis_print.c:272
 #, c-format
 msgid "Character Separator : %c\n"
 msgstr "Teckenseparator     : %c\n"
 
-#: nis/nis_print.c:272
+#: nis/nis_print.c:273
 #, c-format
 msgid "Search Path         : %s\n"
 msgstr "Sökväg              : %s\n"
 
-#: nis/nis_print.c:273
+#: nis/nis_print.c:274
 msgid "Columns             :\n"
 msgstr "Kolumner            :\n"
 
-#: nis/nis_print.c:276
+#: nis/nis_print.c:277
 #, c-format
 msgid "\t[%d]\tName          : %s\n"
 msgstr "\t[%d]\tNamn          : %s\n"
 
-#: nis/nis_print.c:278
+#: nis/nis_print.c:279
 msgid "\t\tAttributes    : "
 msgstr "\t\tAttribut      : "
 
-#: nis/nis_print.c:280
+#: nis/nis_print.c:281
 msgid "\t\tAccess Rights : "
 msgstr "\t\tRättigheter   : "
 
-#: nis/nis_print.c:290
+#: nis/nis_print.c:291
 msgid "Linked Object Type : "
 msgstr "Länkad objekttyp   : "
 
-#: nis/nis_print.c:292
+#: nis/nis_print.c:293
 #, c-format
 msgid "Linked to : %s\n"
 msgstr "Länkad till: %s\n"
 
-#: nis/nis_print.c:302
+#: nis/nis_print.c:303
 #, c-format
 msgid "\tEntry data of type %s\n"
 msgstr "\tPostdata av typ %s\n"
 
-#: nis/nis_print.c:305
+#: nis/nis_print.c:306
 #, c-format
 msgid "\t[%u] - [%u bytes] "
 msgstr "\t[%u] - [%u byte] "
 
-#: nis/nis_print.c:308
+#: nis/nis_print.c:309
 msgid "Encrypted data\n"
 msgstr "Krypterat data\n"
 
-#: nis/nis_print.c:310
+#: nis/nis_print.c:311
 msgid "Binary data\n"
 msgstr "Binärdata\n"
 
-#: nis/nis_print.c:326
+#: nis/nis_print.c:327
 #, c-format
 msgid "Object Name   : %s\n"
 msgstr "Objektnamn    : %s\n"
 
-#: nis/nis_print.c:327
+#: nis/nis_print.c:328
 #, c-format
 msgid "Directory     : %s\n"
 msgstr "Katalog       : %s\n"
 
-#: nis/nis_print.c:328
+#: nis/nis_print.c:329
 #, c-format
 msgid "Owner         : %s\n"
 msgstr "Ägare         : %s\n"
 
-#: nis/nis_print.c:329
+#: nis/nis_print.c:330
 #, c-format
 msgid "Group         : %s\n"
 msgstr "Grupp         : %s\n"
 
-#: nis/nis_print.c:330
+#: nis/nis_print.c:331
 msgid "Access Rights : "
 msgstr "Rättigheter   : "
 
-#: nis/nis_print.c:332
+#: nis/nis_print.c:333
 #, c-format
 msgid ""
 "\n"
@@ -3563,90 +3563,90 @@ msgstr ""
 "\n"
 "Livslängd     : "
 
-#: nis/nis_print.c:335
+#: nis/nis_print.c:336
 #, c-format
 msgid "Creation Time : %s"
 msgstr "Skapad        : %s"
 
-#: nis/nis_print.c:337
+#: nis/nis_print.c:338
 #, c-format
 msgid "Mod. Time     : %s"
 msgstr "Ändr. tid     : %s"
 
-#: nis/nis_print.c:338
+#: nis/nis_print.c:339
 msgid "Object Type   : "
 msgstr "Objekttyp     : "
 
-#: nis/nis_print.c:358
+#: nis/nis_print.c:359
 #, c-format
 msgid "    Data Length = %u\n"
 msgstr "    Datalängd = %u\n"
 
-#: nis/nis_print.c:372
+#: nis/nis_print.c:373
 #, c-format
 msgid "Status            : %s\n"
 msgstr "Status            : %s\n"
 
-#: nis/nis_print.c:373
+#: nis/nis_print.c:374
 #, c-format
 msgid "Number of objects : %u\n"
 msgstr "Antal objekt      : %u\n"
 
-#: nis/nis_print.c:377
+#: nis/nis_print.c:378
 #, c-format
 msgid "Object #%d:\n"
 msgstr "Objekt nr %d:\n"
 
-#: nis/nis_print_group_entry.c:116
+#: nis/nis_print_group_entry.c:117
 #, c-format
 msgid "Group entry for \"%s.%s\" group:\n"
 msgstr "Gruppost för \"%s.%s\" grupp:\n"
 
-#: nis/nis_print_group_entry.c:124
+#: nis/nis_print_group_entry.c:125
 msgid "    Explicit members:\n"
 msgstr "    Explicita medlemmar:\n"
 
-#: nis/nis_print_group_entry.c:129
+#: nis/nis_print_group_entry.c:130
 msgid "    No explicit members\n"
 msgstr "    Inga explicita medlemmar\n"
 
-#: nis/nis_print_group_entry.c:132
+#: nis/nis_print_group_entry.c:133
 msgid "    Implicit members:\n"
 msgstr "    Implicita medlemmar:\n"
 
-#: nis/nis_print_group_entry.c:137
+#: nis/nis_print_group_entry.c:138
 msgid "    No implicit members\n"
 msgstr "    Inga implicita medlemmar\n"
 
-#: nis/nis_print_group_entry.c:140
+#: nis/nis_print_group_entry.c:141
 msgid "    Recursive members:\n"
 msgstr "    Rekursiva medlemmar:\n"
 
-#: nis/nis_print_group_entry.c:145
+#: nis/nis_print_group_entry.c:146
 msgid "    No recursive members\n"
 msgstr "    Inga rekursiva medlemmar\n"
 
-#: nis/nis_print_group_entry.c:148
+#: nis/nis_print_group_entry.c:149
 msgid "    Explicit nonmembers:\n"
 msgstr "    Explicita icke-medlemmar:\n"
 
-#: nis/nis_print_group_entry.c:153
+#: nis/nis_print_group_entry.c:154
 msgid "    No explicit nonmembers\n"
 msgstr "    Inga explicita icke-medlemmar\n"
 
-#: nis/nis_print_group_entry.c:156
+#: nis/nis_print_group_entry.c:157
 msgid "    Implicit nonmembers:\n"
 msgstr "    Implicita icke-medlemmar:\n"
 
-#: nis/nis_print_group_entry.c:161
+#: nis/nis_print_group_entry.c:162
 msgid "    No implicit nonmembers\n"
 msgstr "    Inga implicita icke-medlemmar\n"
 
-#: nis/nis_print_group_entry.c:164
+#: nis/nis_print_group_entry.c:165
 msgid "    Recursive nonmembers:\n"
 msgstr "    Rekursiva icke-medlemmar:\n"
 
-#: nis/nis_print_group_entry.c:169
+#: nis/nis_print_group_entry.c:170
 msgid "    No recursive nonmembers\n"
 msgstr "    Inga rekursiva icke-medlemmar\n"
 
@@ -3688,100 +3688,100 @@ msgstr "netname2user: LOCAL-post för %s i katalog %s är inte unik"
 msgid "netname2user: should not have uid 0"
 msgstr "netname2user: borde inte ha uid 0"
 
-#: nis/ypclnt.c:820
+#: nis/ypclnt.c:827
 msgid "Request arguments bad"
 msgstr "Argument för förfrågan felaktiga"
 
-#: nis/ypclnt.c:823
+#: nis/ypclnt.c:830
 msgid "RPC failure on NIS operation"
 msgstr "RPC-fel vid NIS-operation"
 
-#: nis/ypclnt.c:826
+#: nis/ypclnt.c:833
 msgid "Can't bind to server which serves this domain"
 msgstr "Kan inte ansluta till servern som betjänar denna domän"
 
-#: nis/ypclnt.c:829
+#: nis/ypclnt.c:836
 msgid "No such map in server's domain"
 msgstr "Ingen sådan tabell i serverns domän"
 
-#: nis/ypclnt.c:832
+#: nis/ypclnt.c:839
 msgid "No such key in map"
 msgstr "Ingen sådan nyckel i tabellen"
 
-#: nis/ypclnt.c:835
+#: nis/ypclnt.c:842
 msgid "Internal NIS error"
 msgstr "Internt NIS-fel"
 
-#: nis/ypclnt.c:838
+#: nis/ypclnt.c:845
 msgid "Local resource allocation failure"
 msgstr "Allokeringsfel för lokal resurs"
 
-#: nis/ypclnt.c:841
+#: nis/ypclnt.c:848
 msgid "No more records in map database"
 msgstr "Inga fler poster i tabelldatabasen"
 
-#: nis/ypclnt.c:844
+#: nis/ypclnt.c:851
 msgid "Can't communicate with portmapper"
 msgstr "Kan inte kommunicera med portmapper"
 
-#: nis/ypclnt.c:847
+#: nis/ypclnt.c:854
 msgid "Can't communicate with ypbind"
 msgstr "Kan inte kommunicera med ypbind"
 
-#: nis/ypclnt.c:850
+#: nis/ypclnt.c:857
 msgid "Can't communicate with ypserv"
 msgstr "Kan inte kommunicera med ypserv"
 
-#: nis/ypclnt.c:853
+#: nis/ypclnt.c:860
 msgid "Local domain name not set"
 msgstr "Lokalt domännamn inte satt"
 
-#: nis/ypclnt.c:856
+#: nis/ypclnt.c:863
 msgid "NIS map database is bad"
 msgstr "NIS tabelldatabas är felaktig"
 
-#: nis/ypclnt.c:859
+#: nis/ypclnt.c:866
 msgid "NIS client/server version mismatch - can't supply service"
 msgstr "NIS versionsskillnad klient/server - kan inte betjäna"
 
-#: nis/ypclnt.c:865
+#: nis/ypclnt.c:872
 msgid "Database is busy"
 msgstr "Databasen är upptagen"
 
-#: nis/ypclnt.c:868
+#: nis/ypclnt.c:875
 msgid "Unknown NIS error code"
 msgstr "Okänd NIS-felkod"
 
-#: nis/ypclnt.c:908
+#: nis/ypclnt.c:916
 msgid "Internal ypbind error"
 msgstr "Internt ypbind-fel"
 
-#: nis/ypclnt.c:911
+#: nis/ypclnt.c:919
 msgid "Domain not bound"
 msgstr "Domän inte bunden"
 
-#: nis/ypclnt.c:914
+#: nis/ypclnt.c:922
 msgid "System resource allocation failure"
 msgstr "Allokeringsfel för systemresurs"
 
-#: nis/ypclnt.c:917
+#: nis/ypclnt.c:925
 msgid "Unknown ypbind error"
 msgstr "Okänt ypbind-fel"
 
-#: nis/ypclnt.c:958
+#: nis/ypclnt.c:966
 msgid "yp_update: cannot convert host to netname\n"
 msgstr "yp_update: kan inte omvandla värd till nätnamn\n"
 
-#: nis/ypclnt.c:976
+#: nis/ypclnt.c:984
 msgid "yp_update: cannot get server address\n"
 msgstr "yp_update: kan inte hämta serveradress\n"
 
-#: nscd/aicache.c:84 nscd/hstcache.c:485
+#: nscd/aicache.c:85 nscd/hstcache.c:485
 #, c-format
 msgid "Haven't found \"%s\" in hosts cache!"
 msgstr "Hittar inte \"%s\" i värdcache!"
 
-#: nscd/aicache.c:86 nscd/hstcache.c:487
+#: nscd/aicache.c:87 nscd/hstcache.c:487
 #, c-format
 msgid "Reloading \"%s\" in hosts cache!"
 msgstr "Omladdar \"%s\" i värdcache!"
@@ -3815,269 +3815,264 @@ msgstr "beskär %s cache; tid %ld"
 msgid "considering %s entry \"%s\", timeout %<PRIu64>"
 msgstr "överväger %s-post \"%s\", tidsgräns %<PRIu64>"
 
-#: nscd/connections.c:548
+#: nscd/connections.c:537
 #, c-format
 msgid "invalid persistent database file \"%s\": %s"
 msgstr "ogiltig persistent databasfil \"%s\": %s"
 
-#: nscd/connections.c:556
+#: nscd/connections.c:545
 msgid "uninitialized header"
 msgstr "oinitierat huvud"
 
-#: nscd/connections.c:561
+#: nscd/connections.c:550
 msgid "header size does not match"
 msgstr "huvudstorlek stämmer inte"
 
-#: nscd/connections.c:571
+#: nscd/connections.c:560
 msgid "file size does not match"
 msgstr "filstorlek stämmer inte"
 
-#: nscd/connections.c:588
+#: nscd/connections.c:577
 msgid "verification failed"
 msgstr "verifikation misslyckades"
 
-#: nscd/connections.c:602
+#: nscd/connections.c:591
 #, c-format
 msgid "suggested size of table for database %s larger than the persistent database's table"
 msgstr "föreslagen storlek på tabellen för databas %s är större än den persistenta databasens tabell"
 
-#: nscd/connections.c:613 nscd/connections.c:697
+#: nscd/connections.c:602 nscd/connections.c:686
 #, c-format
 msgid "cannot create read-only descriptor for \"%s\"; no mmap"
 msgstr "kan inte skapa läsbar filidentifierare för \"%s\", ingen mmap"
 
-#: nscd/connections.c:629
+#: nscd/connections.c:618
 #, c-format
 msgid "cannot access '%s'"
 msgstr "kan inte komma åt \"%s\""
 
-#: nscd/connections.c:677
+#: nscd/connections.c:666
 #, c-format
 msgid "database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"
 msgstr "databas för %s korrupt eller använd av flera samtidigt; ta bort %s manuellt om det behövs och starta om"
 
-#: nscd/connections.c:683
+#: nscd/connections.c:672
 #, c-format
 msgid "cannot create %s; no persistent database used"
 msgstr "kan inte skapa %s; ingen persistent databas används"
 
-#: nscd/connections.c:686
+#: nscd/connections.c:675
 #, c-format
 msgid "cannot create %s; no sharing possible"
 msgstr "kan inte skapa %s; ingen delning möjlig"
 
-#: nscd/connections.c:757
+#: nscd/connections.c:746
 #, c-format
 msgid "cannot write to database file %s: %s"
 msgstr "kan inte skriva till databasfil %s: %s"
 
-#: nscd/connections.c:796
-#, c-format
-msgid "cannot set socket to close on exec: %s; disabling paranoia mode"
-msgstr "kan inte sätta uttag (socket) att stängas vid programstart: %s; kopplar ur paranoialäge"
-
-#: nscd/connections.c:831
+#: nscd/connections.c:802
 #, c-format
 msgid "cannot open socket: %s"
 msgstr "kan inte öppna uttag (socket): %s"
 
-#: nscd/connections.c:850
+#: nscd/connections.c:821
 #, c-format
 msgid "cannot enable socket to accept connections: %s"
 msgstr "kan inte få uttag (socket) att acceptera förbindelser: %s"
 
-#: nscd/connections.c:907
+#: nscd/connections.c:878
 #, c-format
 msgid "disabled inotify-based monitoring for file `%s': %s"
 msgstr "avaktiverade inotify-baserad övervakning för filen ”%s”: %s"
 
-#: nscd/connections.c:911
+#: nscd/connections.c:882
 #, c-format
 msgid "monitoring file `%s` (%d)"
 msgstr "övervakar filen ”%s” (%d)"
 
-#: nscd/connections.c:924
+#: nscd/connections.c:895
 #, c-format
 msgid "disabled inotify-based monitoring for directory `%s': %s"
 msgstr "avaktiverade inotify-baserad övervakning av katalogen ”%s”: %s"
 
-#: nscd/connections.c:928
+#: nscd/connections.c:899
 #, c-format
 msgid "monitoring directory `%s` (%d)"
 msgstr "övervakar katalogen ”%s” (%d)"
 
-#: nscd/connections.c:956
+#: nscd/connections.c:927
 #, c-format
 msgid "monitoring file %s for database %s"
 msgstr "övervakar filen %s för databas %s"
 
-#: nscd/connections.c:966
+#: nscd/connections.c:937
 #, c-format
 msgid "stat failed for file `%s'; will try again later: %s"
 msgstr "stat misslyckades för filen ”%s”; kommer försöka igen senare: %s"
 
-#: nscd/connections.c:1085
+#: nscd/connections.c:1056
 #, c-format
 msgid "provide access to FD %d, for %s"
 msgstr "ge åtkomst till FD %d, för %s"
 
-#: nscd/connections.c:1097
+#: nscd/connections.c:1068
 #, c-format
 msgid "cannot handle old request version %d; current version is %d"
 msgstr "kan inte hantera äldre förfrågansversion %d, nuvarande version är %d"
 
-#: nscd/connections.c:1119
+#: nscd/connections.c:1090
 #, c-format
 msgid "request from %ld not handled due to missing permission"
 msgstr "begäran från %ld inte hanterad för att rättigheter saknas"
 
-#: nscd/connections.c:1124
+#: nscd/connections.c:1095
 #, c-format
 msgid "request from '%s' [%ld] not handled due to missing permission"
 msgstr "begäran från \"%s\" [%ld] inte hanterad för att rättigheter saknas"
 
-#: nscd/connections.c:1129
+#: nscd/connections.c:1100
 msgid "request not handled due to missing permission"
 msgstr "begäran inte hanterad för att rättigheter saknas"
 
-#: nscd/connections.c:1167 nscd/connections.c:1220
+#: nscd/connections.c:1138 nscd/connections.c:1191
 #, c-format
 msgid "cannot write result: %s"
 msgstr "kan inte skriva resultat: %s"
 
-#: nscd/connections.c:1311
+#: nscd/connections.c:1282
 #, c-format
 msgid "error getting caller's id: %s"
 msgstr "kunde inte hämta anropandes identitet: %s"
 
-#: nscd/connections.c:1371
+#: nscd/connections.c:1342
 #, c-format
 msgid "cannot open /proc/self/cmdline: %s; disabling paranoia mode"
 msgstr "kan inte öppna /proc/slef/cmdline: %s, kopplar ur paranoialäge"
 
-#: nscd/connections.c:1385
+#: nscd/connections.c:1356
 #, c-format
 msgid "cannot read /proc/self/cmdline: %s; disabling paranoia mode"
 msgstr "kan inte läsa /proc/self/cmdline: %s, kopplar ur paranoialäge"
 
-#: nscd/connections.c:1425
+#: nscd/connections.c:1396
 #, c-format
 msgid "cannot change to old UID: %s; disabling paranoia mode"
 msgstr "kan inte byta till föregående UID: %s; kopplar ur paranoialäge"
 
-#: nscd/connections.c:1435
+#: nscd/connections.c:1406
 #, c-format
 msgid "cannot change to old GID: %s; disabling paranoia mode"
 msgstr "kan inte byta till föregående GID: %s; kopplar ur paranoialäge"
 
-#: nscd/connections.c:1448
+#: nscd/connections.c:1419
 #, c-format
 msgid "cannot change to old working directory: %s; disabling paranoia mode"
 msgstr "kan inte byta till föregående arbetskatalog: %s; kopplar ur paranoialäge"
 
-#: nscd/connections.c:1494
+#: nscd/connections.c:1465
 #, c-format
 msgid "re-exec failed: %s; disabling paranoia mode"
 msgstr "återstart misslyckades: %s; kopplar ur paranoialäge"
 
-#: nscd/connections.c:1503
+#: nscd/connections.c:1474
 #, c-format
 msgid "cannot change current working directory to \"/\": %s"
 msgstr "kan inte byta aktuell katalog till \"/\": %s"
 
-#: nscd/connections.c:1696
+#: nscd/connections.c:1657
 #, c-format
 msgid "short read while reading request: %s"
 msgstr "fattas data vid läsning av begäran: %s"
 
-#: nscd/connections.c:1729
+#: nscd/connections.c:1690
 #, c-format
 msgid "key length in request too long: %d"
 msgstr "nyckellängd i begäran för lång: %d"
 
-#: nscd/connections.c:1742
+#: nscd/connections.c:1703
 #, c-format
 msgid "short read while reading request key: %s"
 msgstr "fattas data vid läsning av begäransnyckel: %s"
 
-#: nscd/connections.c:1752
+#: nscd/connections.c:1713
 #, c-format
 msgid "handle_request: request received (Version = %d) from PID %ld"
 msgstr "handle_request: begäran mottagen (Version = %d) från PID %ld"
 
-#: nscd/connections.c:1757
+#: nscd/connections.c:1718
 #, c-format
 msgid "handle_request: request received (Version = %d)"
 msgstr "handle_request: begäran mottagen (Version = %d)"
 
-#: nscd/connections.c:1897
+#: nscd/connections.c:1858
 #, c-format
 msgid "ignored inotify event for `%s` (file exists)"
 msgstr "ignorerade inotify-händelse för ”%s” (filen finns)"
 
-#: nscd/connections.c:1902
+#: nscd/connections.c:1863
 #, c-format
 msgid "monitored file `%s` was %s, removing watch"
 msgstr "den övervakade filen ”%s” var %s, tar bort vakten"
 
-#: nscd/connections.c:1910 nscd/connections.c:1952
+#: nscd/connections.c:1871 nscd/connections.c:1913
 #, c-format
 msgid "failed to remove file watch `%s`: %s"
 msgstr "misslyckades att ta bort filvakt ”%s”: %s"
 
-#: nscd/connections.c:1925
+#: nscd/connections.c:1886
 #, c-format
 msgid "monitored file `%s` was written to"
 msgstr "den övervakade filen ”%s” skrevs till"
 
-#: nscd/connections.c:1949
+#: nscd/connections.c:1910
 #, c-format
 msgid "monitored parent directory `%s` was %s, removing watch on `%s`"
 msgstr "den övervakade föräldrakatalogen ”%s” var %s, tar bort vakten av ”%s”"
 
-#: nscd/connections.c:1975
+#: nscd/connections.c:1936
 #, c-format
 msgid "monitored file `%s` was %s, adding watch"
 msgstr "den övervakade filen ”%s” var %s, lägger till vakt"
 
-#: nscd/connections.c:1987
+#: nscd/connections.c:1948
 #, c-format
 msgid "failed to add file watch `%s`: %s"
 msgstr "misslyckades med att lägga till filvakt ”%s”: %s"
 
-#: nscd/connections.c:2181 nscd/connections.c:2362
+#: nscd/connections.c:2126 nscd/connections.c:2291
 #, c-format
 msgid "disabled inotify-based monitoring after read error %d"
 msgstr "avaktiverade inotify-baserad övervakning efter läsfel %d"
 
-#: nscd/connections.c:2477
+#: nscd/connections.c:2406
 msgid "could not initialize conditional variable"
 msgstr "kan inte initiera villkorsvariabel"
 
-#: nscd/connections.c:2485
+#: nscd/connections.c:2414
 msgid "could not start clean-up thread; terminating"
 msgstr "kunde inte starta städtråd; avslutar"
 
-#: nscd/connections.c:2499
+#: nscd/connections.c:2428
 msgid "could not start any worker thread; terminating"
 msgstr "kunde inte starta någon arbetstråd; avslutar"
 
-#: nscd/connections.c:2554 nscd/connections.c:2556 nscd/connections.c:2572
-#: nscd/connections.c:2582 nscd/connections.c:2600 nscd/connections.c:2611
-#: nscd/connections.c:2621
+#: nscd/connections.c:2483 nscd/connections.c:2485 nscd/connections.c:2501
+#: nscd/connections.c:2511 nscd/connections.c:2529 nscd/connections.c:2540
+#: nscd/connections.c:2550
 #, c-format
 msgid "Failed to run nscd as user '%s'"
 msgstr "Misslyckades att köra nscd som användare \"%s\""
 
-#: nscd/connections.c:2574
+#: nscd/connections.c:2503
 msgid "initial getgrouplist failed"
 msgstr "första getgrouplist misslyckades"
 
-#: nscd/connections.c:2583
+#: nscd/connections.c:2512
 msgid "getgrouplist failed"
 msgstr "getgrouplist misslyckades"
 
-#: nscd/connections.c:2601
+#: nscd/connections.c:2530
 msgid "setgroups failed"
 msgstr "setgroups misslyckades"
 
@@ -4760,62 +4755,41 @@ msgstr "odefinierad"
 msgid "Unrecognized variable `%s'"
 msgstr "Okänd variabel \"%s\""
 
-#: posix/getopt.c:592 posix/getopt.c:621
+#: posix/getopt.c:277
 #, c-format
-msgid "%s: option '%s' is ambiguous; possibilities:"
-msgstr "%s: flaggan \"%s\" är tvetydig; alternativ:"
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: flaggan ”%s%s” är tvetydig\n"
 
-#: posix/getopt.c:662 posix/getopt.c:666
+#: posix/getopt.c:283
 #, c-format
-msgid "%s: option '--%s' doesn't allow an argument\n"
-msgstr "%s: flaggan \"--%s\" tar inget argument\n"
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: flaggan ”%s%s” är tvetydig; alternativ:"
 
-#: posix/getopt.c:675 posix/getopt.c:680
+#: posix/getopt.c:318
 #, c-format
-msgid "%s: option '%c%s' doesn't allow an argument\n"
-msgstr "%s: flaggan \"%c%s\" tar inget argument\n"
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: okänd flagga ”%s%s”\n"
 
-#: posix/getopt.c:723 posix/getopt.c:742
+#: posix/getopt.c:344
 #, c-format
-msgid "%s: option '--%s' requires an argument\n"
-msgstr "%s: flaggan \"--%s\" kräver ett argument\n"
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: flaggan ”%s%s” tar inget argument\n"
 
-#: posix/getopt.c:780 posix/getopt.c:783
+#: posix/getopt.c:359
 #, c-format
-msgid "%s: unrecognized option '--%s'\n"
-msgstr "%s: okänd flagga \"--%s\"\n"
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: flaggan ”%s%s” kräver ett argument\n"
 
-#: posix/getopt.c:791 posix/getopt.c:794
-#, c-format
-msgid "%s: unrecognized option '%c%s'\n"
-msgstr "%s: okänd flagga \"%c%s\"\n"
-
-#: posix/getopt.c:843 posix/getopt.c:846
+#: posix/getopt.c:620
 #, c-format
 msgid "%s: invalid option -- '%c'\n"
 msgstr "%s: ogiltig flagga -- \"%c\"\n"
 
-#: posix/getopt.c:899 posix/getopt.c:916 posix/getopt.c:1126
-#: posix/getopt.c:1144
+#: posix/getopt.c:635 posix/getopt.c:681
 #, c-format
 msgid "%s: option requires an argument -- '%c'\n"
 msgstr "%s: flaggan kräver ett argument -- \"%c\"\n"
 
-#: posix/getopt.c:972 posix/getopt.c:988
-#, c-format
-msgid "%s: option '-W %s' is ambiguous\n"
-msgstr "%s: flaggan \"-W %s\" är tvetydig\n"
-
-#: posix/getopt.c:1012 posix/getopt.c:1030
-#, c-format
-msgid "%s: option '-W %s' doesn't allow an argument\n"
-msgstr "%s: flaggan \"-W %s\" tar inget argument\n"
-
-#: posix/getopt.c:1051 posix/getopt.c:1069
-#, c-format
-msgid "%s: option '-W %s' requires an argument\n"
-msgstr "%s: flaggan \"-W %s\" kräver ett argument\n"
-
 #: posix/regcomp.c:140
 msgid "No match"
 msgstr "Ingen träff"
@@ -4884,7 +4858,7 @@ msgstr "Obalanserade ) eller \\)"
 msgid "No previous regular expression"
 msgstr "Inget föregående reguljärt uttryck"
 
-#: posix/wordexp.c:1852
+#: posix/wordexp.c:1822
 msgid "parameter null or not set"
 msgstr "parameter är tom eller inte satt"
 
@@ -5069,7 +5043,7 @@ msgstr "Buffertplats för utdata tillgängligt"
 msgid "Input message available"
 msgstr "Inkommande meddelande tillgängligt"
 
-#: stdio-common/psiginfo-data.h:46 timezone/zdump.c:541 timezone/zic.c:483
+#: stdio-common/psiginfo-data.h:46 timezone/zdump.c:381 timezone/zic.c:520
 msgid "I/O error"
 msgstr "I/O-fel"
 
@@ -5149,170 +5123,170 @@ msgstr "Realtidssignal %d"
 msgid "Unknown signal %d"
 msgstr "Okänd signal %d"
 
-#: sunrpc/auth_unix.c:111 sunrpc/clnt_tcp.c:123 sunrpc/clnt_udp.c:135
-#: sunrpc/clnt_unix.c:124 sunrpc/svc_tcp.c:188 sunrpc/svc_tcp.c:233
-#: sunrpc/svc_udp.c:160 sunrpc/svc_unix.c:188 sunrpc/svc_unix.c:229
-#: sunrpc/xdr.c:627 sunrpc/xdr.c:787 sunrpc/xdr_array.c:101
-#: sunrpc/xdr_rec.c:152 sunrpc/xdr_ref.c:78
+#: sunrpc/auth_unix.c:112 sunrpc/clnt_tcp.c:124 sunrpc/clnt_udp.c:139
+#: sunrpc/clnt_unix.c:125 sunrpc/svc_tcp.c:189 sunrpc/svc_tcp.c:234
+#: sunrpc/svc_udp.c:161 sunrpc/svc_unix.c:189 sunrpc/svc_unix.c:230
+#: sunrpc/xdr.c:628 sunrpc/xdr.c:788 sunrpc/xdr_array.c:102
+#: sunrpc/xdr_rec.c:153 sunrpc/xdr_ref.c:79
 msgid "out of memory\n"
 msgstr "minnet slut\n"
 
-#: sunrpc/auth_unix.c:349
+#: sunrpc/auth_unix.c:350
 msgid "auth_unix.c: Fatal marshalling problem"
 msgstr "auth_unix.c: Fatalt kodningsproblem"
 
-#: sunrpc/clnt_perr.c:95 sunrpc/clnt_perr.c:111
+#: sunrpc/clnt_perr.c:96 sunrpc/clnt_perr.c:112
 #, c-format
 msgid "%s: %s; low version = %lu, high version = %lu"
 msgstr "%s: %s; undre version = %lu, övre version = %lu"
 
-#: sunrpc/clnt_perr.c:102
+#: sunrpc/clnt_perr.c:103
 #, c-format
 msgid "%s: %s; why = %s\n"
 msgstr "%s: %s; varför = %s\n"
 
-#: sunrpc/clnt_perr.c:104
+#: sunrpc/clnt_perr.c:105
 #, c-format
 msgid "%s: %s; why = (unknown authentication error - %d)\n"
 msgstr "%s: %s; varför = (okänt fel vid äkthetskontroll - %d)\n"
 
-#: sunrpc/clnt_perr.c:153
+#: sunrpc/clnt_perr.c:154
 msgid "RPC: Success"
 msgstr "RPC: Lyckat"
 
-#: sunrpc/clnt_perr.c:156
+#: sunrpc/clnt_perr.c:157
 msgid "RPC: Can't encode arguments"
 msgstr "RPC: Kan inte koda argumentet"
 
-#: sunrpc/clnt_perr.c:160
+#: sunrpc/clnt_perr.c:161
 msgid "RPC: Can't decode result"
 msgstr "RPC: Kan inte avkoda resultatet"
 
-#: sunrpc/clnt_perr.c:164
+#: sunrpc/clnt_perr.c:165
 msgid "RPC: Unable to send"
 msgstr "RPC: Kan inte skicka"
 
-#: sunrpc/clnt_perr.c:168
+#: sunrpc/clnt_perr.c:169
 msgid "RPC: Unable to receive"
 msgstr "RPC: Kan inte ta emot"
 
-#: sunrpc/clnt_perr.c:172
+#: sunrpc/clnt_perr.c:173
 msgid "RPC: Timed out"
 msgstr "RPC: Tiden löpte ut"
 
-#: sunrpc/clnt_perr.c:176
+#: sunrpc/clnt_perr.c:177
 msgid "RPC: Incompatible versions of RPC"
 msgstr "RPC: Inkompatibla versioner av RPC"
 
-#: sunrpc/clnt_perr.c:180
+#: sunrpc/clnt_perr.c:181
 msgid "RPC: Authentication error"
 msgstr "RPC: Fel vid äkthetskontroll"
 
-#: sunrpc/clnt_perr.c:184
+#: sunrpc/clnt_perr.c:185
 msgid "RPC: Program unavailable"
 msgstr "RPC: Programmet otillgängligt"
 
-#: sunrpc/clnt_perr.c:188
+#: sunrpc/clnt_perr.c:189
 msgid "RPC: Program/version mismatch"
 msgstr "RPC: Program/version-inkompatibilitet"
 
-#: sunrpc/clnt_perr.c:192
+#: sunrpc/clnt_perr.c:193
 msgid "RPC: Procedure unavailable"
 msgstr "RPC: Procedur inte tillgänglig"
 
-#: sunrpc/clnt_perr.c:196
+#: sunrpc/clnt_perr.c:197
 msgid "RPC: Server can't decode arguments"
 msgstr "RPC: Server kan inte avkoda argumenten"
 
-#: sunrpc/clnt_perr.c:200
+#: sunrpc/clnt_perr.c:201
 msgid "RPC: Remote system error"
 msgstr "RPC: Fjärrsystemsfel"
 
-#: sunrpc/clnt_perr.c:204
+#: sunrpc/clnt_perr.c:205
 msgid "RPC: Unknown host"
 msgstr "RPC: Okänd värdmaskin"
 
-#: sunrpc/clnt_perr.c:208
+#: sunrpc/clnt_perr.c:209
 msgid "RPC: Unknown protocol"
 msgstr "RPC: Okänt protokoll"
 
-#: sunrpc/clnt_perr.c:212
+#: sunrpc/clnt_perr.c:213
 msgid "RPC: Port mapper failure"
 msgstr "RPC: Fel i portöversättare"
 
-#: sunrpc/clnt_perr.c:216
+#: sunrpc/clnt_perr.c:217
 msgid "RPC: Program not registered"
 msgstr "RPC: Programmet inte registrerat"
 
-#: sunrpc/clnt_perr.c:220
+#: sunrpc/clnt_perr.c:221
 msgid "RPC: Failed (unspecified error)"
 msgstr "RPC: Misslyckades (ospecificerat fel)"
 
-#: sunrpc/clnt_perr.c:261
+#: sunrpc/clnt_perr.c:262
 msgid "RPC: (unknown error code)"
 msgstr "RPC: (okänd felkod)"
 
-#: sunrpc/clnt_perr.c:333
+#: sunrpc/clnt_perr.c:334
 msgid "Authentication OK"
 msgstr "Äkthetskontroll OK"
 
-#: sunrpc/clnt_perr.c:336
+#: sunrpc/clnt_perr.c:337
 msgid "Invalid client credential"
 msgstr "Ogiltiga klientreferenser"
 
-#: sunrpc/clnt_perr.c:340
+#: sunrpc/clnt_perr.c:341
 msgid "Server rejected credential"
 msgstr "Server förkastade kreditiv"
 
-#: sunrpc/clnt_perr.c:344
+#: sunrpc/clnt_perr.c:345
 msgid "Invalid client verifier"
 msgstr "Ogiltig klientverifierare"
 
-#: sunrpc/clnt_perr.c:348
+#: sunrpc/clnt_perr.c:349
 msgid "Server rejected verifier"
 msgstr "Server förkastade verifierare"
 
-#: sunrpc/clnt_perr.c:352
+#: sunrpc/clnt_perr.c:353
 msgid "Client credential too weak"
 msgstr "Klientens referenser är för svaga"
 
-#: sunrpc/clnt_perr.c:356
+#: sunrpc/clnt_perr.c:357
 msgid "Invalid server verifier"
 msgstr "Ogiltig serververifierare"
 
-#: sunrpc/clnt_perr.c:360
+#: sunrpc/clnt_perr.c:361
 msgid "Failed (unspecified error)"
 msgstr "Misslyckades (ospecificerat fel)"
 
-#: sunrpc/clnt_raw.c:115
+#: sunrpc/clnt_raw.c:116
 msgid "clnt_raw.c: fatal header serialization error"
 msgstr "clnt_raw.c: fatalt fel vid serialisering"
 
-#: sunrpc/pm_getmaps.c:77
+#: sunrpc/pm_getmaps.c:78
 msgid "pmap_getmaps.c: rpc problem"
 msgstr "pmap_getmaps.c rpc problem"
 
-#: sunrpc/pmap_clnt.c:127
+#: sunrpc/pmap_clnt.c:128
 msgid "Cannot register service"
 msgstr "Kan inte registrera tjänst"
 
-#: sunrpc/pmap_rmt.c:244
+#: sunrpc/pmap_rmt.c:245
 msgid "Cannot create socket for broadcast rpc"
 msgstr "Kan inte skapa uttag (socket) för utsändnings-rpc"
 
-#: sunrpc/pmap_rmt.c:251
+#: sunrpc/pmap_rmt.c:252
 msgid "Cannot set socket option SO_BROADCAST"
 msgstr "Kan inte sätta uttagsflaggan (socket option) SO_BROADCAST"
 
-#: sunrpc/pmap_rmt.c:303
+#: sunrpc/pmap_rmt.c:304
 msgid "Cannot send broadcast packet"
 msgstr "Kan inte skicka utsändningspaket"
 
-#: sunrpc/pmap_rmt.c:328
+#: sunrpc/pmap_rmt.c:329
 msgid "Broadcast poll problem"
 msgstr "Problem med poll vid utsändning"
 
-#: sunrpc/pmap_rmt.c:341
+#: sunrpc/pmap_rmt.c:342
 msgid "Cannot receive reply to broadcast"
 msgstr "Kan inte ta emot svar på utsändning"
 
@@ -5595,11 +5569,11 @@ msgstr "tom teckensträng"
 msgid "preprocessor error"
 msgstr "preprocessorfel"
 
-#: sunrpc/svc_run.c:71
+#: sunrpc/svc_run.c:72
 msgid "svc_run: - out of memory"
 msgstr "svc_run: - minnet slut"
 
-#: sunrpc/svc_run.c:91
+#: sunrpc/svc_run.c:92
 msgid "svc_run: - poll failed"
 msgstr "svc_run: - poll misslyckades"
 
@@ -5631,204 +5605,204 @@ msgstr "problem att svara till prog %d\n"
 msgid "never registered prog %d\n"
 msgstr "aldrig registrerat prog %d\n"
 
-#: sunrpc/svc_tcp.c:164
+#: sunrpc/svc_tcp.c:165
 msgid "svc_tcp.c - tcp socket creation problem"
 msgstr "svc_tcp.c - problem att skapa tcp-uttag (socket)"
 
-#: sunrpc/svc_tcp.c:179
+#: sunrpc/svc_tcp.c:180
 msgid "svc_tcp.c - cannot getsockname or listen"
 msgstr "svc_tcp.c - kan inte anropa getsockname eller listen"
 
-#: sunrpc/svc_udp.c:135
+#: sunrpc/svc_udp.c:136
 msgid "svcudp_create: socket creation problem"
 msgstr "svcudp_create: problem att skapa uttag (socket)"
 
-#: sunrpc/svc_udp.c:149
+#: sunrpc/svc_udp.c:150
 msgid "svcudp_create - cannot getsockname"
 msgstr "svcudp_create - kan inte anropa getsockname"
 
-#: sunrpc/svc_udp.c:181
+#: sunrpc/svc_udp.c:182
 msgid "svcudp_create: xp_pad is too small for IP_PKTINFO\n"
 msgstr "svcudp_create: xp_pad är för liten för IP_PKTINFO\n"
 
-#: sunrpc/svc_udp.c:480
+#: sunrpc/svc_udp.c:481
 msgid "enablecache: cache already enabled"
 msgstr "enablecache: cache redan påslagen"
 
-#: sunrpc/svc_udp.c:486
+#: sunrpc/svc_udp.c:487
 msgid "enablecache: could not allocate cache"
 msgstr "enablecache: kunde inte allokera cache"
 
-#: sunrpc/svc_udp.c:495
+#: sunrpc/svc_udp.c:496
 msgid "enablecache: could not allocate cache data"
 msgstr "enablecache: kunde inte allokera cache-data"
 
-#: sunrpc/svc_udp.c:503
+#: sunrpc/svc_udp.c:504
 msgid "enablecache: could not allocate cache fifo"
 msgstr "enablecache: kunde inte allokera cache-fifo"
 
-#: sunrpc/svc_udp.c:539
+#: sunrpc/svc_udp.c:540
 msgid "cache_set: victim not found"
 msgstr "cache_set: offer hittades inte"
 
-#: sunrpc/svc_udp.c:550
+#: sunrpc/svc_udp.c:551
 msgid "cache_set: victim alloc failed"
 msgstr "cache_set: offerallokering misslyckades"
 
-#: sunrpc/svc_udp.c:557
+#: sunrpc/svc_udp.c:558
 msgid "cache_set: could not allocate new rpc_buffer"
 msgstr "cache_set: kunde inte allokera ny rpc-buffert"
 
-#: sunrpc/svc_unix.c:162
+#: sunrpc/svc_unix.c:163
 msgid "svc_unix.c - AF_UNIX socket creation problem"
 msgstr "svc_unix.c - problem att skapa AF_UNIX uttag (socket)"
 
-#: sunrpc/svc_unix.c:178
+#: sunrpc/svc_unix.c:179
 msgid "svc_unix.c - cannot getsockname or listen"
 msgstr "svc_unix.c - kan inte anropa getsockname eller listen"
 
-#: sysdeps/generic/siglist.h:28
+#: sysdeps/generic/siglist.h:29
 msgid "Hangup"
 msgstr "Avringd"
 
-#: sysdeps/generic/siglist.h:29
+#: sysdeps/generic/siglist.h:30
 msgid "Interrupt"
 msgstr "Avbruten (SIGINT)"
 
-#: sysdeps/generic/siglist.h:30
+#: sysdeps/generic/siglist.h:31
 msgid "Quit"
 msgstr "Lämnad"
 
-#: sysdeps/generic/siglist.h:31
+#: sysdeps/generic/siglist.h:32
 msgid "Illegal instruction"
 msgstr "Otillåten instruktion"
 
-#: sysdeps/generic/siglist.h:32
+#: sysdeps/generic/siglist.h:33
 msgid "Trace/breakpoint trap"
 msgstr "Spårningsfälla"
 
-#: sysdeps/generic/siglist.h:33
+#: sysdeps/generic/siglist.h:34
 msgid "Aborted"
 msgstr "Avbruten (SIGABRT)"
 
-#: sysdeps/generic/siglist.h:34
+#: sysdeps/generic/siglist.h:35
 msgid "Floating point exception"
 msgstr "Flyttalsfel"
 
-#: sysdeps/generic/siglist.h:35
+#: sysdeps/generic/siglist.h:36
 msgid "Killed"
 msgstr "Dödad"
 
-#: sysdeps/generic/siglist.h:36
+#: sysdeps/generic/siglist.h:37
 msgid "Bus error"
 msgstr "Bussfel"
 
-#: sysdeps/generic/siglist.h:37
+#: sysdeps/generic/siglist.h:38
+msgid "Bad system call"
+msgstr "Felaktigt systemanrop"
+
+#: sysdeps/generic/siglist.h:39
 msgid "Segmentation fault"
 msgstr "Segmenteringsfel"
 
-#. TRANS Broken pipe; there is no process reading from the other end of a pipe.
+#. TRANS There is no process reading from the other end of a pipe.
 #. TRANS Every library function that returns this error code also generates a
 #. TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
 #. TRANS or blocked.  Thus, your program will never actually see @code{EPIPE}
 #. TRANS unless it has handled or blocked @code{SIGPIPE}.
-#: sysdeps/generic/siglist.h:38 sysdeps/gnu/errlist.c:360
+#: sysdeps/generic/siglist.h:40 sysdeps/gnu/errlist.c:360
 msgid "Broken pipe"
 msgstr "Brutet rör"
 
-#: sysdeps/generic/siglist.h:39
+#: sysdeps/generic/siglist.h:41
 msgid "Alarm clock"
 msgstr "Alarmklocka"
 
-#: sysdeps/generic/siglist.h:40
+#: sysdeps/generic/siglist.h:42
 msgid "Terminated"
 msgstr "Avslutad"
 
-#: sysdeps/generic/siglist.h:41
+#: sysdeps/generic/siglist.h:43
 msgid "Urgent I/O condition"
 msgstr "Akut I/O-tillstånd"
 
-#: sysdeps/generic/siglist.h:42
+#: sysdeps/generic/siglist.h:44
 msgid "Stopped (signal)"
 msgstr "Stoppad (signal)"
 
-#: sysdeps/generic/siglist.h:43
+#: sysdeps/generic/siglist.h:45
 msgid "Stopped"
 msgstr "Stoppad"
 
-#: sysdeps/generic/siglist.h:44
+#: sysdeps/generic/siglist.h:46
 msgid "Continued"
 msgstr "Återupptagen"
 
-#: sysdeps/generic/siglist.h:45
+#: sysdeps/generic/siglist.h:47
 msgid "Child exited"
 msgstr "Barnprocess avslutad"
 
-#: sysdeps/generic/siglist.h:46
+#: sysdeps/generic/siglist.h:48
 msgid "Stopped (tty input)"
 msgstr "Stoppad (terminalläsning)"
 
-#: sysdeps/generic/siglist.h:47
+#: sysdeps/generic/siglist.h:49
 msgid "Stopped (tty output)"
 msgstr "Stoppad (terminalskrivning)"
 
-#: sysdeps/generic/siglist.h:48
+#: sysdeps/generic/siglist.h:50
 msgid "I/O possible"
 msgstr "I/O möjligt"
 
-#: sysdeps/generic/siglist.h:49
+#: sysdeps/generic/siglist.h:51
 msgid "CPU time limit exceeded"
 msgstr "Begränsning av CPU-tid överskriden"
 
-#: sysdeps/generic/siglist.h:50
+#: sysdeps/generic/siglist.h:52
 msgid "File size limit exceeded"
 msgstr "Begränsning av filstorlek överskriden"
 
-#: sysdeps/generic/siglist.h:51
+#: sysdeps/generic/siglist.h:53
 msgid "Virtual timer expired"
 msgstr "Alarmklocka - virtuell tid"
 
-#: sysdeps/generic/siglist.h:52
+#: sysdeps/generic/siglist.h:54
 msgid "Profiling timer expired"
 msgstr "Profileringsklocka"
 
-#: sysdeps/generic/siglist.h:53
+#: sysdeps/generic/siglist.h:55
 msgid "User defined signal 1"
 msgstr "Användarsignal 1"
 
-#: sysdeps/generic/siglist.h:54
+#: sysdeps/generic/siglist.h:56
 msgid "User defined signal 2"
 msgstr "Användarsignal 2"
 
-#: sysdeps/generic/siglist.h:58
-msgid "EMT trap"
-msgstr "Emulatorfälla"
+#: sysdeps/generic/siglist.h:57
+msgid "Window changed"
+msgstr "Ändrat fönster"
 
 #: sysdeps/generic/siglist.h:61
-msgid "Bad system call"
-msgstr "Felaktigt systemanrop"
+msgid "EMT trap"
+msgstr "Emulatorfälla"
 
 #: sysdeps/generic/siglist.h:64
 msgid "Stack fault"
 msgstr "Stackfel"
 
 #: sysdeps/generic/siglist.h:67
-msgid "Information request"
-msgstr "Informationsbegäran"
-
-#: sysdeps/generic/siglist.h:69
 msgid "Power failure"
 msgstr "Strömavbrott"
 
-#: sysdeps/generic/siglist.h:72
+#: sysdeps/generic/siglist.h:70
+msgid "Information request"
+msgstr "Informationsbegäran"
+
+#: sysdeps/generic/siglist.h:73
 msgid "Resource lost"
 msgstr "Förlorad resurs"
 
-#: sysdeps/generic/siglist.h:75
-msgid "Window changed"
-msgstr "Ändrat fönster"
-
-#. TRANS Operation not permitted; only the owner of the file (or other resource)
+#. TRANS Only the owner of the file (or other resource)
 #. TRANS or processes with special privileges can perform the operation.
 #: sysdeps/gnu/errlist.c:26
 msgid "Operation not permitted"
@@ -5839,7 +5813,7 @@ msgstr "Operationen inte tillåten"
 msgid "No such process"
 msgstr "Processen finns inte"
 
-#. TRANS Interrupted function call; an asynchronous signal occurred and prevented
+#. TRANS An asynchronous signal occurred and prevented
 #. TRANS completion of the call.  When this happens, you should try the call
 #. TRANS again.
 #. TRANS
@@ -5850,12 +5824,12 @@ msgstr "Processen finns inte"
 msgid "Interrupted system call"
 msgstr "Avbrutet systemanrop"
 
-#. TRANS Input/output error; usually used for physical read or write errors.
+#. TRANS Usually used for physical read or write errors.
 #: sysdeps/gnu/errlist.c:70
 msgid "Input/output error"
 msgstr "In/ut-fel"
 
-#. TRANS No such device or address.  The system tried to use the device
+#. TRANS The system tried to use the device
 #. TRANS represented by a file you specified, and it couldn't find the device.
 #. TRANS This can mean that the device file was installed incorrectly, or that
 #. TRANS the physical device is missing or not correctly attached to the
@@ -5864,7 +5838,7 @@ msgstr "In/ut-fel"
 msgid "No such device or address"
 msgstr "Enheten eller adressen finns inte"
 
-#. TRANS Argument list too long; used when the arguments passed to a new program
+#. TRANS Used when the arguments passed to a new program
 #. TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
 #. TRANS File}) occupy too much memory space.  This condition never arises on
 #. TRANS @gnuhurdsystems{}.
@@ -5878,21 +5852,21 @@ msgstr "Argumentlistan för lång"
 msgid "Exec format error"
 msgstr "Formatfel på körbar fil"
 
-#. TRANS Bad file descriptor; for example, I/O on a descriptor that has been
+#. TRANS For example, I/O on a descriptor that has been
 #. TRANS closed or reading from a descriptor open only for writing (or vice
 #. TRANS versa).
 #: sysdeps/gnu/errlist.c:116
 msgid "Bad file descriptor"
 msgstr "Felaktig filidentifierare"
 
-#. TRANS There are no child processes.  This error happens on operations that are
+#. TRANS This error happens on operations that are
 #. TRANS supposed to manipulate child processes, when there aren't any processes
 #. TRANS to manipulate.
 #: sysdeps/gnu/errlist.c:127
 msgid "No child processes"
 msgstr "Inga barnprocesser"
 
-#. TRANS Deadlock avoided; allocating a system resource would have resulted in a
+#. TRANS Allocating a system resource would have resulted in a
 #. TRANS deadlock situation.  The system does not guarantee that it will notice
 #. TRANS all such situations.  This error means you got lucky and the system
 #. TRANS noticed; it might just hang.  @xref{File Locks}, for an example.
@@ -5900,13 +5874,13 @@ msgstr "Inga barnprocesser"
 msgid "Resource deadlock avoided"
 msgstr "Resursdödläge undveks"
 
-#. TRANS No memory available.  The system cannot allocate more virtual memory
+#. TRANS The system cannot allocate more virtual memory
 #. TRANS because its capacity is full.
 #: sysdeps/gnu/errlist.c:149
 msgid "Cannot allocate memory"
 msgstr "Kan inte allokera minne"
 
-#. TRANS Bad address; an invalid pointer was detected.
+#. TRANS An invalid pointer was detected.
 #. TRANS On @gnuhurdsystems{}, this error never happens; you get a signal instead.
 #: sysdeps/gnu/errlist.c:168
 msgid "Bad address"
@@ -5919,14 +5893,14 @@ msgstr "Felaktig adress"
 msgid "Block device required"
 msgstr "Blockenhet krävs"
 
-#. TRANS Resource busy; a system resource that can't be shared is already in use.
+#. TRANS A system resource that can't be shared is already in use.
 #. TRANS For example, if you try to delete a file that is the root of a currently
 #. TRANS mounted filesystem, you get this error.
 #: sysdeps/gnu/errlist.c:190
 msgid "Device or resource busy"
 msgstr "Enhet eller resurs upptagen"
 
-#. TRANS File exists; an existing file was specified in a context where it only
+#. TRANS An existing file was specified in a context where it only
 #. TRANS makes sense to specify a new file.
 #: sysdeps/gnu/errlist.c:200
 msgid "File exists"
@@ -5950,13 +5924,13 @@ msgstr "Enheten finns inte"
 msgid "Not a directory"
 msgstr "Inte en katalog"
 
-#. TRANS File is a directory; you cannot open a directory for writing,
+#. TRANS You cannot open a directory for writing,
 #. TRANS or create or remove hard links to it.
 #: sysdeps/gnu/errlist.c:240
 msgid "Is a directory"
 msgstr "Är en katalog"
 
-#. TRANS Invalid argument.  This is used to indicate various kinds of problems
+#. TRANS This is used to indicate various kinds of problems
 #. TRANS with passing the wrong argument to a library function.
 #: sysdeps/gnu/errlist.c:250
 msgid "Invalid argument"
@@ -5995,12 +5969,12 @@ msgstr "Olämplig ioctl för enheten"
 msgid "Text file busy"
 msgstr "Kodfil upptagen"
 
-#. TRANS File too big; the size of a file would be larger than allowed by the system.
+#. TRANS The size of a file would be larger than allowed by the system.
 #: sysdeps/gnu/errlist.c:308
 msgid "File too large"
 msgstr "För stor fil"
 
-#. TRANS No space left on device; write operation on a file failed because the
+#. TRANS Write operation on a file failed because the
 #. TRANS disk is full.
 #: sysdeps/gnu/errlist.c:318
 msgid "No space left on device"
@@ -6016,26 +5990,26 @@ msgstr "Otillåten sökning"
 msgid "Read-only file system"
 msgstr "Skrivskyddat filsystem"
 
-#. TRANS Too many links; the link count of a single file would become too large.
+#. TRANS The link count of a single file would become too large.
 #. TRANS @code{rename} can cause this error if the file being renamed already has
 #. TRANS as many links as it can take (@pxref{Renaming Files}).
 #: sysdeps/gnu/errlist.c:347
 msgid "Too many links"
 msgstr "För många länkar"
 
-#. TRANS Domain error; used by mathematical functions when an argument value does
+#. TRANS Used by mathematical functions when an argument value does
 #. TRANS not fall into the domain over which the function is defined.
 #: sysdeps/gnu/errlist.c:370
 msgid "Numerical argument out of domain"
 msgstr "Numeriskt argument är utanför området"
 
-#. TRANS Range error; used by mathematical functions when the result value is
+#. TRANS Used by mathematical functions when the result value is
 #. TRANS not representable because of overflow or underflow.
 #: sysdeps/gnu/errlist.c:380
 msgid "Numerical result out of range"
 msgstr "Numeriskt resultat är utanför giltigt intervall"
 
-#. TRANS Resource temporarily unavailable; the call might work if you try again
+#. TRANS The call might work if you try again
 #. TRANS later.  The macro @code{EWOULDBLOCK} is another name for @code{EAGAIN};
 #. TRANS they are always the same in @theglibc{}.
 #. TRANS
@@ -6223,76 +6197,75 @@ msgstr "Destinationsadress krävs"
 msgid "Cannot send after transport endpoint shutdown"
 msgstr "Kan inte skicka efter att transportslutpunkten stängts"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:677
+#: sysdeps/gnu/errlist.c:676
 msgid "Too many references: cannot splice"
 msgstr "För många referenser: kan inte skarva"
 
 #. TRANS A socket operation with a specified timeout received no response during
 #. TRANS the timeout period.
-#: sysdeps/gnu/errlist.c:687
+#: sysdeps/gnu/errlist.c:686
 msgid "Connection timed out"
 msgstr "Förbindelsens tidsgräns löpte ut"
 
 #. TRANS A remote host refused to allow the network connection (typically because
 #. TRANS it is not running the requested service).
-#: sysdeps/gnu/errlist.c:697
+#: sysdeps/gnu/errlist.c:696
 msgid "Connection refused"
 msgstr "Förbindelsen förvägrad"
 
 #. TRANS Too many levels of symbolic links were encountered in looking up a file name.
 #. TRANS This often indicates a cycle of symbolic links.
-#: sysdeps/gnu/errlist.c:707
+#: sysdeps/gnu/errlist.c:706
 msgid "Too many levels of symbolic links"
 msgstr "För många nivåer av symboliska länkar"
 
 #. TRANS Filename too long (longer than @code{PATH_MAX}; @pxref{Limits for
 #. TRANS Files}) or host name too long (in @code{gethostname} or
 #. TRANS @code{sethostname}; @pxref{Host Identification}).
-#: sysdeps/gnu/errlist.c:718
+#: sysdeps/gnu/errlist.c:717
 msgid "File name too long"
 msgstr "För långt filnamn"
 
 #. TRANS The remote host for a requested network connection is down.
-#: sysdeps/gnu/errlist.c:727
+#: sysdeps/gnu/errlist.c:726
 msgid "Host is down"
 msgstr "Värddator är nere"
 
 #. TRANS The remote host for a requested network connection is not reachable.
-#: sysdeps/gnu/errlist.c:736
+#: sysdeps/gnu/errlist.c:735
 msgid "No route to host"
 msgstr "Ingen väg till värd"
 
 #. TRANS Directory not empty, where an empty directory was expected.  Typically,
 #. TRANS this error occurs when you are trying to delete a directory.
-#: sysdeps/gnu/errlist.c:746
+#: sysdeps/gnu/errlist.c:745
 msgid "Directory not empty"
 msgstr "Katalog inte tom"
 
 #. TRANS This means that the per-user limit on new process would be exceeded by
 #. TRANS an attempted @code{fork}.  @xref{Limits on Resources}, for details on
 #. TRANS the @code{RLIMIT_NPROC} limit.
-#: sysdeps/gnu/errlist.c:757
+#: sysdeps/gnu/errlist.c:756
 msgid "Too many processes"
 msgstr "För många processer"
 
 #. TRANS The file quota system is confused because there are too many users.
 #. TRANS @c This can probably happen in a GNU system when using NFS.
-#: sysdeps/gnu/errlist.c:767
+#: sysdeps/gnu/errlist.c:766
 msgid "Too many users"
 msgstr "För många användare"
 
 #. TRANS The user's disk quota was exceeded.
-#: sysdeps/gnu/errlist.c:776
+#: sysdeps/gnu/errlist.c:775
 msgid "Disk quota exceeded"
 msgstr "Diskkvot överskriden"
 
-#. TRANS Stale file handle.  This indicates an internal confusion in the
+#. TRANS This indicates an internal confusion in the
 #. TRANS file system which is due to file system rearrangements on the server host
 #. TRANS for NFS file systems or corruption in other file systems.
 #. TRANS Repairing this condition usually requires unmounting, possibly repairing
 #. TRANS and remounting the file system.
-#: sysdeps/gnu/errlist.c:789
+#: sysdeps/gnu/errlist.c:788
 msgid "Stale file handle"
 msgstr "Förlegat filhandtag"
 
@@ -6300,72 +6273,65 @@ msgstr "Förlegat filhandtag"
 #. TRANS already specifies an NFS-mounted file.
 #. TRANS (This is an error on some operating systems, but we expect it to work
 #. TRANS properly on @gnuhurdsystems{}, making this error code impossible.)
-#: sysdeps/gnu/errlist.c:801
+#: sysdeps/gnu/errlist.c:800
 msgid "Object is remote"
 msgstr "Är ett fjärrobjekt"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:810
+#: sysdeps/gnu/errlist.c:808
 msgid "RPC struct is bad"
 msgstr "RPC-strukturen är felaktig"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:819
+#: sysdeps/gnu/errlist.c:816
 msgid "RPC version wrong"
 msgstr "RPC-versionen är felaktig"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:828
+#: sysdeps/gnu/errlist.c:824
 msgid "RPC program not available"
 msgstr "RPC-programmet inte tillgängligt"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:837
+#: sysdeps/gnu/errlist.c:832
 msgid "RPC program version wrong"
 msgstr "RPC-programversionen är felaktig"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:846
+#: sysdeps/gnu/errlist.c:840
 msgid "RPC bad procedure for program"
 msgstr "Felaktig RPC-procedur för programmet"
 
-#. TRANS No locks available.  This is used by the file locking facilities; see
+#. TRANS This is used by the file locking facilities; see
 #. TRANS @ref{File Locks}.  This error is never generated by @gnuhurdsystems{}, but
 #. TRANS it can result from an operation to an NFS server running another
 #. TRANS operating system.
-#: sysdeps/gnu/errlist.c:858
+#: sysdeps/gnu/errlist.c:852
 msgid "No locks available"
 msgstr "Inga lås tillgängliga"
 
-#. TRANS Inappropriate file type or format.  The file was the wrong type for the
+#. TRANS The file was the wrong type for the
 #. TRANS operation, or a data file had the wrong format.
 #. TRANS
 #. TRANS On some systems @code{chmod} returns this error if you try to set the
 #. TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}.
-#: sysdeps/gnu/errlist.c:871
+#: sysdeps/gnu/errlist.c:865
 msgid "Inappropriate file type or format"
 msgstr "Filtyp eller format olämplig"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:880
+#: sysdeps/gnu/errlist.c:873
 msgid "Authentication error"
 msgstr "Autentiseringsfel"
 
-#. TRANS ???
-#: sysdeps/gnu/errlist.c:889
+#: sysdeps/gnu/errlist.c:881
 msgid "Need authenticator"
 msgstr "Behöver autentiserare"
 
-#. TRANS Function not implemented.  This indicates that the function called is
+#. TRANS This indicates that the function called is
 #. TRANS not implemented at all, either in the C library itself or in the
 #. TRANS operating system.  When you get this error, you can be sure that this
 #. TRANS particular function will always fail with @code{ENOSYS} unless you
 #. TRANS install a new version of the C library or the operating system.
-#: sysdeps/gnu/errlist.c:902
+#: sysdeps/gnu/errlist.c:894
 msgid "Function not implemented"
 msgstr "Funktion inte implementerad"
 
-#. TRANS Not supported.  A function returns this error when certain parameter
+#. TRANS A function returns this error when certain parameter
 #. TRANS values are valid, but the functionality they request is not available.
 #. TRANS This can mean that the function does not implement a particular command
 #. TRANS or option value or flag bit at all.  For functions that operate on some
@@ -6377,13 +6343,13 @@ msgstr "Funktion inte implementerad"
 #. TRANS
 #. TRANS If the entire function is not available at all in the implementation,
 #. TRANS it returns @code{ENOSYS} instead.
-#: sysdeps/gnu/errlist.c:922
+#: sysdeps/gnu/errlist.c:914
 msgid "Not supported"
 msgstr "Stöds ej"
 
 #. TRANS While decoding a multibyte character the function came along an invalid
 #. TRANS or an incomplete sequence of bytes or the given wide character is invalid.
-#: sysdeps/gnu/errlist.c:932
+#: sysdeps/gnu/errlist.c:924
 msgid "Invalid or incomplete multibyte or wide character"
 msgstr "Ogiltigt eller ofullständigt flerbyte- eller brett tecken"
 
@@ -6393,276 +6359,276 @@ msgstr "Ogiltigt eller ofullständigt flerbyte- eller brett tecken"
 #. TRANS error because functions such as @code{read} and @code{write} translate
 #. TRANS it into a @code{SIGTTIN} or @code{SIGTTOU} signal.  @xref{Job Control},
 #. TRANS for information on process groups and these signals.
-#: sysdeps/gnu/errlist.c:946
+#: sysdeps/gnu/errlist.c:938
 msgid "Inappropriate operation for background process"
 msgstr "Operation för bakgrundsprocess olämplig"
 
 #. TRANS On @gnuhurdsystems{}, opening a file returns this error when the file is
 #. TRANS translated by a program and the translator program dies while starting
 #. TRANS up, before it has connected to the file.
-#: sysdeps/gnu/errlist.c:957
+#: sysdeps/gnu/errlist.c:949
 msgid "Translator died"
 msgstr "Översättaren dog"
 
 #. TRANS The experienced user will know what is wrong.
 #. TRANS @c This error code is a joke.  Its perror text is part of the joke.
 #. TRANS @c Don't change it.
-#: sysdeps/gnu/errlist.c:968
+#: sysdeps/gnu/errlist.c:960
 msgid "?"
 msgstr "?"
 
 #. TRANS You did @strong{what}?
-#: sysdeps/gnu/errlist.c:977
+#: sysdeps/gnu/errlist.c:969
 msgid "You really blew it this time"
 msgstr "Du strulade till det den här gången"
 
 #. TRANS Go home and have a glass of warm, dairy-fresh milk.
-#: sysdeps/gnu/errlist.c:986
+#: sysdeps/gnu/errlist.c:978
 msgid "Computer bought the farm"
 msgstr "Datorn packade ihop"
 
 #. TRANS This error code has no purpose.
-#: sysdeps/gnu/errlist.c:995
+#: sysdeps/gnu/errlist.c:987
 msgid "Gratuitous error"
 msgstr "Omotiverat fel"
 
-#: sysdeps/gnu/errlist.c:1003
+#: sysdeps/gnu/errlist.c:995
 msgid "Bad message"
 msgstr "Felaktigt meddelande"
 
-#: sysdeps/gnu/errlist.c:1011
+#: sysdeps/gnu/errlist.c:1003
 msgid "Identifier removed"
 msgstr "Identifierare borttagen"
 
-#: sysdeps/gnu/errlist.c:1019
+#: sysdeps/gnu/errlist.c:1011
 msgid "Multihop attempted"
 msgstr "Flerhopp försöktes"
 
-#: sysdeps/gnu/errlist.c:1027
+#: sysdeps/gnu/errlist.c:1019
 msgid "No data available"
 msgstr "Inga data tillgängliga"
 
-#: sysdeps/gnu/errlist.c:1035
+#: sysdeps/gnu/errlist.c:1027
 msgid "Link has been severed"
 msgstr "Länken har brutits"
 
-#: sysdeps/gnu/errlist.c:1043
+#: sysdeps/gnu/errlist.c:1035
 msgid "No message of desired type"
 msgstr "Inget meddelande av önskad typ"
 
-#: sysdeps/gnu/errlist.c:1051
+#: sysdeps/gnu/errlist.c:1043
 msgid "Out of streams resources"
 msgstr "Stream-resurserna är slut"
 
-#: sysdeps/gnu/errlist.c:1059
+#: sysdeps/gnu/errlist.c:1051
 msgid "Device not a stream"
 msgstr "Enheten är inte en stream"
 
-#: sysdeps/gnu/errlist.c:1067
+#: sysdeps/gnu/errlist.c:1059
 msgid "Value too large for defined data type"
 msgstr "Värdet för stort för definierad datatyp"
 
-#: sysdeps/gnu/errlist.c:1075
+#: sysdeps/gnu/errlist.c:1067
 msgid "Protocol error"
 msgstr "Protokollfel"
 
-#: sysdeps/gnu/errlist.c:1083
+#: sysdeps/gnu/errlist.c:1075
 msgid "Timer expired"
 msgstr "Klockan ringde"
 
-#. TRANS Operation canceled; an asynchronous operation was canceled before it
+#. TRANS An asynchronous operation was canceled before it
 #. TRANS completed.  @xref{Asynchronous I/O}.  When you call @code{aio_cancel},
 #. TRANS the normal result is for the operations affected to complete with this
 #. TRANS error; @pxref{Cancel AIO Operations}.
-#: sysdeps/gnu/errlist.c:1095
+#: sysdeps/gnu/errlist.c:1087
 msgid "Operation canceled"
 msgstr "Operationen avbruten"
 
-#: sysdeps/gnu/errlist.c:1103
+#: sysdeps/gnu/errlist.c:1095
 msgid "Interrupted system call should be restarted"
 msgstr "Avbrutet systemanrop borde omstartas"
 
-#: sysdeps/gnu/errlist.c:1111
+#: sysdeps/gnu/errlist.c:1103
 msgid "Channel number out of range"
 msgstr "Kanalnummer utanför giltigt intervall"
 
-#: sysdeps/gnu/errlist.c:1119
+#: sysdeps/gnu/errlist.c:1111
 msgid "Level 2 not synchronized"
 msgstr "Nivå 2 inte synkroniserad"
 
-#: sysdeps/gnu/errlist.c:1127
+#: sysdeps/gnu/errlist.c:1119
 msgid "Level 3 halted"
 msgstr "Nivå 3 stannad"
 
-#: sysdeps/gnu/errlist.c:1135
+#: sysdeps/gnu/errlist.c:1127
 msgid "Level 3 reset"
 msgstr "Nivå 3 omstartad"
 
-#: sysdeps/gnu/errlist.c:1143
+#: sysdeps/gnu/errlist.c:1135
 msgid "Link number out of range"
 msgstr "Länkantal utanför giltigt intervall"
 
-#: sysdeps/gnu/errlist.c:1151
+#: sysdeps/gnu/errlist.c:1143
 msgid "Protocol driver not attached"
 msgstr "Styrprogram för protokoll inte anslutet"
 
-#: sysdeps/gnu/errlist.c:1159
+#: sysdeps/gnu/errlist.c:1151
 msgid "No CSI structure available"
 msgstr "Inga CSI-strukturer tillgängliga"
 
-#: sysdeps/gnu/errlist.c:1167
+#: sysdeps/gnu/errlist.c:1159
 msgid "Level 2 halted"
 msgstr "Nivå 2 stannad"
 
-#: sysdeps/gnu/errlist.c:1175
+#: sysdeps/gnu/errlist.c:1167
 msgid "Invalid exchange"
 msgstr "Ogiltig växel"
 
-#: sysdeps/gnu/errlist.c:1183
+#: sysdeps/gnu/errlist.c:1175
 msgid "Invalid request descriptor"
-msgstr "Ogiltig begärandeidendiferare"
+msgstr "Ogiltig begärandeidentifierare"
 
-#: sysdeps/gnu/errlist.c:1191
+#: sysdeps/gnu/errlist.c:1183
 msgid "Exchange full"
 msgstr "Växeln full"
 
-#: sysdeps/gnu/errlist.c:1199
+#: sysdeps/gnu/errlist.c:1191
 msgid "No anode"
 msgstr "Ingen anod"
 
-#: sysdeps/gnu/errlist.c:1207
+#: sysdeps/gnu/errlist.c:1199
 msgid "Invalid request code"
 msgstr "Ogiltig begärandekod"
 
-#: sysdeps/gnu/errlist.c:1215
+#: sysdeps/gnu/errlist.c:1207
 msgid "Invalid slot"
 msgstr "Ogiltig plats"
 
-#: sysdeps/gnu/errlist.c:1223
+#: sysdeps/gnu/errlist.c:1215
 msgid "File locking deadlock error"
 msgstr "Fillåsning gav dödläge"
 
-#: sysdeps/gnu/errlist.c:1231
+#: sysdeps/gnu/errlist.c:1223
 msgid "Bad font file format"
 msgstr "Felaktigt format på typsnittsfil"
 
-#: sysdeps/gnu/errlist.c:1239
+#: sysdeps/gnu/errlist.c:1231
 msgid "Machine is not on the network"
 msgstr "Maskinen finns inte på nätverket"
 
-#: sysdeps/gnu/errlist.c:1247
+#: sysdeps/gnu/errlist.c:1239
 msgid "Package not installed"
 msgstr "Paketet är inte installerat"
 
-#: sysdeps/gnu/errlist.c:1255
+#: sysdeps/gnu/errlist.c:1247
 msgid "Advertise error"
 msgstr "Annonseringsfel"
 
-#: sysdeps/gnu/errlist.c:1263
+#: sysdeps/gnu/errlist.c:1255
 msgid "Srmount error"
 msgstr "Srmount-fel"
 
-#: sysdeps/gnu/errlist.c:1271
+#: sysdeps/gnu/errlist.c:1263
 msgid "Communication error on send"
 msgstr "Kommunikationsfel vid sändning"
 
-#: sysdeps/gnu/errlist.c:1279
+#: sysdeps/gnu/errlist.c:1271
 msgid "RFS specific error"
 msgstr "RFS-specifikt fel"
 
-#: sysdeps/gnu/errlist.c:1287
+#: sysdeps/gnu/errlist.c:1279
 msgid "Name not unique on network"
 msgstr "Namnet inte unikt i nätverket"
 
-#: sysdeps/gnu/errlist.c:1295
+#: sysdeps/gnu/errlist.c:1287
 msgid "File descriptor in bad state"
 msgstr "Filidentifierare i felaktigt tillstånd"
 
-#: sysdeps/gnu/errlist.c:1303
+#: sysdeps/gnu/errlist.c:1295
 msgid "Remote address changed"
 msgstr "Fjärradress ändrades"
 
-#: sysdeps/gnu/errlist.c:1311
+#: sysdeps/gnu/errlist.c:1303
 msgid "Can not access a needed shared library"
 msgstr "Kan inte komma åt ett nödvändigt delat bibliotek"
 
-#: sysdeps/gnu/errlist.c:1319
+#: sysdeps/gnu/errlist.c:1311
 msgid "Accessing a corrupted shared library"
 msgstr "Öppnar ett korrupt delat bibliotek"
 
-#: sysdeps/gnu/errlist.c:1327
+#: sysdeps/gnu/errlist.c:1319
 msgid ".lib section in a.out corrupted"
 msgstr ".lib-sektion i a.out korrupt"
 
-#: sysdeps/gnu/errlist.c:1335
+#: sysdeps/gnu/errlist.c:1327
 msgid "Attempting to link in too many shared libraries"
 msgstr "Försöker att länka in för många delade bibliotek"
 
-#: sysdeps/gnu/errlist.c:1343
+#: sysdeps/gnu/errlist.c:1335
 msgid "Cannot exec a shared library directly"
 msgstr "Kan inte köra ett delat bibliotek direkt"
 
-#: sysdeps/gnu/errlist.c:1351
+#: sysdeps/gnu/errlist.c:1343
 msgid "Streams pipe error"
 msgstr "Streams-rörfel"
 
-#: sysdeps/gnu/errlist.c:1359
+#: sysdeps/gnu/errlist.c:1351
 msgid "Structure needs cleaning"
 msgstr "Strukturen behöver städas"
 
-#: sysdeps/gnu/errlist.c:1367
+#: sysdeps/gnu/errlist.c:1359
 msgid "Not a XENIX named type file"
 msgstr "Inte en XENIX-namngiven fil"
 
-#: sysdeps/gnu/errlist.c:1375
+#: sysdeps/gnu/errlist.c:1367
 msgid "No XENIX semaphores available"
 msgstr "Inga XENIX-semaforer tillgängliga"
 
-#: sysdeps/gnu/errlist.c:1383
+#: sysdeps/gnu/errlist.c:1375
 msgid "Is a named type file"
 msgstr "Är av typ namnfil"
 
-#: sysdeps/gnu/errlist.c:1391
+#: sysdeps/gnu/errlist.c:1383
 msgid "Remote I/O error"
 msgstr "I/O-fel på fjärrmaskin"
 
-#: sysdeps/gnu/errlist.c:1399
+#: sysdeps/gnu/errlist.c:1391
 msgid "No medium found"
 msgstr "Inget medium funnet"
 
-#: sysdeps/gnu/errlist.c:1407
+#: sysdeps/gnu/errlist.c:1399
 msgid "Wrong medium type"
 msgstr "Fel medietyp"
 
-#: sysdeps/gnu/errlist.c:1415
+#: sysdeps/gnu/errlist.c:1407
 msgid "Required key not available"
 msgstr "Obligatorisk nyckel inte tillgänglig"
 
-#: sysdeps/gnu/errlist.c:1423
+#: sysdeps/gnu/errlist.c:1415
 msgid "Key has expired"
 msgstr "Nyckeln har gått ut"
 
-#: sysdeps/gnu/errlist.c:1431
+#: sysdeps/gnu/errlist.c:1423
 msgid "Key has been revoked"
 msgstr "Nyckeln har återkallats"
 
-#: sysdeps/gnu/errlist.c:1439
+#: sysdeps/gnu/errlist.c:1431
 msgid "Key was rejected by service"
 msgstr "Nyckeln accepterades inte av tjänsten"
 
-#: sysdeps/gnu/errlist.c:1447
+#: sysdeps/gnu/errlist.c:1439
 msgid "Owner died"
 msgstr "Ägaren dog"
 
-#: sysdeps/gnu/errlist.c:1455
+#: sysdeps/gnu/errlist.c:1447
 msgid "State not recoverable"
 msgstr "Det går inte att återhämta från tillståndet"
 
-#: sysdeps/gnu/errlist.c:1463
+#: sysdeps/gnu/errlist.c:1455
 msgid "Operation not possible due to RF-kill"
 msgstr "Operationen inte möjlig p.g.a. RF-kill"
 
-#: sysdeps/gnu/errlist.c:1471
+#: sysdeps/gnu/errlist.c:1463
 msgid "Memory page has hardware error"
 msgstr "Minnessida har hårdvarufel"
 
@@ -6767,73 +6733,90 @@ msgstr "kan inte öppna \"%s\""
 msgid "cannot read header from `%s'"
 msgstr "kan inte läsa huvud från \"%s\""
 
-#: timezone/zdump.c:494
+#: timezone/zdump.c:338
 msgid "has fewer than 3 characters"
 msgstr "har färre än 3 tecken"
 
-#: timezone/zdump.c:496
+#: timezone/zdump.c:340
 msgid "has more than 6 characters"
 msgstr "har fler än 6 tecken"
 
-#: timezone/zdump.c:498
+#: timezone/zdump.c:342
 msgid "has characters other than ASCII alphanumerics, '-' or '+'"
 msgstr "har andra tecken än ASCII alfanumeriska, ”-” eller ”+”"
 
-#: timezone/zdump.c:503
+#: timezone/zdump.c:347
 #, c-format
 msgid "%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"
 msgstr "%s: varning: zon \"%s\" förkortning \"%s\": %s\n"
 
-#: timezone/zdump.c:553
+#: timezone/zdump.c:393
 #, c-format
 msgid ""
-"%s: usage: %s [--version] [--help] [-{vV}] [-{ct} [lo,]hi] zonename ...\n"
+"%s: usage: %s OPTIONS ZONENAME ...\n"
+"Options include:\n"
+"  -c [L,]U   Start at year L (default -500), end before year U (default 2500)\n"
+"  -t [L,]U   Start at time L, end before time U (in seconds since 1970)\n"
+"  -i         List transitions briefly (format is experimental)\n"
+"  -v         List transitions verbosely\n"
+"  -V         List transitions a bit less verbosely\n"
+"  --help     Output this help\n"
+"  --version  Output version info\n"
 "\n"
 "Report bugs to %s.\n"
 msgstr ""
-"%s: användning: %s [ --version ] [ --help ] [ -{vV} ] [ -{ct} [start,]slut] zonnamn ...\n"
+"%s: användning: %s FLAGGOR ZONNAMN …\n"
+"Flaggorna inkluderar:\n"
+"  -c [L,]Ö   Starta vid år L (standard -500), och sluta före år Ö (standard 2500)\n"
+"  -t [L,]Ö   Starta vid tid L, och sluta före tid Ö (i sekunder sedan 1970)\n"
+"  -i         Lista övergångar kort (formatet är experimentellt)\n"
+"  -v         Lista övergångar utförligt\n"
+"  -V         Lista övergångar lite mindre utförligt\n"
+"  --help     Skriv ut denna hjälp\n"
+"  --version  Skriv ut versionsinformation\n"
+"\n"
 "Rapportera fel till %s.\n"
 "Rapportera fel eller synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\n"
 
-#: timezone/zdump.c:635
+#: timezone/zdump.c:479
 #, c-format
 msgid "%s: wild -c argument %s\n"
 msgstr "%s: argument \"%s\" till flaggan -c har fel format\n"
 
-#: timezone/zdump.c:668
+#: timezone/zdump.c:512
 #, c-format
 msgid "%s: wild -t argument %s\n"
 msgstr "%s: argument \"%s\" till flaggan -t har fel format\n"
 
-#: timezone/zic.c:361
+#: timezone/zic.c:398
 #, c-format
 msgid "%s: Memory exhausted: %s\n"
 msgstr "%s: Minnet slut: %s\n"
 
-#: timezone/zic.c:369
+#: timezone/zic.c:406
 msgid "size overflow"
 msgstr "för stor storlek"
 
-#: timezone/zic.c:416
-msgid "int overflow"
-msgstr "för stort heltal"
+#: timezone/zic.c:454
+msgid "integer overflow"
+msgstr "heltalsspill"
 
-#: timezone/zic.c:451
+#: timezone/zic.c:488
 #, c-format
-msgid "\"%s\", line %d: "
-msgstr "\"%s\", rad %d: "
+msgid "\"%s\", line %<PRIdMAX>: "
+msgstr "”%s”, rad %<PRIdMAX>: "
 
-#: timezone/zic.c:454
+#: timezone/zic.c:491
 #, c-format
-msgid " (rule from \"%s\", line %d)"
-msgstr " (regel från \"%s\", rad %d)"
+msgid " (rule from \"%s\", line %<PRIdMAX>)"
+msgstr " (regel från ”%s”, rad %<PRIdMAX>)"
 
-#: timezone/zic.c:473
+#: timezone/zic.c:510
 #, c-format
 msgid "warning: "
 msgstr "varning: "
 
-#: timezone/zic.c:498
+#: timezone/zic.c:535
 #, c-format
 msgid ""
 "%s: usage is %s [ --version ] [ --help ] [ -v ] \\\n"
@@ -6849,361 +6832,382 @@ msgstr ""
 "Rapportera fel till %s.\n"
 "Rapportera fel eller synpunkter på översättningen till <tp-sv@listor.tp-sv.se>.\n"
 
-#: timezone/zic.c:534
+#: timezone/zic.c:558
+#, c-format
+msgid "%s: Can't chdir to %s: %s\n"
+msgstr "%s: Kan inte byta katalog till %s: %s\n"
+
+#: timezone/zic.c:590
 msgid "wild compilation-time specification of zic_t"
 msgstr "definitionen av zic_t vid kompilering är orimlig"
 
-#: timezone/zic.c:554
+#: timezone/zic.c:610
 #, c-format
 msgid "%s: More than one -d option specified\n"
 msgstr "%s: Flaggan -d given mer än en gång\n"
 
-#: timezone/zic.c:564
+#: timezone/zic.c:620
 #, c-format
 msgid "%s: More than one -l option specified\n"
 msgstr "%s: Flaggan -l given mer än en gång\n"
 
-#: timezone/zic.c:574
+#: timezone/zic.c:630
 #, c-format
 msgid "%s: More than one -p option specified\n"
 msgstr "%s: Flaggan -p given mer än en gång\n"
 
-#: timezone/zic.c:584
+#: timezone/zic.c:640
 #, c-format
 msgid "%s: More than one -y option specified\n"
 msgstr "%s: Flaggan -y given mer än en gång\n"
 
-#: timezone/zic.c:594
+#: timezone/zic.c:650
 #, c-format
 msgid "%s: More than one -L option specified\n"
 msgstr "%s: Flaggan -L given mer än en gång\n"
 
-#: timezone/zic.c:603
+#: timezone/zic.c:659
 msgid "-s ignored"
 msgstr "-s ignoreras"
 
-#: timezone/zic.c:641
+#: timezone/zic.c:698
 msgid "link to link"
 msgstr "länk till länk"
 
-#: timezone/zic.c:644 timezone/zic.c:648
+#: timezone/zic.c:701 timezone/zic.c:705
 msgid "command line"
 msgstr "kommandorad"
 
-#: timezone/zic.c:664
+#: timezone/zic.c:721
 msgid "empty file name"
 msgstr "tomt filnamn"
 
-#: timezone/zic.c:667
+#: timezone/zic.c:724
 #, c-format
 msgid "file name '%s' begins with '/'"
 msgstr "filnamnet ”%s” börjar med ”/”"
 
-#: timezone/zic.c:676
+#: timezone/zic.c:734
 #, c-format
 msgid "file name '%s' contains '%.*s' component"
 msgstr "filnamnet ”%s” innehåller en komponent ”%.*s”"
 
-#: timezone/zic.c:682
+#: timezone/zic.c:740
 #, c-format
 msgid "file name '%s' component contains leading '-'"
 msgstr "en komponent i filnamnet ”%s” innehåller en inledande ”-”"
 
-#: timezone/zic.c:685
+#: timezone/zic.c:743
 #, c-format
 msgid "file name '%s' contains overlength component '%.*s...'"
 msgstr "filnamnet ”%s” innehåller en för lång komponent ”%.*s…”"
 
-#: timezone/zic.c:713
+#: timezone/zic.c:771
 #, c-format
 msgid "file name '%s' contains byte '%c'"
 msgstr "filnamnet ”%s” innehåller en byte ”%c”"
 
-#: timezone/zic.c:714
+#: timezone/zic.c:772
 #, c-format
 msgid "file name '%s' contains byte '\\%o'"
 msgstr "filnamnet ”%s” innehåller en byte ”\\%o”"
 
-#: timezone/zic.c:757
+#: timezone/zic.c:842
+#, c-format
+msgid "%s: link from %s/%s failed: %s\n"
+msgstr "%s: länk från %s/%s misslyckades: %s\n"
+
+#: timezone/zic.c:852 timezone/zic.c:1815
+#, c-format
+msgid "%s: Can't remove %s/%s: %s\n"
+msgstr "%s: Kan inte ta bort %s/%s: %s\n"
+
+#: timezone/zic.c:874
 #, c-format
-msgid "%s: link from %s failed: %s"
-msgstr "%s: länk från %s misslyckades: %s"
+msgid "symbolic link used because hard link failed: %s"
+msgstr "symbolisk länk använd eftersom en hård länk misslyckades: %s"
 
-#: timezone/zic.c:792
-msgid "hard link failed, symbolic link used"
-msgstr "hård länk misslyckades, använder symbolisk länk"
+#: timezone/zic.c:882
+#, c-format
+msgid "%s: Can't read %s/%s: %s\n"
+msgstr "%s: Kan inte läsa %s/%s: %s\n"
 
-#: timezone/zic.c:802
+#: timezone/zic.c:889 timezone/zic.c:1828
 #, c-format
-msgid "%s: Can't read %s: %s\n"
-msgstr "%s: Kan inte läsa %s: %s\n"
+msgid "%s: Can't create %s/%s: %s\n"
+msgstr "%s: Kan inte skapa %s/%s: %s\n"
 
-#: timezone/zic.c:810 timezone/zic.c:1701
+#: timezone/zic.c:898
 #, c-format
-msgid "%s: Can't create %s: %s\n"
-msgstr "%s: Kan inte skapa %s: %s\n"
+msgid "copy used because hard link failed: %s"
+msgstr "kopiering använd eftersom en hård länk misslyckades: %s"
 
-#: timezone/zic.c:818
-msgid "link failed, copy used"
-msgstr "länka misslyckades, kopia skapad"
+#: timezone/zic.c:901
+#, c-format
+msgid "copy used because symbolic link failed: %s"
+msgstr "kopiering använd eftersom en symbolisk länk misslyckades: %s"
 
-#: timezone/zic.c:913 timezone/zic.c:915
+#: timezone/zic.c:1013 timezone/zic.c:1015
 msgid "same rule name in multiple files"
 msgstr "samma regelnamn i flera filer"
 
-#: timezone/zic.c:956
+#: timezone/zic.c:1056
 msgid "unruly zone"
 msgstr "besvärlig zon"
 
-#: timezone/zic.c:963
+#: timezone/zic.c:1063
 #, c-format
 msgid "%s in ruleless zone"
 msgstr "%s i zon utan regler"
 
-#: timezone/zic.c:983
+#: timezone/zic.c:1083
 msgid "standard input"
 msgstr "standard in"
 
-#: timezone/zic.c:988
+#: timezone/zic.c:1088
 #, c-format
 msgid "%s: Can't open %s: %s\n"
 msgstr "%s: Kan inte öppna %s: %s\n"
 
-#: timezone/zic.c:999
+#: timezone/zic.c:1099
 msgid "line too long"
 msgstr "för lång rad"
 
-#: timezone/zic.c:1019
+#: timezone/zic.c:1119
 msgid "input line of unknown type"
 msgstr "inrad av okänd typ"
 
-#: timezone/zic.c:1034
+#: timezone/zic.c:1134
 #, c-format
 msgid "%s: Leap line in non leap seconds file %s"
 msgstr "%s: \"Leap\"-rad i fil %s som inte är skottsekundsfil"
 
-#: timezone/zic.c:1042 timezone/zic.c:1447 timezone/zic.c:1469
+#: timezone/zic.c:1142 timezone/zic.c:1547 timezone/zic.c:1569
 #, c-format
 msgid "%s: panic: Invalid l_value %d\n"
 msgstr "%s: panik: Ogiltigt l_value %d\n"
 
-#: timezone/zic.c:1051
+#: timezone/zic.c:1151
 msgid "expected continuation line not found"
 msgstr "förväntad fortsättningsrad inte funnen"
 
-#: timezone/zic.c:1093 timezone/zic.c:2826
+#: timezone/zic.c:1193 timezone/zic.c:2976
 msgid "time overflow"
 msgstr "för stort tidsvärde"
 
-#: timezone/zic.c:1098
+#: timezone/zic.c:1198
 msgid "values over 24 hours not handled by pre-2007 versions of zic"
 msgstr "värden större än 24 timmar hanteras inte av zic-versioner före 2007"
 
-#: timezone/zic.c:1109
+#: timezone/zic.c:1209
 msgid "wrong number of fields on Rule line"
 msgstr "fel antal fält på \"Rule\"-rad"
 
-#: timezone/zic.c:1113
+#: timezone/zic.c:1213
 msgid "nameless rule"
 msgstr "namnlös regel"
 
-#: timezone/zic.c:1118
+#: timezone/zic.c:1218
 msgid "invalid saved time"
 msgstr "ogiltig sparad tid"
 
-#: timezone/zic.c:1135
+#: timezone/zic.c:1235
 msgid "wrong number of fields on Zone line"
 msgstr "fel antal fält på \"Zone\"-rad"
 
-#: timezone/zic.c:1140
+#: timezone/zic.c:1240
 #, c-format
 msgid "\"Zone %s\" line and -l option are mutually exclusive"
 msgstr "\"Zone %s\"-rad och flaggan -l är ömsesidigt uteslutande"
 
-#: timezone/zic.c:1146
+#: timezone/zic.c:1246
 #, c-format
 msgid "\"Zone %s\" line and -p option are mutually exclusive"
 msgstr "\"Zone %s\"-rad och flaggan -p är ömsesidigt uteslutande"
 
-#: timezone/zic.c:1154
+#: timezone/zic.c:1253
 #, c-format
-msgid "duplicate zone name %s (file \"%s\", line %d)"
-msgstr "dubblerat zonnamn %s (fil \"%s\", rad %d)"
+msgid "duplicate zone name %s (file \"%s\", line %<PRIdMAX>)"
+msgstr "dubblerat zonnamn %s (filen ”%s”, rad %<PRIdMAX>)"
 
-#: timezone/zic.c:1167
+#: timezone/zic.c:1267
 msgid "wrong number of fields on Zone continuation line"
 msgstr "fel antal fält på \"Zone\"-fortsättningsrad"
 
-#: timezone/zic.c:1207
+#: timezone/zic.c:1307
 msgid "invalid UT offset"
 msgstr "ogiltigt UT-tillägg"
 
-#: timezone/zic.c:1211
+#: timezone/zic.c:1311
 msgid "invalid abbreviation format"
 msgstr "ogiltigt förkortningsformat"
 
-#: timezone/zic.c:1220
+#: timezone/zic.c:1320
 #, c-format
 msgid "format '%s' not handled by pre-2015 versions of zic"
 msgstr "formatet ”%s” hanteras inte av versioner av zic före 2015"
 
-#: timezone/zic.c:1247
+#: timezone/zic.c:1347
 msgid "Zone continuation line end time is not after end time of previous line"
 msgstr "Zon-fortsättningsradens sluttid är inte efter sluttiden på föregående rad"
 
-#: timezone/zic.c:1274
+#: timezone/zic.c:1374
 msgid "wrong number of fields on Leap line"
 msgstr "fel antal fält på \"Leap\"-rad"
 
-#: timezone/zic.c:1283
+#: timezone/zic.c:1383
 msgid "invalid leaping year"
 msgstr "ogiltigt skottår"
 
-#: timezone/zic.c:1303 timezone/zic.c:1401
+#: timezone/zic.c:1403 timezone/zic.c:1501
 msgid "invalid month name"
 msgstr "ogiltigt månadsnamn"
 
-#: timezone/zic.c:1316 timezone/zic.c:1514 timezone/zic.c:1528
+#: timezone/zic.c:1416 timezone/zic.c:1614 timezone/zic.c:1628
 msgid "invalid day of month"
 msgstr "ogiltig dag i månaden"
 
-#: timezone/zic.c:1321
+#: timezone/zic.c:1421
 msgid "time too small"
 msgstr "tid för kort"
 
-#: timezone/zic.c:1325
+#: timezone/zic.c:1425
 msgid "time too large"
 msgstr "tid för lång"
 
-#: timezone/zic.c:1329 timezone/zic.c:1430
+#: timezone/zic.c:1429 timezone/zic.c:1530
 msgid "invalid time of day"
 msgstr "ogiltig tid på dagen"
 
-#: timezone/zic.c:1348
+#: timezone/zic.c:1448
 msgid "illegal CORRECTION field on Leap line"
 msgstr "otillåtet \"CORRECTION\"-fält på \"Leap\"-rad"
 
-#: timezone/zic.c:1353
+#: timezone/zic.c:1453
 msgid "illegal Rolling/Stationary field on Leap line"
 msgstr "otillåtet \"Rolling/Stationary\"-fält på \"Leap\"-rad"
 
-#: timezone/zic.c:1359
+#: timezone/zic.c:1459
 msgid "leap second precedes Big Bang"
 msgstr "skottsekund föregår Big Bang"
 
-#: timezone/zic.c:1372
+#: timezone/zic.c:1472
 msgid "wrong number of fields on Link line"
 msgstr "fel antal fält på \"Link\"-rad"
 
-#: timezone/zic.c:1376
+#: timezone/zic.c:1476
 msgid "blank FROM field on Link line"
 msgstr "tomt \"FROM\"-fält på \"Link\"-rad"
 
-#: timezone/zic.c:1451
+#: timezone/zic.c:1551
 msgid "invalid starting year"
 msgstr "ogiltigt startår"
 
-#: timezone/zic.c:1473
+#: timezone/zic.c:1573
 msgid "invalid ending year"
 msgstr "ogiltigt slutår"
 
-#: timezone/zic.c:1477
+#: timezone/zic.c:1577
 msgid "starting year greater than ending year"
 msgstr "startår är större än slutår"
 
-#: timezone/zic.c:1484
+#: timezone/zic.c:1584
 msgid "typed single year"
 msgstr "satte typ på endast ett år"
 
-#: timezone/zic.c:1519
+#: timezone/zic.c:1619
 msgid "invalid weekday name"
 msgstr "ogiltigt veckodagsnamn"
 
-#: timezone/zic.c:1638
+#: timezone/zic.c:1743
+#, c-format
+msgid "reference clients mishandle more than %d transition times"
+msgstr "referensklienter hanterar fler än %d övergångstider felaktigt"
+
+#: timezone/zic.c:1747
 msgid "pre-2014 clients may mishandle more than 1200 transition times"
 msgstr "klienter från före 2014 kan hantera fler än 1200 övergångstider felaktigt"
 
-#: timezone/zic.c:1691
-#, c-format
-msgid "%s: Can't remove %s: %s\n"
-msgstr "%s: Kan inte ta bort %s: %s\n"
+#: timezone/zic.c:1858
+msgid "too many transition times"
+msgstr "för många övergångstider"
 
-#: timezone/zic.c:1918
+#: timezone/zic.c:2047
 #, c-format
 msgid "%%z UTC offset magnitude exceeds 99:59:59"
 msgstr "%%z storleken på avståndet från UTC överstiger 99.59.59"
 
-#: timezone/zic.c:2291
+#: timezone/zic.c:2424
 msgid "no POSIX environment variable for zone"
 msgstr "ingen POSIX-miljövariabel för zon"
 
-#: timezone/zic.c:2297
+#: timezone/zic.c:2430
 #, c-format
 msgid "%s: pre-%d clients may mishandle distant timestamps"
 msgstr "%s: klienter före %d kan hantera avlägsna tidsstämplar felaktigt"
 
-#: timezone/zic.c:2428
+#: timezone/zic.c:2566
 msgid "two rules for same instant"
 msgstr "två regler för samma tillfälle"
 
-#: timezone/zic.c:2485
+#: timezone/zic.c:2627
 msgid "can't determine time zone abbreviation to use just after until time"
 msgstr "kan inte avgöra tidszonsförkortning att använda just efter \"until\"-tid"
 
-#: timezone/zic.c:2531 timezone/zic.c:2593
+#: timezone/zic.c:2725
 msgid "too many local time types"
 msgstr "för många lokala tidstyper"
 
-#: timezone/zic.c:2597
+#: timezone/zic.c:2729
 msgid "UT offset out of range"
 msgstr "UT-offset utanför giltigt intervall"
 
-#: timezone/zic.c:2621
+#: timezone/zic.c:2753
 msgid "too many leap seconds"
 msgstr "för många skottsekunder"
 
-#: timezone/zic.c:2627
+#: timezone/zic.c:2759
 msgid "repeated leap second moment"
 msgstr "upprepat skottsekundstillfälle"
 
-#: timezone/zic.c:2677
+#: timezone/zic.c:2830
 msgid "Wild result from command execution"
 msgstr "Vilt resultat från kommandokörning"
 
-#: timezone/zic.c:2678
+#: timezone/zic.c:2831
 #, c-format
 msgid "%s: command was '%s', result was %d\n"
 msgstr "%s: kommandot var \"%s\", resultatet blev %d\n"
 
-#: timezone/zic.c:2810
+#: timezone/zic.c:2961
 msgid "Odd number of quotation marks"
 msgstr "Ojämnt antal citationstecken"
 
-#: timezone/zic.c:2896
+#: timezone/zic.c:3046
 msgid "use of 2/29 in non leap-year"
 msgstr "använder 29/2 i icke-skottår"
 
-#: timezone/zic.c:2931
+#: timezone/zic.c:3081
 msgid "rule goes past start/end of month; will not work with pre-2004 versions of zic"
 msgstr "regeln går utanför start/slut på månad; fungerar inte med versioner av zic före 2004"
 
-#: timezone/zic.c:2958
+#: timezone/zic.c:3108
 msgid "time zone abbreviation has fewer than 3 characters"
 msgstr "tidszonsförkortning har färre än 3 tecken"
 
-#: timezone/zic.c:2960
+#: timezone/zic.c:3110
 msgid "time zone abbreviation has too many characters"
 msgstr "tidszonsförkortning har för många tecken"
 
-#: timezone/zic.c:2962
+#: timezone/zic.c:3112
 msgid "time zone abbreviation differs from POSIX standard"
 msgstr "tidszonsförkortning skiljer sig från POSIX-standarden"
 
-#: timezone/zic.c:2968
+#: timezone/zic.c:3118
 msgid "too many, or too long, time zone abbreviations"
 msgstr "för många eller för långa tidszonsförkortningar"
 
-#: timezone/zic.c:3004
+#: timezone/zic.c:3161
 #, c-format
 msgid "%s: Can't create directory %s: %s"
 msgstr "%s: Kan inte skapa katalog %s: %s"
-- 
2.14.1


From 290ba1089ecdca306cb2a0fbf3c7dc9cc29bc56f Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Thu, 5 Oct 2017 21:55:31 +0530
Subject: [PATCH 52/90] aarch64: Optimized implementation of memmove for
 Qualcomm Falkor

This is an optimized memmove implementation for the Qualcomm Falkor
processor core.  Due to the way the falkor memcpy needs to be written,
code cannot be easily shared between memmove and memcpy like in case
of other aarch64 memcpy implementations due to which this routine is
separate.  The underlying principle is the same as that of memcpy
where it tries to use registers with the same lower 4 bits for
fetching the same stream, thus optimizing hardware prefetcher
performance.

The memcpy copy loop copies 64 bytes at a time using the same register
pair since that's the way to train the hardware prefetcher on the
falkor core.  memmove cannot quite do that since it needs to avoid
overlaps, so it does the next best thing, i.e. has a 32 byte loop with
a 32 byte end (prefetch a loop ahead to account for overlapping
locations) with register pairs that alias so that they hit the same
prefetcher.  Due to this difference in loop size, they have to
currently be separate implementations but efforts are on to try and
get memmove to fall back into memcpy whenever it can without simply
duplicating all of the code.

Performance:

The routine fares around 20-25% better than the generic memmove for
most medium to large sizes (i.e. > 128 bytes) for the new walking
memmove benchmark (memmove-walk) with an unexplained regression
between 1K and 2K.  The minor regression is something worth looking
into for us, but the remaining gains are significant enough that we
would like this included upstream as we looking into the cause for the
regression.  Here is a snippet of the numbers as generated from the
microbenchmark by the compare_strings script.  Comparisons are against
__memmove_generic:

Function: memmove
Variant: walk
                                    __memmove_thunderx	__memmove_falkor	__memmove_generic
========================================================================================================================
<snip>
                        length=16384:  12508800.00 (  6.09%)	 11486800.00 ( 13.76%)	 13319600.00
                        length=16400:  13614200.00 ( -0.67%)	 11585000.00 ( 14.33%)	 13523600.00
                        length=16385:  13448400.00 (  0.10%)	 11732700.00 ( 12.84%)	 13461200.00
                        length=16399:  13594100.00 ( -0.22%)	 11859600.00 ( 12.57%)	 13564400.00
                        length=16386:  13211600.00 (  1.13%)	 11503800.00 ( 13.91%)	 13362400.00
                        length=16398:  13218600.00 (  2.12%)	 11573200.00 ( 14.30%)	 13504700.00
                        length=16387:  13510900.00 ( -0.37%)	 11744200.00 ( 12.76%)	 13461300.00
                        length=16397:  13603700.00 ( -0.15%)	 11878200.00 ( 12.55%)	 13583200.00
                        length=16388:  13461700.00 ( -0.13%)	 11558000.00 ( 14.03%)	 13444100.00
                        length=16396:  13517500.00 ( -0.03%)	 11561300.00 ( 14.45%)	 13513900.00
                        length=16389:  13534100.00 (  0.17%)	 11756800.00 ( 13.28%)	 13556900.00
                        length=16395:  13585600.00 (  0.11%)	 11791800.00 ( 13.30%)	 13601200.00
                        length=16390:  13480100.00 ( -0.13%)	 11685500.00 ( 13.20%)	 13462100.00
                        length=16394:  13529900.00 ( -0.23%)	 11549800.00 ( 14.43%)	 13498200.00
                        length=16391:  13595400.00 ( -0.26%)	 11768200.00 ( 13.22%)	 13560600.00
                        length=16393:  13567000.00 (  0.20%)	 11779700.00 ( 13.35%)	 13594700.00
                        length=32768:  71308800.00 ( -6.53%)	 50220800.00 ( 24.98%)	 66939200.00
                        length=32784:  72100800.00 (-11.55%)	 50114100.00 ( 22.47%)	 64636300.00
                        length=32769:  71767000.00 ( -7.10%)	 51238400.00 ( 23.54%)	 67010000.00
                        length=32783:  70113700.00 (-40.95%)	 51129000.00 ( -2.78%)	 49744400.00
                        length=32770:  71367600.00 ( -6.52%)	 50244700.00 ( 25.01%)	 67000900.00
                        length=32782:  64366700.00 (  4.71%)	 50101400.00 ( 25.83%)	 67545600.00
                        length=32771:  71440100.00 ( -6.51%)	 51263900.00 ( 23.57%)	 67074900.00
                        length=32781:  66993000.00 (  0.34%)	 51108300.00 ( 23.97%)	 67220300.00
                        length=32772:  71443900.00 (-60.50%)	 50062100.00 (-12.47%)	 44512600.00
                        length=32780:  71759100.00 ( -6.58%)	 50263200.00 ( 25.35%)	 67328600.00
                        length=32773:  71714900.00 (-33.21%)	 51076600.00 (  5.12%)	 53835400.00
                        length=32779:  71756900.00 ( -6.56%)	 51290800.00 ( 23.83%)	 67337800.00
                        length=32774:  59689300.00 (-34.55%)	 50068400.00 (-12.86%)	 44363300.00
                        length=32778:  71847500.00 (-18.20%)	 50084100.00 ( 17.61%)	 60786500.00
                        length=32775:  71599300.00 ( -6.54%)	 51278200.00 ( 23.70%)	 67204800.00
                        length=32777:  71862900.00 (-60.85%)	 51094000.00 (-14.36%)	 44677900.00
                        length=65536: 282848000.00 ( -6.60%)	199187000.00 ( 24.93%)	265325000.00
                        length=65552: 243285000.00 (-41.61%)	198512000.00 (-15.54%)	171805000.00
                        length=65537: 255415000.00 (-23.47%)	202499000.00 (  2.11%)	206858000.00
                        length=65551: 280122000.00 (-62.95%)	203349000.00 (-18.29%)	171911000.00
                        length=65538: 283676000.00 (-14.46%)	198368000.00 ( 19.96%)	247848000.00
                        length=65550: 275566000.00 (-51.76%)	198494000.00 ( -9.31%)	181581000.00
                        length=65539: 283699000.00 ( -6.58%)	203453000.00 ( 23.57%)	266195000.00
                        length=65549: 286572000.00 ( -6.65%)	202607000.00 ( 24.60%)	268712000.00
                        length=65540: 283710000.00 ( -6.59%)	199161000.00 ( 25.17%)	266160000.00
                        length=65548: 237573000.00 ( 11.48%)	198462000.00 ( 26.06%)	268395000.00
                        length=65541: 284150000.00 ( -6.58%)	203273000.00 ( 23.75%)	266600000.00
                        length=65547: 286250000.00 ( -6.70%)	202594000.00 ( 24.48%)	268263000.00
                        length=65542: 284167000.00 ( -6.60%)	199122000.00 ( 25.31%)	266584000.00
                        length=65546: 285656000.00 ( -6.59%)	198443000.00 ( 25.95%)	268002000.00
                        length=65543: 284600000.00 ( -6.58%)	203247000.00 ( 23.89%)	267030000.00
                        length=65545: 285665000.00 ( -6.40%)	202575000.00 ( 24.55%)	268472000.00
<snip>

	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add
	memmove_falkor.
	* sysdeps/aarch64/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Likewise.
	* sysdeps/aarch64/multiarch/memmove.c: Likewise.
	* sysdeps/aarch64/multiarch/memmove_falkor.S: New file.
---
 ChangeLog                                   |  16 ++
 sysdeps/aarch64/multiarch/Makefile          |   3 +-
 sysdeps/aarch64/multiarch/ifunc-impl-list.c |   1 +
 sysdeps/aarch64/multiarch/memmove.c         |   7 +-
 sysdeps/aarch64/multiarch/memmove_falkor.S  | 232 ++++++++++++++++++++++++++++
 5 files changed, 257 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/aarch64/multiarch/memmove_falkor.S

diff --git a/ChangeLog b/ChangeLog
index 2aa1711834..d478f5d8e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2017-10-10  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add
+	memmove_falkor.
+	* sysdeps/aarch64/multiarch/ifunc-impl-list.c
+	(__libc_ifunc_impl_list): Likewise.
+	* sysdeps/aarch64/multiarch/memmove.c: Likewise.
+	* sysdeps/aarch64/multiarch/memmove_falkor.S: New file.
+
+	* benchtests/bench-memmove-walk.c: New file.
+	* benchtests/Makefile (string-benchset): Add it.
+
+	* benchtests/bench-memset-walk.c: New file.
+	* benchtests/Makefile (string-benchset): Add it.
+
+	* benchtests/bench-memcpy-walk.c: New file.
+	* benchtests/Makefile (string-benchset): Add it.
+
 	* po/sv.po: Update translations.
 	* po/fr.po: Likewise.
 
diff --git a/sysdeps/aarch64/multiarch/Makefile b/sysdeps/aarch64/multiarch/Makefile
index 164ba1ae4b..9aa1e79a80 100644
--- a/sysdeps/aarch64/multiarch/Makefile
+++ b/sysdeps/aarch64/multiarch/Makefile
@@ -1,3 +1,4 @@
 ifeq ($(subdir),string)
-sysdep_routines += memcpy_generic memcpy_thunderx memcpy_falkor
+sysdep_routines += memcpy_generic memcpy_thunderx memcpy_falkor \
+		   memmove_falkor
 endif
diff --git a/sysdeps/aarch64/multiarch/ifunc-impl-list.c b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
index 8e873b3d9f..2cb74d5b43 100644
--- a/sysdeps/aarch64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/aarch64/multiarch/ifunc-impl-list.c
@@ -44,6 +44,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_generic))
   IFUNC_IMPL (i, name, memmove,
 	      IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_thunderx)
+	      IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_falkor)
 	      IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_generic))
 
   return i;
diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c
index 34c6b29bd5..016f03ee50 100644
--- a/sysdeps/aarch64/multiarch/memmove.c
+++ b/sysdeps/aarch64/multiarch/memmove.c
@@ -30,9 +30,14 @@ extern __typeof (__redirect_memmove) __libc_memmove;
 
 extern __typeof (__redirect_memmove) __memmove_generic attribute_hidden;
 extern __typeof (__redirect_memmove) __memmove_thunderx attribute_hidden;
+extern __typeof (__redirect_memmove) __memmove_falkor attribute_hidden;
 
 libc_ifunc (__libc_memmove,
-            IS_THUNDERX (midr) ? __memmove_thunderx : __memmove_generic);
+            (IS_THUNDERX (midr)
+	     ? __memmove_thunderx
+	     : (IS_FALKOR (midr)
+		? __memmove_falkor
+		: __memmove_generic)));
 
 # undef memmove
 strong_alias (__libc_memmove, memmove);
diff --git a/sysdeps/aarch64/multiarch/memmove_falkor.S b/sysdeps/aarch64/multiarch/memmove_falkor.S
new file mode 100644
index 0000000000..3a4e6a2a8e
--- /dev/null
+++ b/sysdeps/aarch64/multiarch/memmove_falkor.S
@@ -0,0 +1,232 @@
+/* Copyright (C) 2017 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* Assumptions: ARMv8-a, AArch64, falkor, unaligned accesses.  */
+
+#define dstin	x0
+#define src	x1
+#define count	x2
+#define dstlen	x3
+#define dst	x3
+#define srcend	x4
+#define dstend	x5
+#define A_l	x6
+#define A_lw	w6
+#define A_h	x7
+#define A_hw	w7
+#define B_l	x8
+#define B_lw	w8
+#define B_h	x9
+#define C_l	x10
+#define C_h	x11
+#define D_l	x12
+#define D_h	x13
+#define E_l	src
+#define E_h	count
+#define F_l	srcend
+#define F_h	dst
+#define tmp1	x14
+
+/* Alias with A_l and A_h to train the prefetcher.  */
+#define Q_l	x22
+#define Q_h	x23
+
+/* RATIONALE:
+
+   The copy has 4 distinct parts:
+   * Small copies of 16 bytes and under
+   * Medium sized copies of 17-96 bytes
+   * Large copies where the source address is higher than the destination
+     (forward copies)
+   * Large copies where the destination address is higher than the source
+     (copy backward, or move).
+
+   We use only two registerpairs x6,x7 and x22,x23 for the copies and copy 32
+   bytes at a time to correctly train the hardware prefetcher for better
+   throughput.  */
+ENTRY_ALIGN (__memmove_falkor, 6)
+
+	sub	tmp1, dstin, src
+	add	srcend, src, count
+	add	dstend, dstin, count
+	cmp	count, 96
+	ccmp	tmp1, count, 2, hi
+	b.lo	L(move_long)
+
+	cmp	count, 16
+	b.ls	L(copy16)
+	cmp	count, 96
+	b.hi	L(copy_long)
+
+	/* Medium copies: 17..96 bytes.  */
+	sub	tmp1, count, 1
+	ldp	A_l, A_h, [src]
+	tbnz	tmp1, 6, L(copy96)
+	ldp	D_l, D_h, [srcend, -16]
+	tbz	tmp1, 5, 1f
+	ldp	B_l, B_h, [src, 16]
+	ldp	C_l, C_h, [srcend, -32]
+	stp	B_l, B_h, [dstin, 16]
+	stp	C_l, C_h, [dstend, -32]
+1:
+	stp	A_l, A_h, [dstin]
+	stp	D_l, D_h, [dstend, -16]
+	ret
+
+	.p2align 4
+	/* Small copies: 0..16 bytes.  */
+L(copy16):
+	cmp	count, 8
+	b.lo	1f
+	ldr	A_l, [src]
+	ldr	A_h, [srcend, -8]
+	str	A_l, [dstin]
+	str	A_h, [dstend, -8]
+	ret
+	.p2align 4
+1:
+	/* 4-7 */
+	tbz	count, 2, 1f
+	ldr	A_lw, [src]
+	ldr	A_hw, [srcend, -4]
+	str	A_lw, [dstin]
+	str	A_hw, [dstend, -4]
+	ret
+	.p2align 4
+1:
+	/* 2-3 */
+	tbz	count, 1, 1f
+	ldrh	A_lw, [src]
+	ldrh	A_hw, [srcend, -2]
+	strh	A_lw, [dstin]
+	strh	A_hw, [dstend, -2]
+	ret
+	.p2align 4
+1:
+	/* 0-1 */
+	tbz	count, 0, 1f
+	ldrb	A_lw, [src]
+	strb	A_lw, [dstin]
+1:	ret
+
+	.p2align 4
+	/* Copy 64..96 bytes.  Copy 64 bytes from the start and
+	   32 bytes from the end.  */
+L(copy96):
+	ldp	B_l, B_h, [src, 16]
+	ldp	C_l, C_h, [src, 32]
+	ldp	D_l, D_h, [src, 48]
+	ldp	E_l, E_h, [srcend, -32]
+	ldp	F_l, F_h, [srcend, -16]
+	stp	A_l, A_h, [dstin]
+	stp	B_l, B_h, [dstin, 16]
+	stp	C_l, C_h, [dstin, 32]
+	stp	D_l, D_h, [dstin, 48]
+	stp	E_l, E_h, [dstend, -32]
+	stp	F_l, F_h, [dstend, -16]
+	ret
+
+	/* Align SRC to 16 byte alignment so that we don't cross cache line
+	   boundaries on both loads and stores.  There are at least 96 bytes
+	   to copy, so copy 16 bytes unaligned and then align.  The loop
+	   copies 32 bytes per iteration and prefetches one iteration ahead.  */
+
+	.p2align 4
+L(copy_long):
+	sub	count, count, 64 + 16	/* Test and readjust count.  */
+	mov	B_l, Q_l
+	mov	B_h, Q_h
+	ldp	A_l, A_h, [src]
+	and	tmp1, src, 15
+	bic	src, src, 15
+	sub	dst, dstin, tmp1
+	add	count, count, tmp1	/* Count is now 16 too large.  */
+	ldp	Q_l, Q_h, [src, 16]!
+	stp	A_l, A_h, [dstin]
+	ldp	A_l, A_h, [src, 16]!
+
+L(loop64):
+	subs	count, count, 32
+	stp	Q_l, Q_h, [dst, 16]
+	ldp	Q_l, Q_h, [src, 16]!
+	stp	A_l, A_h, [dst, 32]!
+	ldp	A_l, A_h, [src, 16]!
+	b.hi	L(loop64)
+
+	/* Write the last full set of 32 bytes.  The remainder is at most 32
+	   bytes, so it is safe to always copy 32 bytes from the end even if
+	   there is just 1 byte left.  */
+L(last64):
+	ldp	C_l, C_h, [srcend, -32]
+	stp	Q_l, Q_h, [dst, 16]
+	ldp	Q_l, Q_h, [srcend, -16]
+	stp	A_l, A_h, [dst, 32]
+	stp	C_l, C_h, [dstend, -32]
+	stp	Q_l, Q_h, [dstend, -16]
+	mov	Q_l, B_l
+	mov	Q_h, B_h
+	ret
+
+	.p2align 4
+L(move_long):
+	cbz	tmp1, 3f
+
+	mov	B_l, Q_l
+	mov	B_h, Q_h
+
+	/* Align SRCEND to 16 byte alignment so that we don't cross cache line
+	   boundaries on both loads and stores.  There are at least 96 bytes
+	   to copy, so copy 16 bytes unaligned and then align.  The loop
+	   copies 32 bytes per iteration and prefetches one iteration ahead.  */
+
+	ldp	A_l, A_h, [srcend, -16]
+	and	tmp1, srcend, 15
+	sub	srcend, srcend, tmp1
+	ldp	Q_l, Q_h, [srcend, -16]!
+	stp	A_l, A_h, [dstend, -16]
+	sub	count, count, tmp1
+	ldp	A_l, A_h, [srcend, -16]!
+	sub	dstend, dstend, tmp1
+	sub	count, count, 64
+
+1:
+	subs	count, count, 32
+	stp	Q_l, Q_h, [dstend, -16]
+	ldp	Q_l, Q_h, [srcend, -16]!
+	stp	A_l, A_h, [dstend, -32]!
+	ldp	A_l, A_h, [srcend, -16]!
+	b.hi	1b
+
+	/* Write the last full set of 32 bytes.  The remainder is at most 32
+	   bytes, so it is safe to always copy 32 bytes from the start even if
+	   there is just 1 byte left.  */
+2:
+	ldp	C_l, C_h, [src, 16]
+	stp	Q_l, Q_h, [dstend, -16]
+	ldp	Q_l, Q_h, [src]
+	stp	A_l, A_h, [dstend, -32]
+	stp	C_l, C_h, [dstin, 16]
+	stp	Q_l, Q_h, [dstin]
+	mov	Q_l, B_l
+	mov	Q_h, B_h
+3:	ret
+
+END (__memmove_falkor)
+libc_hidden_builtin_def (__memmove_falkor)
-- 
2.14.1


From 1f1239c389f7839e963b02794f64ed85df81396f Mon Sep 17 00:00:00 2001
From: Steve Ellcey <sellcey@caviumnetworks.com>
Date: Tue, 10 Oct 2017 15:53:55 +0530
Subject: [PATCH 53/90] Fix glibc.tune.cpu tunable handling

	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (get_midr_from_mcpu):
	Use strcmp instead of tunable_is_name.
---
 ChangeLog                                      | 5 +++++
 sysdeps/unix/sysv/linux/aarch64/cpu-features.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d478f5d8e4..ff9bc2b7eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-10  Steve Ellcey  <sellcey@cavium.com>
+
+	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (get_midr_from_mcpu):
+	Use strcmp instead of tunable_is_name.
+
 2017-10-10  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
 	* sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add
diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
index 18f5e60f4c..0c7e13f4fa 100644
--- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
@@ -37,7 +37,7 @@ static uint64_t
 get_midr_from_mcpu (const char *mcpu)
 {
   for (int i = 0; i < sizeof (cpu_list) / sizeof (struct cpu_list); i++)
-    if (tunable_is_name (mcpu, cpu_list[i].name) == 0)
+    if (strcmp (mcpu, cpu_list[i].name) == 0)
       return cpu_list[i].midr;
 
   return UINT64_MAX;
-- 
2.14.1


From 356a2df52a65c6f299181a8edc730dcbde1441bb Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
Date: Mon, 4 Sep 2017 12:48:31 -0300
Subject: [PATCH 54/90] powerpc64le: Add -mfloat128 to tst-strtod-nan-locale
 testcase

On powerpc64le, not all files can have the flag -mfloat128 passed as an
option on the compile command, since that could conflict with other
flags, such as -mno-vsx.  Each file that needs the flag, gets it through
a CFLAGS-filename variable on sysdeps/powerpc/powerpc64le/Makefile.

The test cases tst-strtod-nan-locale and tst-wcstod-nan-locale are
missing this flag.

Tested for powerpc64le.

	* sysdeps/powerpc/powerpc64le/Makefile
	(CFLAGS-tst-strtod-nan-locale.c): New variable.
	(CFLAGS-tst-wcstod-nan-locale.c): New variable.

(cherry picked from commit ffa448041beb4d5899ad0258843ecca4c106d1cd)
---
 ChangeLog                            | 6 ++++++
 sysdeps/powerpc/powerpc64le/Makefile | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index ff9bc2b7eb..60a1554fac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	* sysdeps/powerpc/powerpc64le/Makefile
+	(CFLAGS-tst-strtod-nan-locale.c): New variable.
+	(CFLAGS-tst-wcstod-nan-locale.c): New variable.
+
 2017-10-10  Steve Ellcey  <sellcey@cavium.com>
 
 	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (get_midr_from_mcpu):
diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile
index cf2dbfb673..f554a791b7 100644
--- a/sysdeps/powerpc/powerpc64le/Makefile
+++ b/sysdeps/powerpc/powerpc64le/Makefile
@@ -34,12 +34,15 @@ CFLAGS-bug-strtod.c += -mfloat128
 CFLAGS-bug-strtod2.c += -mfloat128
 CFLAGS-tst-strtod-round.c += -mfloat128
 CFLAGS-tst-wcstod-round.c += -mfloat128
+CFLAGS-tst-strtod-nan-locale.c += -mfloat128
+CFLAGS-tst-wcstod-nan-locale.c += -mfloat128
 CFLAGS-tst-strtod6.c += -mfloat128
 CFLAGS-tst-strfrom.c += -mfloat128
 CFLAGS-tst-strfrom-locale.c += -mfloat128
 CFLAGS-strfrom-skeleton.c += -mfloat128
 $(foreach test,bug-strtod bug-strtod2 bug-strtod2 tst-strtod-round \
 tst-wcstod-round tst-strtod6 tst-strrom tst-strfrom-locale \
+tst-strtod-nan-locale tst-wcstod-nan-locale \
 strfrom-skeleton,$(objpfx)$(test)): gnulib-tests += $(f128-loader-link)
 
 # When building glibc with support for _Float128, the powers of ten tables in
-- 
2.14.1


From c9163eeb6e10c6559796b283702b04eed5349fd3 Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
Date: Mon, 4 Sep 2017 13:07:18 -0300
Subject: [PATCH 55/90] powerpc: Add redirection for finitef128, isinf128, and
 isnanf128

On powerpc64le, compiler support for float128 is not enabled by default
on gcc.  To enable it, the flag -mfloat128 must be passed as a command
line option to the compiler.  This means that only the few files that
actively have -mfloat128 passed as an argument get compiler support for
float128, whereas all other files don't.

When -mfloat128 becomes enabled by default on powerpc [1], all the files
that do not currently have compiler support for float128 enabled during
their compilation, will start to have it.  This will lead to build
errors in s_finite.c, s_isinf.c, and s_isnan.c.

The errors are due to the unintended macro expansion of __finitef128 to
__redirect_finitef128 in math/bits/mathcalls-helper-functions.h.  In
that header, __MATHDECL_1 takes '__finite' and 'f128' as arguments and
concatenates them.  However, since '__finite' has been redefined in
s_finite.c, the function declaration becomes __redirect_finitef128:

    extern int __redirect___finitef128 (_Float128 __value) __attribute__ ((__nothrow__ )) __attribute__ ((__const__));

This declaration itself is OK.  The problem arises when include/math.h
creates the hidden prototype ('hidden_proto (__finitef128)'), which
expands to:

    extern __typeof (__finitef128) __finitef128 __attribute__ ((visibility ("hidden")));

Since __finitef128 is not declared, __typeof fails.  This effect was
already true for the 'float' and 'long double' versions and is now true
for float128.  Likewise for isinsff128 and isnanf128.

This patch defines __finitef128 as __redirect___finitef128 in
sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c, similarly to what's
done for the float and long double versions of these functions, to get
rid of the build error.  Likewise for isinff128 and isnanf128.

[1] https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01028.html

Tested for powerpc64 and powerpc64le.

	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
	(__finitef128): Define to __redirect___finitef128.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
	(__isinff128): Define to __redirect___isinff128.
	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
	(__isnanf128): Define to __redirect___isnanf128.

(cherry picked from commit e010deb231113e92f5f351315645a8197857dffd)
---
 ChangeLog                                          | 9 +++++++++
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c | 9 +++++++++
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c  | 9 +++++++++
 sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c  | 9 +++++++++
 4 files changed, 36 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 60a1554fac..9ecf757e81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
+	(__finitef128): Define to __redirect___finitef128.
+	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
+	(__isinff128): Define to __redirect___isinff128.
+	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
+	(__isnanf128): Define to __redirect___isnanf128.
+
 2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
 	* sysdeps/powerpc/powerpc64le/Makefile
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
index a5ec36b72f..7efc84b56a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
@@ -17,8 +17,16 @@
    <http://www.gnu.org/licenses/>.  */
 
 #define __finite __redirect___finite
+
+/* The following definitions, although not related to the 'double'
+   version of 'finite', are required to guarantee macro expansions
+   (e.g.: from __finitef to __redirect_finitef) in include/math.h, thus
+   compensating for the unintended macro expansions in
+   math/bits/mathcalls-helper-functions.h.  */
 #define __finitef __redirect___finitef
 #define __finitel __redirect___finitel
+#define __finitef128 __redirect___finitef128
+
 #include <math.h>
 #include <math_ldbl_opt.h>
 #include <shlib-compat.h>
@@ -30,6 +38,7 @@ extern __typeof (__finite) __finite_power8 attribute_hidden;
 #undef __finite
 #undef __finitef
 #undef __finitel
+#undef __finitef128
 
 libc_ifunc_redirected (__redirect___finite, __finite,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
index 9c6789c7bd..b79bdd5edd 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isinf.c
@@ -17,8 +17,16 @@
    <http://www.gnu.org/licenses/>.  */
 
 #define __isinf __redirect___isinf
+
+/* The following definitions, although not related to the 'double'
+   version of 'isinf', are required to guarantee macro expansions
+   (e.g.: from __isinff to __redirect_isinff) in include/math.h, thus
+   compensating for the unintended macro expansions in
+   math/bits/mathcalls-helper-functions.h.  */
 #define __isinff __redirect___isinff
 #define __isinfl __redirect___isinfl
+#define __isinff128 __redirect___isinff128
+
 #include <math.h>
 #include <math_ldbl_opt.h>
 #include <shlib-compat.h>
@@ -30,6 +38,7 @@ extern __typeof (__isinf) __isinf_power8 attribute_hidden;
 #undef __isinf
 #undef __isinff
 #undef __isinfl
+#undef __isinff128
 
 libc_ifunc_redirected (__redirect___isinf, __isinf,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
index 3cfe1793da..a8127e89f7 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_isnan.c
@@ -17,8 +17,16 @@
    <http://www.gnu.org/licenses/>.  */
 
 #define __isnan __redirect___isnan
+
+/* The following definitions, although not related to the 'double'
+   version of 'isnan', are required to guarantee macro expansions
+   (e.g.: from __isnanf to __redirect_isnanf) in include/math.h, thus
+   compensating for the unintended macro expansions in
+   math/bits/mathcalls-helper-functions.h.  */
 #define __isnanf __redirect___isnanf
 #define __isnanl __redirect___isnanl
+#define __isnanf128 __redirect___isnanf128
+
 #include <math.h>
 #include <math_ldbl_opt.h>
 #include <shlib-compat.h>
@@ -33,6 +41,7 @@ extern __typeof (__isnan) __isnan_power8 attribute_hidden;
 #undef __isnan
 #undef __isnanf
 #undef __isnanl
+#undef __isnanf128
 
 libc_ifunc_redirected (__redirect___isnan, __isnan,
 		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
-- 
2.14.1


From 4f11fe97c3934292226007f88c9cec7dd56978b0 Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
Date: Mon, 4 Sep 2017 14:34:04 -0300
Subject: [PATCH 56/90] ldbl-128ibm: Copy implementations from ldbl-128 instead
 of including them

Some files under sysdeps/ieee754/ldbl-128ibm/ are able to reuse the
implementation in sysdeps/ieee754/ldbl-128/ by defining _Float128 to
long double.  This relied on compiler support for _Float128 being
disabled.  On powerpc, such support was disabled by default, however, it
got enabled by default [1] in GCC 8.

This patch copies the implementations from ldbl-128 to ldbl-128ibm.  The
uses of _Float128 and L() are kept intact in this patch and are replaced
with a script in a subsequent patch.

[1] https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01028.html

Tested for powerpc64 and powerpc64le.

	* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Include tables from
	sysdeps/ieee754/ldbl-128ibm.
	* sysdeps/ieee754/ldbl-128ibm/e_j0l.c: Copy contents from the
	equivalent implementation in sysdeps/ieee754/ldbl-128/ instead
	of including it.  Keep _Float128 and L() intact.  These will be
	reviewed by a separate patch.
	* sysdeps/ieee754/ldbl-128ibm/e_j1l.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/t_expl.h: Likewise.

(cherry picked from commit c5c2e667bf834951ea95fc5124da4ef093711ebe)
---
 ChangeLog                                 |  13 +
 sysdeps/ieee754/ldbl-128ibm/e_expl.c      |   2 +-
 sysdeps/ieee754/ldbl-128ibm/e_j0l.c       | 865 +++++++++++++++++++++++++-
 sysdeps/ieee754/ldbl-128ibm/e_j1l.c       | 886 +++++++++++++++++++++++++-
 sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c | 997 +++++++++++++++++++++++++++++-
 sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c     | 104 +++-
 sysdeps/ieee754/ldbl-128ibm/t_expl.h      | 972 +++++++++++++++++++++++++++++
 7 files changed, 3827 insertions(+), 12 deletions(-)
 create mode 100644 sysdeps/ieee754/ldbl-128ibm/t_expl.h

diff --git a/ChangeLog b/ChangeLog
index 9ecf757e81..9713fd8e21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Include tables from
+	sysdeps/ieee754/ldbl-128ibm.
+	* sysdeps/ieee754/ldbl-128ibm/e_j0l.c: Copy contents from the
+	equivalent implementation in sysdeps/ieee754/ldbl-128/ instead
+	of including it.  Keep _Float128 and L() intact.  These will be
+	reviewed by a separate patch.
+	* sysdeps/ieee754/ldbl-128ibm/e_j1l.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/t_expl.h: Likewise.
+
 2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
 	* sysdeps/powerpc/powerpc64/fpu/multiarch/s_finite.c
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index 10df6bb7d5..db812e9b82 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -69,7 +69,7 @@
 #define _Float128 long double
 #define L(x) x ## L
 
-#include <sysdeps/ieee754/ldbl-128/t_expl.h>
+#include "t_expl.h"
 
 static const long double C[] = {
 /* Smallest integer x for which e^x overflows.  */
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
index 00bce29284..d437926bb1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
@@ -1,5 +1,866 @@
-/* Looks like we can use ieee854 e_j0l.c as is for IBM extended format. */
+/* Bessel function of order zero.  IBM Extended Precision version.
+   Copyright 2001 by Stephen L. Moshier (moshier@na-net.ornl.gov).
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c.  */
+
 #define _Float128 long double
 #define L(x) x ## L
-#include <sysdeps/ieee754/ldbl-128/e_j0l.c>
 
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
+/* 2 / pi */
+static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
+static const _Float128 zero = 0;
+
+/* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2)
+   Peak relative error 3.4e-37
+   0 <= x <= 2  */
+#define NJ0_2N 6
+static const _Float128 J0_2N[NJ0_2N + 1] = {
+  L(3.133239376997663645548490085151484674892E16),
+ L(-5.479944965767990821079467311839107722107E14),
+  L(6.290828903904724265980249871997551894090E12),
+ L(-3.633750176832769659849028554429106299915E10),
+  L(1.207743757532429576399485415069244807022E8),
+ L(-2.107485999925074577174305650549367415465E5),
+  L(1.562826808020631846245296572935547005859E2),
+};
+#define NJ0_2D 6
+static const _Float128 J0_2D[NJ0_2D + 1] = {
+  L(2.005273201278504733151033654496928968261E18),
+  L(2.063038558793221244373123294054149790864E16),
+  L(1.053350447931127971406896594022010524994E14),
+  L(3.496556557558702583143527876385508882310E11),
+  L(8.249114511878616075860654484367133976306E8),
+  L(1.402965782449571800199759247964242790589E6),
+  L(1.619910762853439600957801751815074787351E3),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2),
+   0 <= 1/x <= .0625
+   Peak relative error 3.3e-36  */
+#define NP16_IN 9
+static const _Float128 P16_IN[NP16_IN + 1] = {
+  L(-1.901689868258117463979611259731176301065E-16),
+  L(-1.798743043824071514483008340803573980931E-13),
+  L(-6.481746687115262291873324132944647438959E-11),
+  L(-1.150651553745409037257197798528294248012E-8),
+  L(-1.088408467297401082271185599507222695995E-6),
+  L(-5.551996725183495852661022587879817546508E-5),
+  L(-1.477286941214245433866838787454880214736E-3),
+  L(-1.882877976157714592017345347609200402472E-2),
+  L(-9.620983176855405325086530374317855880515E-2),
+  L(-1.271468546258855781530458854476627766233E-1),
+};
+#define NP16_ID 9
+static const _Float128 P16_ID[NP16_ID + 1] = {
+  L(2.704625590411544837659891569420764475007E-15),
+  L(2.562526347676857624104306349421985403573E-12),
+  L(9.259137589952741054108665570122085036246E-10),
+  L(1.651044705794378365237454962653430805272E-7),
+  L(1.573561544138733044977714063100859136660E-5),
+  L(8.134482112334882274688298469629884804056E-4),
+  L(2.219259239404080863919375103673593571689E-2),
+  L(2.976990606226596289580242451096393862792E-1),
+  L(1.713895630454693931742734911930937246254E0),
+  L(3.231552290717904041465898249160757368855E0),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+    0.0625 <= 1/x <= 0.125
+    Peak relative error 2.4e-35  */
+#define NP8_16N 10
+static const _Float128 P8_16N[NP8_16N + 1] = {
+  L(-2.335166846111159458466553806683579003632E-15),
+  L(-1.382763674252402720401020004169367089975E-12),
+  L(-3.192160804534716696058987967592784857907E-10),
+  L(-3.744199606283752333686144670572632116899E-8),
+  L(-2.439161236879511162078619292571922772224E-6),
+  L(-9.068436986859420951664151060267045346549E-5),
+  L(-1.905407090637058116299757292660002697359E-3),
+  L(-2.164456143936718388053842376884252978872E-2),
+  L(-1.212178415116411222341491717748696499966E-1),
+  L(-2.782433626588541494473277445959593334494E-1),
+  L(-1.670703190068873186016102289227646035035E-1),
+};
+#define NP8_16D 10
+static const _Float128 P8_16D[NP8_16D + 1] = {
+  L(3.321126181135871232648331450082662856743E-14),
+  L(1.971894594837650840586859228510007703641E-11),
+  L(4.571144364787008285981633719513897281690E-9),
+  L(5.396419143536287457142904742849052402103E-7),
+  L(3.551548222385845912370226756036899901549E-5),
+  L(1.342353874566932014705609788054598013516E-3),
+  L(2.899133293006771317589357444614157734385E-2),
+  L(3.455374978185770197704507681491574261545E-1),
+  L(2.116616964297512311314454834712634820514E0),
+  L(5.850768316827915470087758636881584174432E0),
+  L(5.655273858938766830855753983631132928968E0),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+  0.125 <= 1/x <= 0.1875
+  Peak relative error 2.7e-35  */
+#define NP5_8N 10
+static const _Float128 P5_8N[NP5_8N + 1] = {
+  L(-1.270478335089770355749591358934012019596E-12),
+  L(-4.007588712145412921057254992155810347245E-10),
+  L(-4.815187822989597568124520080486652009281E-8),
+  L(-2.867070063972764880024598300408284868021E-6),
+  L(-9.218742195161302204046454768106063638006E-5),
+  L(-1.635746821447052827526320629828043529997E-3),
+  L(-1.570376886640308408247709616497261011707E-2),
+  L(-7.656484795303305596941813361786219477807E-2),
+  L(-1.659371030767513274944805479908858628053E-1),
+  L(-1.185340550030955660015841796219919804915E-1),
+  L(-8.920026499909994671248893388013790366712E-3),
+};
+#define NP5_8D 9
+static const _Float128 P5_8D[NP5_8D + 1] = {
+  L(1.806902521016705225778045904631543990314E-11),
+  L(5.728502760243502431663549179135868966031E-9),
+  L(6.938168504826004255287618819550667978450E-7),
+  L(4.183769964807453250763325026573037785902E-5),
+  L(1.372660678476925468014882230851637878587E-3),
+  L(2.516452105242920335873286419212708961771E-2),
+  L(2.550502712902647803796267951846557316182E-1),
+  L(1.365861559418983216913629123778747617072E0),
+  L(3.523825618308783966723472468855042541407E0),
+  L(3.656365803506136165615111349150536282434E0),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+   Peak relative error 3.5e-35
+   0.1875 <= 1/x <= 0.25  */
+#define NP4_5N 9
+static const _Float128 P4_5N[NP4_5N + 1] = {
+  L(-9.791405771694098960254468859195175708252E-10),
+  L(-1.917193059944531970421626610188102836352E-7),
+  L(-1.393597539508855262243816152893982002084E-5),
+  L(-4.881863490846771259880606911667479860077E-4),
+  L(-8.946571245022470127331892085881699269853E-3),
+  L(-8.707474232568097513415336886103899434251E-2),
+  L(-4.362042697474650737898551272505525973766E-1),
+  L(-1.032712171267523975431451359962375617386E0),
+  L(-9.630502683169895107062182070514713702346E-1),
+  L(-2.251804386252969656586810309252357233320E-1),
+};
+#define NP4_5D 9
+static const _Float128 P4_5D[NP4_5D + 1] = {
+  L(1.392555487577717669739688337895791213139E-8),
+  L(2.748886559120659027172816051276451376854E-6),
+  L(2.024717710644378047477189849678576659290E-4),
+  L(7.244868609350416002930624752604670292469E-3),
+  L(1.373631762292244371102989739300382152416E-1),
+  L(1.412298581400224267910294815260613240668E0),
+  L(7.742495637843445079276397723849017617210E0),
+  L(2.138429269198406512028307045259503811861E1),
+  L(2.651547684548423476506826951831712762610E1),
+  L(1.167499382465291931571685222882909166935E1),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+   Peak relative error 2.3e-36
+   0.25 <= 1/x <= 0.3125  */
+#define NP3r2_4N 9
+static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
+  L(-2.589155123706348361249809342508270121788E-8),
+  L(-3.746254369796115441118148490849195516593E-6),
+  L(-1.985595497390808544622893738135529701062E-4),
+  L(-5.008253705202932091290132760394976551426E-3),
+  L(-6.529469780539591572179155511840853077232E-2),
+  L(-4.468736064761814602927408833818990271514E-1),
+  L(-1.556391252586395038089729428444444823380E0),
+  L(-2.533135309840530224072920725976994981638E0),
+  L(-1.605509621731068453869408718565392869560E0),
+  L(-2.518966692256192789269859830255724429375E-1),
+};
+#define NP3r2_4D 9
+static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
+  L(3.682353957237979993646169732962573930237E-7),
+  L(5.386741661883067824698973455566332102029E-5),
+  L(2.906881154171822780345134853794241037053E-3),
+  L(7.545832595801289519475806339863492074126E-2),
+  L(1.029405357245594877344360389469584526654E0),
+  L(7.565706120589873131187989560509757626725E0),
+  L(2.951172890699569545357692207898667665796E1),
+  L(5.785723537170311456298467310529815457536E1),
+  L(5.095621464598267889126015412522773474467E1),
+  L(1.602958484169953109437547474953308401442E1),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+   Peak relative error 1.0e-35
+   0.3125 <= 1/x <= 0.375  */
+#define NP2r7_3r2N 9
+static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
+  L(-1.917322340814391131073820537027234322550E-7),
+  L(-1.966595744473227183846019639723259011906E-5),
+  L(-7.177081163619679403212623526632690465290E-4),
+  L(-1.206467373860974695661544653741899755695E-2),
+  L(-1.008656452188539812154551482286328107316E-1),
+  L(-4.216016116408810856620947307438823892707E-1),
+  L(-8.378631013025721741744285026537009814161E-1),
+  L(-6.973895635309960850033762745957946272579E-1),
+  L(-1.797864718878320770670740413285763554812E-1),
+  L(-4.098025357743657347681137871388402849581E-3),
+};
+#define NP2r7_3r2D 8
+static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
+  L(2.726858489303036441686496086962545034018E-6),
+  L(2.840430827557109238386808968234848081424E-4),
+  L(1.063826772041781947891481054529454088832E-2),
+  L(1.864775537138364773178044431045514405468E-1),
+  L(1.665660052857205170440952607701728254211E0),
+  L(7.723745889544331153080842168958348568395E0),
+  L(1.810726427571829798856428548102077799835E1),
+  L(1.986460672157794440666187503833545388527E1),
+  L(8.645503204552282306364296517220055815488E0),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+   Peak relative error 1.3e-36
+   0.3125 <= 1/x <= 0.4375  */
+#define NP2r3_2r7N 9
+static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
+  L(-1.594642785584856746358609622003310312622E-6),
+  L(-1.323238196302221554194031733595194539794E-4),
+  L(-3.856087818696874802689922536987100372345E-3),
+  L(-5.113241710697777193011470733601522047399E-2),
+  L(-3.334229537209911914449990372942022350558E-1),
+  L(-1.075703518198127096179198549659283422832E0),
+  L(-1.634174803414062725476343124267110981807E0),
+  L(-1.030133247434119595616826842367268304880E0),
+  L(-1.989811539080358501229347481000707289391E-1),
+  L(-3.246859189246653459359775001466924610236E-3),
+};
+#define NP2r3_2r7D 8
+static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
+  L(2.267936634217251403663034189684284173018E-5),
+  L(1.918112982168673386858072491437971732237E-3),
+  L(5.771704085468423159125856786653868219522E-2),
+  L(8.056124451167969333717642810661498890507E-1),
+  L(5.687897967531010276788680634413789328776E0),
+  L(2.072596760717695491085444438270778394421E1),
+  L(3.801722099819929988585197088613160496684E1),
+  L(3.254620235902912339534998592085115836829E1),
+  L(1.104847772130720331801884344645060675036E1),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J0(x)cosX + Y0(x)sinX = sqrt( 2/(pi x)) P0(x), P0(x) = 1 + 1/x^2 R(1/x^2)
+   Peak relative error 1.2e-35
+   0.4375 <= 1/x <= 0.5  */
+#define NP2_2r3N 8
+static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
+  L(-1.001042324337684297465071506097365389123E-4),
+  L(-6.289034524673365824853547252689991418981E-3),
+  L(-1.346527918018624234373664526930736205806E-1),
+  L(-1.268808313614288355444506172560463315102E0),
+  L(-5.654126123607146048354132115649177406163E0),
+  L(-1.186649511267312652171775803270911971693E1),
+  L(-1.094032424931998612551588246779200724257E1),
+  L(-3.728792136814520055025256353193674625267E0),
+  L(-3.000348318524471807839934764596331810608E-1),
+};
+#define NP2_2r3D 8
+static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
+  L(1.423705538269770974803901422532055612980E-3),
+  L(9.171476630091439978533535167485230575894E-2),
+  L(2.049776318166637248868444600215942828537E0),
+  L(2.068970329743769804547326701946144899583E1),
+  L(1.025103500560831035592731539565060347709E2),
+  L(2.528088049697570728252145557167066708284E2),
+  L(2.992160327587558573740271294804830114205E2),
+  L(1.540193761146551025832707739468679973036E2),
+  L(2.779516701986912132637672140709452502650E1),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 2.2e-35
+   0 <= 1/x <= .0625  */
+#define NQ16_IN 10
+static const _Float128 Q16_IN[NQ16_IN + 1] = {
+  L(2.343640834407975740545326632205999437469E-18),
+  L(2.667978112927811452221176781536278257448E-15),
+  L(1.178415018484555397390098879501969116536E-12),
+  L(2.622049767502719728905924701288614016597E-10),
+  L(3.196908059607618864801313380896308968673E-8),
+  L(2.179466154171673958770030655199434798494E-6),
+  L(8.139959091628545225221976413795645177291E-5),
+  L(1.563900725721039825236927137885747138654E-3),
+  L(1.355172364265825167113562519307194840307E-2),
+  L(3.928058355906967977269780046844768588532E-2),
+  L(1.107891967702173292405380993183694932208E-2),
+};
+#define NQ16_ID 9
+static const _Float128 Q16_ID[NQ16_ID + 1] = {
+  L(3.199850952578356211091219295199301766718E-17),
+  L(3.652601488020654842194486058637953363918E-14),
+  L(1.620179741394865258354608590461839031281E-11),
+  L(3.629359209474609630056463248923684371426E-9),
+  L(4.473680923894354600193264347733477363305E-7),
+  L(3.106368086644715743265603656011050476736E-5),
+  L(1.198239259946770604954664925153424252622E-3),
+  L(2.446041004004283102372887804475767568272E-2),
+  L(2.403235525011860603014707768815113698768E-1),
+  L(9.491006790682158612266270665136910927149E-1),
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 5.1e-36
+   0.0625 <= 1/x <= 0.125  */
+#define NQ8_16N 11
+static const _Float128 Q8_16N[NQ8_16N + 1] = {
+  L(1.001954266485599464105669390693597125904E-17),
+  L(7.545499865295034556206475956620160007849E-15),
+  L(2.267838684785673931024792538193202559922E-12),
+  L(3.561909705814420373609574999542459912419E-10),
+  L(3.216201422768092505214730633842924944671E-8),
+  L(1.731194793857907454569364622452058554314E-6),
+  L(5.576944613034537050396518509871004586039E-5),
+  L(1.051787760316848982655967052985391418146E-3),
+  L(1.102852974036687441600678598019883746959E-2),
+  L(5.834647019292460494254225988766702933571E-2),
+  L(1.290281921604364618912425380717127576529E-1),
+  L(7.598886310387075708640370806458926458301E-2),
+};
+#define NQ8_16D 11
+static const _Float128 Q8_16D[NQ8_16D + 1] = {
+  L(1.368001558508338469503329967729951830843E-16),
+  L(1.034454121857542147020549303317348297289E-13),
+  L(3.128109209247090744354764050629381674436E-11),
+  L(4.957795214328501986562102573522064468671E-9),
+  L(4.537872468606711261992676606899273588899E-7),
+  L(2.493639207101727713192687060517509774182E-5),
+  L(8.294957278145328349785532236663051405805E-4),
+  L(1.646471258966713577374948205279380115839E-2),
+  L(1.878910092770966718491814497982191447073E-1),
+  L(1.152641605706170353727903052525652504075E0),
+  L(3.383550240669773485412333679367792932235E0),
+  L(3.823875252882035706910024716609908473970E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 3.9e-35
+   0.125 <= 1/x <= 0.1875  */
+#define NQ5_8N 10
+static const _Float128 Q5_8N[NQ5_8N + 1] = {
+  L(1.750399094021293722243426623211733898747E-13),
+  L(6.483426211748008735242909236490115050294E-11),
+  L(9.279430665656575457141747875716899958373E-9),
+  L(6.696634968526907231258534757736576340266E-7),
+  L(2.666560823798895649685231292142838188061E-5),
+  L(6.025087697259436271271562769707550594540E-4),
+  L(7.652807734168613251901945778921336353485E-3),
+  L(5.226269002589406461622551452343519078905E-2),
+  L(1.748390159751117658969324896330142895079E-1),
+  L(2.378188719097006494782174902213083589660E-1),
+  L(8.383984859679804095463699702165659216831E-2),
+};
+#define NQ5_8D 10
+static const _Float128 Q5_8D[NQ5_8D + 1] = {
+  L(2.389878229704327939008104855942987615715E-12),
+  L(8.926142817142546018703814194987786425099E-10),
+  L(1.294065862406745901206588525833274399038E-7),
+  L(9.524139899457666250828752185212769682191E-6),
+  L(3.908332488377770886091936221573123353489E-4),
+  L(9.250427033957236609624199884089916836748E-3),
+  L(1.263420066165922645975830877751588421451E-1),
+  L(9.692527053860420229711317379861733180654E-1),
+  L(3.937813834630430172221329298841520707954E0),
+  L(7.603126427436356534498908111445191312181E0),
+  L(5.670677653334105479259958485084550934305E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 3.2e-35
+   0.1875 <= 1/x <= 0.25  */
+#define NQ4_5N 10
+static const _Float128 Q4_5N[NQ4_5N + 1] = {
+  L(2.233870042925895644234072357400122854086E-11),
+  L(5.146223225761993222808463878999151699792E-9),
+  L(4.459114531468296461688753521109797474523E-7),
+  L(1.891397692931537975547242165291668056276E-5),
+  L(4.279519145911541776938964806470674565504E-4),
+  L(5.275239415656560634702073291768904783989E-3),
+  L(3.468698403240744801278238473898432608887E-2),
+  L(1.138773146337708415188856882915457888274E-1),
+  L(1.622717518946443013587108598334636458955E-1),
+  L(7.249040006390586123760992346453034628227E-2),
+  L(1.941595365256460232175236758506411486667E-3),
+};
+#define NQ4_5D 9
+static const _Float128 Q4_5D[NQ4_5D + 1] = {
+  L(3.049977232266999249626430127217988047453E-10),
+  L(7.120883230531035857746096928889676144099E-8),
+  L(6.301786064753734446784637919554359588859E-6),
+  L(2.762010530095069598480766869426308077192E-4),
+  L(6.572163250572867859316828886203406361251E-3),
+  L(8.752566114841221958200215255461843397776E-2),
+  L(6.487654992874805093499285311075289932664E-1),
+  L(2.576550017826654579451615283022812801435E0),
+  L(5.056392229924022835364779562707348096036E0),
+  L(4.179770081068251464907531367859072157773E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 1.4e-36
+   0.25 <= 1/x <= 0.3125  */
+#define NQ3r2_4N 10
+static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
+  L(6.126167301024815034423262653066023684411E-10),
+  L(1.043969327113173261820028225053598975128E-7),
+  L(6.592927270288697027757438170153763220190E-6),
+  L(2.009103660938497963095652951912071336730E-4),
+  L(3.220543385492643525985862356352195896964E-3),
+  L(2.774405975730545157543417650436941650990E-2),
+  L(1.258114008023826384487378016636555041129E-1),
+  L(2.811724258266902502344701449984698323860E-1),
+  L(2.691837665193548059322831687432415014067E-1),
+  L(7.949087384900985370683770525312735605034E-2),
+  L(1.229509543620976530030153018986910810747E-3),
+};
+#define NQ3r2_4D 9
+static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
+  L(8.364260446128475461539941389210166156568E-9),
+  L(1.451301850638956578622154585560759862764E-6),
+  L(9.431830010924603664244578867057141839463E-5),
+  L(3.004105101667433434196388593004526182741E-3),
+  L(5.148157397848271739710011717102773780221E-2),
+  L(4.901089301726939576055285374953887874895E-1),
+  L(2.581760991981709901216967665934142240346E0),
+  L(7.257105880775059281391729708630912791847E0),
+  L(1.006014717326362868007913423810737369312E1),
+  L(5.879416600465399514404064187445293212470E0),
+ /* 1.000000000000000000000000000000000000000E0*/
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 3.8e-36
+   0.3125 <= 1/x <= 0.375  */
+#define NQ2r7_3r2N 9
+static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+  L(7.584861620402450302063691901886141875454E-8),
+  L(9.300939338814216296064659459966041794591E-6),
+  L(4.112108906197521696032158235392604947895E-4),
+  L(8.515168851578898791897038357239630654431E-3),
+  L(8.971286321017307400142720556749573229058E-2),
+  L(4.885856732902956303343015636331874194498E-1),
+  L(1.334506268733103291656253500506406045846E0),
+  L(1.681207956863028164179042145803851824654E0),
+  L(8.165042692571721959157677701625853772271E-1),
+  L(9.805848115375053300608712721986235900715E-2),
+};
+#define NQ2r7_3r2D 9
+static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+  L(1.035586492113036586458163971239438078160E-6),
+  L(1.301999337731768381683593636500979713689E-4),
+  L(5.993695702564527062553071126719088859654E-3),
+  L(1.321184892887881883489141186815457808785E-1),
+  L(1.528766555485015021144963194165165083312E0),
+  L(9.561463309176490874525827051566494939295E0),
+  L(3.203719484883967351729513662089163356911E1),
+  L(5.497294687660930446641539152123568668447E1),
+  L(4.391158169390578768508675452986948391118E1),
+  L(1.347836630730048077907818943625789418378E1),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 2.2e-35
+   0.375 <= 1/x <= 0.4375  */
+#define NQ2r3_2r7N 9
+static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+  L(4.455027774980750211349941766420190722088E-7),
+  L(4.031998274578520170631601850866780366466E-5),
+  L(1.273987274325947007856695677491340636339E-3),
+  L(1.818754543377448509897226554179659122873E-2),
+  L(1.266748858326568264126353051352269875352E-1),
+  L(4.327578594728723821137731555139472880414E-1),
+  L(6.892532471436503074928194969154192615359E-1),
+  L(4.490775818438716873422163588640262036506E-1),
+  L(8.649615949297322440032000346117031581572E-2),
+  L(7.261345286655345047417257611469066147561E-4),
+};
+#define NQ2r3_2r7D 8
+static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+  L(6.082600739680555266312417978064954793142E-6),
+  L(5.693622538165494742945717226571441747567E-4),
+  L(1.901625907009092204458328768129666975975E-2),
+  L(2.958689532697857335456896889409923371570E-1),
+  L(2.343124711045660081603809437993368799568E0),
+  L(9.665894032187458293568704885528192804376E0),
+  L(2.035273104990617136065743426322454881353E1),
+  L(2.044102010478792896815088858740075165531E1),
+  L(8.445937177863155827844146643468706599304E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y0(x)cosX - J0(x)sinX = sqrt( 2/(pi x)) Q0(x),
+   Q0(x) = 1/x (-.125 + 1/x^2 R(1/x^2))
+   Peak relative error 3.1e-36
+   0.4375 <= 1/x <= 0.5  */
+#define NQ2_2r3N 9
+static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
+  L(2.817566786579768804844367382809101929314E-6),
+  L(2.122772176396691634147024348373539744935E-4),
+  L(5.501378031780457828919593905395747517585E-3),
+  L(6.355374424341762686099147452020466524659E-2),
+  L(3.539652320122661637429658698954748337223E-1),
+  L(9.571721066119617436343740541777014319695E-1),
+  L(1.196258777828426399432550698612171955305E0),
+  L(6.069388659458926158392384709893753793967E-1),
+  L(9.026746127269713176512359976978248763621E-2),
+  L(5.317668723070450235320878117210807236375E-4),
+};
+#define NQ2_2r3D 8
+static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
+  L(3.846924354014260866793741072933159380158E-5),
+  L(3.017562820057704325510067178327449946763E-3),
+  L(8.356305620686867949798885808540444210935E-2),
+  L(1.068314930499906838814019619594424586273E0),
+  L(6.900279623894821067017966573640732685233E0),
+  L(2.307667390886377924509090271780839563141E1),
+  L(3.921043465412723970791036825401273528513E1),
+  L(3.167569478939719383241775717095729233436E1),
+  L(1.051023841699200920276198346301543665909E1),
+ /* 1.000000000000000000000000000000000000000E0*/
+};
+
+
+/* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
+
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
+{
+  _Float128 y;
+
+  p += n;
+  y = *p--;
+  do
+    {
+      y = y * x + *p--;
+    }
+  while (--n > 0);
+  return y;
+}
+
+
+/* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
+
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
+{
+  _Float128 y;
+
+  p += n;
+  y = x + *p--;
+  do
+    {
+      y = y * x + *p--;
+    }
+  while (--n > 0);
+  return y;
+}
+
+
+/* Bessel function of the first kind, order zero.  */
+
+_Float128
+__ieee754_j0l (_Float128 x)
+{
+  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+
+  if (! isfinite (x))
+    {
+      if (x != x)
+	return x + x;
+      else
+	return 0;
+    }
+  if (x == 0)
+    return 1;
+
+  xx = fabsl (x);
+  if (xx <= 2)
+    {
+      if (xx < L(0x1p-57))
+	return 1;
+      /* 0 <= x <= 2 */
+      z = xx * xx;
+      p = z * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
+      p -= L(0.25) * z;
+      p += 1;
+      return p;
+    }
+
+  /* X = x - pi/4
+     cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+     = 1/sqrt(2) * (cos(x) + sin(x))
+     sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+     = 1/sqrt(2) * (sin(x) - cos(x))
+     sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+     cf. Fdlibm.  */
+  __sincosl (xx, &s, &c);
+  ss = s - c;
+  cc = s + c;
+  if (xx <= LDBL_MAX / 2)
+    {
+      z = -__cosl (xx + xx);
+      if ((s * c) < 0)
+	cc = z / ss;
+      else
+	ss = z / cc;
+    }
+
+  if (xx > L(0x1p256))
+    return ONEOSQPI * cc / __ieee754_sqrtl (xx);
+
+  xinv = 1 / xx;
+  z = xinv * xinv;
+  if (xinv <= 0.25)
+    {
+      if (xinv <= 0.125)
+	{
+	  if (xinv <= 0.0625)
+	    {
+	      p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+	      q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+	    }
+	  else
+	    {
+	      p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+	      q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+	    }
+	}
+      else if (xinv <= 0.1875)
+	{
+	  p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+	  q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+	}
+      else
+	{
+	  p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+	  q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+	}
+    }				/* .25 */
+  else /* if (xinv <= 0.5) */
+    {
+      if (xinv <= 0.375)
+	{
+	  if (xinv <= 0.3125)
+	    {
+	      p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+	      q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+	    }
+	  else
+	    {
+	      p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+		  / deval (z, P2r7_3r2D, NP2r7_3r2D);
+	      q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+		  / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+	    }
+	}
+      else if (xinv <= 0.4375)
+	{
+	  p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+	      / deval (z, P2r3_2r7D, NP2r3_2r7D);
+	  q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+	      / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+	}
+      else
+	{
+	  p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+	  q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+	}
+    }
+  p = 1 + z * p;
+  q = z * xinv * q;
+  q = q - L(0.125) * xinv;
+  z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
+  return z;
+}
+strong_alias (__ieee754_j0l, __j0l_finite)
+
+
+/* Y0(x) = 2/pi * log(x) * J0(x) + R(x^2)
+   Peak absolute error 1.7e-36 (relative where Y0 > 1)
+   0 <= x <= 2   */
+#define NY0_2N 7
+static _Float128 Y0_2N[NY0_2N + 1] = {
+ L(-1.062023609591350692692296993537002558155E19),
+  L(2.542000883190248639104127452714966858866E19),
+ L(-1.984190771278515324281415820316054696545E18),
+  L(4.982586044371592942465373274440222033891E16),
+ L(-5.529326354780295177243773419090123407550E14),
+  L(3.013431465522152289279088265336861140391E12),
+ L(-7.959436160727126750732203098982718347785E9),
+  L(8.230845651379566339707130644134372793322E6),
+};
+#define NY0_2D 7
+static _Float128 Y0_2D[NY0_2D + 1] = {
+  L(1.438972634353286978700329883122253752192E20),
+  L(1.856409101981569254247700169486907405500E18),
+  L(1.219693352678218589553725579802986255614E16),
+  L(5.389428943282838648918475915779958097958E13),
+  L(1.774125762108874864433872173544743051653E11),
+  L(4.522104832545149534808218252434693007036E8),
+  L(8.872187401232943927082914504125234454930E5),
+  L(1.251945613186787532055610876304669413955E3),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+static const _Float128 U0 = L(-7.3804295108687225274343927948483016310862e-02);
+
+/* Bessel function of the second kind, order zero.  */
+
+_Float128
+ __ieee754_y0l(_Float128 x)
+{
+  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+
+  if (! isfinite (x))
+    return 1 / (x + x * x);
+  if (x <= 0)
+    {
+      if (x < 0)
+	return (zero / (zero * x));
+      return -1 / zero; /* -inf and divide by zero exception.  */
+    }
+  xx = fabsl (x);
+  if (xx <= 0x1p-57)
+    return U0 + TWOOPI * __ieee754_logl (x);
+  if (xx <= 2)
+    {
+      /* 0 <= x <= 2 */
+      z = xx * xx;
+      p = neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+      p = TWOOPI * __ieee754_logl (x) * __ieee754_j0l (x) + p;
+      return p;
+    }
+
+  /* X = x - pi/4
+     cos(X) = cos(x) cos(pi/4) + sin(x) sin(pi/4)
+     = 1/sqrt(2) * (cos(x) + sin(x))
+     sin(X) = sin(x) cos(pi/4) - cos(x) sin(pi/4)
+     = 1/sqrt(2) * (sin(x) - cos(x))
+     sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
+     cf. Fdlibm.  */
+  __sincosl (x, &s, &c);
+  ss = s - c;
+  cc = s + c;
+  if (xx <= LDBL_MAX / 2)
+    {
+      z = -__cosl (x + x);
+      if ((s * c) < 0)
+	cc = z / ss;
+      else
+	ss = z / cc;
+    }
+
+  if (xx > L(0x1p256))
+    return ONEOSQPI * ss / __ieee754_sqrtl (x);
+
+  xinv = 1 / xx;
+  z = xinv * xinv;
+  if (xinv <= 0.25)
+    {
+      if (xinv <= 0.125)
+	{
+	  if (xinv <= 0.0625)
+	    {
+	      p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+	      q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+	    }
+	  else
+	    {
+	      p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+	      q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+	    }
+	}
+      else if (xinv <= 0.1875)
+	{
+	  p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+	  q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+	}
+      else
+	{
+	  p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+	  q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+	}
+    }				/* .25 */
+  else /* if (xinv <= 0.5) */
+    {
+      if (xinv <= 0.375)
+	{
+	  if (xinv <= 0.3125)
+	    {
+	      p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+	      q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+	    }
+	  else
+	    {
+	      p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+		  / deval (z, P2r7_3r2D, NP2r7_3r2D);
+	      q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+		  / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+	    }
+	}
+      else if (xinv <= 0.4375)
+	{
+	  p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+	      / deval (z, P2r3_2r7D, NP2r3_2r7D);
+	  q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+	      / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+	}
+      else
+	{
+	  p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+	  q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+	}
+    }
+  p = 1 + z * p;
+  q = z * xinv * q;
+  q = q - L(0.125) * xinv;
+  z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (x);
+  return z;
+}
+strong_alias (__ieee754_y0l, __y0l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
index da9fd9eeca..3cedeec438 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
@@ -1,4 +1,886 @@
-/* Looks like we can use ieee854 e_j1l.c as is for IBM extended format. */
+/* Bessel function of order one.  IBM Extended Precision version.
+   Copyright 2001 by Stephen L. Moshier (moshier@na-net.onrl.gov).
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c.  */
+
 #define _Float128 long double
 #define L(x) x ## L
-#include <sysdeps/ieee754/ldbl-128/e_j1l.c>
+
+#include <errno.h>
+#include <math.h>
+#include <math_private.h>
+#include <float.h>
+
+/* 1 / sqrt(pi) */
+static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
+/* 2 / pi */
+static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
+static const _Float128 zero = 0;
+
+/* J1(x) = .5x + x x^2 R(x^2)
+   Peak relative error 1.9e-35
+   0 <= x <= 2  */
+#define NJ0_2N 6
+static const _Float128 J0_2N[NJ0_2N + 1] = {
+ L(-5.943799577386942855938508697619735179660E16),
+  L(1.812087021305009192259946997014044074711E15),
+ L(-2.761698314264509665075127515729146460895E13),
+  L(2.091089497823600978949389109350658815972E11),
+ L(-8.546413231387036372945453565654130054307E8),
+  L(1.797229225249742247475464052741320612261E6),
+ L(-1.559552840946694171346552770008812083969E3)
+};
+#define NJ0_2D 6
+static const _Float128 J0_2D[NJ0_2D + 1] = {
+  L(9.510079323819108569501613916191477479397E17),
+  L(1.063193817503280529676423936545854693915E16),
+  L(5.934143516050192600795972192791775226920E13),
+  L(2.168000911950620999091479265214368352883E11),
+  L(5.673775894803172808323058205986256928794E8),
+  L(1.080329960080981204840966206372671147224E6),
+  L(1.411951256636576283942477881535283304912E3),
+ /* 1.000000000000000000000000000000000000000E0L */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+   0 <= 1/x <= .0625
+   Peak relative error 3.6e-36  */
+#define NP16_IN 9
+static const _Float128 P16_IN[NP16_IN + 1] = {
+  L(5.143674369359646114999545149085139822905E-16),
+  L(4.836645664124562546056389268546233577376E-13),
+  L(1.730945562285804805325011561498453013673E-10),
+  L(3.047976856147077889834905908605310585810E-8),
+  L(2.855227609107969710407464739188141162386E-6),
+  L(1.439362407936705484122143713643023998457E-4),
+  L(3.774489768532936551500999699815873422073E-3),
+  L(4.723962172984642566142399678920790598426E-2),
+  L(2.359289678988743939925017240478818248735E-1),
+  L(3.032580002220628812728954785118117124520E-1),
+};
+#define NP16_ID 9
+static const _Float128 P16_ID[NP16_ID + 1] = {
+  L(4.389268795186898018132945193912677177553E-15),
+  L(4.132671824807454334388868363256830961655E-12),
+  L(1.482133328179508835835963635130894413136E-9),
+  L(2.618941412861122118906353737117067376236E-7),
+  L(2.467854246740858470815714426201888034270E-5),
+  L(1.257192927368839847825938545925340230490E-3),
+  L(3.362739031941574274949719324644120720341E-2),
+  L(4.384458231338934105875343439265370178858E-1),
+  L(2.412830809841095249170909628197264854651E0),
+  L(4.176078204111348059102962617368214856874E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+    0.0625 <= 1/x <= 0.125
+    Peak relative error 1.9e-36  */
+#define NP8_16N 11
+static const _Float128 P8_16N[NP8_16N + 1] = {
+  L(2.984612480763362345647303274082071598135E-16),
+  L(1.923651877544126103941232173085475682334E-13),
+  L(4.881258879388869396043760693256024307743E-11),
+  L(6.368866572475045408480898921866869811889E-9),
+  L(4.684818344104910450523906967821090796737E-7),
+  L(2.005177298271593587095982211091300382796E-5),
+  L(4.979808067163957634120681477207147536182E-4),
+  L(6.946005761642579085284689047091173581127E-3),
+  L(5.074601112955765012750207555985299026204E-2),
+  L(1.698599455896180893191766195194231825379E-1),
+  L(1.957536905259237627737222775573623779638E-1),
+  L(2.991314703282528370270179989044994319374E-2),
+};
+#define NP8_16D 10
+static const _Float128 P8_16D[NP8_16D + 1] = {
+  L(2.546869316918069202079580939942463010937E-15),
+  L(1.644650111942455804019788382157745229955E-12),
+  L(4.185430770291694079925607420808011147173E-10),
+  L(5.485331966975218025368698195861074143153E-8),
+  L(4.062884421686912042335466327098932678905E-6),
+  L(1.758139661060905948870523641319556816772E-4),
+  L(4.445143889306356207566032244985607493096E-3),
+  L(6.391901016293512632765621532571159071158E-2),
+  L(4.933040207519900471177016015718145795434E-1),
+  L(1.839144086168947712971630337250761842976E0),
+  L(2.715120873995490920415616716916149586579E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+  0.125 <= 1/x <= 0.1875
+  Peak relative error 1.3e-36  */
+#define NP5_8N 10
+static const _Float128 P5_8N[NP5_8N + 1] = {
+  L(2.837678373978003452653763806968237227234E-12),
+  L(9.726641165590364928442128579282742354806E-10),
+  L(1.284408003604131382028112171490633956539E-7),
+  L(8.524624695868291291250573339272194285008E-6),
+  L(3.111516908953172249853673787748841282846E-4),
+  L(6.423175156126364104172801983096596409176E-3),
+  L(7.430220589989104581004416356260692450652E-2),
+  L(4.608315409833682489016656279567605536619E-1),
+  L(1.396870223510964882676225042258855977512E0),
+  L(1.718500293904122365894630460672081526236E0),
+  L(5.465927698800862172307352821870223855365E-1)
+};
+#define NP5_8D 10
+static const _Float128 P5_8D[NP5_8D + 1] = {
+  L(2.421485545794616609951168511612060482715E-11),
+  L(8.329862750896452929030058039752327232310E-9),
+  L(1.106137992233383429630592081375289010720E-6),
+  L(7.405786153760681090127497796448503306939E-5),
+  L(2.740364785433195322492093333127633465227E-3),
+  L(5.781246470403095224872243564165254652198E-2),
+  L(6.927711353039742469918754111511109983546E-1),
+  L(4.558679283460430281188304515922826156690E0),
+  L(1.534468499844879487013168065728837900009E1),
+  L(2.313927430889218597919624843161569422745E1),
+  L(1.194506341319498844336768473218382828637E1),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+   Peak relative error 1.4e-36
+   0.1875 <= 1/x <= 0.25  */
+#define NP4_5N 10
+static const _Float128 P4_5N[NP4_5N + 1] = {
+  L(1.846029078268368685834261260420933914621E-10),
+  L(3.916295939611376119377869680335444207768E-8),
+  L(3.122158792018920627984597530935323997312E-6),
+  L(1.218073444893078303994045653603392272450E-4),
+  L(2.536420827983485448140477159977981844883E-3),
+  L(2.883011322006690823959367922241169171315E-2),
+  L(1.755255190734902907438042414495469810830E-1),
+  L(5.379317079922628599870898285488723736599E-1),
+  L(7.284904050194300773890303361501726561938E-1),
+  L(3.270110346613085348094396323925000362813E-1),
+  L(1.804473805689725610052078464951722064757E-2),
+};
+#define NP4_5D 9
+static const _Float128 P4_5D[NP4_5D + 1] = {
+  L(1.575278146806816970152174364308980863569E-9),
+  L(3.361289173657099516191331123405675054321E-7),
+  L(2.704692281550877810424745289838790693708E-5),
+  L(1.070854930483999749316546199273521063543E-3),
+  L(2.282373093495295842598097265627962125411E-2),
+  L(2.692025460665354148328762368240343249830E-1),
+  L(1.739892942593664447220951225734811133759E0),
+  L(5.890727576752230385342377570386657229324E0),
+  L(9.517442287057841500750256954117735128153E0),
+  L(6.100616353935338240775363403030137736013E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+   Peak relative error 3.0e-36
+   0.25 <= 1/x <= 0.3125  */
+#define NP3r2_4N 9
+static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
+  L(8.240803130988044478595580300846665863782E-8),
+  L(1.179418958381961224222969866406483744580E-5),
+  L(6.179787320956386624336959112503824397755E-4),
+  L(1.540270833608687596420595830747166658383E-2),
+  L(1.983904219491512618376375619598837355076E-1),
+  L(1.341465722692038870390470651608301155565E0),
+  L(4.617865326696612898792238245990854646057E0),
+  L(7.435574801812346424460233180412308000587E0),
+  L(4.671327027414635292514599201278557680420E0),
+  L(7.299530852495776936690976966995187714739E-1),
+};
+#define NP3r2_4D 9
+static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
+  L(7.032152009675729604487575753279187576521E-7),
+  L(1.015090352324577615777511269928856742848E-4),
+  L(5.394262184808448484302067955186308730620E-3),
+  L(1.375291438480256110455809354836988584325E-1),
+  L(1.836247144461106304788160919310404376670E0),
+  L(1.314378564254376655001094503090935880349E1),
+  L(4.957184590465712006934452500894672343488E1),
+  L(9.287394244300647738855415178790263465398E1),
+  L(7.652563275535900609085229286020552768399E1),
+  L(2.147042473003074533150718117770093209096E1),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+   Peak relative error 1.0e-35
+   0.3125 <= 1/x <= 0.375  */
+#define NP2r7_3r2N 9
+static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
+  L(4.599033469240421554219816935160627085991E-7),
+  L(4.665724440345003914596647144630893997284E-5),
+  L(1.684348845667764271596142716944374892756E-3),
+  L(2.802446446884455707845985913454440176223E-2),
+  L(2.321937586453963310008279956042545173930E-1),
+  L(9.640277413988055668692438709376437553804E-1),
+  L(1.911021064710270904508663334033003246028E0),
+  L(1.600811610164341450262992138893970224971E0),
+  L(4.266299218652587901171386591543457861138E-1),
+  L(1.316470424456061252962568223251247207325E-2),
+};
+#define NP2r7_3r2D 8
+static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
+  L(3.924508608545520758883457108453520099610E-6),
+  L(4.029707889408829273226495756222078039823E-4),
+  L(1.484629715787703260797886463307469600219E-2),
+  L(2.553136379967180865331706538897231588685E-1),
+  L(2.229457223891676394409880026887106228740E0),
+  L(1.005708903856384091956550845198392117318E1),
+  L(2.277082659664386953166629360352385889558E1),
+  L(2.384726835193630788249826630376533988245E1),
+  L(9.700989749041320895890113781610939632410E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+   Peak relative error 1.7e-36
+   0.3125 <= 1/x <= 0.4375  */
+#define NP2r3_2r7N 9
+static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
+  L(3.916766777108274628543759603786857387402E-6),
+  L(3.212176636756546217390661984304645137013E-4),
+  L(9.255768488524816445220126081207248947118E-3),
+  L(1.214853146369078277453080641911700735354E-1),
+  L(7.855163309847214136198449861311404633665E-1),
+  L(2.520058073282978403655488662066019816540E0),
+  L(3.825136484837545257209234285382183711466E0),
+  L(2.432569427554248006229715163865569506873E0),
+  L(4.877934835018231178495030117729800489743E-1),
+  L(1.109902737860249670981355149101343427885E-2),
+};
+#define NP2r3_2r7D 8
+static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
+  L(3.342307880794065640312646341190547184461E-5),
+  L(2.782182891138893201544978009012096558265E-3),
+  L(8.221304931614200702142049236141249929207E-2),
+  L(1.123728246291165812392918571987858010949E0),
+  L(7.740482453652715577233858317133423434590E0),
+  L(2.737624677567945952953322566311201919139E1),
+  L(4.837181477096062403118304137851260715475E1),
+  L(3.941098643468580791437772701093795299274E1),
+  L(1.245821247166544627558323920382547533630E1),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* J1(x)cosX + Y1(x)sinX = sqrt( 2/(pi x)) P1(x), P1(x) = 1 + 1/x^2 R(1/x^2),
+   Peak relative error 1.7e-35
+   0.4375 <= 1/x <= 0.5  */
+#define NP2_2r3N 8
+static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
+  L(3.397930802851248553545191160608731940751E-4),
+  L(2.104020902735482418784312825637833698217E-2),
+  L(4.442291771608095963935342749477836181939E-1),
+  L(4.131797328716583282869183304291833754967E0),
+  L(1.819920169779026500146134832455189917589E1),
+  L(3.781779616522937565300309684282401791291E1),
+  L(3.459605449728864218972931220783543410347E1),
+  L(1.173594248397603882049066603238568316561E1),
+  L(9.455702270242780642835086549285560316461E-1),
+};
+#define NP2_2r3D 8
+static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
+  L(2.899568897241432883079888249845707400614E-3),
+  L(1.831107138190848460767699919531132426356E-1),
+  L(3.999350044057883839080258832758908825165E0),
+  L(3.929041535867957938340569419874195303712E1),
+  L(1.884245613422523323068802689915538908291E2),
+  L(4.461469948819229734353852978424629815929E2),
+  L(5.004998753999796821224085972610636347903E2),
+  L(2.386342520092608513170837883757163414100E2),
+  L(3.791322528149347975999851588922424189957E1),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 8.0e-36
+   0 <= 1/x <= .0625  */
+#define NQ16_IN 10
+static const _Float128 Q16_IN[NQ16_IN + 1] = {
+  L(-3.917420835712508001321875734030357393421E-18),
+  L(-4.440311387483014485304387406538069930457E-15),
+  L(-1.951635424076926487780929645954007139616E-12),
+  L(-4.318256438421012555040546775651612810513E-10),
+  L(-5.231244131926180765270446557146989238020E-8),
+  L(-3.540072702902043752460711989234732357653E-6),
+  L(-1.311017536555269966928228052917534882984E-4),
+  L(-2.495184669674631806622008769674827575088E-3),
+  L(-2.141868222987209028118086708697998506716E-2),
+  L(-6.184031415202148901863605871197272650090E-2),
+  L(-1.922298704033332356899546792898156493887E-2),
+};
+#define NQ16_ID 9
+static const _Float128 Q16_ID[NQ16_ID + 1] = {
+  L(3.820418034066293517479619763498400162314E-17),
+  L(4.340702810799239909648911373329149354911E-14),
+  L(1.914985356383416140706179933075303538524E-11),
+  L(4.262333682610888819476498617261895474330E-9),
+  L(5.213481314722233980346462747902942182792E-7),
+  L(3.585741697694069399299005316809954590558E-5),
+  L(1.366513429642842006385029778105539457546E-3),
+  L(2.745282599850704662726337474371355160594E-2),
+  L(2.637644521611867647651200098449903330074E-1),
+  L(1.006953426110765984590782655598680488746E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+ };
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 1.9e-36
+   0.0625 <= 1/x <= 0.125  */
+#define NQ8_16N 11
+static const _Float128 Q8_16N[NQ8_16N + 1] = {
+  L(-2.028630366670228670781362543615221542291E-17),
+  L(-1.519634620380959966438130374006858864624E-14),
+  L(-4.540596528116104986388796594639405114524E-12),
+  L(-7.085151756671466559280490913558388648274E-10),
+  L(-6.351062671323970823761883833531546885452E-8),
+  L(-3.390817171111032905297982523519503522491E-6),
+  L(-1.082340897018886970282138836861233213972E-4),
+  L(-2.020120801187226444822977006648252379508E-3),
+  L(-2.093169910981725694937457070649605557555E-2),
+  L(-1.092176538874275712359269481414448063393E-1),
+  L(-2.374790947854765809203590474789108718733E-1),
+  L(-1.365364204556573800719985118029601401323E-1),
+};
+#define NQ8_16D 11
+static const _Float128 Q8_16D[NQ8_16D + 1] = {
+  L(1.978397614733632533581207058069628242280E-16),
+  L(1.487361156806202736877009608336766720560E-13),
+  L(4.468041406888412086042576067133365913456E-11),
+  L(7.027822074821007443672290507210594648877E-9),
+  L(6.375740580686101224127290062867976007374E-7),
+  L(3.466887658320002225888644977076410421940E-5),
+  L(1.138625640905289601186353909213719596986E-3),
+  L(2.224470799470414663443449818235008486439E-2),
+  L(2.487052928527244907490589787691478482358E-1),
+  L(1.483927406564349124649083853892380899217E0),
+  L(4.182773513276056975777258788903489507705E0),
+  L(4.419665392573449746043880892524360870944E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 1.5e-35
+   0.125 <= 1/x <= 0.1875  */
+#define NQ5_8N 10
+static const _Float128 Q5_8N[NQ5_8N + 1] = {
+  L(-3.656082407740970534915918390488336879763E-13),
+  L(-1.344660308497244804752334556734121771023E-10),
+  L(-1.909765035234071738548629788698150760791E-8),
+  L(-1.366668038160120210269389551283666716453E-6),
+  L(-5.392327355984269366895210704976314135683E-5),
+  L(-1.206268245713024564674432357634540343884E-3),
+  L(-1.515456784370354374066417703736088291287E-2),
+  L(-1.022454301137286306933217746545237098518E-1),
+  L(-3.373438906472495080504907858424251082240E-1),
+  L(-4.510782522110845697262323973549178453405E-1),
+  L(-1.549000892545288676809660828213589804884E-1),
+};
+#define NQ5_8D 10
+static const _Float128 Q5_8D[NQ5_8D + 1] = {
+  L(3.565550843359501079050699598913828460036E-12),
+  L(1.321016015556560621591847454285330528045E-9),
+  L(1.897542728662346479999969679234270605975E-7),
+  L(1.381720283068706710298734234287456219474E-5),
+  L(5.599248147286524662305325795203422873725E-4),
+  L(1.305442352653121436697064782499122164843E-2),
+  L(1.750234079626943298160445750078631894985E-1),
+  L(1.311420542073436520965439883806946678491E0),
+  L(5.162757689856842406744504211089724926650E0),
+  L(9.527760296384704425618556332087850581308E0),
+  L(6.604648207463236667912921642545100248584E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 1.3e-35
+   0.1875 <= 1/x <= 0.25  */
+#define NQ4_5N 10
+static const _Float128 Q4_5N[NQ4_5N + 1] = {
+  L(-4.079513568708891749424783046520200903755E-11),
+  L(-9.326548104106791766891812583019664893311E-9),
+  L(-8.016795121318423066292906123815687003356E-7),
+  L(-3.372350544043594415609295225664186750995E-5),
+  L(-7.566238665947967882207277686375417983917E-4),
+  L(-9.248861580055565402130441618521591282617E-3),
+  L(-6.033106131055851432267702948850231270338E-2),
+  L(-1.966908754799996793730369265431584303447E-1),
+  L(-2.791062741179964150755788226623462207560E-1),
+  L(-1.255478605849190549914610121863534191666E-1),
+  L(-4.320429862021265463213168186061696944062E-3),
+};
+#define NQ4_5D 9
+static const _Float128 Q4_5D[NQ4_5D + 1] = {
+  L(3.978497042580921479003851216297330701056E-10),
+  L(9.203304163828145809278568906420772246666E-8),
+  L(8.059685467088175644915010485174545743798E-6),
+  L(3.490187375993956409171098277561669167446E-4),
+  L(8.189109654456872150100501732073810028829E-3),
+  L(1.072572867311023640958725265762483033769E-1),
+  L(7.790606862409960053675717185714576937994E-1),
+  L(3.016049768232011196434185423512777656328E0),
+  L(5.722963851442769787733717162314477949360E0),
+  L(4.510527838428473279647251350931380867663E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 2.1e-35
+   0.25 <= 1/x <= 0.3125  */
+#define NQ3r2_4N 9
+static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
+  L(-1.087480809271383885936921889040388133627E-8),
+  L(-1.690067828697463740906962973479310170932E-6),
+  L(-9.608064416995105532790745641974762550982E-5),
+  L(-2.594198839156517191858208513873961837410E-3),
+  L(-3.610954144421543968160459863048062977822E-2),
+  L(-2.629866798251843212210482269563961685666E-1),
+  L(-9.709186825881775885917984975685752956660E-1),
+  L(-1.667521829918185121727268867619982417317E0),
+  L(-1.109255082925540057138766105229900943501E0),
+  L(-1.812932453006641348145049323713469043328E-1),
+};
+#define NQ3r2_4D 9
+static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
+  L(1.060552717496912381388763753841473407026E-7),
+  L(1.676928002024920520786883649102388708024E-5),
+  L(9.803481712245420839301400601140812255737E-4),
+  L(2.765559874262309494758505158089249012930E-2),
+  L(4.117921827792571791298862613287549140706E-1),
+  L(3.323769515244751267093378361930279161413E0),
+  L(1.436602494405814164724810151689705353670E1),
+  L(3.163087869617098638064881410646782408297E1),
+  L(3.198181264977021649489103980298349589419E1),
+  L(1.203649258862068431199471076202897823272E1),
+ /* 1.000000000000000000000000000000000000000E0  */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 1.6e-36
+   0.3125 <= 1/x <= 0.375  */
+#define NQ2r7_3r2N 9
+static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+  L(-1.723405393982209853244278760171643219530E-7),
+  L(-2.090508758514655456365709712333460087442E-5),
+  L(-9.140104013370974823232873472192719263019E-4),
+  L(-1.871349499990714843332742160292474780128E-2),
+  L(-1.948930738119938669637865956162512983416E-1),
+  L(-1.048764684978978127908439526343174139788E0),
+  L(-2.827714929925679500237476105843643064698E0),
+  L(-3.508761569156476114276988181329773987314E0),
+  L(-1.669332202790211090973255098624488308989E0),
+  L(-1.930796319299022954013840684651016077770E-1),
+};
+#define NQ2r7_3r2D 9
+static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+  L(1.680730662300831976234547482334347983474E-6),
+  L(2.084241442440551016475972218719621841120E-4),
+  L(9.445316642108367479043541702688736295579E-3),
+  L(2.044637889456631896650179477133252184672E-1),
+  L(2.316091982244297350829522534435350078205E0),
+  L(1.412031891783015085196708811890448488865E1),
+  L(4.583830154673223384837091077279595496149E1),
+  L(7.549520609270909439885998474045974122261E1),
+  L(5.697605832808113367197494052388203310638E1),
+  L(1.601496240876192444526383314589371686234E1),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 9.5e-36
+   0.375 <= 1/x <= 0.4375  */
+#define NQ2r3_2r7N 9
+static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+  L(-8.603042076329122085722385914954878953775E-7),
+  L(-7.701746260451647874214968882605186675720E-5),
+  L(-2.407932004380727587382493696877569654271E-3),
+  L(-3.403434217607634279028110636919987224188E-2),
+  L(-2.348707332185238159192422084985713102877E-1),
+  L(-7.957498841538254916147095255700637463207E-1),
+  L(-1.258469078442635106431098063707934348577E0),
+  L(-8.162415474676345812459353639449971369890E-1),
+  L(-1.581783890269379690141513949609572806898E-1),
+  L(-1.890595651683552228232308756569450822905E-3),
+};
+#define NQ2r3_2r7D 8
+static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+  L(8.390017524798316921170710533381568175665E-6),
+  L(7.738148683730826286477254659973968763659E-4),
+  L(2.541480810958665794368759558791634341779E-2),
+  L(3.878879789711276799058486068562386244873E-1),
+  L(3.003783779325811292142957336802456109333E0),
+  L(1.206480374773322029883039064575464497400E1),
+  L(2.458414064785315978408974662900438351782E1),
+  L(2.367237826273668567199042088835448715228E1),
+  L(9.231451197519171090875569102116321676763E0),
+ /* 1.000000000000000000000000000000000000000E0 */
+};
+
+/* Y1(x)cosX - J1(x)sinX = sqrt( 2/(pi x)) Q1(x),
+   Q1(x) = 1/x (.375 + 1/x^2 R(1/x^2)),
+   Peak relative error 1.4e-36
+   0.4375 <= 1/x <= 0.5  */
+#define NQ2_2r3N 9
+static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
+  L(-5.552507516089087822166822364590806076174E-6),
+  L(-4.135067659799500521040944087433752970297E-4),
+  L(-1.059928728869218962607068840646564457980E-2),
+  L(-1.212070036005832342565792241385459023801E-1),
+  L(-6.688350110633603958684302153362735625156E-1),
+  L(-1.793587878197360221340277951304429821582E0),
+  L(-2.225407682237197485644647380483725045326E0),
+  L(-1.123402135458940189438898496348239744403E0),
+  L(-1.679187241566347077204805190763597299805E-1),
+  L(-1.458550613639093752909985189067233504148E-3),
+};
+#define NQ2_2r3D 8
+static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
+  L(5.415024336507980465169023996403597916115E-5),
+  L(4.179246497380453022046357404266022870788E-3),
+  L(1.136306384261959483095442402929502368598E-1),
+  L(1.422640343719842213484515445393284072830E0),
+  L(8.968786703393158374728850922289204805764E0),
+  L(2.914542473339246127533384118781216495934E1),
+  L(4.781605421020380669870197378210457054685E1),
+  L(3.693865837171883152382820584714795072937E1),
+  L(1.153220502744204904763115556224395893076E1),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+
+/* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
+
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
+{
+  _Float128 y;
+
+  p += n;
+  y = *p--;
+  do
+    {
+      y = y * x + *p--;
+    }
+  while (--n > 0);
+  return y;
+}
+
+
+/* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
+
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
+{
+  _Float128 y;
+
+  p += n;
+  y = x + *p--;
+  do
+    {
+      y = y * x + *p--;
+    }
+  while (--n > 0);
+  return y;
+}
+
+
+/* Bessel function of the first kind, order one.  */
+
+_Float128
+__ieee754_j1l (_Float128 x)
+{
+  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+
+  if (! isfinite (x))
+    {
+      if (x != x)
+	return x + x;
+      else
+	return 0;
+    }
+  if (x == 0)
+    return x;
+  xx = fabsl (x);
+  if (xx <= L(0x1p-58))
+    {
+      _Float128 ret = x * L(0.5);
+      math_check_force_underflow (ret);
+      if (ret == 0)
+	__set_errno (ERANGE);
+      return ret;
+    }
+  if (xx <= 2)
+    {
+      /* 0 <= x <= 2 */
+      z = xx * xx;
+      p = xx * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
+      p += L(0.5) * xx;
+      if (x < 0)
+	p = -p;
+      return p;
+    }
+
+  /* X = x - 3 pi/4
+     cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+     = 1/sqrt(2) * (-cos(x) + sin(x))
+     sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+     = -1/sqrt(2) * (sin(x) + cos(x))
+     cf. Fdlibm.  */
+  __sincosl (xx, &s, &c);
+  ss = -s - c;
+  cc = s - c;
+  if (xx <= LDBL_MAX / 2)
+    {
+      z = __cosl (xx + xx);
+      if ((s * c) > 0)
+	cc = z / ss;
+      else
+	ss = z / cc;
+    }
+
+  if (xx > L(0x1p256))
+    {
+      z = ONEOSQPI * cc / __ieee754_sqrtl (xx);
+      if (x < 0)
+	z = -z;
+      return z;
+    }
+
+  xinv = 1 / xx;
+  z = xinv * xinv;
+  if (xinv <= 0.25)
+    {
+      if (xinv <= 0.125)
+	{
+	  if (xinv <= 0.0625)
+	    {
+	      p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+	      q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+	    }
+	  else
+	    {
+	      p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+	      q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+	    }
+	}
+      else if (xinv <= 0.1875)
+	{
+	  p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+	  q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+	}
+      else
+	{
+	  p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+	  q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+	}
+    }				/* .25 */
+  else /* if (xinv <= 0.5) */
+    {
+      if (xinv <= 0.375)
+	{
+	  if (xinv <= 0.3125)
+	    {
+	      p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+	      q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+	    }
+	  else
+	    {
+	      p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+		  / deval (z, P2r7_3r2D, NP2r7_3r2D);
+	      q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+		  / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+	    }
+	}
+      else if (xinv <= 0.4375)
+	{
+	  p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+	      / deval (z, P2r3_2r7D, NP2r3_2r7D);
+	  q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+	      / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+	}
+      else
+	{
+	  p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+	  q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+	}
+    }
+  p = 1 + z * p;
+  q = z * q;
+  q = q * xinv + L(0.375) * xinv;
+  z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
+  if (x < 0)
+    z = -z;
+  return z;
+}
+strong_alias (__ieee754_j1l, __j1l_finite)
+
+
+/* Y1(x) = 2/pi * (log(x) * J1(x) - 1/x) + x R(x^2)
+   Peak relative error 6.2e-38
+   0 <= x <= 2   */
+#define NY0_2N 7
+static _Float128 Y0_2N[NY0_2N + 1] = {
+  L(-6.804415404830253804408698161694720833249E19),
+  L(1.805450517967019908027153056150465849237E19),
+  L(-8.065747497063694098810419456383006737312E17),
+  L(1.401336667383028259295830955439028236299E16),
+  L(-1.171654432898137585000399489686629680230E14),
+  L(5.061267920943853732895341125243428129150E11),
+  L(-1.096677850566094204586208610960870217970E9),
+  L(9.541172044989995856117187515882879304461E5),
+};
+#define NY0_2D 7
+static _Float128 Y0_2D[NY0_2D + 1] = {
+  L(3.470629591820267059538637461549677594549E20),
+  L(4.120796439009916326855848107545425217219E18),
+  L(2.477653371652018249749350657387030814542E16),
+  L(9.954678543353888958177169349272167762797E13),
+  L(2.957927997613630118216218290262851197754E11),
+  L(6.748421382188864486018861197614025972118E8),
+  L(1.173453425218010888004562071020305709319E6),
+  L(1.450335662961034949894009554536003377187E3),
+  /* 1.000000000000000000000000000000000000000E0 */
+};
+
+
+/* Bessel function of the second kind, order one.  */
+
+_Float128
+__ieee754_y1l (_Float128 x)
+{
+  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+
+  if (! isfinite (x))
+    return 1 / (x + x * x);
+  if (x <= 0)
+    {
+      if (x < 0)
+	return (zero / (zero * x));
+      return -1 / zero; /* -inf and divide by zero exception.  */
+    }
+  xx = fabsl (x);
+  if (xx <= 0x1p-114)
+    {
+      z = -TWOOPI / x;
+      if (isinf (z))
+	__set_errno (ERANGE);
+      return z;
+    }
+  if (xx <= 2)
+    {
+      /* 0 <= x <= 2 */
+      SET_RESTORE_ROUNDL (FE_TONEAREST);
+      z = xx * xx;
+      p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D);
+      p = -TWOOPI / xx + p;
+      p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p;
+      return p;
+    }
+
+  /* X = x - 3 pi/4
+     cos(X) = cos(x) cos(3 pi/4) + sin(x) sin(3 pi/4)
+     = 1/sqrt(2) * (-cos(x) + sin(x))
+     sin(X) = sin(x) cos(3 pi/4) - cos(x) sin(3 pi/4)
+     = -1/sqrt(2) * (sin(x) + cos(x))
+     cf. Fdlibm.  */
+  __sincosl (xx, &s, &c);
+  ss = -s - c;
+  cc = s - c;
+  if (xx <= LDBL_MAX / 2)
+    {
+      z = __cosl (xx + xx);
+      if ((s * c) > 0)
+	cc = z / ss;
+      else
+	ss = z / cc;
+    }
+
+  if (xx > L(0x1p256))
+    return ONEOSQPI * ss / __ieee754_sqrtl (xx);
+
+  xinv = 1 / xx;
+  z = xinv * xinv;
+  if (xinv <= 0.25)
+    {
+      if (xinv <= 0.125)
+	{
+	  if (xinv <= 0.0625)
+	    {
+	      p = neval (z, P16_IN, NP16_IN) / deval (z, P16_ID, NP16_ID);
+	      q = neval (z, Q16_IN, NQ16_IN) / deval (z, Q16_ID, NQ16_ID);
+	    }
+	  else
+	    {
+	      p = neval (z, P8_16N, NP8_16N) / deval (z, P8_16D, NP8_16D);
+	      q = neval (z, Q8_16N, NQ8_16N) / deval (z, Q8_16D, NQ8_16D);
+	    }
+	}
+      else if (xinv <= 0.1875)
+	{
+	  p = neval (z, P5_8N, NP5_8N) / deval (z, P5_8D, NP5_8D);
+	  q = neval (z, Q5_8N, NQ5_8N) / deval (z, Q5_8D, NQ5_8D);
+	}
+      else
+	{
+	  p = neval (z, P4_5N, NP4_5N) / deval (z, P4_5D, NP4_5D);
+	  q = neval (z, Q4_5N, NQ4_5N) / deval (z, Q4_5D, NQ4_5D);
+	}
+    }				/* .25 */
+  else /* if (xinv <= 0.5) */
+    {
+      if (xinv <= 0.375)
+	{
+	  if (xinv <= 0.3125)
+	    {
+	      p = neval (z, P3r2_4N, NP3r2_4N) / deval (z, P3r2_4D, NP3r2_4D);
+	      q = neval (z, Q3r2_4N, NQ3r2_4N) / deval (z, Q3r2_4D, NQ3r2_4D);
+	    }
+	  else
+	    {
+	      p = neval (z, P2r7_3r2N, NP2r7_3r2N)
+		  / deval (z, P2r7_3r2D, NP2r7_3r2D);
+	      q = neval (z, Q2r7_3r2N, NQ2r7_3r2N)
+		  / deval (z, Q2r7_3r2D, NQ2r7_3r2D);
+	    }
+	}
+      else if (xinv <= 0.4375)
+	{
+	  p = neval (z, P2r3_2r7N, NP2r3_2r7N)
+	      / deval (z, P2r3_2r7D, NP2r3_2r7D);
+	  q = neval (z, Q2r3_2r7N, NQ2r3_2r7N)
+	      / deval (z, Q2r3_2r7D, NQ2r3_2r7D);
+	}
+      else
+	{
+	  p = neval (z, P2_2r3N, NP2_2r3N) / deval (z, P2_2r3D, NP2_2r3D);
+	  q = neval (z, Q2_2r3N, NQ2_2r3N) / deval (z, Q2_2r3D, NQ2_2r3D);
+	}
+    }
+  p = 1 + z * p;
+  q = z * q;
+  q = q * xinv + L(0.375) * xinv;
+  z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (xx);
+  return z;
+}
+strong_alias (__ieee754_y1l, __y1l_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
index 8ac8283bd8..f3e184c622 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -1,5 +1,998 @@
-/* Looks like we can use ieee854 e_lgammal_r.c as is for IBM extended format. */
+/* Natural logarithm of gamma function.  IBM Extended Precision version.
+   Copyright 2001 by Stephen L. Moshier <moshier@na-net.ornl.gov>
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_lgammal_r.c.  */
+
 #define _Float128 long double
 #define L(x) x ## L
-#include <sysdeps/ieee754/ldbl-128/e_lgammal_r.c>
 
+#include <math.h>
+#include <math_private.h>
+#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;
+
+/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
+   1/x <= 0.0741 (x >= 13.495...)
+   Peak relative error 1.5e-36  */
+static const _Float128 ls2pi = L(9.1893853320467274178032973640561763986140E-1);
+#define NRASY 12
+static const _Float128 RASY[NRASY + 1] =
+{
+  L(8.333333333333333333333333333310437112111E-2),
+ L(-2.777777777777777777777774789556228296902E-3),
+  L(7.936507936507936507795933938448586499183E-4),
+ L(-5.952380952380952041799269756378148574045E-4),
+  L(8.417508417507928904209891117498524452523E-4),
+ L(-1.917526917481263997778542329739806086290E-3),
+  L(6.410256381217852504446848671499409919280E-3),
+ L(-2.955064066900961649768101034477363301626E-2),
+  L(1.796402955865634243663453415388336954675E-1),
+ L(-1.391522089007758553455753477688592767741E0),
+  L(1.326130089598399157988112385013829305510E1),
+ L(-1.420412699593782497803472576479997819149E2),
+  L(1.218058922427762808938869872528846787020E3)
+};
+
+
+/* log gamma(x+13) = log gamma(13) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   12.5 <= x+13 <= 13.5
+   Peak relative error 1.1e-36  */
+static const _Float128 lgam13a = L(1.9987213134765625E1);
+static const _Float128 lgam13b = L(1.3608962611495173623870550785125024484248E-6);
+#define NRN13 7
+static const _Float128 RN13[NRN13 + 1] =
+{
+  L(8.591478354823578150238226576156275285700E11),
+  L(2.347931159756482741018258864137297157668E11),
+  L(2.555408396679352028680662433943000804616E10),
+  L(1.408581709264464345480765758902967123937E9),
+  L(4.126759849752613822953004114044451046321E7),
+  L(6.133298899622688505854211579222889943778E5),
+  L(3.929248056293651597987893340755876578072E3),
+  L(6.850783280018706668924952057996075215223E0)
+};
+#define NRD13 6
+static const _Float128 RD13[NRD13 + 1] =
+{
+  L(3.401225382297342302296607039352935541669E11),
+  L(8.756765276918037910363513243563234551784E10),
+  L(8.873913342866613213078554180987647243903E9),
+  L(4.483797255342763263361893016049310017973E8),
+  L(1.178186288833066430952276702931512870676E7),
+  L(1.519928623743264797939103740132278337476E5),
+  L(7.989298844938119228411117593338850892311E2)
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+12) = log gamma(12) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   11.5 <= x+12 <= 12.5
+   Peak relative error 4.1e-36  */
+static const _Float128 lgam12a = L(1.75023040771484375E1);
+static const _Float128 lgam12b = L(3.7687254483392876529072161996717039575982E-6);
+#define NRN12 7
+static const _Float128 RN12[NRN12 + 1] =
+{
+  L(4.709859662695606986110997348630997559137E11),
+  L(1.398713878079497115037857470168777995230E11),
+  L(1.654654931821564315970930093932954900867E10),
+  L(9.916279414876676861193649489207282144036E8),
+  L(3.159604070526036074112008954113411389879E7),
+  L(5.109099197547205212294747623977502492861E5),
+  L(3.563054878276102790183396740969279826988E3),
+  L(6.769610657004672719224614163196946862747E0)
+};
+#define NRD12 6
+static const _Float128 RD12[NRD12 + 1] =
+{
+  L(1.928167007860968063912467318985802726613E11),
+  L(5.383198282277806237247492369072266389233E10),
+  L(5.915693215338294477444809323037871058363E9),
+  L(3.241438287570196713148310560147925781342E8),
+  L(9.236680081763754597872713592701048455890E6),
+  L(1.292246897881650919242713651166596478850E5),
+  L(7.366532445427159272584194816076600211171E2)
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+11) = log gamma(11) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   10.5 <= x+11 <= 11.5
+   Peak relative error 1.8e-35  */
+static const _Float128 lgam11a = L(1.5104400634765625E1);
+static const _Float128 lgam11b = L(1.1938309890295225709329251070371882250744E-5);
+#define NRN11 7
+static const _Float128 RN11[NRN11 + 1] =
+{
+  L(2.446960438029415837384622675816736622795E11),
+  L(7.955444974446413315803799763901729640350E10),
+  L(1.030555327949159293591618473447420338444E10),
+  L(6.765022131195302709153994345470493334946E8),
+  L(2.361892792609204855279723576041468347494E7),
+  L(4.186623629779479136428005806072176490125E5),
+  L(3.202506022088912768601325534149383594049E3),
+  L(6.681356101133728289358838690666225691363E0)
+};
+#define NRD11 6
+static const _Float128 RD11[NRD11 + 1] =
+{
+  L(1.040483786179428590683912396379079477432E11),
+  L(3.172251138489229497223696648369823779729E10),
+  L(3.806961885984850433709295832245848084614E9),
+  L(2.278070344022934913730015420611609620171E8),
+  L(7.089478198662651683977290023829391596481E6),
+  L(1.083246385105903533237139380509590158658E5),
+  L(6.744420991491385145885727942219463243597E2)
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+10) = log gamma(10) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   9.5 <= x+10 <= 10.5
+   Peak relative error 5.4e-37  */
+static const _Float128 lgam10a = L(1.280181884765625E1);
+static const _Float128 lgam10b = L(8.6324252196112077178745667061642811492557E-6);
+#define NRN10 7
+static const _Float128 RN10[NRN10 + 1] =
+{
+  L(-1.239059737177249934158597996648808363783E14),
+  L(-4.725899566371458992365624673357356908719E13),
+  L(-7.283906268647083312042059082837754850808E12),
+  L(-5.802855515464011422171165179767478794637E11),
+  L(-2.532349691157548788382820303182745897298E10),
+  L(-5.884260178023777312587193693477072061820E8),
+  L(-6.437774864512125749845840472131829114906E6),
+  L(-2.350975266781548931856017239843273049384E4)
+};
+#define NRD10 7
+static const _Float128 RD10[NRD10 + 1] =
+{
+  L(-5.502645997581822567468347817182347679552E13),
+  L(-1.970266640239849804162284805400136473801E13),
+  L(-2.819677689615038489384974042561531409392E12),
+  L(-2.056105863694742752589691183194061265094E11),
+  L(-8.053670086493258693186307810815819662078E9),
+  L(-1.632090155573373286153427982504851867131E8),
+  L(-1.483575879240631280658077826889223634921E6),
+  L(-4.002806669713232271615885826373550502510E3)
+ /* 1.0E0L */
+};
+
+
+/* log gamma(x+9) = log gamma(9) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   8.5 <= x+9 <= 9.5
+   Peak relative error 3.6e-36  */
+static const _Float128 lgam9a = L(1.06045989990234375E1);
+static const _Float128 lgam9b = L(3.9037218127284172274007216547549861681400E-6);
+#define NRN9 7
+static const _Float128 RN9[NRN9 + 1] =
+{
+  L(-4.936332264202687973364500998984608306189E13),
+  L(-2.101372682623700967335206138517766274855E13),
+  L(-3.615893404644823888655732817505129444195E12),
+  L(-3.217104993800878891194322691860075472926E11),
+  L(-1.568465330337375725685439173603032921399E10),
+  L(-4.073317518162025744377629219101510217761E8),
+  L(-4.983232096406156139324846656819246974500E6),
+  L(-2.036280038903695980912289722995505277253E4)
+};
+#define NRD9 7
+static const _Float128 RD9[NRD9 + 1] =
+{
+  L(-2.306006080437656357167128541231915480393E13),
+  L(-9.183606842453274924895648863832233799950E12),
+  L(-1.461857965935942962087907301194381010380E12),
+  L(-1.185728254682789754150068652663124298303E11),
+  L(-5.166285094703468567389566085480783070037E9),
+  L(-1.164573656694603024184768200787835094317E8),
+  L(-1.177343939483908678474886454113163527909E6),
+  L(-3.529391059783109732159524500029157638736E3)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+8) = log gamma(8) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   7.5 <= x+8 <= 8.5
+   Peak relative error 2.4e-37  */
+static const _Float128 lgam8a = L(8.525146484375E0);
+static const _Float128 lgam8b = L(1.4876690414300165531036347125050759667737E-5);
+#define NRN8 8
+static const _Float128 RN8[NRN8 + 1] =
+{
+  L(6.600775438203423546565361176829139703289E11),
+  L(3.406361267593790705240802723914281025800E11),
+  L(7.222460928505293914746983300555538432830E10),
+  L(8.102984106025088123058747466840656458342E9),
+  L(5.157620015986282905232150979772409345927E8),
+  L(1.851445288272645829028129389609068641517E7),
+  L(3.489261702223124354745894067468953756656E5),
+  L(2.892095396706665774434217489775617756014E3),
+  L(6.596977510622195827183948478627058738034E0)
+};
+#define NRD8 7
+static const _Float128 RD8[NRD8 + 1] =
+{
+  L(3.274776546520735414638114828622673016920E11),
+  L(1.581811207929065544043963828487733970107E11),
+  L(3.108725655667825188135393076860104546416E10),
+  L(3.193055010502912617128480163681842165730E9),
+  L(1.830871482669835106357529710116211541839E8),
+  L(5.790862854275238129848491555068073485086E6),
+  L(9.305213264307921522842678835618803553589E4),
+  L(6.216974105861848386918949336819572333622E2)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+7) = log gamma(7) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   6.5 <= x+7 <= 7.5
+   Peak relative error 3.2e-36  */
+static const _Float128 lgam7a = L(6.5792388916015625E0);
+static const _Float128 lgam7b = L(1.2320408538495060178292903945321122583007E-5);
+#define NRN7 8
+static const _Float128 RN7[NRN7 + 1] =
+{
+  L(2.065019306969459407636744543358209942213E11),
+  L(1.226919919023736909889724951708796532847E11),
+  L(2.996157990374348596472241776917953749106E10),
+  L(3.873001919306801037344727168434909521030E9),
+  L(2.841575255593761593270885753992732145094E8),
+  L(1.176342515359431913664715324652399565551E7),
+  L(2.558097039684188723597519300356028511547E5),
+  L(2.448525238332609439023786244782810774702E3),
+  L(6.460280377802030953041566617300902020435E0)
+};
+#define NRD7 7
+static const _Float128 RD7[NRD7 + 1] =
+{
+  L(1.102646614598516998880874785339049304483E11),
+  L(6.099297512712715445879759589407189290040E10),
+  L(1.372898136289611312713283201112060238351E10),
+  L(1.615306270420293159907951633566635172343E9),
+  L(1.061114435798489135996614242842561967459E8),
+  L(3.845638971184305248268608902030718674691E6),
+  L(7.081730675423444975703917836972720495507E4),
+  L(5.423122582741398226693137276201344096370E2)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+6) = log gamma(6) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   5.5 <= x+6 <= 6.5
+   Peak relative error 6.2e-37  */
+static const _Float128 lgam6a = L(4.7874908447265625E0);
+static const _Float128 lgam6b = L(8.9805548349424770093452324304839959231517E-7);
+#define NRN6 8
+static const _Float128 RN6[NRN6 + 1] =
+{
+  L(-3.538412754670746879119162116819571823643E13),
+  L(-2.613432593406849155765698121483394257148E13),
+  L(-8.020670732770461579558867891923784753062E12),
+  L(-1.322227822931250045347591780332435433420E12),
+  L(-1.262809382777272476572558806855377129513E11),
+  L(-7.015006277027660872284922325741197022467E9),
+  L(-2.149320689089020841076532186783055727299E8),
+  L(-3.167210585700002703820077565539658995316E6),
+  L(-1.576834867378554185210279285358586385266E4)
+};
+#define NRD6 8
+static const _Float128 RD6[NRD6 + 1] =
+{
+  L(-2.073955870771283609792355579558899389085E13),
+  L(-1.421592856111673959642750863283919318175E13),
+  L(-4.012134994918353924219048850264207074949E12),
+  L(-6.013361045800992316498238470888523722431E11),
+  L(-5.145382510136622274784240527039643430628E10),
+  L(-2.510575820013409711678540476918249524123E9),
+  L(-6.564058379709759600836745035871373240904E7),
+  L(-7.861511116647120540275354855221373571536E5),
+  L(-2.821943442729620524365661338459579270561E3)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+5) = log gamma(5) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   4.5 <= x+5 <= 5.5
+   Peak relative error 3.4e-37  */
+static const _Float128 lgam5a = L(3.17803955078125E0);
+static const _Float128 lgam5b = L(1.4279566695619646941601297055408873990961E-5);
+#define NRN5 9
+static const _Float128 RN5[NRN5 + 1] =
+{
+  L(2.010952885441805899580403215533972172098E11),
+  L(1.916132681242540921354921906708215338584E11),
+  L(7.679102403710581712903937970163206882492E10),
+  L(1.680514903671382470108010973615268125169E10),
+  L(2.181011222911537259440775283277711588410E9),
+  L(1.705361119398837808244780667539728356096E8),
+  L(7.792391565652481864976147945997033946360E6),
+  L(1.910741381027985291688667214472560023819E5),
+  L(2.088138241893612679762260077783794329559E3),
+  L(6.330318119566998299106803922739066556550E0)
+};
+#define NRD5 8
+static const _Float128 RD5[NRD5 + 1] =
+{
+  L(1.335189758138651840605141370223112376176E11),
+  L(1.174130445739492885895466097516530211283E11),
+  L(4.308006619274572338118732154886328519910E10),
+  L(8.547402888692578655814445003283720677468E9),
+  L(9.934628078575618309542580800421370730906E8),
+  L(6.847107420092173812998096295422311820672E7),
+  L(2.698552646016599923609773122139463150403E6),
+  L(5.526516251532464176412113632726150253215E4),
+  L(4.772343321713697385780533022595450486932E2)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+4) = log gamma(4) +  x P(x)/Q(x)
+   -0.5 <= x <= 0.5
+   3.5 <= x+4 <= 4.5
+   Peak relative error 6.7e-37  */
+static const _Float128 lgam4a = L(1.791748046875E0);
+static const _Float128 lgam4b = L(1.1422353055000812477358380702272722990692E-5);
+#define NRN4 9
+static const _Float128 RN4[NRN4 + 1] =
+{
+  L(-1.026583408246155508572442242188887829208E13),
+  L(-1.306476685384622809290193031208776258809E13),
+  L(-7.051088602207062164232806511992978915508E12),
+  L(-2.100849457735620004967624442027793656108E12),
+  L(-3.767473790774546963588549871673843260569E11),
+  L(-4.156387497364909963498394522336575984206E10),
+  L(-2.764021460668011732047778992419118757746E9),
+  L(-1.036617204107109779944986471142938641399E8),
+  L(-1.895730886640349026257780896972598305443E6),
+  L(-1.180509051468390914200720003907727988201E4)
+};
+#define NRD4 9
+static const _Float128 RD4[NRD4 + 1] =
+{
+  L(-8.172669122056002077809119378047536240889E12),
+  L(-9.477592426087986751343695251801814226960E12),
+  L(-4.629448850139318158743900253637212801682E12),
+  L(-1.237965465892012573255370078308035272942E12),
+  L(-1.971624313506929845158062177061297598956E11),
+  L(-1.905434843346570533229942397763361493610E10),
+  L(-1.089409357680461419743730978512856675984E9),
+  L(-3.416703082301143192939774401370222822430E7),
+  L(-4.981791914177103793218433195857635265295E5),
+  L(-2.192507743896742751483055798411231453733E3)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+3) = log gamma(3) +  x P(x)/Q(x)
+   -0.25 <= x <= 0.5
+   2.75 <= x+3 <= 3.5
+   Peak relative error 6.0e-37  */
+static const _Float128 lgam3a = L(6.93145751953125E-1);
+static const _Float128 lgam3b = L(1.4286068203094172321214581765680755001344E-6);
+
+#define NRN3 9
+static const _Float128 RN3[NRN3 + 1] =
+{
+  L(-4.813901815114776281494823863935820876670E11),
+  L(-8.425592975288250400493910291066881992620E11),
+  L(-6.228685507402467503655405482985516909157E11),
+  L(-2.531972054436786351403749276956707260499E11),
+  L(-6.170200796658926701311867484296426831687E10),
+  L(-9.211477458528156048231908798456365081135E9),
+  L(-8.251806236175037114064561038908691305583E8),
+  L(-4.147886355917831049939930101151160447495E7),
+  L(-1.010851868928346082547075956946476932162E6),
+  L(-8.333374463411801009783402800801201603736E3)
+};
+#define NRD3 9
+static const _Float128 RD3[NRD3 + 1] =
+{
+  L(-5.216713843111675050627304523368029262450E11),
+  L(-8.014292925418308759369583419234079164391E11),
+  L(-5.180106858220030014546267824392678611990E11),
+  L(-1.830406975497439003897734969120997840011E11),
+  L(-3.845274631904879621945745960119924118925E10),
+  L(-4.891033385370523863288908070309417710903E9),
+  L(-3.670172254411328640353855768698287474282E8),
+  L(-1.505316381525727713026364396635522516989E7),
+  L(-2.856327162923716881454613540575964890347E5),
+  L(-1.622140448015769906847567212766206894547E3)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+2.5) = log gamma(2.5) +  x P(x)/Q(x)
+   -0.125 <= x <= 0.25
+   2.375 <= x+2.5 <= 2.75  */
+static const _Float128 lgam2r5a = L(2.8466796875E-1);
+static const _Float128 lgam2r5b = L(1.4901722919159632494669682701924320137696E-5);
+#define NRN2r5 8
+static const _Float128 RN2r5[NRN2r5 + 1] =
+{
+  L(-4.676454313888335499356699817678862233205E9),
+  L(-9.361888347911187924389905984624216340639E9),
+  L(-7.695353600835685037920815799526540237703E9),
+  L(-3.364370100981509060441853085968900734521E9),
+  L(-8.449902011848163568670361316804900559863E8),
+  L(-1.225249050950801905108001246436783022179E8),
+  L(-9.732972931077110161639900388121650470926E6),
+  L(-3.695711763932153505623248207576425983573E5),
+  L(-4.717341584067827676530426007495274711306E3)
+};
+#define NRD2r5 8
+static const _Float128 RD2r5[NRD2r5 + 1] =
+{
+  L(-6.650657966618993679456019224416926875619E9),
+  L(-1.099511409330635807899718829033488771623E10),
+  L(-7.482546968307837168164311101447116903148E9),
+  L(-2.702967190056506495988922973755870557217E9),
+  L(-5.570008176482922704972943389590409280950E8),
+  L(-6.536934032192792470926310043166993233231E7),
+  L(-4.101991193844953082400035444146067511725E6),
+  L(-1.174082735875715802334430481065526664020E5),
+  L(-9.932840389994157592102947657277692978511E2)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+2) = x P(x)/Q(x)
+   -0.125 <= x <= +0.375
+   1.875 <= x+2 <= 2.375
+   Peak relative error 4.6e-36  */
+#define NRN2 9
+static const _Float128 RN2[NRN2 + 1] =
+{
+  L(-3.716661929737318153526921358113793421524E9),
+  L(-1.138816715030710406922819131397532331321E10),
+  L(-1.421017419363526524544402598734013569950E10),
+  L(-9.510432842542519665483662502132010331451E9),
+  L(-3.747528562099410197957514973274474767329E9),
+  L(-8.923565763363912474488712255317033616626E8),
+  L(-1.261396653700237624185350402781338231697E8),
+  L(-9.918402520255661797735331317081425749014E6),
+  L(-3.753996255897143855113273724233104768831E5),
+  L(-4.778761333044147141559311805999540765612E3)
+};
+#define NRD2 9
+static const _Float128 RD2[NRD2 + 1] =
+{
+  L(-8.790916836764308497770359421351673950111E9),
+  L(-2.023108608053212516399197678553737477486E10),
+  L(-1.958067901852022239294231785363504458367E10),
+  L(-1.035515043621003101254252481625188704529E10),
+  L(-3.253884432621336737640841276619272224476E9),
+  L(-6.186383531162456814954947669274235815544E8),
+  L(-6.932557847749518463038934953605969951466E7),
+  L(-4.240731768287359608773351626528479703758E6),
+  L(-1.197343995089189188078944689846348116630E5),
+  L(-1.004622911670588064824904487064114090920E3)
+/* 1.0E0 */
+};
+
+
+/* log gamma(x+1.75) = log gamma(1.75) +  x P(x)/Q(x)
+   -0.125 <= x <= +0.125
+   1.625 <= x+1.75 <= 1.875
+   Peak relative error 9.2e-37 */
+static const _Float128 lgam1r75a = L(-8.441162109375E-2);
+static const _Float128 lgam1r75b = L(1.0500073264444042213965868602268256157604E-5);
+#define NRN1r75 8
+static const _Float128 RN1r75[NRN1r75 + 1] =
+{
+  L(-5.221061693929833937710891646275798251513E7),
+  L(-2.052466337474314812817883030472496436993E8),
+  L(-2.952718275974940270675670705084125640069E8),
+  L(-2.132294039648116684922965964126389017840E8),
+  L(-8.554103077186505960591321962207519908489E7),
+  L(-1.940250901348870867323943119132071960050E7),
+  L(-2.379394147112756860769336400290402208435E6),
+  L(-1.384060879999526222029386539622255797389E5),
+  L(-2.698453601378319296159355612094598695530E3)
+};
+#define NRD1r75 8
+static const _Float128 RD1r75[NRD1r75 + 1] =
+{
+  L(-2.109754689501705828789976311354395393605E8),
+  L(-5.036651829232895725959911504899241062286E8),
+  L(-4.954234699418689764943486770327295098084E8),
+  L(-2.589558042412676610775157783898195339410E8),
+  L(-7.731476117252958268044969614034776883031E7),
+  L(-1.316721702252481296030801191240867486965E7),
+  L(-1.201296501404876774861190604303728810836E6),
+  L(-5.007966406976106636109459072523610273928E4),
+  L(-6.155817990560743422008969155276229018209E2)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+x0) = y0 +  x^2 P(x)/Q(x)
+   -0.0867 <= x <= +0.1634
+   1.374932... <= x+x0 <= 1.625032...
+   Peak relative error 4.0e-36  */
+static const _Float128 x0a = L(1.4616241455078125);
+static const _Float128 x0b = L(7.9994605498412626595423257213002588621246E-6);
+static const _Float128 y0a = L(-1.21490478515625E-1);
+static const _Float128 y0b = L(4.1879797753919044854428223084178486438269E-6);
+#define NRN1r5 8
+static const _Float128 RN1r5[NRN1r5 + 1] =
+{
+  L(6.827103657233705798067415468881313128066E5),
+  L(1.910041815932269464714909706705242148108E6),
+  L(2.194344176925978377083808566251427771951E6),
+  L(1.332921400100891472195055269688876427962E6),
+  L(4.589080973377307211815655093824787123508E5),
+  L(8.900334161263456942727083580232613796141E4),
+  L(9.053840838306019753209127312097612455236E3),
+  L(4.053367147553353374151852319743594873771E2),
+  L(5.040631576303952022968949605613514584950E0)
+};
+#define NRD1r5 8
+static const _Float128 RD1r5[NRD1r5 + 1] =
+{
+  L(1.411036368843183477558773688484699813355E6),
+  L(4.378121767236251950226362443134306184849E6),
+  L(5.682322855631723455425929877581697918168E6),
+  L(3.999065731556977782435009349967042222375E6),
+  L(1.653651390456781293163585493620758410333E6),
+  L(4.067774359067489605179546964969435858311E5),
+  L(5.741463295366557346748361781768833633256E4),
+  L(4.226404539738182992856094681115746692030E3),
+  L(1.316980975410327975566999780608618774469E2),
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x+1.25) = log gamma(1.25) +  x P(x)/Q(x)
+   -.125 <= x <= +.125
+   1.125 <= x+1.25 <= 1.375
+   Peak relative error = 4.9e-36 */
+static const _Float128 lgam1r25a = L(-9.82818603515625E-2);
+static const _Float128 lgam1r25b = L(1.0023929749338536146197303364159774377296E-5);
+#define NRN1r25 9
+static const _Float128 RN1r25[NRN1r25 + 1] =
+{
+  L(-9.054787275312026472896002240379580536760E4),
+  L(-8.685076892989927640126560802094680794471E4),
+  L(2.797898965448019916967849727279076547109E5),
+  L(6.175520827134342734546868356396008898299E5),
+  L(5.179626599589134831538516906517372619641E5),
+  L(2.253076616239043944538380039205558242161E5),
+  L(5.312653119599957228630544772499197307195E4),
+  L(6.434329437514083776052669599834938898255E3),
+  L(3.385414416983114598582554037612347549220E2),
+  L(4.907821957946273805080625052510832015792E0)
+};
+#define NRD1r25 8
+static const _Float128 RD1r25[NRD1r25 + 1] =
+{
+  L(3.980939377333448005389084785896660309000E5),
+  L(1.429634893085231519692365775184490465542E6),
+  L(2.145438946455476062850151428438668234336E6),
+  L(1.743786661358280837020848127465970357893E6),
+  L(8.316364251289743923178092656080441655273E5),
+  L(2.355732939106812496699621491135458324294E5),
+  L(3.822267399625696880571810137601310855419E4),
+  L(3.228463206479133236028576845538387620856E3),
+  L(1.152133170470059555646301189220117965514E2)
+  /* 1.0E0L */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+   0.0 <= x <= +0.125
+   1.0 <= x+1 <= 1.125
+   Peak relative error 1.1e-35  */
+#define NRN1 8
+static const _Float128 RN1[NRN1 + 1] =
+{
+  L(-9.987560186094800756471055681088744738818E3),
+  L(-2.506039379419574361949680225279376329742E4),
+  L(-1.386770737662176516403363873617457652991E4),
+  L(1.439445846078103202928677244188837130744E4),
+  L(2.159612048879650471489449668295139990693E4),
+  L(1.047439813638144485276023138173676047079E4),
+  L(2.250316398054332592560412486630769139961E3),
+  L(1.958510425467720733041971651126443864041E2),
+  L(4.516830313569454663374271993200291219855E0)
+};
+#define NRD1 7
+static const _Float128 RD1[NRD1 + 1] =
+{
+  L(1.730299573175751778863269333703788214547E4),
+  L(6.807080914851328611903744668028014678148E4),
+  L(1.090071629101496938655806063184092302439E5),
+  L(9.124354356415154289343303999616003884080E4),
+  L(4.262071638655772404431164427024003253954E4),
+  L(1.096981664067373953673982635805821283581E4),
+  L(1.431229503796575892151252708527595787588E3),
+  L(7.734110684303689320830401788262295992921E1)
+ /* 1.0E0 */
+};
+
+
+/* log gamma(x + 1) = x P(x)/Q(x)
+   -0.125 <= x <= 0
+   0.875 <= x+1 <= 1.0
+   Peak relative error 7.0e-37  */
+#define NRNr9 8
+static const _Float128 RNr9[NRNr9 + 1] =
+{
+  L(4.441379198241760069548832023257571176884E5),
+  L(1.273072988367176540909122090089580368732E6),
+  L(9.732422305818501557502584486510048387724E5),
+  L(-5.040539994443998275271644292272870348684E5),
+  L(-1.208719055525609446357448132109723786736E6),
+  L(-7.434275365370936547146540554419058907156E5),
+  L(-2.075642969983377738209203358199008185741E5),
+  L(-2.565534860781128618589288075109372218042E4),
+  L(-1.032901669542994124131223797515913955938E3),
+};
+#define NRDr9 8
+static const _Float128 RDr9[NRDr9 + 1] =
+{
+  L(-7.694488331323118759486182246005193998007E5),
+  L(-3.301918855321234414232308938454112213751E6),
+  L(-5.856830900232338906742924836032279404702E6),
+  L(-5.540672519616151584486240871424021377540E6),
+  L(-3.006530901041386626148342989181721176919E6),
+  L(-9.350378280513062139466966374330795935163E5),
+  L(-1.566179100031063346901755685375732739511E5),
+  L(-1.205016539620260779274902967231510804992E4),
+  L(-2.724583156305709733221564484006088794284E2)
+/* 1.0E0 */
+};
+
+
+/* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
+
+static _Float128
+neval (_Float128 x, const _Float128 *p, int n)
+{
+  _Float128 y;
+
+  p += n;
+  y = *p--;
+  do
+    {
+      y = y * x + *p--;
+    }
+  while (--n > 0);
+  return y;
+}
+
+
+/* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
+
+static _Float128
+deval (_Float128 x, const _Float128 *p, int n)
+{
+  _Float128 y;
+
+  p += n;
+  y = x + *p--;
+  do
+    {
+      y = y * x + *p--;
+    }
+  while (--n > 0);
+  return y;
+}
+
+
+_Float128
+__ieee754_lgammal_r (_Float128 x, int *signgamp)
+{
+  _Float128 p, q, w, z, nx;
+  int i, nn;
+
+  *signgamp = 1;
+
+  if (! isfinite (x))
+    return x * x;
+
+  if (x == 0)
+    {
+      if (signbit (x))
+	*signgamp = -1;
+    }
+
+  if (x < 0)
+    {
+      if (x < -2 && x > (LDBL_MANT_DIG == 106 ? -48 : -50))
+	return __lgamma_negl (x, signgamp);
+      q = -x;
+      p = __floorl (q);
+      if (p == q)
+	return (one / __fabsl (p - p));
+      _Float128 halfp = p * L(0.5);
+      if (halfp == __floorl (halfp))
+	*signgamp = -1;
+      else
+	*signgamp = 1;
+      if (q < L(0x1p-120))
+	return -__logl (q);
+      z = q - p;
+      if (z > L(0.5))
+	{
+	  p += 1;
+	  z = p - q;
+	}
+      z = q * __sinl (PIL * z);
+      w = __ieee754_lgammal_r (q, &i);
+      z = __logl (PIL / z) - w;
+      return (z);
+    }
+
+  if (x < L(13.5))
+    {
+      p = 0;
+      nx = __floorl (x + L(0.5));
+      nn = nx;
+      switch (nn)
+	{
+	case 0:
+	  /* log gamma (x + 1) = log(x) + log gamma(x) */
+	  if (x < L(0x1p-120))
+	    return -__logl (x);
+	  else if (x <= 0.125)
+	    {
+	      p = x * neval (x, RN1, NRN1) / deval (x, RD1, NRD1);
+	    }
+	  else if (x <= 0.375)
+	    {
+	      z = x - L(0.25);
+	      p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+	      p += lgam1r25b;
+	      p += lgam1r25a;
+	    }
+	  else if (x <= 0.625)
+	    {
+	      z = x + (1 - x0a);
+	      z = z - x0b;
+	      p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+	      p = p * z * z;
+	      p = p + y0b;
+	      p = p + y0a;
+	    }
+	  else if (x <= 0.875)
+	    {
+	      z = x - L(0.75);
+	      p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+	      p += lgam1r75b;
+	      p += lgam1r75a;
+	    }
+	  else
+	    {
+	      z = x - 1;
+	      p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+	    }
+	  p = p - __logl (x);
+	  break;
+
+	case 1:
+	  if (x < L(0.875))
+	    {
+	      if (x <= 0.625)
+		{
+		  z = x + (1 - x0a);
+		  z = z - x0b;
+		  p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+		  p = p * z * z;
+		  p = p + y0b;
+		  p = p + y0a;
+		}
+	      else if (x <= 0.875)
+		{
+		  z = x - L(0.75);
+		  p = z * neval (z, RN1r75, NRN1r75)
+			/ deval (z, RD1r75, NRD1r75);
+		  p += lgam1r75b;
+		  p += lgam1r75a;
+		}
+	      else
+		{
+		  z = x - 1;
+		  p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+		}
+	      p = p - __logl (x);
+	    }
+	  else if (x < 1)
+	    {
+	      z = x - 1;
+	      p = z * neval (z, RNr9, NRNr9) / deval (z, RDr9, NRDr9);
+	    }
+	  else if (x == 1)
+	    p = 0;
+	  else if (x <= L(1.125))
+	    {
+	      z = x - 1;
+	      p = z * neval (z, RN1, NRN1) / deval (z, RD1, NRD1);
+	    }
+	  else if (x <= 1.375)
+	    {
+	      z = x - L(1.25);
+	      p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
+	      p += lgam1r25b;
+	      p += lgam1r25a;
+	    }
+	  else
+	    {
+	      /* 1.375 <= x+x0 <= 1.625 */
+	      z = x - x0a;
+	      z = z - x0b;
+	      p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+	      p = p * z * z;
+	      p = p + y0b;
+	      p = p + y0a;
+	    }
+	  break;
+
+	case 2:
+	  if (x < L(1.625))
+	    {
+	      z = x - x0a;
+	      z = z - x0b;
+	      p = neval (z, RN1r5, NRN1r5) / deval (z, RD1r5, NRD1r5);
+	      p = p * z * z;
+	      p = p + y0b;
+	      p = p + y0a;
+	    }
+	  else if (x < L(1.875))
+	    {
+	      z = x - L(1.75);
+	      p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
+	      p += lgam1r75b;
+	      p += lgam1r75a;
+	    }
+	  else if (x == 2)
+	    p = 0;
+	  else if (x < L(2.375))
+	    {
+	      z = x - 2;
+	      p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
+	    }
+	  else
+	    {
+	      z = x - L(2.5);
+	      p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+	      p += lgam2r5b;
+	      p += lgam2r5a;
+	    }
+	  break;
+
+	case 3:
+	  if (x < 2.75)
+	    {
+	      z = x - L(2.5);
+	      p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
+	      p += lgam2r5b;
+	      p += lgam2r5a;
+	    }
+	  else
+	    {
+	      z = x - 3;
+	      p = z * neval (z, RN3, NRN3) / deval (z, RD3, NRD3);
+	      p += lgam3b;
+	      p += lgam3a;
+	    }
+	  break;
+
+	case 4:
+	  z = x - 4;
+	  p = z * neval (z, RN4, NRN4) / deval (z, RD4, NRD4);
+	  p += lgam4b;
+	  p += lgam4a;
+	  break;
+
+	case 5:
+	  z = x - 5;
+	  p = z * neval (z, RN5, NRN5) / deval (z, RD5, NRD5);
+	  p += lgam5b;
+	  p += lgam5a;
+	  break;
+
+	case 6:
+	  z = x - 6;
+	  p = z * neval (z, RN6, NRN6) / deval (z, RD6, NRD6);
+	  p += lgam6b;
+	  p += lgam6a;
+	  break;
+
+	case 7:
+	  z = x - 7;
+	  p = z * neval (z, RN7, NRN7) / deval (z, RD7, NRD7);
+	  p += lgam7b;
+	  p += lgam7a;
+	  break;
+
+	case 8:
+	  z = x - 8;
+	  p = z * neval (z, RN8, NRN8) / deval (z, RD8, NRD8);
+	  p += lgam8b;
+	  p += lgam8a;
+	  break;
+
+	case 9:
+	  z = x - 9;
+	  p = z * neval (z, RN9, NRN9) / deval (z, RD9, NRD9);
+	  p += lgam9b;
+	  p += lgam9a;
+	  break;
+
+	case 10:
+	  z = x - 10;
+	  p = z * neval (z, RN10, NRN10) / deval (z, RD10, NRD10);
+	  p += lgam10b;
+	  p += lgam10a;
+	  break;
+
+	case 11:
+	  z = x - 11;
+	  p = z * neval (z, RN11, NRN11) / deval (z, RD11, NRD11);
+	  p += lgam11b;
+	  p += lgam11a;
+	  break;
+
+	case 12:
+	  z = x - 12;
+	  p = z * neval (z, RN12, NRN12) / deval (z, RD12, NRD12);
+	  p += lgam12b;
+	  p += lgam12a;
+	  break;
+
+	case 13:
+	  z = x - 13;
+	  p = z * neval (z, RN13, NRN13) / deval (z, RD13, NRD13);
+	  p += lgam13b;
+	  p += lgam13a;
+	  break;
+	}
+      return p;
+    }
+
+  if (x > MAXLGM)
+    return (*signgamp * huge * huge);
+
+  if (x > L(0x1p120))
+    return x * (__logl (x) - 1);
+  q = ls2pi - x;
+  q = (x - L(0.5)) * __logl (x) + q;
+  if (x > L(1.0e18))
+    return (q);
+
+  p = 1 / (x * x);
+  q += neval (p, RASY, NRASY) / x;
+  return (q);
+}
+strong_alias (__ieee754_lgammal_r, __lgammal_r_finite)
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
index 64bfc46414..615707ca98 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
@@ -1,10 +1,104 @@
-/* Looks like we can use ieee854 s_cbrtl.c as is for IBM extended format. */
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+/* Implementation of cbrtl.  IBM Extended Precision version.
+   Cephes Math Library Release 2.2: January, 1991
+   Copyright 1984, 1991 by Stephen L. Moshier
+   Adapted for glibc October, 2001.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c.  */
 
 #define _Float128 long double
 #define L(x) x ## L
 
-#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
+#include <math_ldbl_opt.h>
+#include <math.h>
+#include <math_private.h>
+
+static const _Float128 CBRT2 = L(1.259921049894873164767210607278228350570251);
+static const _Float128 CBRT4 = L(1.587401051968199474751705639272308260391493);
+static const _Float128 CBRT2I = L(0.7937005259840997373758528196361541301957467);
+static const _Float128 CBRT4I = L(0.6299605249474365823836053036391141752851257);
+
+
+_Float128
+__cbrtl (_Float128 x)
+{
+  int e, rem, sign;
+  _Float128 z;
+
+  if (!isfinite (x))
+    return x + x;
+
+  if (x == 0)
+    return (x);
+
+  if (x > 0)
+    sign = 1;
+  else
+    {
+      sign = -1;
+      x = -x;
+    }
+
+  z = x;
+ /* extract power of 2, leaving mantissa between 0.5 and 1  */
+  x = __frexpl (x, &e);
+
+  /* Approximate cube root of number between .5 and 1,
+     peak relative error = 1.2e-6  */
+  x = ((((L(1.3584464340920900529734e-1) * x
+	  - L(6.3986917220457538402318e-1)) * x
+	 + L(1.2875551670318751538055e0)) * x
+	- L(1.4897083391357284957891e0)) * x
+       + L(1.3304961236013647092521e0)) * x + L(3.7568280825958912391243e-1);
+
+  /* exponent divided by 3 */
+  if (e >= 0)
+    {
+      rem = e;
+      e /= 3;
+      rem -= 3 * e;
+      if (rem == 1)
+	x *= CBRT2;
+      else if (rem == 2)
+	x *= CBRT4;
+    }
+  else
+    {				/* argument less than 1 */
+      e = -e;
+      rem = e;
+      e /= 3;
+      rem -= 3 * e;
+      if (rem == 1)
+	x *= CBRT2I;
+      else if (rem == 2)
+	x *= CBRT4I;
+      e = -e;
+    }
+
+  /* multiply by power of 2 */
+  x = __ldexpl (x, e);
+
+  /* Newton iteration */
+  x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+  x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+  x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+
+  if (sign < 0)
+    x = -x;
+  return (x);
+}
+
 long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_expl.h b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
new file mode 100644
index 0000000000..0ab0877301
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
@@ -0,0 +1,972 @@
+/* Accurate table for expl().
+   Copyright (C) 1999-2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* __expl_table basically consists of four tables, T_EXPL_ARG{1,2} and
+   T_EXPL_RES{1,2}. All tables use positive and negative indexes, the 0 points
+   are marked by T_EXPL_* defines.
+   For ARG1 and RES1 tables lets B be 89 and S 256.0, for ARG2 and RES2 B is 65
+   and S 32768.0.
+   These table have the property that, for all integers -B <= i <= B
+   expl(__expl_table[T_EXPL_ARGN+2*i]+__expl_table[T_EXPL_ARGN+2*i+1]+r) ==
+   __expl_table[T_EXPL_RESN+i], __expl_table[T_EXPL_RESN+i] is some exact number
+   with the low 58 bits of the mantissa 0,
+   __expl_table[T_EXPL_ARGN+2*i] == i/S+s
+   where absl(s) <= 2^-54 and absl(r) <= 2^-212.  */
+
+#define _Float128 long double
+#define L(x) x ## L
+
+static const _Float128 __expl_table [] = {
+ L(-3.47656250000000000584188889839535373E-01), /* bffd640000000000002b1b04213cf000 */
+  L(6.90417668990715641167244540876988960E-32), /* 3f97667c3fdb588a6ae1af8748357a17 */
+ L(-3.43749999999999981853132895957607418E-01), /* bffd5ffffffffffffac4ff5f4050b000 */
+ L(-7.16021898043268093462818380603370350E-33), /* bf94296c8219427edc1431ac2498583e */
+ L(-3.39843750000000013418643523138766329E-01), /* bffd5c000000000003de1f027a30e000 */
+  L(8.16920774283317801641347327589583265E-32), /* 3f97a82b65774bdca1b4440d749ed8d3 */
+ L(-3.35937500000000014998092453039303051E-01), /* bffd5800000000000452a9f4d8857000 */
+ L(-6.55865578425428447938248396879359670E-32), /* bf97548b7d240f3d034b395e6eecfac8 */
+ L(-3.32031250000000000981984049529998541E-01), /* bffd540000000000004875277cda5000 */
+  L(6.91213046334032232108944519541512737E-32), /* 3f9766e5f925338a19045c94443b66e1 */
+ L(-3.28124999999999986646017645350399708E-01), /* bffd4ffffffffffffc26a667bf44d000 */
+ L(-6.16281060996110316602421505683742661E-32), /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
+ L(-3.24218749999999991645717430645867963E-01), /* bffd4bfffffffffffd97901063e48000 */
+ L(-7.90797211087760527593856542417304137E-32), /* bf979a9afaaca1ada6a8ed1c80584d60 */
+ L(-3.20312499999999998918211610690789652E-01), /* bffd47ffffffffffffb02d9856d71000 */
+  L(8.64024799457616856987630373786503376E-32), /* 3f97c0a098623f95579d5d9b2b67342d */
+ L(-3.16406249999999998153974811017181883E-01), /* bffd43ffffffffffff77c991f1076000 */
+ L(-2.73176610180696076418536105483668404E-32), /* bf961baeccb32f9b1fcbb8e60468e95a */
+ L(-3.12500000000000011420976192575972779E-01), /* bffd400000000000034ab8240483d000 */
+  L(7.16573502812389453744433792609989420E-32), /* 3f977410f4c2cfc4335f28446c0fb363 */
+ L(-3.08593750000000001735496343854851414E-01), /* bffd3c000000000000800e995c176000 */
+ L(-1.56292999645122272621237565671593071E-32), /* bf95449b9cbdaff6ac1246adb2c826ac */
+ L(-3.04687499999999982592401295899221626E-01), /* bffd37fffffffffffafb8bc1e061a000 */
+  L(6.48993208584888904958594509625158417E-32), /* 3f9750f9fe8366d82d77afa0031a92e1 */
+ L(-3.00781249999999999230616898937763959E-01), /* bffd33ffffffffffffc73ac39da54000 */
+  L(6.57082437496961397305801409357792029E-32), /* 3f97552d3cb598ea80135cf3feb27ec4 */
+ L(-2.96874999999999998788769281703245722E-01), /* bffd2fffffffffffffa6a07fa5021000 */
+ L(-3.26588297198283968096426564544269170E-32), /* bf9653260fc1802f46b629aee171809b */
+ L(-2.92968750000000015318089182805941695E-01), /* bffd2c0000000000046a468614bd6000 */
+ L(-1.73291974845198589684358727559290718E-32), /* bf9567e9d158f52e483c8d8dcb5961dd */
+ L(-2.89062500000000007736778942676309681E-01), /* bffd280000000000023adf9f4c3d3000 */
+ L(-6.83629745986675744404029225571026236E-32), /* bf9762f5face6281c1daf1c6aedbdb45 */
+ L(-2.85156250000000001367091555763661937E-01), /* bffd2400000000000064dfa11e3fb000 */
+ L(-5.44898442619766878281110054067026237E-32), /* bf971aed6d2db9f542986a785edae072 */
+ L(-2.81249999999999986958718100227029406E-01), /* bffd1ffffffffffffc3db9265ca9d000 */
+  L(1.13007318374506125723591889451107046E-32), /* 3f94d569fe387f456a97902907ac3856 */
+ L(-2.77343750000000000356078829380495179E-01), /* bffd1c0000000000001a462390083000 */
+ L(-4.98979365468978332358409063436543102E-32), /* bf970315bbf3e0d14b5c94c900702d4c */
+ L(-2.73437499999999990276993957508540484E-01), /* bffd17fffffffffffd32919bcdc94000 */
+ L(-8.79390484115892344533724650295100871E-32), /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
+ L(-2.69531250000000002434203866460082225E-01), /* bffd14000000000000b39ccf9e130000 */
+  L(9.44060754687026590886751809927191596E-32), /* 3f97ea2f32cfecca5c64a26137a9210f */
+ L(-2.65624999999999997296320716986257179E-01), /* bffd0fffffffffffff3880f13a2bc000 */
+  L(2.07142664067265697791007875348396921E-32), /* 3f95ae37ee685b9122fbe377bd205ee4 */
+ L(-2.61718750000000010237478733739017956E-01), /* bffd0c000000000002f3648179d40000 */
+ L(-6.10552936159265665298996309192680256E-32), /* bf973d0467d31e407515a3cca0f3b4e2 */
+ L(-2.57812500000000011948220522778370303E-01), /* bffd08000000000003719f81275bd000 */
+  L(6.72477169058908902499239631466443836E-32), /* 3f975d2b8c475d3160cf72d227d8e6f9 */
+ L(-2.53906249999999991822993360536596860E-01), /* bffd03fffffffffffda4a4b62f818000 */
+ L(-2.44868296623215865054704392917190994E-32), /* bf95fc92516c6d057d29fc2528855976 */
+ L(-2.49999999999999986862019457428548084E-01), /* bffcfffffffffffff86d2d20d5ff4000 */
+ L(-3.85302898949105073614122724961613078E-32), /* bf96901f147cb7d643af71b6129ce929 */
+ L(-2.46093750000000000237554160737318435E-01), /* bffcf8000000000000230e8ade26b000 */
+ L(-1.52823675242678363494345369284988589E-32), /* bf953d6700c5f3fc303f79d0ec8c680a */
+ L(-2.42187500000000003023380963205457065E-01), /* bffcf0000000000001be2c1a78bb0000 */
+ L(-7.78402037952209709489481182714311699E-34), /* bf9102ab1f3998e887f0ee4cf940faa5 */
+ L(-2.38281249999999995309623303145485725E-01), /* bffce7fffffffffffd4bd2940f43f000 */
+ L(-3.54307216794236899443913216397197696E-32), /* bf966fef03ab69c3f289436205b21d02 */
+ L(-2.34374999999999998425804947623207526E-01), /* bffcdfffffffffffff17b097a6092000 */
+ L(-2.86038428948386602859761879407549696E-32), /* bf96290a0eba0131efe3a05fe188f2e3 */
+ L(-2.30468749999999993822207406785200832E-01), /* bffcd7fffffffffffc70519834eae000 */
+ L(-2.54339521031747516806893838749365762E-32), /* bf96081f0ad7f9107ae6cddb32c178ab */
+ L(-2.26562499999999997823524030344489884E-01), /* bffccffffffffffffebecf10093df000 */
+  L(4.31904611473158635644635628922959401E-32), /* 3f96c083f0b1faa7c4c686193e38d67c */
+ L(-2.22656250000000004835132405125162742E-01), /* bffcc8000000000002c98a233f19f000 */
+  L(2.54709791629335691650310168420597566E-33), /* 3f92a735903f5eed07a716ab931e20d9 */
+ L(-2.18749999999999988969454021829236626E-01), /* bffcbffffffffffff9a42dc14ce36000 */
+ L(-3.77236096429336082213752014054909454E-32), /* bf9687be8e5b2fca54d3e81157eac660 */
+ L(-2.14843750000000010613256919115758495E-01), /* bffcb80000000000061e3d828ecac000 */
+ L(-4.55194148712216691177097854305964738E-32), /* bf96d8b35c776aa3e1a4768271380503 */
+ L(-2.10937499999999993204656148110447201E-01), /* bffcaffffffffffffc152f2aea118000 */
+ L(-2.95044199165561453749332254271716417E-32), /* bf96326433b00b2439094d9bef22ddd1 */
+ L(-2.07031250000000012233944895423355677E-01), /* bffca80000000000070d695ee0e94000 */
+  L(1.93146788688385419095981415411012357E-32), /* 3f959126729135a5e390d4bb802a0bde */
+ L(-2.03125000000000008030983633336321863E-01), /* bffca0000000000004a129fbc51af000 */
+  L(2.37361904671826193563212931215900137E-32), /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
+ L(-1.99218750000000001763815712796132779E-01), /* bffc98000000000001044b12d9950000 */
+ L(-3.63171243370923753295192486732883239E-33), /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
+ L(-1.95312500000000004883660234506677272E-01), /* bffc90000000000002d0b3779d1f9000 */
+ L(-3.19989507343607877747980892249711601E-33), /* bf9309d63de96bb3ef744c865f22f1bd */
+ L(-1.91406250000000013720152363227519348E-01), /* bffc88000000000007e8bcb387121000 */
+ L(-1.89295754093147174148371614722178860E-32), /* bf958926e2e67dfe812c508290add2e7 */
+ L(-1.87500000000000000182342082774432620E-01), /* bffc800000000000001ae8b06a39f000 */
+ L(-2.96812835183184815200854214892983927E-32), /* bf96343a62d156bbe71f55d14ca4b6e5 */
+ L(-1.83593750000000012410147185883290345E-01), /* bffc78000000000007276a1adda8d000 */
+ L(-2.02191931237489669058466239995304587E-32), /* bf95a3efab92d26ec2df90df036a117f */
+ L(-1.79687499999999997439177363346082917E-01), /* bffc6ffffffffffffe8616db2927d000 */
+ L(-9.92752326937775530007399526834009465E-33), /* bf949c5f88ed17041e1a3f1829d543cd */
+ L(-1.75781249999999995824373974504785174E-01), /* bffc67fffffffffffd97c94f13ea3000 */
+  L(1.44184772065335613487885714828816178E-32), /* 3f952b75c63476e7fcc2f5841c27bcce */
+ L(-1.71874999999999986685050259043077809E-01), /* bffc5ffffffffffff8530f6bc531a000 */
+ L(-3.49007014971241147689894940544402482E-32), /* bf966a6dfaa012aea8ffe6d90b02330f */
+ L(-1.67968749999999997316058782350439701E-01), /* bffc57fffffffffffe73eb914f2aa000 */
+  L(3.34025733574205019081305778794376391E-32), /* 3f965adf4572561fd5456a6c13d8babf */
+ L(-1.64062499999999993322730602128318480E-01), /* bffc4ffffffffffffc269be4f68f3000 */
+ L(-1.83345916769684984022099095506340635E-32), /* bf957ccb69026cb2f6024c211576d5f4 */
+ L(-1.60156249999999992419000744447607979E-01), /* bffc47fffffffffffba13df21784a000 */
+  L(2.73442789798110494773517431626534726E-32), /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
+ L(-1.56249999999999987665010524130393080E-01), /* bffc3ffffffffffff8e3ad45e7508000 */
+  L(2.02695576464836145806428118889332191E-32), /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
+ L(-1.52343749999999989905291167951491803E-01), /* bffc37fffffffffffa2e48aecfc24000 */
+ L(-3.61436631548815190395331054871041524E-32), /* bf967756567ebd108075ae527cc2e7f0 */
+ L(-1.48437500000000006686107754967759751E-01), /* bffc30000000000003dab20261b3c000 */
+ L(-2.15524270159131591469319477922198390E-32), /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
+ L(-1.44531250000000005132889939177166485E-01), /* bffc28000000000002f57b1969e7b000 */
+  L(2.74741116529653547935086189244019604E-32), /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
+ L(-1.40625000000000000707469094533647325E-01), /* bffc2000000000000068676d3d5c4000 */
+  L(4.40607097220049957013547629906723266E-33), /* 3f936e0ac425daf795b42913cf0ef881 */
+ L(-1.36718749999999995713752139187543306E-01), /* bffc17fffffffffffd87762255991000 */
+ L(-3.73751317180116492404578048203389108E-32), /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
+ L(-1.32812500000000007198453630478482191E-01), /* bffc10000000000004264de3a4379000 */
+ L(-3.97050085179660203884930593717220728E-32), /* bf969c52048de14be3c9c1971e50869c */
+ L(-1.28906250000000006070486371645733082E-01), /* bffc080000000000037fd87db2cb0000 */
+  L(3.59610068058504988294019521946586131E-32), /* 3f967570c10687cb8e9ebd0b280abf5a */
+ L(-1.25000000000000003700729208608337966E-01), /* bffc00000000000002222198bbc74000 */
+  L(3.23464851393124362331846965931995969E-33), /* 3f930cb95da3bfc847e593716c91d57a */
+ L(-1.21093750000000013729038501177102555E-01), /* bffbf000000000000fd418d1f5fda000 */
+  L(2.45242487730722066611358741283977619E-32), /* 3f95fd5945ad86a464292e26ac192a84 */
+ L(-1.17187499999999999765305306880205578E-01), /* bffbdfffffffffffffbabaf869845000 */
+ L(-1.14557520298960389903199646350205537E-32), /* bf94dbda735322179d9bcf392e1dd06d */
+ L(-1.13281250000000009579647893740755690E-01), /* bffbd000000000000b0b69bae7ab9000 */
+  L(2.37873962873837390105423621772752350E-32), /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
+ L(-1.09375000000000008981153004560108539E-01), /* bffbc000000000000a5ac4bc1d2c3000 */
+  L(1.53152444860014076105003555837231015E-32), /* 3f953e15ce931e12ef9a152522e32bdd */
+ L(-1.05468749999999992399063850363228723E-01), /* bffbaffffffffffff73c998091408000 */
+ L(-8.75920903597804862471749360196688834E-33), /* bf946bd7e310a01bae5687ebdc47fcc5 */
+ L(-1.01562500000000007685885179918350550E-01), /* bffba0000000000008dc7910a648c000 */
+ L(-4.63820993797174451904075397785059501E-33), /* bf938153d0e54001a472da180fb5e8aa */
+ L(-9.76562499999999887262211517861331814E-02), /* bffb8ffffffffffff300915aa6fd6000 */
+ L(-2.63767025974952608658936466715705903E-33), /* bf92b64215bb8d520be5404620d38088 */
+ L(-9.37499999999999939650246024457439795E-02), /* bffb7ffffffffffff90aca26bd0fc000 */
+ L(-1.72047822349322956713582039121348377E-32), /* bf9565545015c5b9b56d02cfefca2c7d */
+ L(-8.98437500000000033088896383977486369E-02), /* bffb70000000000003d09ca1e3cbe000 */
+  L(3.04831994420989436248526129869697270E-33), /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
+ L(-8.59374999999999947312400115121319225E-02), /* bffb5ffffffffffff9ecefc03376e000 */
+  L(1.50416954438393392150792422537312281E-32), /* 3f9538675ee99bd722fad0023c09c915 */
+ L(-8.20312500000000054182280847004695514E-02), /* bffb500000000000063f2dbd40200000 */
+  L(2.68399664523430004488075638997207289E-33), /* 3f92bdf49766629882c49a3da88928ed */
+ L(-7.81250000000000114767533968079748798E-02), /* bffb4000000000000d3b56f81ba70000 */
+  L(1.72318124201659121296305402819694281E-32), /* 3f9565e407aaabfb359e8a567d760de3 */
+ L(-7.42187500000000035531829472486812869E-02), /* bffb3000000000000418b6e9b5388000 */
+  L(2.09401756478514117051383998628099655E-32), /* 3f95b2e91221fcd74be0a86d8ad658d2 */
+ L(-7.03124999999999987474933134860732535E-02), /* bffb1ffffffffffffe8e53453d2ac000 */
+  L(2.28515798224350800271565551341211666E-32), /* 3f95da9bd6adf00894f05b5cc5530125 */
+ L(-6.64062500000000042267533361089054159E-02), /* bffb10000000000004df8473dbcf2000 */
+  L(1.97576478800281368377376002585430031E-32), /* 3f959a59acbddb2f53bd3096b66370e9 */
+ L(-6.25000000000000066329769382774201686E-02), /* bffb00000000000007a5b5914e336000 */
+ L(-1.46422615813786836245343723048221678E-33), /* bf91e69295f069fc0c4a9db181ea25a3 */
+ L(-5.85937500000000002823707957982406053E-02), /* bffae0000000000000a6aeab10592000 */
+  L(9.25637741701318872896718218457555829E-33), /* 3f94807eb021f1f40a37d4015b1eb76b */
+ L(-5.46875000000000081586888005226044448E-02), /* bffac0000000000012d00a3171e3a000 */
+ L(-4.87144542459404765480424673678105050E-33), /* bf9394b42faba6b7036fe7b36269daf3 */
+ L(-5.07812499999999927720348253140567013E-02), /* bffa9fffffffffffef555cc8dd914000 */
+ L(-3.01901021987395945826043649523451725E-33), /* bf92f59e7e3025691f290f8f67277faf */
+ L(-4.68749999999999935349476738962633103E-02), /* bffa7ffffffffffff117b4ea2b876000 */
+  L(1.21521638219189777347767475937119750E-32), /* 3f94f8c7f88c5b56674b94d984ac8ecb */
+ L(-4.29687500000000056305562847814228219E-02), /* bffa6000000000000cfbb19be30c0000 */
+ L(-1.18643699217679276275559592978275214E-32), /* bf94ecd39f0833a876550e83eb012b99 */
+ L(-3.90624999999999962692914526031373542E-02), /* bffa3ffffffffffff765c743922f9000 */
+ L(-4.91277156857520035712509544689973679E-33), /* bf939823189996193872e58ac0dececb */
+ L(-3.51562500000000108152468207687602886E-02), /* bffa20000000000018f031e41177f000 */
+  L(1.18599806302656253755207072755609820E-32), /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
+ L(-3.12500000000000077376981036742289578E-02), /* bffa00000000000011d787e0b386f000 */
+  L(9.97730386477005171963635210799577079E-33), /* 3f949e70e498c46a0173ac0d46c699fc */
+ L(-2.73437500000000139436129596418623235E-02), /* bff9c00000000000404db66e70a08000 */
+  L(2.25755321633070123579875157841633859E-33), /* 3f927719b1a93074bdf9f3c2cb784785 */
+ L(-2.34375000000000088003629211828324876E-02), /* bff98000000000002895a27d45feb000 */
+  L(2.84374279216848803102126617873942975E-33), /* 3f92d87f70e749d6da6c260b68dc210b */
+ L(-1.95312500000000107408831063404855424E-02), /* bff9400000000000318898ba69f71000 */
+  L(2.47348089686935458989103979140011912E-33), /* 3f929afa3de45086fe909fdddb41edce */
+ L(-1.56250000000000081443917555362290635E-02), /* bff9000000000000258f335e9cdd6000 */
+ L(-2.43379314483517422161458863218426254E-33), /* bf9294621c8a9ccacf2b020ec19cad27 */
+ L(-1.17187500000000051490597418161403184E-02), /* bff88000000000002f7ddfa26221f000 */
+  L(1.83405297208145390679150568810924707E-33), /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
+ L(-7.81249999999999715861805208310174953E-03), /* bff7ffffffffffffcb95f3fff157d000 */
+  L(3.51548384878710915171654413641872451E-34), /* 3f8fd349b76c22966f77a39fc37ed704 */
+ L(-3.90625000000000309326013918295097128E-03), /* bff7000000000000390f820c8e153000 */
+  L(6.38058004651791109324060099097251911E-36), /* 3f8a0f665d3ac25a1ac94d688273dbcd */
+#define T_EXPL_ARG1 (2*89)
+  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+  L(3.90625000000000245479958859972588985E-03), /* 3ff70000000000002d48769ac9874000 */
+ L(-6.58439598384342854976169982902779828E-36), /* bf8a1811b923e6c626b07ef29761482a */
+  L(7.81250000000001311374391093664996358E-03), /* 3ff800000000000078f3f3cd89111000 */
+  L(2.60265650555493781464273319671555602E-33), /* 3f92b070c3b635b87af426735a71fc87 */
+  L(1.17187500000000269581156218247101912E-02), /* 3ff8800000000000f8a50d02fe20d000 */
+  L(1.00961747974945520631836275894919326E-33), /* 3f914f80c1a4f8042044fe3b757b030b */
+  L(1.56249999999999797878275270751825475E-02), /* 3ff8ffffffffffff45935b69da62e000 */
+  L(2.03174577741375590087897353146748580E-33), /* 3f925194e863496e0f6e91cbf6b22e26 */
+  L(1.95312499999999760319884511789111533E-02), /* 3ff93fffffffffff917790ff9a8f4000 */
+  L(4.62788519658803722282100289809515007E-33), /* 3f9380783ba81295feeb3e4879d7d52d */
+  L(2.34374999999999822953909016349145918E-02), /* 3ff97fffffffffffae5a163bd3cd5000 */
+ L(-3.19499956304699705390404384504876533E-33), /* bf93096e2037ced8194cf344c692f8d6 */
+  L(2.73437500000000137220327275871555682E-02), /* 3ff9c000000000003f481dea5dd51000 */
+ L(-2.25757776523031994464630107442723424E-33), /* bf92771abcf988a02b414bf2614e3734 */
+  L(3.12499999999999790857640618332718621E-02), /* 3ff9ffffffffffff9f8cd40b51509000 */
+ L(-4.22479470489989916319395454536511458E-33), /* bf935efb7245612f371deca17cb7b30c */
+  L(3.51562499999999840753382405747597346E-02), /* 3ffa1fffffffffffdb47bd275f722000 */
+  L(1.08459658374118041980976756063083500E-34), /* 3f8e2055d18b7117c9db1c318b1e889b */
+  L(3.90624999999999989384433621470426757E-02), /* 3ffa3ffffffffffffd8d5e18b042e000 */
+ L(-7.41674226146122000759491297811091830E-33), /* bf94341454e48029e5b0205d91baffdc */
+  L(4.29687500000000107505739500500200462E-02), /* 3ffa60000000000018ca04cd9085c000 */
+ L(-4.74689012756713017494437969420919847E-34), /* bf903b7c268103c6f7fbaaa24142e287 */
+  L(4.68749999999999978700749928325717352E-02), /* 3ffa7ffffffffffffb16b6d5479e3000 */
+ L(-1.06208165308448830117773486334902917E-32), /* bf94b92be4b3b5b5a596a0a5187cc955 */
+  L(5.07812499999999815072625435955786253E-02), /* 3ffa9fffffffffffd55bd086d5cbc000 */
+ L(-9.37038897148383660401929567549111394E-33), /* bf94853b111b0175b491c80d00419416 */
+  L(5.46874999999999809511553152189867394E-02), /* 3ffabfffffffffffd4138bfa74a61000 */
+  L(1.06642963074562437340498606682822123E-32), /* 3f94bafa3fe991b39255d563dfa05d89 */
+  L(5.85937500000000184331996330905145551E-02), /* 3ffae000000000002a810a5f2f8bf000 */
+ L(-1.76639977694797200820296641773791945E-34), /* bf8ed596f07ce4408f1705c8ec16864c */
+  L(6.25000000000000021544696744852045001E-02), /* 3ffb000000000000027be32045e2b000 */
+  L(1.68616371995798354366633034788947149E-32), /* 3f955e33d7440794d8a1b25233d086ab */
+  L(6.64062499999999965563110718495802889E-02), /* 3ffb0ffffffffffffc079a38a3fed000 */
+ L(-1.82463217667830160048872113565316215E-32), /* bf957af6163bcdb97cefab44a942482a */
+  L(7.03124999999999759989183341261898222E-02), /* 3ffb1fffffffffffe454218acea05000 */
+ L(-1.07843770101525495515646940862541503E-32), /* bf94bff72aada26d94e76e71c07e0580 */
+  L(7.42187499999999898968873730710101412E-02), /* 3ffb2ffffffffffff45a166496dc1000 */
+  L(1.28629441689592874462780757154138223E-32), /* 3f950b2724597b8b93ce1e9d1cf4d035 */
+  L(7.81249999999999957198938523510804668E-02), /* 3ffb3ffffffffffffb10bc52adbc5000 */
+  L(1.13297573459968118467100063135856856E-33), /* 3f91787eea895b3c245899cf34ad0abd */
+  L(8.20312500000000199911640621145851159E-02), /* 3ffb500000000000170c59a661a89000 */
+ L(-1.51161335208135146756554123073528707E-32), /* bf9539f326c5ca84e7db5401566f3775 */
+  L(8.59375000000000134175373433347670743E-02), /* 3ffb6000000000000f78287547af0000 */
+  L(1.09763629458404270323909815379924900E-32), /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
+  L(8.98437500000000036533922600308306335E-02), /* 3ffb70000000000004364a83b7a14000 */
+  L(3.11459653680110433194288029777718358E-33), /* 3f9302c0248136d65cebeab69488d949 */
+  L(9.37500000000000184977946245216914691E-02), /* 3ffb800000000000155395d870b17000 */
+ L(-4.66656154468277949130395786965043927E-33), /* bf9383aec9b993b6db492b1ede786d8a */
+  L(9.76562500000000237839723100419376084E-02), /* 3ffb9000000000001b6bca237f6c4000 */
+ L(-1.03028043424658760249140747856831301E-32), /* bf94abf6352e3d2bb398e47919a343fb */
+  L(1.01562500000000012345545575236836572E-01), /* 3ffba000000000000e3bc30cd9a1f000 */
+  L(2.15755372310795701322789783729456319E-32), /* 3f95c01b3b819edd9d07548fafd61550 */
+  L(1.05468749999999976493840484471911438E-01), /* 3ffbafffffffffffe4e634cd77985000 */
+  L(1.78771847038773333029677216592309083E-32), /* 3f95734b6ae650f33dd43c49a1df9fc0 */
+  L(1.09375000000000002267015055992785402E-01), /* 3ffbc00000000000029d1ad08de7b000 */
+  L(6.23263106693943817730045115112427717E-33), /* 3f9402e4b39ce2198a45e1d045868cd6 */
+  L(1.13281250000000022354208618429577398E-01), /* 3ffbd0000000000019c5cc3f9d2b5000 */
+  L(5.40514416644786448581426756221178868E-33), /* 3f93c10ab4021472c662f69435de9269 */
+  L(1.17187500000000013252367133076817603E-01), /* 3ffbe000000000000f47688cc561b000 */
+ L(-7.12412585457324989451327215568641325E-33), /* bf9427ecb343a8d1758990565fcfbf45 */
+  L(1.21093750000000020759863992944300792E-01), /* 3ffbf0000000000017ef3af97bf04000 */
+  L(6.26591408357572503875647872077266444E-33), /* 3f940446a09a2da771b45fc075514d12 */
+  L(1.25000000000000004739659392396765618E-01), /* 3ffc00000000000002bb7344ecd89000 */
+ L(-1.55611398459729463981000080101758830E-32), /* bf95433135febefa9e6aa4db39e263d2 */
+  L(1.28906249999999982360888081057894783E-01), /* 3ffc07fffffffffff5d4ed3154361000 */
+ L(-1.77531518652835570781208599686606474E-32), /* bf9570b7f225ea076f97f418d11359c1 */
+  L(1.32812500000000010568583998727400436E-01), /* 3ffc1000000000000617a5d09526a000 */
+  L(2.12104021624990594668286391598300893E-32), /* 3f95b885d767a1048d93055927a27adc */
+  L(1.36718749999999998434125157367005292E-01), /* 3ffc17ffffffffffff18eaebc7970000 */
+  L(2.50454798592543203967309921276955297E-32), /* 3f9604164e5598528a76faff26cd1c97 */
+  L(1.40625000000000015550032422969330356E-01), /* 3ffc20000000000008f6c79d8928c000 */
+  L(7.80972982879849783680252962992639832E-33), /* 3f9444674acf2b3225c7647e0d95edf3 */
+  L(1.44531250000000012402535562111122522E-01), /* 3ffc28000000000007264a8bc1ff1000 */
+  L(2.79662468716455159585514763921671876E-32), /* 3f96226b095bd78aa650faf95a221993 */
+  L(1.48437500000000007761020440087419948E-01), /* 3ffc3000000000000479530ff8fe3000 */
+  L(2.15518492972728435680556239996258527E-32), /* 3f95bf9d49295e73a957906a029768cb */
+  L(1.52343750000000001733189947520484032E-01), /* 3ffc38000000000000ffc6109f71f000 */
+  L(8.34032236093545825619420380704500188E-33), /* 3f945a71851226a1d0ce5e656693153e */
+  L(1.56249999999999988073295321246958484E-01), /* 3ffc3ffffffffffff91fedd62ae0f000 */
+  L(2.44119337150624789345260194989620908E-32), /* 3f95fb041a57bc1c1280680ac1620bea */
+  L(1.60156250000000002076894210913572460E-01), /* 3ffc48000000000001327ed84a199000 */
+ L(-7.36124501128859978061216696286151753E-33), /* bf9431c62f01e59d2c1e00f195a0037f */
+  L(1.64062500000000000950861276373482172E-01), /* 3ffc500000000000008c5285fba85000 */
+ L(-4.80566184447001164583855800470217373E-33), /* bf938f3d1fcafd390f22f80e6c19421f */
+  L(1.67968749999999989878071706155265999E-01), /* 3ffc57fffffffffffa2a445c548c5000 */
+ L(-4.42154428718618459799673088733365064E-32), /* bf96cb28cf1c1b28006d53ffe633b22a */
+  L(1.71874999999999999459734108403218175E-01), /* 3ffc5fffffffffffffb04554e9dd4000 */
+ L(-3.29736288190321377985697972236270628E-32), /* bf96566af0ebc852e84be12859b24a31 */
+  L(1.75781249999999997987525759778901845E-01), /* 3ffc67fffffffffffed702df6ffff000 */
+ L(-1.28800728638468399687523924685844352E-32), /* bf950b8236b88ca0c1b739dc91a7e3fc */
+  L(1.79687500000000004929565820437175783E-01), /* 3ffc70000000000002d779bb32d2e000 */
+  L(1.60624461317978482424582320675174225E-32), /* 3f954d9a9cc0c963fd081f3dc922d04e */
+  L(1.83593750000000016873727045739708856E-01), /* 3ffc78000000000009ba1f6263c9a000 */
+ L(-3.83390389582056606880506003118452558E-32), /* bf968e22a5d826f77f19ee788474df22 */
+  L(1.87500000000000013443068740761666872E-01), /* 3ffc80000000000007bfd8c72a1bf000 */
+ L(-2.74141662712926256150154726565203091E-32), /* bf961caf5ac59c7f941f928e324c2cc1 */
+  L(1.91406249999999981494101786848611970E-01), /* 3ffc87fffffffffff55502eeae001000 */
+  L(3.68992437075565165346469517256118001E-32), /* 3f967f2f03f9096793372a27b92ad79d */
+  L(1.95312499999999989069921848800501648E-01), /* 3ffc8ffffffffffff9b3015280394000 */
+  L(3.69712249337856518452988332367785220E-32), /* 3f967fee5fdb5bd501ff93516999faa0 */
+  L(1.99218750000000021148042946919300804E-01), /* 3ffc9800000000000c30e67939095000 */
+  L(2.50142536781142175091322844848566649E-32), /* 3f9603c34ae58e10b300b07137ee618a */
+  L(2.03124999999999977732559198825437141E-01), /* 3ffc9ffffffffffff329e7df079e4000 */
+ L(-2.41951877287895024779300892731537816E-32), /* bf95f683aefe6965f080df8f59dd34a1 */
+  L(2.07031249999999996744030653771913124E-01), /* 3ffca7fffffffffffe1f80f4b73ca000 */
+ L(-1.94346475904454000031592792989765585E-32), /* bf9593a44f87870a3d100d498501ecc7 */
+  L(2.10937500000000000251399259834392298E-01), /* 3ffcb000000000000025199873310000 */
+ L(-1.33528748788094249098998693871759411E-33), /* bf91bbb9b25c813668d6103d08acac35 */
+  L(2.14843749999999993936323609611875097E-01), /* 3ffcb7fffffffffffc8128c866236000 */
+  L(1.14839877977014974625242788556545292E-32), /* 3f94dd06b4655c9b83a1305b240e7a42 */
+  L(2.18750000000000015181732784749663837E-01), /* 3ffcc0000000000008c06da5fff24000 */
+  L(1.42689085313142539755499441881408391E-32), /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
+  L(2.22656249999999992172647770539596569E-01), /* 3ffcc7fffffffffffb7ce2fe531f6000 */
+ L(-3.34421462850496887359128610229650547E-32), /* bf965b487962b5c2d9056ca6ac0c2e5c */
+  L(2.26562499999999989595607223847082419E-01), /* 3ffccffffffffffffa0095277be5c000 */
+ L(-3.08983588107248752517344356508205569E-32), /* bf9640dded57157f8eded311213bdbcd */
+  L(2.30468749999999979130462438434567117E-01), /* 3ffcd7fffffffffff3f8332996560000 */
+ L(-3.01407539802851697849105682795217019E-32), /* bf9638ffde35dbdfe1a1ffe45185de5d */
+  L(2.34375000000000012194252337217891971E-01), /* 3ffce0000000000007078dd402c86000 */
+ L(-8.46879710915628592284714319904522657E-33), /* bf945fc7b29a2ac6c9eff9eb258a510f */
+  L(2.38281249999999982991877076137149870E-01), /* 3ffce7fffffffffff6320b486eece000 */
+ L(-2.93563878880439245627127095245798544E-32), /* bf9630daaa4f40ff05caf29ace2ea7d4 */
+  L(2.42187499999999981447559841442773990E-01), /* 3ffceffffffffffff54e24a09a8d5000 */
+ L(-4.56766746558806021264215486909850481E-32), /* bf96da556dee11f3113e5a3467b908e6 */
+  L(2.46093749999999991067720539980207318E-01), /* 3ffcf7fffffffffffad9d405dcb5d000 */
+  L(2.14033004219908074003010247652128251E-32), /* 3f95bc8776e8f9ae098884aa664cc3df */
+  L(2.50000000000000016613825838126835953E-01), /* 3ffd00000000000004c9e24c12bb3000 */
+  L(2.57617532593749185996714235009382870E-32), /* 3f960b867cc01178c0ec68226c6cb47d */
+  L(2.53906250000000013372004437827044321E-01), /* 3ffd04000000000003daae05b3168000 */
+  L(7.20177123439204414298152646284640101E-32), /* 3f9775eff59ddad7e7530b83934af87f */
+  L(2.57812499999999995765234725413886085E-01), /* 3ffd07fffffffffffec7878bad9d5000 */
+  L(6.51253187532920882777046064603770602E-32), /* 3f975226659ca241402e71c2011583b0 */
+  L(2.61718750000000007647689994011222248E-01), /* 3ffd0c000000000002344cc793a0f000 */
+  L(3.02370610028725823590045201871491395E-32), /* 3f9639ffe55fa2fa011674448b4e5b96 */
+  L(2.65624999999999986893899042596554269E-01), /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
+ L(-2.07683715950724761146070082510569258E-32), /* bf95af579a92e872fef81abfdf06bae8 */
+  L(2.69531249999999979842788204900639327E-01), /* 3ffd13fffffffffffa30a908d67db000 */
+  L(8.71465252506557329027658736641075706E-32), /* 3f97c47d99e19830447a42b1c0ffac61 */
+  L(2.73437500000000006712165837793818271E-01), /* 3ffd18000000000001ef453a58edb000 */
+ L(-6.62704045767568912140550474455810301E-32), /* bf9758187a204dcb06ece46588aeeaba */
+  L(2.77343749999999994411329302988535617E-01), /* 3ffd1bfffffffffffe63a0fec9c9e000 */
+ L(-4.87273466291944117406493607771338767E-32), /* bf96fa0381b0844a0be46bac2d673f0c */
+  L(2.81250000000000012677892447379453135E-01), /* 3ffd20000000000003a7769e125d6000 */
+ L(-8.55871796664700790726282049552906783E-32), /* bf97bc64e01332cf7616b0091b8dff2c */
+  L(2.85156249999999998558643013736363981E-01), /* 3ffd23ffffffffffff95a5894bccf000 */
+ L(-1.33068334720606220176455289635046875E-32), /* bf95145f43290ecf5b7adcb24697bc73 */
+  L(2.89062500000000008831431235621753924E-01), /* 3ffd280000000000028ba504fac59000 */
+ L(-9.34157398616814623985483776710704237E-32), /* bf97e50ad1115b941fcb5f0c88a428f7 */
+  L(2.92968750000000019840235286110877063E-01), /* 3ffd2c000000000005b7f372d184f000 */
+  L(4.99302093775173155906059132992249671E-33), /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
+  L(2.96875000000000015867911730971630513E-01), /* 3ffd3000000000000492d860c79db000 */
+  L(7.86107787827057767235127454590866211E-33), /* 3f944689517ee8f16cdb97d6a6938f32 */
+  L(3.00781250000000015814100002286124758E-01), /* 3ffd340000000000048edfe73a17d000 */
+ L(-1.65419431293024229981937172317171504E-32), /* bf9557900e3efca16c89646b57f68dc0 */
+  L(3.04687499999999985213157159965287195E-01), /* 3ffd37fffffffffffbbcec6f99b36000 */
+  L(9.68753602893894024018934325652944198E-32), /* 3f97f70170e5458660c33a7e8d43d049 */
+  L(3.08593749999999989969324338045156215E-01), /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
+  L(7.10268609610294706092252562643261106E-32), /* 3f9770cae45cdf615010401a4b37d8d4 */
+  L(3.12500000000000002971606591018488854E-01), /* 3ffd40000000000000db440fbc06b000 */
+  L(6.38924218802905979887732294952782964E-32), /* 3f974bbf988bb5622bd8fbaa46e8b811 */
+  L(3.16406250000000006594921047402056305E-01), /* 3ffd44000000000001e69e8954814000 */
+  L(3.96079878754651470094149874444850097E-32), /* 3f969b5017b9fa7a1e86975258c73d3d */
+  L(3.20312500000000006713799366908329147E-01), /* 3ffd48000000000001ef64159c065000 */
+ L(-1.86401314975634286055150437995880517E-32), /* bf958323f0434911794e5fb8bfe136ba */
+  L(3.24218749999999987061246567584951210E-01), /* 3ffd4bfffffffffffc4549db9b928000 */
+ L(-3.18643523744758601387071062700407431E-32), /* bf964ae5fa7e26c2c3981bed12e14372 */
+  L(3.28124999999999991782776266707412953E-01), /* 3ffd4ffffffffffffda1ad0840ca8000 */
+ L(-4.46964199751314296839915534813144652E-32), /* bf96d0277729ffd74727150df6d15547 */
+  L(3.32031250000000000393816557756032682E-01), /* 3ffd540000000000001d0efc04fad000 */
+ L(-9.03246333902065439930373230002688649E-33), /* bf947731a008748cc6dee948839ef7ae */
+  L(3.35937499999999983810482995064392173E-01), /* 3ffd57fffffffffffb556cab8ae61000 */
+  L(5.27742727066129518825981597650621794E-32), /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
+  L(3.39843750000000004310441349760912471E-01), /* 3ffd5c0000000000013e0def5ddc4000 */
+ L(-3.85927263474732591932884416445586106E-32), /* bf9690c51088ef3db9ca000829c450c2 */
+  L(3.43749999999999990248130003997484364E-01), /* 3ffd5ffffffffffffd3070624a0af000 */
+  L(9.62005170171527308106468341512327487E-34), /* 3f913fae595cea84432eb01430817fca */
+  L(3.47656250000000004085726414568625697E-01), /* 3ffd640000000000012d79309e291000 */
+ L(-6.59664093705705297250259434519072507E-32), /* bf97568465eafb0e662e64a5dbfaf35f */
+
+ L(-1.98364257812501251077851763965418372E-03), /* bff6040000000001cd90f658cf0b1000 */
+ L(-3.71984513103117734260309047540278737E-34), /* bf8fee73c54483194782aac4a6154d11 */
+ L(-1.95312500000000378520649630233891879E-03), /* bff60000000000008ba643bb5e2e8000 */
+ L(-1.12194202736719050440745599339855038E-34), /* bf8e2a436aeff7bc529873354f47a3f5 */
+ L(-1.92260742187499397430259771221991482E-03), /* bff5f7fffffffffe4361cb51170da000 */
+ L(-2.30068299876822157331268484824540848E-34), /* bf8f31d02f85cfe8c0cc02276ce0f437 */
+ L(-1.89208984375001137424603270262074989E-03), /* bff5f0000000000347456ed490c23000 */
+ L(-1.15012507244426243338260435466985403E-34), /* bf8e31c174d5677a937a34ad8d2a70b4 */
+ L(-1.86157226562500172319250342061336738E-03), /* bff5e800000000007f262fa3617b4000 */
+ L(-3.12438344643346437509767736937785561E-34), /* bf8f9f4d426a2457c273d34ef7d9bde9 */
+ L(-1.83105468749999505256246872355430379E-03), /* bff5dffffffffffe92f18c1c2b6fa000 */
+ L(-5.91130415288336591179087455220308942E-35), /* bf8d3a4c80b42dc036bae446c9807f78 */
+ L(-1.80053710937499445182387245573120522E-03), /* bff5d7fffffffffe669dea82b4a4c000 */
+ L(-1.92396289352411531324908916321392100E-34), /* bf8eff7a2123fb573ba9778550d669bd */
+ L(-1.77001953125000387737631542516323906E-03), /* bff5d000000000011e19915c3ddb7000 */
+  L(7.91101758977203355387806553469731354E-36), /* 3f8a507f5a70faaccf469e3461873dea */
+ L(-1.73950195312500034854670281415554486E-03), /* bff5c8000000000019b7dc6ef97bd000 */
+  L(1.55906551582436824067407021178835755E-34), /* 3f8e9e7880333e34955aebcde3cfb053 */
+ L(-1.70898437499998955782591472611429852E-03), /* bff5bffffffffffcfd80e88aa6b96000 */
+  L(8.22951661962611381718215899498500357E-35), /* 3f8db58e6031a779b59f6ece191de7cc */
+ L(-1.67846679687500586652037711131708544E-03), /* bff5b80000000001b0df6fd21c133000 */
+ L(-8.96642618848426299713145894522897419E-35), /* bf8ddcbcab46d531801bfae4121f2f8a */
+ L(-1.64794921875000109499161354039904782E-03), /* bff5b0000000000050cbce8915575000 */
+ L(-2.88077905394253859590587789680486639E-34), /* bf8f7eebd4dd860ef73b674d5e707959 */
+ L(-1.61743164062501133830507079150388351E-03), /* bff5a80000000003449e8700c3e82000 */
+ L(-3.68271725851639066312899986829350273E-34), /* bf8fe9845fe20a5fe74059e0cae185d6 */
+ L(-1.58691406249999015546015764131101956E-03), /* bff59ffffffffffd2999e668cdd28000 */
+  L(8.48197657099957029953716507898788812E-35), /* 3f8dc2faaebb97392e451b07b28c4b12 */
+ L(-1.55639648437500317366570219290722587E-03), /* bff5980000000000ea2cd9a40d256000 */
+ L(-3.45156704719737676412949957712570373E-36), /* bf8925a079505516c8e317ac1ff53255 */
+ L(-1.52587890625000568759013197767046039E-03), /* bff5900000000001a3ab8a3f6b698000 */
+ L(-1.01902948542497496574967177677556729E-34), /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
+ L(-1.49536132812500945889014955936485340E-03), /* bff5880000000002b9f1621b57743000 */
+ L(-3.32264697086631598830366079048117140E-34), /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
+ L(-1.46484374999999931883259902869504725E-03), /* bff57fffffffffffcdbd1c90e1b4a000 */
+ L(-1.76487524793892929381101031660811433E-34), /* bf8ed52f2f724bc1ae870b18356337b4 */
+ L(-1.43432617187498876325946983333888768E-03), /* bff577fffffffffcc2dff8faa5570000 */
+ L(-3.54550084538495708816233114576143814E-34), /* bf8fd74724576915868c1e8ce9f430f1 */
+ L(-1.40380859374999215367421282192718062E-03), /* bff56ffffffffffdbd0b18aac65ed000 */
+ L(-1.90585907028351204486765167064669639E-34), /* bf8efaaa0c0e23e50c11b2120348054f */
+ L(-1.37329101562499692341771212945644892E-03), /* bff567ffffffffff1cfd00f1b0577000 */
+ L(-3.59631150411372589637918252836880320E-34), /* bf8fde08239ac74942a46298ea4fb715 */
+ L(-1.34277343749999137467356674296739172E-03), /* bff55ffffffffffd839030b05d53d000 */
+ L(-1.49571076125940368185068762485268117E-35), /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
+ L(-1.31225585937499247038404301859788734E-03), /* bff557fffffffffdd469936e691e3000 */
+  L(3.10375845385355395586146533282311300E-34), /* 3f8f9c8f6d63b7a4145716ffd92491fb */
+ L(-1.28173828124999024755581675764821898E-03), /* bff54ffffffffffd306589b0ab21d000 */
+ L(-1.98541096105909793397376077900810019E-34), /* bf8f07e808bbb1e35106c294ffbb9687 */
+ L(-1.25122070312500340204619591143332523E-03), /* bff5480000000000fb06d5f16ad2c000 */
+  L(3.62884195935761446237911443317457521E-34), /* 3f8fe25b17d623178a386a6fa6c5afb2 */
+ L(-1.22070312499999591578388993012071279E-03), /* bff53ffffffffffed2a356c440074000 */
+ L(-2.96756662615653130862526710937493307E-35), /* bf8c3b90d8ff2a991e5bd16718fb0645 */
+ L(-1.19018554687498821966212632349422735E-03), /* bff537fffffffffc9ac3b585dda89000 */
+  L(1.44659971891167323357060028901142644E-34), /* 3f8e809279ab249edf1dad9fe13fb0bf */
+ L(-1.15966796875000160938908064907298384E-03), /* bff530000000000076c0800db9639000 */
+  L(2.50088010538742402346270685365928513E-34), /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
+ L(-1.12915039062500267151512523291939657E-03), /* bff5280000000000c51f7e7315137000 */
+  L(7.56402096465615210500092443924888831E-35), /* 3f8d922c1e485d99aea2668ed32b55a6 */
+ L(-1.09863281249998665006360103291051571E-03), /* bff51ffffffffffc26f2d4c9ce2ba000 */
+  L(1.43982174467233642713619821353592061E-34), /* 3f8e7ec530b3d92b6303bec1c81214d1 */
+ L(-1.06811523437500522742248711752028025E-03), /* bff518000000000181b7380f10446000 */
+  L(5.41265133745862349181293024531133174E-35), /* 3f8d1fc9313d018b30e790e06b6be723 */
+ L(-1.03759765624999980942114138999770552E-03), /* bff50ffffffffffff1f01130490e1000 */
+  L(1.21525139612685854366189534669623436E-34), /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
+ L(-1.00708007812499602697537601515759439E-03), /* bff507fffffffffedad7afcce7051000 */
+  L(1.00020246351201558505328236381833392E-34), /* 3f8e09e640992512b1300744a7e984ed */
+ L(-9.76562499999992592487302113340463694E-04), /* bff4fffffffffffbbad8151f8adf6000 */
+ L(-1.64984406575162932060422892046851002E-34), /* bf8eb69a919986e8054b86fc34300f24 */
+ L(-9.46044921874989085824996924138179594E-04), /* bff4effffffffff9b55a204fd9792000 */
+ L(-9.29539174108308550334255350011347171E-35), /* bf8dee3a50ed896b4656fa577a1df3d7 */
+ L(-9.15527343750013735214860599791540029E-04), /* bff4e00000000007eaf5bf103f82d000 */
+  L(3.07557018309280519949818825519490586E-35), /* 3f8c470cfbef77d32c74cb8042f6ee81 */
+ L(-8.85009765625012292294986105781516428E-04), /* bff4d000000000071605c65403b97000 */
+  L(4.77499983783821950338363358545463558E-35), /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
+ L(-8.54492187499986941239470706817188192E-04), /* bff4bffffffffff878ddf9cab264a000 */
+ L(-1.60128240346239526958630011447901568E-34), /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
+ L(-8.23974609374996290174598690241743810E-04), /* bff4affffffffffddc86c249ebe06000 */
+  L(1.61677540391961912631535763471935882E-34), /* 3f8eadd00841366b0dc2bc262c2c8c36 */
+ L(-7.93457031249988696952538334288757473E-04), /* bff49ffffffffff97bf6f0aa85a5f000 */
+  L(1.22318577008381887076634753347515709E-34), /* 3f8e452db5b5d250878f71040da06d14 */
+ L(-7.62939453124996723316499040007097041E-04), /* bff48ffffffffffe1c7265b431108000 */
+ L(-1.03845161748762410745671891558398468E-34), /* bf8e14115ad884c96d1a820c73647220 */
+ L(-7.32421874999998242520117923997325794E-04), /* bff47ffffffffffefca4498b7aa8a000 */
+  L(5.64005211953031009549514026639438083E-35), /* 3f8d2be06950f68f1a6d8ff829a6928e */
+ L(-7.01904296874999772890934814265622012E-04), /* bff46fffffffffffde7c0fe5d8041000 */
+  L(5.90245467325173644235991233229525762E-35), /* 3f8d39d40cc49002189243c194b1db0e */
+ L(-6.71386718750008699269643939210658742E-04), /* bff460000000000503c91d798b60c000 */
+ L(-5.20515801723324452151498579012322191E-35), /* bf8d14c0f08a6a9285b32b8bda003eb5 */
+ L(-6.40869140625005499535275057463709988E-04), /* bff45000000000032b969184e9751000 */
+ L(-6.69469163285461870099846471658294534E-35), /* bf8d63f36bab7b24d936c9380e3d3fa6 */
+ L(-6.10351562499999293780097329596079841E-04), /* bff43fffffffffff97c7c433e35ed000 */
+ L(-1.16941808547394177991845382085515086E-34), /* bf8e36e27886f10b234a7dd8fc588bf0 */
+ L(-5.79833984375000068291972326409994795E-04), /* bff43000000000000a13ff6dcf2bf000 */
+  L(1.17885044988246219185041488459766001E-34), /* 3f8e3964677e001a00412aab52790842 */
+ L(-5.49316406249990904622170867910987793E-04), /* bff41ffffffffffac1c25739c716b000 */
+ L(-3.31875702128137033065075734368960972E-35), /* bf8c60e928d8982c3c99aef4f885a121 */
+ L(-5.18798828125011293653756992177727236E-04), /* bff410000000000682a62cff36775000 */
+ L(-5.69971237642088463334239430962628187E-35), /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
+ L(-4.88281249999990512232251384917893121E-04), /* bff3fffffffffff50fb48992320df000 */
+  L(1.02144616714408655325510171265051108E-35), /* 3f8ab279a3626612710b9b3ac71734ac */
+ L(-4.57763671874997554564967307956493434E-04), /* bff3dffffffffffd2e3c272e3cca9000 */
+ L(-8.25484058867957231164162481843653503E-35), /* bf8db6e71158e7bf93e2e683f07aa841 */
+ L(-4.27246093749991203999790346349633286E-04), /* bff3bffffffffff5dbe103cba0eb2000 */
+ L(-3.51191203319375193921924105905691755E-35), /* bf8c757356d0f3dd7fbefc0dd419ab50 */
+ L(-3.96728515624986649402960638705483281E-04), /* bff39ffffffffff09b996882706ec000 */
+ L(-5.51925962073095883016589497244931171E-36), /* bf89d586d49f22289cfc860bebb99056 */
+ L(-3.66210937499999945095511981300980754E-04), /* bff37fffffffffffefcb88bfc7df6000 */
+ L(-2.11696465278144529364423332249588595E-35), /* bf8bc23a84d28e5496c874ef9833be25 */
+ L(-3.35693359374992480958458008559640163E-04), /* bff35ffffffffff754c548a8798f2000 */
+ L(-8.58941791799705081104736787493668352E-35), /* bf8dc8b1192fb7c3662826d43acb7c68 */
+ L(-3.05175781250009811036303273640122156E-04), /* bff340000000000b4fb4f1aad1c76000 */
+ L(-8.61173897858769926480551302277426632E-35), /* bf8dc9e0eabb1c0b33051011b64769fa */
+ L(-2.74658203124987298321920308390303850E-04), /* bff31ffffffffff15b2056ac252fd000 */
+  L(3.35152809454778381053519808988046631E-37), /* 3f85c82fb59ff8d7c80d44e635420ab1 */
+ L(-2.44140624999999992770514819575735516E-04), /* bff2fffffffffffffbbb82d6a7636000 */
+  L(3.54445837111124472730013879165516908E-35), /* 3f8c78e955b01378be647b1c92aa9a77 */
+ L(-2.13623046875012756463165168672749438E-04), /* bff2c0000000001d6a1635fea6bbf000 */
+  L(1.50050816288650121729916777279129473E-35), /* 3f8b3f1f6f616a61129a58e131cbd31d */
+ L(-1.83105468749991323078784464300306893E-04), /* bff27fffffffffebfe0cbd0c82399000 */
+ L(-9.14919506501448661140572099029756008E-37), /* bf873754bacaa9d9513b6127e791eb47 */
+ L(-1.52587890625013337032336300236461546E-04), /* bff240000000001ec0cb57f2cc995000 */
+  L(2.84906084373176180870418394956384516E-35), /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
+ L(-1.22070312499990746786116828458007518E-04), /* bff1ffffffffffd553bbb49f35a34000 */
+  L(6.71618008964968339584520728412444537E-36), /* 3f8a1dacb99c60071fc9cd2349495bf0 */
+ L(-9.15527343750029275602791047595142231E-05), /* bff180000000000d8040cd6ecde28000 */
+ L(-1.95753652091078750312541716951402172E-35), /* bf8ba0526cfb24d8d59122f1c7a09a14 */
+ L(-6.10351562499913258461494008080572701E-05), /* bff0ffffffffffaffebbb92d7f6a9000 */
+  L(5.69868489273961111703398456218119973E-36), /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
+ L(-3.05175781250092882818419203884960853E-05), /* bff0000000000055ab55de88fac1d000 */
+  L(9.03341100018476837609128961872915953E-36), /* 3f8a803d229fa3a0e834a63abb06662b */
+#define T_EXPL_ARG2 (2*T_EXPL_ARG1 + 2 + 2*65)
+  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
+  L(3.05175781249814607084128277672749162E-05), /* 3feffffffffffeaa02abb9102f499000 */
+  L(1.00271855391179733380665816525889949E-36), /* 3f8755351afa042ac3f58114824d4c10 */
+  L(6.10351562500179243748093427073421439E-05), /* 3ff1000000000052a95de07a4c26d000 */
+  L(1.67231624299180373502350811501181670E-36), /* 3f881c87a53691cae9d77f4e40d66616 */
+  L(9.15527343749970728685313252158399200E-05), /* 3ff17ffffffffff28040cc2acde28000 */
+  L(2.43665747834893104318707597514407880E-36), /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
+  L(1.22070312500027751961838150070880064E-04), /* 3ff200000000003ffddde6c153b53000 */
+ L(-1.73322146370624186623546452226755405E-35), /* bf8b709d8d658ed5dbbe943de56ee84e */
+  L(1.52587890624995916105682628143179430E-04), /* 3ff23ffffffffff6954b56e285d23000 */
+  L(1.23580432650945898349135528000443828E-35), /* 3f8b06d396601dde16de7d7bc27346e6 */
+  L(1.83105468750008670314358488289621794E-04), /* 3ff2800000000013fe0cdc8c823b7000 */
+  L(4.30446229148833293310207915930740796E-35), /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
+  L(2.13623046875005741337455947623248132E-04), /* 3ff2c0000000000d3d1662de21a3f000 */
+ L(-3.96110759869520786681660669615255057E-35), /* bf8ca5379b04ff4a31aab0ceacc917e6 */
+  L(2.44140624999981493573336463433440506E-04), /* 3ff2ffffffffffd553bbdf48e0534000 */
+ L(-1.39617373942387888957350179316792928E-35), /* bf8b28eeedc286015802b63f96b8c5cd */
+  L(2.74658203124984920706309918754626834E-04), /* 3ff31fffffffffee9d60c8439ec1d000 */
+ L(-3.16168080483901830349738314447356223E-36), /* bf890cf74f81c77a611abc1243812444 */
+  L(3.05175781250008648918265055410966055E-04), /* 3ff3400000000009f8b5c9a346636000 */
+  L(8.54421306185008998867856704677221443E-35), /* 3f8dc649cd40922fc08adc6b6b20ead0 */
+  L(3.35693359374988945462612499316774515E-04), /* 3ff35ffffffffff34146c540f15b2000 */
+  L(7.96443137431639500475160850431097078E-35), /* 3f8da77638ed3148fc4d99d1c9e13446 */
+  L(3.66210937500027690542093987739604535E-04), /* 3ff380000000001fecce34bea89c4000 */
+  L(2.14507323877752361258862577769090367E-35), /* 3f8bc834e554d38894cf91957b0253d3 */
+  L(3.96728515625003928083564943615052121E-04), /* 3ff3a00000000004875d9a4acf6ab000 */
+  L(4.88358523466632050664019922448605508E-35), /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
+  L(4.27246093750017799227172345607351585E-04), /* 3ff3c00000000014856794c3ee850000 */
+  L(6.66520494592631402182216588784828935E-35), /* 3f8d6262118fcdb59b8f16108f5f1a6c */
+  L(4.57763671875002108342364320152138181E-04), /* 3ff3e000000000026e45d855410b9000 */
+  L(7.21799615960261390920033272189522298E-35), /* 3f8d7fc645cff8879462296af975c9fd */
+  L(4.88281249999999768797631616370963356E-04), /* 3ff3ffffffffffffbbc2d7cc004df000 */
+ L(-5.30564629906905979452258114088325361E-35), /* bf8d1a18b71929a30d67a217a27ae851 */
+  L(5.18798828124997339054881383202487041E-04), /* 3ff40ffffffffffe775055eea5851000 */
+ L(-4.03682911253647925867848180522846377E-35), /* bf8cad44f0f3e5199d8a589d9332acad */
+  L(5.49316406249980511907933706754958501E-04), /* 3ff41ffffffffff4c410b29bb62fb000 */
+ L(-2.08166843948323917121806956728438051E-35), /* bf8bbab8cf691403249fe5b699e25143 */
+  L(5.79833984374989593561576568548497165E-04), /* 3ff42ffffffffffa0047df328d817000 */
+ L(-1.72745033420153042445343706432627539E-34), /* bf8ecb3c2d7d3a9e6e960576be901fdf */
+  L(6.10351562500008540711511259540838154E-04), /* 3ff4400000000004ec62f54f8c271000 */
+  L(7.41889382604319545724663095428976499E-35), /* 3f8d8a74c002c81a47c93b8e05d15f8e */
+  L(6.40869140625020444702875407535884986E-04), /* 3ff450000000000bc91b09718515d000 */
+ L(-4.47321009727305792048065440180490107E-35), /* bf8cdbac5c8fe70822081d8993eb5cb6 */
+  L(6.71386718750007531635964622352684074E-04), /* 3ff460000000000457792973db05c000 */
+  L(5.13698959677949336513874456684462092E-35), /* 3f8d112114436949c5ef38d8049004ab */
+  L(7.01904296875006634673332887754430334E-04), /* 3ff4700000000003d31adf2cb8b1d000 */
+ L(-8.25665755717729437292989870760751482E-35), /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
+  L(7.32421874999998244664170215504673504E-04), /* 3ff47ffffffffffefcf5498bd5c8a000 */
+ L(-5.64005234937832153139057628112753364E-35), /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
+  L(7.62939453125017456345986752604096408E-04), /* 3ff490000000000a101a1b093d4a8000 */
+ L(-1.11084094120417622468550608896588329E-34), /* bf8e274feabd2d94f6694507a46accb1 */
+  L(7.93457031249987558617598988993908016E-04), /* 3ff49ffffffffff8d3f9dcab74bbf000 */
+ L(-1.22966480225449015129079129940978828E-34), /* bf8e46e6a65eef8fa9e42eddf3da305e */
+  L(8.23974609374997378723747633335135819E-04), /* 3ff4affffffffffe7d2afbaa55b26000 */
+ L(-1.62270010016794279091906973366704963E-34), /* bf8eaf633f057ebdb664a34566401c4e */
+  L(8.54492187500023938282350821569920958E-04), /* 3ff4c0000000000dccaabce399e59000 */
+ L(-1.39076361712838158775374263169606160E-34), /* bf8e71ba779364b3bbdba7841f2c4ca1 */
+  L(8.85009765624987932362186815286691297E-04), /* 3ff4cffffffffff90b218886edc2a000 */
+  L(4.07328275060905585228261577392403980E-35), /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
+  L(9.15527343749975579461305518559161974E-04), /* 3ff4dffffffffff1ec2a21f25df33000 */
+  L(1.16855112459192484947855553716334015E-35), /* 3f8af10bf319e9f5270cf249eeffbe5c */
+  L(9.46044921875016761584725882821122521E-04), /* 3ff4f00000000009a992c46c16d71000 */
+  L(9.51660680007524262741115611071680436E-35), /* 3f8df9fd56e81f8edf133843910ee831 */
+  L(9.76562499999974118878133088548272636E-04), /* 3ff4fffffffffff1149edc46a6df6000 */
+ L(-5.65271128977550656964071208289181661E-36), /* bf89e0e12689dd721aa2314c81eb6429 */
+  L(1.00708007812498671732140389760347830E-03), /* 3ff507fffffffffc2be94b90ed091000 */
+ L(-1.43355074891483635310132767255371379E-34), /* bf8e7d1a688c247b16022daab1316d55 */
+  L(1.03759765625002637786192745235343007E-03), /* 3ff51000000000079a57b966bc158000 */
+  L(2.95905815240957629366749917020106928E-34), /* 3f8f895387fc73bb38f8a1b254c01a60 */
+  L(1.06811523437500860568717813047520763E-03), /* 3ff51800000000027afcd5b35f5e6000 */
+ L(-5.98328495358586628195372356742878314E-35), /* bf8d3e204130013bf6328f1b70ff8c76 */
+  L(1.09863281250001439958487251556220070E-03), /* 3ff5200000000004268077c6c66bd000 */
+  L(2.41371837889426603334113000868144760E-34), /* 3f8f40d6948edf864054ccf151f9815e */
+  L(1.12915039062501298413451613770002366E-03), /* 3ff5280000000003be0f5dd8fe81b000 */
+ L(-1.28815268997394164973472617519705703E-34), /* bf8e567321172ea089dce4bc8354ecb7 */
+  L(1.15966796874997272036339054191407232E-03), /* 3ff52ffffffffff8231e3bcfff1e8000 */
+  L(1.02996064554316248496839462594377804E-34), /* 3f8e11cf7d402789244f68e2d4f985b1 */
+  L(1.19018554687502744121802585360546796E-03), /* 3ff5380000000007e8cdf3f8f6c20000 */
+ L(-1.43453217726255628994625761307322163E-34), /* bf8e7d5d3370d85a374f5f4802fc517a */
+  L(1.22070312499997743541996266398850614E-03), /* 3ff53ffffffffff97f0722561f454000 */
+ L(-1.41086259180534339713692694428211646E-34), /* bf8e77125519ff76244dfec5fbd58402 */
+  L(1.25122070312501024092560690174507039E-03), /* 3ff5480000000002f3a59d8820691000 */
+  L(3.84102646020099293168698506729765213E-34), /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
+  L(1.28173828124997986521442660131425390E-03), /* 3ff54ffffffffffa3250a764439d9000 */
+  L(1.44644589735033114377952806106652650E-34), /* 3f8e808801b80dcf38323cdbfdca2549 */
+  L(1.31225585937501665804856968749058137E-03), /* 3ff5580000000004cd25a414c6d62000 */
+  L(1.67474574742200577294563576414361377E-34), /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
+  L(1.34277343749997290265837386401818888E-03), /* 3ff55ffffffffff83091b042cfd59000 */
+ L(-1.55650565030381326742591837551559103E-34), /* bf8e9dca490d7fecfadba9625ffb91c5 */
+  L(1.37329101562497720784949380297774268E-03), /* 3ff567fffffffff96e3c7312f5ccf000 */
+  L(1.65279335325630026116581677369221748E-34), /* 3f8eb763496f5bd7404f2298b402074f */
+  L(1.40380859374999099958354100336136647E-03), /* 3ff56ffffffffffd67e2f09f2a381000 */
+  L(1.89919944388961890195706641264717076E-34), /* 3f8ef8e4d0ffdfeba982aa8829501389 */
+  L(1.43432617187497484122173130998160625E-03), /* 3ff577fffffffff8bf9c1d71af8a8000 */
+  L(2.57638517142061429772064578590009568E-34), /* 3f8f5675d82c1cc4ada70fd3a957b89a */
+  L(1.46484374999999929342158925502052945E-03), /* 3ff57fffffffffffcbdd1c7671b46000 */
+  L(1.76487201934184070490166772482073801E-34), /* 3f8ed52ef732458f6e4c5c07504f33cc */
+  L(1.49536132812502318451070466256902933E-03), /* 3ff5880000000006aeb7066c8ad43000 */
+  L(2.38068367275295804321313550609246656E-34), /* 3f8f3c7277ae6fc390ace5e06c0b025b */
+  L(1.52587890625000448053340248672949543E-03), /* 3ff59000000000014a9ae2104b3bc000 */
+  L(1.01174455568392813258454590274740959E-34), /* 3f8e0cf7c434762991bb38e12acee215 */
+  L(1.55639648437501113499837053523090913E-03), /* 3ff5980000000003359e2c204355e000 */
+ L(-2.82398418808099749023517211651363693E-35), /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
+  L(1.58691406249999937955142588308171026E-03), /* 3ff59fffffffffffd2380ecbc87c2000 */
+ L(-1.27361695572422741562701199136538047E-34), /* bf8e5295e0e206dfb0f0266c07225448 */
+  L(1.61743164062498000531048954475329309E-03), /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
+ L(-1.22606548862580061633942923016222044E-34), /* bf8e45f1b17bb61039d21a351bb207b8 */
+  L(1.64794921875001835451453858682255576E-03), /* 3ff5b000000000054a52fa20f6565000 */
+  L(1.39132339594152335892305491425264583E-34), /* 3f8e71e0904c5449b414ee49b191cef2 */
+  L(1.67846679687501263995029340691547953E-03), /* 3ff5b80000000003a4a9e912c910b000 */
+  L(6.67245854693585315412242764786197029E-35), /* 3f8d62c4ccac1e7511a617d469468ccd */
+  L(1.70898437500002646861403514115369655E-03), /* 3ff5c00000000007a109fbaa7e015000 */
+  L(6.87367172354719289559624829652240928E-36), /* 3f8a245fa835eceb42bae8128d9336db */
+  L(1.73950195312501174308226096992992128E-03), /* 3ff5c80000000003627c8d637a005000 */
+ L(-2.20824271875474985927385878948759352E-34), /* bf8f25869b1cbefb25e735992f232f57 */
+  L(1.77001953124997491747605207736194513E-03), /* 3ff5cffffffffff8c53c84b6883b8000 */
+  L(3.43123048533596296514343180408963705E-34), /* 3f8fc816b91d173ddadbbf09b1287906 */
+  L(1.80053710937497698911127570705069398E-03), /* 3ff5d7fffffffff95e1899f4a8430000 */
+  L(3.99231237340890073475077494556136100E-35), /* 3f8ca889148f62fa854da5674df41279 */
+  L(1.83105468750002267094899598630423914E-03), /* 3ff5e0000000000688d21e62ba674000 */
+ L(-3.22274595655810623999007524769365273E-34), /* bf8fac605cb9ae01eb719675ced25560 */
+  L(1.86157226562500499224728040579690330E-03), /* 3ff5e80000000001705ce28a6d89e000 */
+  L(3.07094985075881613489605622068441083E-34), /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
+  L(1.89208984374998234666824993196980949E-03), /* 3ff5effffffffffae969fdc7cd8cf000 */
+ L(-3.06287628722973914692165056776495733E-34), /* bf8f9720477d9cfa10e464df7f91020c */
+  L(1.92260742187501225343755557292811682E-03), /* 3ff5f800000000038824e428ed49a000 */
+  L(6.30049124729794620592961282769623368E-35), /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
+  L(1.95312499999998514894032051116231258E-03), /* 3ff5fffffffffffbb82f6a04f1ae0000 */
+ L(-6.14610057507500948543216998736262902E-35), /* bf8d46c862d39255370e7974d48daa7e */
+  L(1.98364257812501222021119324146882732E-03), /* 3ff6040000000001c2d8a1aa5188d000 */
+  L(3.71942298418113774118754986159801984E-34), /* 3f8fee6567d9940495519ffe62cbc9a4 */
+
+  L(7.06341639425619532977052017486130353E-01), /* 3ffe69a59c8245a9ac00000000000000 */
+  L(7.09106182437398424589503065362805501E-01), /* 3ffe6b0ff72deb89d000000000000000 */
+  L(7.11881545564596485142772053222870454E-01), /* 3ffe6c7bbce9a6d93000000000000000 */
+  L(7.14667771155948150507697391731198877E-01), /* 3ffe6de8ef213d71e000000000000000 */
+  L(7.17464901725936049503573599395167548E-01), /* 3ffe6f578f41e1a9e400000000000000 */
+  L(7.20272979955439790478166628417966422E-01), /* 3ffe70c79eba33c06c00000000000000 */
+  L(7.23092048692387218133958981525211129E-01), /* 3ffe72391efa434c7400000000000000 */
+  L(7.25922150952408251622927082280511968E-01), /* 3ffe73ac117390acd800000000000000 */
+  L(7.28763329919491220643124052003258839E-01), /* 3ffe752077990e79d000000000000000 */
+  L(7.31615628946641782803794740175362676E-01), /* 3ffe769652df22f7e000000000000000 */
+  L(7.34479091556544505525749855223693885E-01), /* 3ffe780da4bba98c4800000000000000 */
+  L(7.37353761442226890432394270646909717E-01), /* 3ffe79866ea5f432d400000000000000 */
+  L(7.40239682467726090031590047146892175E-01), /* 3ffe7b00b216ccf53000000000000000 */
+  L(7.43136898668758316688354170764796436E-01), /* 3ffe7c7c70887763c000000000000000 */
+  L(7.46045454253390638577059235103661194E-01), /* 3ffe7df9ab76b20fd000000000000000 */
+  L(7.48965393602715662213498148958024103E-01), /* 3ffe7f78645eb8076400000000000000 */
+  L(7.51896761271528629722027403659012634E-01), /* 3ffe80f89cbf42526400000000000000 */
+  L(7.54839601989007347171423134568613023E-01), /* 3ffe827a561889716000000000000000 */
+  L(7.57793960659394638668118204805068672E-01), /* 3ffe83fd91ec46ddc000000000000000 */
+  L(7.60759882362683631518152083117456641E-01), /* 3ffe858251bdb68b8c00000000000000 */
+  L(7.63737412355305483879774897104653064E-01), /* 3ffe87089711986c9400000000000000 */
+  L(7.66726596070820082262642358728044201E-01), /* 3ffe8890636e31f54400000000000000 */
+  L(7.69727479120609181517664865168626420E-01), /* 3ffe8a19b85b4fa2d800000000000000 */
+  L(7.72740107294572486917871856348938309E-01), /* 3ffe8ba4976246833800000000000000 */
+  L(7.75764526561826289752232810315035749E-01), /* 3ffe8d31020df5be4400000000000000 */
+  L(7.78800783071404878477039801509818062E-01), /* 3ffe8ebef9eac820b000000000000000 */
+  L(7.81848923152964780936002853195532225E-01), /* 3ffe904e8086b5a87800000000000000 */
+  L(7.84908993317491698871180005880887620E-01), /* 3ffe91df97714512d800000000000000 */
+  L(7.87981040258010162480317717381694820E-01), /* 3ffe9372403b8d6bcc00000000000000 */
+  L(7.91065110850296016042904057030682452E-01), /* 3ffe95067c78379f2800000000000000 */
+  L(7.94161252153591734614934694036492147E-01), /* 3ffe969c4dbb800b4800000000000000 */
+  L(7.97269511411324433014513601847284008E-01), /* 3ffe9833b59b38154400000000000000 */
+  L(8.00389936051826789142893403550260700E-01), /* 3ffe99ccb5aec7bec800000000000000 */
+  L(8.03522573689060742863077280162542593E-01), /* 3ffe9b674f8f2f3d7c00000000000000 */
+  L(8.06667472123343942680406826184480451E-01), /* 3ffe9d0384d70893f800000000000000 */
+  L(8.09824679342079301047618855591281317E-01), /* 3ffe9ea15722892c7800000000000000 */
+  L(8.12994243520486992160556383169023320E-01), /* 3ffea040c80f8374f000000000000000 */
+  L(8.16176213022339780422953481320291758E-01), /* 3ffea1e1d93d687d0000000000000000 */
+  L(8.19370636400700819157449927843117621E-01), /* 3ffea3848c4d49954c00000000000000 */
+  L(8.22577562398664585696650419777142815E-01), /* 3ffea528e2e1d9f09800000000000000 */
+  L(8.25797039950100647542896581398963463E-01), /* 3ffea6cede9f70467c00000000000000 */
+  L(8.29029118180400342863478613253391813E-01), /* 3ffea876812c0877bc00000000000000 */
+  L(8.32273846407226292054559735333896242E-01), /* 3ffeaa1fcc2f45343800000000000000 */
+  L(8.35531274141265073440720811959181447E-01), /* 3ffeabcac15271a2a400000000000000 */
+  L(8.38801451086982535754188461396552157E-01), /* 3ffead7762408309bc00000000000000 */
+  L(8.42084427143382358016410194068157580E-01), /* 3ffeaf25b0a61a7b4c00000000000000 */
+  L(8.45380252404767357221615498019673396E-01), /* 3ffeb0d5ae318680c400000000000000 */
+  L(8.48688977161503960155997106085123960E-01), /* 3ffeb2875c92c4c99400000000000000 */
+  L(8.52010651900789478530029441571969073E-01), /* 3ffeb43abd7b83db1c00000000000000 */
+  L(8.55345327307422548246407245642330963E-01), /* 3ffeb5efd29f24c26400000000000000 */
+  L(8.58693054264576483003423845730139874E-01), /* 3ffeb7a69db2bcc77800000000000000 */
+  L(8.62053883854575708767242758767679334E-01), /* 3ffeb95f206d17228000000000000000 */
+  L(8.65427867359675251357487013592617586E-01), /* 3ffebb195c86b6b29000000000000000 */
+  L(8.68815056262843166123843730019871145E-01), /* 3ffebcd553b9d7b62000000000000000 */
+  L(8.72215502248546159513864495238522068E-01), /* 3ffebe9307c271855000000000000000 */
+  L(8.75629257203538208242932228131394368E-01), /* 3ffec0527a5e384ddc00000000000000 */
+  L(8.79056373217652342599848225290770642E-01), /* 3ffec213ad4c9ed0d800000000000000 */
+  L(8.82496902584595399599010079327854328E-01), /* 3ffec3d6a24ed8221800000000000000 */
+  L(8.85950897802745995779361010136199184E-01), /* 3ffec59b5b27d9696800000000000000 */
+  L(8.89418411575955636383383762222365476E-01), /* 3ffec761d99c5ba58800000000000000 */
+  L(8.92899496814352794382685374330321793E-01), /* 3ffec92a1f72dd70d400000000000000 */
+  L(8.96394206635150403439382671422208659E-01), /* 3ffecaf42e73a4c7d800000000000000 */
+  L(8.99902594363456265202927397695020773E-01), /* 3ffeccc00868c0d18800000000000000 */
+  L(9.03424713533086704009278378180169966E-01), /* 3ffece8daf1e0ba94c00000000000000 */
+  L(9.06960617887383580004723171441582963E-01), /* 3ffed05d24612c2af000000000000000 */
+  L(9.10510361380034133338412516422977205E-01), /* 3ffed22e6a0197c02c00000000000000 */
+  L(9.14073998175894436579724811053893063E-01), /* 3ffed40181d094303400000000000000 */
+  L(9.17651582651815816982221463149471674E-01), /* 3ffed5d66da13970f400000000000000 */
+  L(9.21243169397474526149949269893113524E-01), /* 3ffed7ad2f48737a2000000000000000 */
+  L(9.24848813216204823639543519675498828E-01), /* 3ffed985c89d041a3000000000000000 */
+  L(9.28468569125835141431224428743007593E-01), /* 3ffedb603b7784cd1800000000000000 */
+  L(9.32102492359527579068867453315760940E-01), /* 3ffedd3c89b26894e000000000000000 */
+  L(9.35750638366620729469147477175283711E-01), /* 3ffedf1ab529fdd41c00000000000000 */
+  L(9.39413062813475779888605643463961314E-01), /* 3ffee0fabfbc702a3c00000000000000 */
+  L(9.43089821584325888048638830696290825E-01), /* 3ffee2dcab49ca51b400000000000000 */
+  L(9.46780970782128888929563004239753354E-01), /* 3ffee4c079b3f8000400000000000000 */
+  L(9.50486566729423443256052905780961737E-01), /* 3ffee6a62cdec7c7b000000000000000 */
+  L(9.54206665969188322362626308859034907E-01), /* 3ffee88dc6afecfbfc00000000000000 */
+  L(9.57941325265705301283958306157728657E-01), /* 3ffeea77490f0196b000000000000000 */
+  L(9.61690601605425299247542625380447134E-01), /* 3ffeec62b5e5881fb000000000000000 */
+  L(9.65454552197837823079851204965962097E-01), /* 3ffeee500f1eed967000000000000000 */
+  L(9.69233234476344074348475032820715569E-01), /* 3ffef03f56a88b5d7800000000000000 */
+  L(9.73026706099133165128733935489435680E-01), /* 3ffef2308e71a927a800000000000000 */
+  L(9.76835024950062025261843245971249416E-01), /* 3ffef423b86b7ee79000000000000000 */
+  L(9.80658249139538557015427500118676107E-01), /* 3ffef618d68936c09c00000000000000 */
+  L(9.84496437005408397968864164795377292E-01), /* 3ffef80feabfeefa4800000000000000 */
+  L(9.88349647113845042323276857132441364E-01), /* 3ffefa08f706bbf53800000000000000 */
+  L(9.92217938260243514925207364285597578E-01), /* 3ffefc03fd56aa225000000000000000 */
+  L(9.96101369470117486981664001177705359E-01), /* 3ffefe00ffaabffbbc00000000000000 */
+#define T_EXPL_RES1 (T_EXPL_ARG2 + 2 + 2*65 + 89)
+  L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
+  L(1.00391388933834757590801700644078664E+00), /* 3fff0100802ab5577800000000000000 */
+  L(1.00784309720644799091004983893071767E+00), /* 3fff0202015600445c00000000000000 */
+  L(1.01178768355933151879000320150225889E+00), /* 3fff0304848362076c00000000000000 */
+  L(1.01574770858668572692806719715008512E+00), /* 3fff04080ab55de39000000000000000 */
+  L(1.01972323271377413034244341361045372E+00), /* 3fff050c94ef7a206c00000000000000 */
+  L(1.02371431660235789884438872832106426E+00), /* 3fff06122436410dd000000000000000 */
+  L(1.02772102115162167201845022646011785E+00), /* 3fff0718b98f42085000000000000000 */
+  L(1.03174340749910264936062276319717057E+00), /* 3fff08205601127ec800000000000000 */
+  L(1.03578153702162378824169763902318664E+00), /* 3fff0928fa934ef90800000000000000 */
+  L(1.03983547133622999947277776300325058E+00), /* 3fff0a32a84e9c1f5800000000000000 */
+  L(1.04390527230112850620713516036630608E+00), /* 3fff0b3d603ca7c32800000000000000 */
+  L(1.04799100201663270004459604933799710E+00), /* 3fff0c49236829e8bc00000000000000 */
+  L(1.05209272282610977189420964350574650E+00), /* 3fff0d55f2dce5d1e800000000000000 */
+  L(1.05621049731693195106174698594259098E+00), /* 3fff0e63cfa7ab09d000000000000000 */
+  L(1.06034438832143151909548350886325352E+00), /* 3fff0f72bad65671b800000000000000 */
+  L(1.06449445891785943185681162503897212E+00), /* 3fff1082b577d34ed800000000000000 */
+  L(1.06866077243134810492719566354935523E+00), /* 3fff1193c09c1c595c00000000000000 */
+  L(1.07284339243487741866189821848820429E+00), /* 3fff12a5dd543ccc4c00000000000000 */
+  L(1.07704238275024494209120007326419000E+00), /* 3fff13b90cb25176a400000000000000 */
+  L(1.08125780744903959851299646288680378E+00), /* 3fff14cd4fc989cd6400000000000000 */
+  L(1.08548973085361949442173568058933597E+00), /* 3fff15e2a7ae28fecc00000000000000 */
+  L(1.08973821753809324563988525369495619E+00), /* 3fff16f9157587069400000000000000 */
+  L(1.09400333232930546678574046381982043E+00), /* 3fff18109a3611c35000000000000000 */
+  L(1.09828514030782586896606289883493446E+00), /* 3fff192937074e0cd800000000000000 */
+  L(1.10258370680894224324930519287590869E+00), /* 3fff1a42ed01d8cbc800000000000000 */
+  L(1.10689909742365749645287564817408565E+00), /* 3fff1b5dbd3f68122400000000000000 */
+  L(1.11123137799969046168868658241990488E+00), /* 3fff1c79a8dacc350c00000000000000 */
+  L(1.11558061464248076122274255794764031E+00), /* 3fff1d96b0eff0e79400000000000000 */
+  L(1.11994687371619722204840741142106708E+00), /* 3fff1eb4d69bde569c00000000000000 */
+  L(1.12433022184475073235176978414529003E+00), /* 3fff1fd41afcba45e800000000000000 */
+  L(1.12873072591281087273529237791080959E+00), /* 3fff20f47f31c92e4800000000000000 */
+  L(1.13314845306682632219974493636982515E+00), /* 3fff2216045b6f5cd000000000000000 */
+  L(1.13758347071604959399593326452304609E+00), /* 3fff2338ab9b32134800000000000000 */
+  L(1.14203584653356560174586320499656722E+00), /* 3fff245c7613b8a9b000000000000000 */
+  L(1.14650564845732405583333957110880874E+00), /* 3fff258164e8cdb0d800000000000000 */
+  L(1.15099294469117646722011727433709893E+00), /* 3fff26a7793f60164400000000000000 */
+  L(1.15549780370591653744227755851170514E+00), /* 3fff27ceb43d84490400000000000000 */
+  L(1.16002029424032515603215642840950750E+00), /* 3fff28f7170a755fd800000000000000 */
+  L(1.16456048530221917269855680387991015E+00), /* 3fff2a20a2ce96406400000000000000 */
+  L(1.16911844616950438835445424956560601E+00), /* 3fff2b4b58b372c79400000000000000 */
+  L(1.17369424639123270948104504896036815E+00), /* 3fff2c7739e3c0f32c00000000000000 */
+  L(1.17828795578866324378353169777255971E+00), /* 3fff2da4478b620c7400000000000000 */
+  L(1.18289964445632783673900689791480545E+00), /* 3fff2ed282d763d42400000000000000 */
+  L(1.18752938276310060494722620205720887E+00), /* 3fff3001ecf601af7000000000000000 */
+  L(1.19217724135327157730657177125976887E+00), /* 3fff31328716a5d63c00000000000000 */
+  L(1.19684329114762477708211463323095813E+00), /* 3fff32645269ea829000000000000000 */
+  L(1.20152760334452030077656559114984702E+00), /* 3fff339750219b212c00000000000000 */
+  L(1.20623024942098072687102217059873510E+00), /* 3fff34cb8170b5835400000000000000 */
+  L(1.21095130113378179892436037334846333E+00), /* 3fff3600e78b6b11d000000000000000 */
+  L(1.21569083052054743854242246925423387E+00), /* 3fff373783a722012400000000000000 */
+  L(1.22044890990084875515009343871497549E+00), /* 3fff386f56fa7686e800000000000000 */
+  L(1.22522561187730755216662714701669756E+00), /* 3fff39a862bd3c106400000000000000 */
+  L(1.23002100933670455162882717559114099E+00), /* 3fff3ae2a8287e7a8000000000000000 */
+  L(1.23483517545109100499445276000187732E+00), /* 3fff3c1e2876834aa800000000000000 */
+  L(1.23966818367890557750499169742397498E+00), /* 3fff3d5ae4e2cae92c00000000000000 */
+  L(1.24452010776609517384017067342938390E+00), /* 3fff3e98deaa11dcbc00000000000000 */
+  L(1.24939102174724003813111039562500082E+00), /* 3fff3fd8170a52071800000000000000 */
+  L(1.25428099994668373895478907797951251E+00), /* 3fff41188f42c3e32000000000000000 */
+  L(1.25919011697966698459794088194030337E+00), /* 3fff425a4893dfc3f800000000000000 */
+  L(1.26411844775346637881341393949696794E+00), /* 3fff439d443f5f159000000000000000 */
+  L(1.26906606746853711786826579555054195E+00), /* 3fff44e183883d9e4800000000000000 */
+  L(1.27403305161966090564007458851847332E+00), /* 3fff462707b2bac20c00000000000000 */
+  L(1.27901947599709753244923149395617656E+00), /* 3fff476dd2045ac67800000000000000 */
+  L(1.28402541668774150540599521264084615E+00), /* 3fff48b5e3c3e8186800000000000000 */
+  L(1.28905095007628295311619126550795045E+00), /* 3fff49ff3e397492bc00000000000000 */
+  L(1.29409615284637330434591717676084954E+00), /* 3fff4b49e2ae5ac67400000000000000 */
+  L(1.29916110198179535206719492634874769E+00), /* 3fff4c95d26d3f440800000000000000 */
+  L(1.30424587476763775839572190307080746E+00), /* 3fff4de30ec211e60000000000000000 */
+  L(1.30935054879147461104338390214252286E+00), /* 3fff4f3198fa0f1cf800000000000000 */
+  L(1.31447520194454914310711046709911898E+00), /* 3fff50817263c13cd000000000000000 */
+  L(1.31961991242296217130558488861424848E+00), /* 3fff51d29c4f01cb3000000000000000 */
+  L(1.32478475872886558573071624778094701E+00), /* 3fff5325180cfacf7800000000000000 */
+  L(1.32996981967165983640200010995613411E+00), /* 3fff5478e6f02823d000000000000000 */
+  L(1.33517517436919680440254865061433520E+00), /* 3fff55ce0a4c58c7bc00000000000000 */
+  L(1.34040090224898678084031189428060316E+00), /* 3fff57248376b033d800000000000000 */
+  L(1.34564708304941055283521222918352578E+00), /* 3fff587c53c5a7af0400000000000000 */
+  L(1.35091379682093615244298234756570309E+00), /* 3fff59d57c910fa4e000000000000000 */
+  L(1.35620112392734021300455538039386738E+00), /* 3fff5b2fff3210fd9400000000000000 */
+  L(1.36150914504693443252136830778908916E+00), /* 3fff5c8bdd032e770800000000000000 */
+  L(1.36683794117379636690046140756749082E+00), /* 3fff5de9176045ff5400000000000000 */
+  L(1.37218759361900544124779344201670028E+00), /* 3fff5f47afa69210a800000000000000 */
+  L(1.37755818401188367960941150158760138E+00), /* 3fff60a7a734ab0e8800000000000000 */
+  L(1.38294979430124120867162673675920814E+00), /* 3fff6208ff6a88a46000000000000000 */
+  L(1.38836250675662681297595213436579797E+00), /* 3fff636bb9a983258400000000000000 */
+  L(1.39379640396958309755959248832368758E+00), /* 3fff64cfd75454ee7c00000000000000 */
+  L(1.39925156885490681313299887733592186E+00), /* 3fff663559cf1bc7c400000000000000 */
+  L(1.40472808465191417726103395580139477E+00), /* 3fff679c427f5a49f400000000000000 */
+  L(1.41022603492571069194738697660795879E+00), /* 3fff690492cbf9432c00000000000000 */
+  L(1.41574550356846662335641440222389065E+00), /* 3fff6a6e4c1d491e1800000000000000 */
+
+  L(9.98018323540573404351050612604012713E-01), /* 3ffefefc41f8d4bdb000000000000000 */
+  L(9.98048781107475468932221929208026268E-01), /* 3ffeff003ff556aa8800000000000000 */
+  L(9.98079239603882895082165305211674422E-01), /* 3ffeff043df9d4986000000000000000 */
+  L(9.98109699029824021243584297735651489E-01), /* 3ffeff083c064e972c00000000000000 */
+  L(9.98140159385327269125909310787392315E-01), /* 3ffeff0c3a1ac4b6ec00000000000000 */
+  L(9.98170620670420977171843901487591211E-01), /* 3ffeff10383737079400000000000000 */
+  L(9.98201082885133511579667242585856002E-01), /* 3ffeff14365ba5991c00000000000000 */
+  L(9.98231546029493238547658506831794512E-01), /* 3ffeff183488107b7c00000000000000 */
+  L(9.98262010103528552029672482603928074E-01), /* 3ffeff1c32bc77beb000000000000000 */
+  L(9.98292475107267818223988342651864514E-01), /* 3ffeff2030f8db72b000000000000000 */
+  L(9.98322941040739375573309644096298143E-01), /* 3ffeff242f3d3ba77000000000000000 */
+  L(9.98353407903971645787066790944663808E-01), /* 3ffeff282d89986cf000000000000000 */
+  L(9.98383875696992967307963340317655820E-01), /* 3ffeff2c2bddf1d32400000000000000 */
+  L(9.98414344419831761845429696222709026E-01), /* 3ffeff302a3a47ea0c00000000000000 */
+  L(9.98444814072516340086593800151604228E-01), /* 3ffeff34289e9ac19800000000000000 */
+  L(9.98475284655075123740886056111776270E-01), /* 3ffeff38270aea69c800000000000000 */
+  L(9.98505756167536479006585636852832977E-01), /* 3ffeff3c257f36f29400000000000000 */
+  L(9.98536228609928799837547330753295682E-01), /* 3ffeff4023fb806bf800000000000000 */
+  L(9.98566701982280452432050310562772211E-01), /* 3ffeff44227fc6e5ec00000000000000 */
+  L(9.98597176284619802988373749030870385E-01), /* 3ffeff48210c0a706800000000000000 */
+  L(9.98627651516975245460372434536111541E-01), /* 3ffeff4c1fa04b1b6800000000000000 */
+  L(9.98658127679375173801901155457017012E-01), /* 3ffeff501e3c88f6e800000000000000 */
+  L(9.98688604771847954211239084543194622E-01), /* 3ffeff541ce0c412e000000000000000 */
+  L(9.98719082794421980642241010173165705E-01), /* 3ffeff581b8cfc7f4c00000000000000 */
+  L(9.98749561747125619293186105096538085E-01), /* 3ffeff5c1a41324c2400000000000000 */
+  L(9.98780041629987291873504773320746608E-01), /* 3ffeff6018fd65896800000000000000 */
+  L(9.98810522443035364581476187595399097E-01), /* 3ffeff6417c196471000000000000000 */
+  L(9.98841004186298203615379520670103375E-01), /* 3ffeff68168dc4951400000000000000 */
+  L(9.98871486859804230684645176552294288E-01), /* 3ffeff6c1561f0837400000000000000 */
+  L(9.98901970463581839743127943620493170E-01), /* 3ffeff70143e1a222c00000000000000 */
+  L(9.98932454997659369233531378995394334E-01), /* 3ffeff74132241813000000000000000 */
+  L(9.98962940462065268620861502313346136E-01), /* 3ffeff78120e66b08400000000000000 */
+  L(9.98993426856827904103397486323956400E-01), /* 3ffeff7c110289c02000000000000000 */
+  L(9.99023914181975669634994119405746460E-01), /* 3ffeff800ffeaac00000000000000000 */
+  L(9.99054402437536959169506189937237650E-01), /* 3ffeff840f02c9c02000000000000000 */
+  L(9.99084891623540138905212870668037795E-01), /* 3ffeff880e0ee6d07800000000000000 */
+  L(9.99115381740013658307120181234495249E-01), /* 3ffeff8c0d2302010c00000000000000 */
+  L(9.99145872786985911329082910015131347E-01), /* 3ffeff900c3f1b61d800000000000000 */
+  L(9.99176364764485236413804614130640402E-01), /* 3ffeff940b633302d000000000000000 */
+  L(9.99206857672540083026291313217370771E-01), /* 3ffeff980a8f48f3f800000000000000 */
+  L(9.99237351511178817364822180024930276E-01), /* 3ffeff9c09c35d454800000000000000 */
+  L(9.99267846280429861138827618560753763E-01), /* 3ffeffa008ff7006c000000000000000 */
+  L(9.99298341980321608302162417203362565E-01), /* 3ffeffa4084381485c00000000000000 */
+  L(9.99328838610882452808681364331278019E-01), /* 3ffeffa8078f911a1800000000000000 */
+  L(9.99359336172140816367814863951934967E-01), /* 3ffeffac06e39f8bf400000000000000 */
+  L(9.99389834664125092933417704443854745E-01), /* 3ffeffb0063facadec00000000000000 */
+  L(9.99420334086863676459344674185558688E-01), /* 3ffeffb405a3b88ffc00000000000000 */
+  L(9.99450834440384988655026177184481639E-01), /* 3ffeffb8050fc3422400000000000000 */
+  L(9.99481335724717395718741386190231424E-01), /* 3ffeffbc0483ccd45c00000000000000 */
+  L(9.99511837939889374871071936468069907E-01), /* 3ffeffc003ffd556ac00000000000000 */
+  L(9.99542341085929264554721385138691403E-01), /* 3ffeffc40383dcd90800000000000000 */
+  L(9.99572845162865514234695751838444266E-01), /* 3ffeffc8030fe36b7400000000000000 */
+  L(9.99603350170726517864849824945849832E-01), /* 3ffeffcc02a3e91dec00000000000000 */
+  L(9.99633856109540669399038392839429434E-01), /* 3ffeffd0023fee006c00000000000000 */
+  L(9.99664362979336418302267475155531429E-01), /* 3ffeffd401e3f222f800000000000000 */
+  L(9.99694870780142130772816244643763639E-01), /* 3ffeffd8018ff5958800000000000000 */
+  L(9.99725379511986284031266336569387931E-01), /* 3ffeffdc0143f8682400000000000000 */
+  L(9.99755889174897216520321308053098619E-01), /* 3ffeffe000fffaaac000000000000000 */
+  L(9.99786399768903377704987178731244057E-01), /* 3ffeffe400c3fc6d6000000000000000 */
+  L(9.99816911294033217050269968240172602E-01), /* 3ffeffe8008ffdc00800000000000000 */
+  L(9.99847423750315072998873233700578567E-01), /* 3ffeffec0063feb2ac00000000000000 */
+  L(9.99877937137777450526954226006637327E-01), /* 3ffefff0003fff555800000000000000 */
+  L(9.99908451456448688077216502279043198E-01), /* 3ffefff40023ffb80000000000000000 */
+  L(9.99938966706357262870241697783058044E-01), /* 3ffefff8000fffeaac00000000000000 */
+  L(9.99969482887531541104308985268289689E-01), /* 3ffefffc0003fffd5400000000000000 */
+#define T_EXPL_RES2 (T_EXPL_RES1 + 1 + 89 + 65)
+  L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
+  L(1.00003051804379100575559391472779680E+00), /* 3fff0002000200015400000000000000 */
+  L(1.00006103701893306334724798034585547E+00), /* 3fff00040008000aac00000000000000 */
+  L(1.00009155692545448346209013834595680E+00), /* 3fff0006001200240000000000000000 */
+  L(1.00012207776338379883185325525118969E+00), /* 3fff0008002000555800000000000000 */
+  L(1.00015259953274932014366527255333494E+00), /* 3fff000a003200a6ac00000000000000 */
+  L(1.00018312223357958012925905677548144E+00), /* 3fff000c004801200400000000000000 */
+  L(1.00021364586590294498691378066723701E+00), /* 3fff000e006201c95c00000000000000 */
+  L(1.00024417042974783642605984823603649E+00), /* 3fff0010008002aab400000000000000 */
+  L(1.00027469592514273166727889474714175E+00), /* 3fff001200a203cc1000000000000000 */
+  L(1.00030522235211605242000132420798764E+00), /* 3fff001400c805357000000000000000 */
+  L(1.00033574971069616488250630936818197E+00), /* 3fff001600f206eed000000000000000 */
+  L(1.00036627800091160178652671675081365E+00), /* 3fff0018012009003800000000000000 */
+  L(1.00039680722279067381919048784766346E+00), /* 3fff001a01520b71a000000000000000 */
+  L(1.00042733737636191371223048918182030E+00), /* 3fff001c01880e4b1000000000000000 */
+  L(1.00045786846165368766392589350289200E+00), /* 3fff001e01c211948400000000000000 */
+  L(1.00048840047869447289485833607614040E+00), /* 3fff0020020015560000000000000000 */
+  L(1.00051893342751269111445822090900037E+00), /* 3fff0022024219978400000000000000 */
+  L(1.00054946730813676403215595200890675E+00), /* 3fff002402881e611000000000000000 */
+  L(1.00058000212059516886853316464112140E+00), /* 3fff002602d223baa800000000000000 */
+  L(1.00061053786491632733302026281307917E+00), /* 3fff0028032029ac4c00000000000000 */
+  L(1.00064107454112866113504765053221490E+00), /* 3fff002a0372303dfc00000000000000 */
+  L(1.00067161214926059198404573180596344E+00), /* 3fff002c03c83777b800000000000000 */
+  L(1.00070215068934059710059614189958666E+00), /* 3fff002e04223f618400000000000000 */
+  L(1.00073269016139709819412928482051939E+00), /* 3fff0030048048036000000000000000 */
+  L(1.00076323056545857248522679583402351E+00), /* 3fff003204e251655000000000000000 */
+  L(1.00079377190155338617216784768970683E+00), /* 3fff003405485b8f5000000000000000 */
+  L(1.00082431416971007198668530691065826E+00), /* 3fff003605b266896800000000000000 */
+  L(1.00085485736995705163820957750431262E+00), /* 3fff00380620725b9800000000000000 */
+  L(1.00088540150232269132501983222027775E+00), /* 3fff003a06927f0ddc00000000000000 */
+  L(1.00091594656683552377884893758164253E+00), /* 3fff003c07088ca83c00000000000000 */
+  L(1.00094649256352402622027852885366883E+00), /* 3fff003e07829b32bc00000000000000 */
+  L(1.00097703949241650933643654752813745E+00), /* 3fff00400800aab55400000000000000 */
+  L(1.00100758735354156137020709138596430E+00), /* 3fff00420882bb381000000000000000 */
+  L(1.00103813614692760403102056443458423E+00), /* 3fff00440908ccc2f000000000000000 */
+  L(1.00106868587260300351715613942360505E+00), /* 3fff00460992df5df000000000000000 */
+  L(1.00109923653059629256034668287611566E+00), /* 3fff00480a20f3111800000000000000 */
+  L(1.00112978812093589287002259879955091E+00), /* 3fff004a0ab307e46800000000000000 */
+  L(1.00116034064365022615561429120134562E+00), /* 3fff004c0b491ddfe000000000000000 */
+  L(1.00119089409876788066000585786241572E+00), /* 3fff004e0be3350b8c00000000000000 */
+  L(1.00122144848631711155917400901671499E+00), /* 3fff00500c814d6f6000000000000000 */
+  L(1.00125200380632656260715407370298635E+00), /* 3fff00520d2367136c00000000000000 */
+  L(1.00128256005882454449107399341301061E+00), /* 3fff00540dc981ffa800000000000000 */
+  L(1.00131311724383964545381786592770368E+00), /* 3fff00560e739e3c2000000000000000 */
+  L(1.00134367536140017618251363273884635E+00), /* 3fff00580f21bbd0cc00000000000000 */
+  L(1.00137423441153472492004539162735455E+00), /* 3fff005a0fd3dac5b800000000000000 */
+  L(1.00140479439427171337584354660066310E+00), /* 3fff005c1089fb22e400000000000000 */
+  L(1.00143535530963956325933850166620687E+00), /* 3fff005e11441cf05000000000000000 */
+  L(1.00146591715766680730226312334707472E+00), /* 3fff0060120240360400000000000000 */
+  L(1.00149647993838186721404781565070152E+00), /* 3fff006212c464fc0000000000000000 */
+  L(1.00152704365181316470412298258452211E+00), /* 3fff0064138a8b4a4400000000000000 */
+  L(1.00155760829798923250422149067162536E+00), /* 3fff00661454b328d800000000000000 */
+  L(1.00158817387693849232377374391944613E+00), /* 3fff00681522dc9fbc00000000000000 */
+  L(1.00161874038868942138336137759324629E+00), /* 3fff006a15f507b6f400000000000000 */
+  L(1.00164930783327055241471725821611471E+00), /* 3fff006c16cb34768800000000000000 */
+  L(1.00167987621071025161612055853765924E+00), /* 3fff006e17a562e67400000000000000 */
+  L(1.00171044552103705171930414508096874E+00), /* 3fff00701883930ec000000000000000 */
+  L(1.00174101576427937443369842185347807E+00), /* 3fff00721965c4f76c00000000000000 */
+  L(1.00177158694046569697988502412044909E+00), /* 3fff00741a4bf8a87c00000000000000 */
+  L(1.00180215904962455208959681840497069E+00), /* 3fff00761b362e29f800000000000000 */
+  L(1.00183273209178441698341543997230474E+00), /* 3fff00781c246583e400000000000000 */
+  L(1.00186330606697365785962006157205906E+00), /* 3fff007a1d169ebe3c00000000000000 */
+  L(1.00189388097522080744994354972732253E+00), /* 3fff007c1e0cd9e10800000000000000 */
+  L(1.00192445681655439848611877096118405E+00), /* 3fff007e1f0716f45000000000000000 */
+  L(1.00195503359100279716642489802325144E+00), /* 3fff0080200556001000000000000000 */
+  L(1.00198561129859459173374602869444061E+00), /* 3fff00822107970c5400000000000000 */
+};
-- 
2.14.1


From d50b9bf1cc842bfac6de12a1e2c7d202fb71879f Mon Sep 17 00:00:00 2001
From: "Gabriel F. T. Gomes" <gabriel@inconstante.eti.br>
Date: Sat, 9 Sep 2017 19:37:11 -0300
Subject: [PATCH 57/90] ldbl-128ibm: Automatic replacing of _Float128 and L()

The ldbl-128ibm implementation of j0l, j1l, lgammal_r, and cbrtl, as
well as the tables used by expl were copied from ldbl-128.  However, the
original files used _Float128 for the type and L() for the literal
suffix.  This patch uses the following sed command to rewrite _Float128
as long double and L(x) as xL (for e_expl.c, e_j0l.c, e_j1l.c,
e_lgammal_r.c, and t_expl.h):

  sed -i <filename> \
    -e "/^#define _Float128 long double/d" \
    -e "/^#define L(x) x ## L/d" \
    -e "/L(/s/)/L/" \
    -e "/L(/s/L(//" \
    -e "s/_Float128/long double/g"

For sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c, this sed command incorrectly
replaces a few occurrences of L(), so the following command is used
instead:

  sed -i sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c \
    -e "/^#define _Float128 long double/d" \
    -e "/^#define L(x) x ## L/d" \
    -e "s/L(0\.3\{40\})/0.3333333333333333333333333333333333333333L/" \
    -e "s/L(3\.7568280825958912391243e-1)/3.7568280825958912391243e-1L/" \
    -e "/L(/s/)/L/" \
    -e "/L(/s/L(//" \
    -e "s/_Float128/long double/g"

Tested for powerpc64le with patched [1] and unpatched gcc.

[1] https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01028.html

	* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Remove definitions of
	_Float128 and L().
	* sysdeps/ieee754/ldbl-128ibm/e_j0l.c: Remove definitions of
	_Float128 and L(). Replace _Float128 with long double and L(x)
	with xL, throughout the file.
	* sysdeps/ieee754/ldbl-128ibm/e_j1l.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/t_expl.h: Likewise.

(cherry picked from commit d2f0ed09f88195dbeaa8a667b2d3ffa5423562a1)
---
 ChangeLog                                 |   12 +
 sysdeps/ieee754/ldbl-128ibm/e_expl.c      |    2 -
 sysdeps/ieee754/ldbl-128ibm/e_j0l.c       |  830 +++++++------
 sysdeps/ieee754/ldbl-128ibm/e_j1l.c       |  834 +++++++------
 sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c |  932 +++++++--------
 sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c     |   32 +-
 sysdeps/ieee754/ldbl-128ibm/t_expl.h      | 1864 ++++++++++++++---------------
 7 files changed, 2253 insertions(+), 2253 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9713fd8e21..21e923c2f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
+
+	* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Remove definitions of
+	_Float128 and L().
+	* sysdeps/ieee754/ldbl-128ibm/e_j0l.c: Remove definitions of
+	_Float128 and L(). Replace _Float128 with long double and L(x)
+	with xL, throughout the file.
+	* sysdeps/ieee754/ldbl-128ibm/e_j1l.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c: Likewise.
+	* sysdeps/ieee754/ldbl-128ibm/t_expl.h: Likewise.
+
 2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
 	* sysdeps/ieee754/ldbl-128ibm/e_expl.c: Include tables from
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_expl.c b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
index db812e9b82..9185e7cb5c 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_expl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_expl.c
@@ -66,8 +66,6 @@
 #include <inttypes.h>
 #include <math_private.h>
 
-#define _Float128 long double
-#define L(x) x ## L
 
 #include "t_expl.h"
 
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
index d437926bb1..0a7fe32354 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j0l.c
@@ -17,41 +17,39 @@
 
 /* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c.  */
 
-#define _Float128 long double
-#define L(x) x ## L
 
 #include <math.h>
 #include <math_private.h>
 #include <float.h>
 
 /* 1 / sqrt(pi) */
-static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
 /* 2 / pi */
-static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
-static const _Float128 zero = 0;
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double zero = 0;
 
 /* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2)
    Peak relative error 3.4e-37
    0 <= x <= 2  */
 #define NJ0_2N 6
-static const _Float128 J0_2N[NJ0_2N + 1] = {
-  L(3.133239376997663645548490085151484674892E16),
- L(-5.479944965767990821079467311839107722107E14),
-  L(6.290828903904724265980249871997551894090E12),
- L(-3.633750176832769659849028554429106299915E10),
-  L(1.207743757532429576399485415069244807022E8),
- L(-2.107485999925074577174305650549367415465E5),
-  L(1.562826808020631846245296572935547005859E2),
+static const long double J0_2N[NJ0_2N + 1] = {
+  3.133239376997663645548490085151484674892E16L,
+ -5.479944965767990821079467311839107722107E14L,
+  6.290828903904724265980249871997551894090E12L,
+ -3.633750176832769659849028554429106299915E10L,
+  1.207743757532429576399485415069244807022E8L,
+ -2.107485999925074577174305650549367415465E5L,
+  1.562826808020631846245296572935547005859E2L,
 };
 #define NJ0_2D 6
-static const _Float128 J0_2D[NJ0_2D + 1] = {
-  L(2.005273201278504733151033654496928968261E18),
-  L(2.063038558793221244373123294054149790864E16),
-  L(1.053350447931127971406896594022010524994E14),
-  L(3.496556557558702583143527876385508882310E11),
-  L(8.249114511878616075860654484367133976306E8),
-  L(1.402965782449571800199759247964242790589E6),
-  L(1.619910762853439600957801751815074787351E3),
+static const long double J0_2D[NJ0_2D + 1] = {
+  2.005273201278504733151033654496928968261E18L,
+  2.063038558793221244373123294054149790864E16L,
+  1.053350447931127971406896594022010524994E14L,
+  3.496556557558702583143527876385508882310E11L,
+  8.249114511878616075860654484367133976306E8L,
+  1.402965782449571800199759247964242790589E6L,
+  1.619910762853439600957801751815074787351E3L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -59,30 +57,30 @@ static const _Float128 J0_2D[NJ0_2D + 1] = {
    0 <= 1/x <= .0625
    Peak relative error 3.3e-36  */
 #define NP16_IN 9
-static const _Float128 P16_IN[NP16_IN + 1] = {
-  L(-1.901689868258117463979611259731176301065E-16),
-  L(-1.798743043824071514483008340803573980931E-13),
-  L(-6.481746687115262291873324132944647438959E-11),
-  L(-1.150651553745409037257197798528294248012E-8),
-  L(-1.088408467297401082271185599507222695995E-6),
-  L(-5.551996725183495852661022587879817546508E-5),
-  L(-1.477286941214245433866838787454880214736E-3),
-  L(-1.882877976157714592017345347609200402472E-2),
-  L(-9.620983176855405325086530374317855880515E-2),
-  L(-1.271468546258855781530458854476627766233E-1),
+static const long double P16_IN[NP16_IN + 1] = {
+  -1.901689868258117463979611259731176301065E-16L,
+  -1.798743043824071514483008340803573980931E-13L,
+  -6.481746687115262291873324132944647438959E-11L,
+  -1.150651553745409037257197798528294248012E-8L,
+  -1.088408467297401082271185599507222695995E-6L,
+  -5.551996725183495852661022587879817546508E-5L,
+  -1.477286941214245433866838787454880214736E-3L,
+  -1.882877976157714592017345347609200402472E-2L,
+  -9.620983176855405325086530374317855880515E-2L,
+  -1.271468546258855781530458854476627766233E-1L,
 };
 #define NP16_ID 9
-static const _Float128 P16_ID[NP16_ID + 1] = {
-  L(2.704625590411544837659891569420764475007E-15),
-  L(2.562526347676857624104306349421985403573E-12),
-  L(9.259137589952741054108665570122085036246E-10),
-  L(1.651044705794378365237454962653430805272E-7),
-  L(1.573561544138733044977714063100859136660E-5),
-  L(8.134482112334882274688298469629884804056E-4),
-  L(2.219259239404080863919375103673593571689E-2),
-  L(2.976990606226596289580242451096393862792E-1),
-  L(1.713895630454693931742734911930937246254E0),
-  L(3.231552290717904041465898249160757368855E0),
+static const long double P16_ID[NP16_ID + 1] = {
+  2.704625590411544837659891569420764475007E-15L,
+  2.562526347676857624104306349421985403573E-12L,
+  9.259137589952741054108665570122085036246E-10L,
+  1.651044705794378365237454962653430805272E-7L,
+  1.573561544138733044977714063100859136660E-5L,
+  8.134482112334882274688298469629884804056E-4L,
+  2.219259239404080863919375103673593571689E-2L,
+  2.976990606226596289580242451096393862792E-1L,
+  1.713895630454693931742734911930937246254E0L,
+  3.231552290717904041465898249160757368855E0L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -90,32 +88,32 @@ static const _Float128 P16_ID[NP16_ID + 1] = {
     0.0625 <= 1/x <= 0.125
     Peak relative error 2.4e-35  */
 #define NP8_16N 10
-static const _Float128 P8_16N[NP8_16N + 1] = {
-  L(-2.335166846111159458466553806683579003632E-15),
-  L(-1.382763674252402720401020004169367089975E-12),
-  L(-3.192160804534716696058987967592784857907E-10),
-  L(-3.744199606283752333686144670572632116899E-8),
-  L(-2.439161236879511162078619292571922772224E-6),
-  L(-9.068436986859420951664151060267045346549E-5),
-  L(-1.905407090637058116299757292660002697359E-3),
-  L(-2.164456143936718388053842376884252978872E-2),
-  L(-1.212178415116411222341491717748696499966E-1),
-  L(-2.782433626588541494473277445959593334494E-1),
-  L(-1.670703190068873186016102289227646035035E-1),
+static const long double P8_16N[NP8_16N + 1] = {
+  -2.335166846111159458466553806683579003632E-15L,
+  -1.382763674252402720401020004169367089975E-12L,
+  -3.192160804534716696058987967592784857907E-10L,
+  -3.744199606283752333686144670572632116899E-8L,
+  -2.439161236879511162078619292571922772224E-6L,
+  -9.068436986859420951664151060267045346549E-5L,
+  -1.905407090637058116299757292660002697359E-3L,
+  -2.164456143936718388053842376884252978872E-2L,
+  -1.212178415116411222341491717748696499966E-1L,
+  -2.782433626588541494473277445959593334494E-1L,
+  -1.670703190068873186016102289227646035035E-1L,
 };
 #define NP8_16D 10
-static const _Float128 P8_16D[NP8_16D + 1] = {
-  L(3.321126181135871232648331450082662856743E-14),
-  L(1.971894594837650840586859228510007703641E-11),
-  L(4.571144364787008285981633719513897281690E-9),
-  L(5.396419143536287457142904742849052402103E-7),
-  L(3.551548222385845912370226756036899901549E-5),
-  L(1.342353874566932014705609788054598013516E-3),
-  L(2.899133293006771317589357444614157734385E-2),
-  L(3.455374978185770197704507681491574261545E-1),
-  L(2.116616964297512311314454834712634820514E0),
-  L(5.850768316827915470087758636881584174432E0),
-  L(5.655273858938766830855753983631132928968E0),
+static const long double P8_16D[NP8_16D + 1] = {
+  3.321126181135871232648331450082662856743E-14L,
+  1.971894594837650840586859228510007703641E-11L,
+  4.571144364787008285981633719513897281690E-9L,
+  5.396419143536287457142904742849052402103E-7L,
+  3.551548222385845912370226756036899901549E-5L,
+  1.342353874566932014705609788054598013516E-3L,
+  2.899133293006771317589357444614157734385E-2L,
+  3.455374978185770197704507681491574261545E-1L,
+  2.116616964297512311314454834712634820514E0L,
+  5.850768316827915470087758636881584174432E0L,
+  5.655273858938766830855753983631132928968E0L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -123,31 +121,31 @@ static const _Float128 P8_16D[NP8_16D + 1] = {
   0.125 <= 1/x <= 0.1875
   Peak relative error 2.7e-35  */
 #define NP5_8N 10
-static const _Float128 P5_8N[NP5_8N + 1] = {
-  L(-1.270478335089770355749591358934012019596E-12),
-  L(-4.007588712145412921057254992155810347245E-10),
-  L(-4.815187822989597568124520080486652009281E-8),
-  L(-2.867070063972764880024598300408284868021E-6),
-  L(-9.218742195161302204046454768106063638006E-5),
-  L(-1.635746821447052827526320629828043529997E-3),
-  L(-1.570376886640308408247709616497261011707E-2),
-  L(-7.656484795303305596941813361786219477807E-2),
-  L(-1.659371030767513274944805479908858628053E-1),
-  L(-1.185340550030955660015841796219919804915E-1),
-  L(-8.920026499909994671248893388013790366712E-3),
+static const long double P5_8N[NP5_8N + 1] = {
+  -1.270478335089770355749591358934012019596E-12L,
+  -4.007588712145412921057254992155810347245E-10L,
+  -4.815187822989597568124520080486652009281E-8L,
+  -2.867070063972764880024598300408284868021E-6L,
+  -9.218742195161302204046454768106063638006E-5L,
+  -1.635746821447052827526320629828043529997E-3L,
+  -1.570376886640308408247709616497261011707E-2L,
+  -7.656484795303305596941813361786219477807E-2L,
+  -1.659371030767513274944805479908858628053E-1L,
+  -1.185340550030955660015841796219919804915E-1L,
+  -8.920026499909994671248893388013790366712E-3L,
 };
 #define NP5_8D 9
-static const _Float128 P5_8D[NP5_8D + 1] = {
-  L(1.806902521016705225778045904631543990314E-11),
-  L(5.728502760243502431663549179135868966031E-9),
-  L(6.938168504826004255287618819550667978450E-7),
-  L(4.183769964807453250763325026573037785902E-5),
-  L(1.372660678476925468014882230851637878587E-3),
-  L(2.516452105242920335873286419212708961771E-2),
-  L(2.550502712902647803796267951846557316182E-1),
-  L(1.365861559418983216913629123778747617072E0),
-  L(3.523825618308783966723472468855042541407E0),
-  L(3.656365803506136165615111349150536282434E0),
+static const long double P5_8D[NP5_8D + 1] = {
+  1.806902521016705225778045904631543990314E-11L,
+  5.728502760243502431663549179135868966031E-9L,
+  6.938168504826004255287618819550667978450E-7L,
+  4.183769964807453250763325026573037785902E-5L,
+  1.372660678476925468014882230851637878587E-3L,
+  2.516452105242920335873286419212708961771E-2L,
+  2.550502712902647803796267951846557316182E-1L,
+  1.365861559418983216913629123778747617072E0L,
+  3.523825618308783966723472468855042541407E0L,
+  3.656365803506136165615111349150536282434E0L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -155,30 +153,30 @@ static const _Float128 P5_8D[NP5_8D + 1] = {
    Peak relative error 3.5e-35
    0.1875 <= 1/x <= 0.25  */
 #define NP4_5N 9
-static const _Float128 P4_5N[NP4_5N + 1] = {
-  L(-9.791405771694098960254468859195175708252E-10),
-  L(-1.917193059944531970421626610188102836352E-7),
-  L(-1.393597539508855262243816152893982002084E-5),
-  L(-4.881863490846771259880606911667479860077E-4),
-  L(-8.946571245022470127331892085881699269853E-3),
-  L(-8.707474232568097513415336886103899434251E-2),
-  L(-4.362042697474650737898551272505525973766E-1),
-  L(-1.032712171267523975431451359962375617386E0),
-  L(-9.630502683169895107062182070514713702346E-1),
-  L(-2.251804386252969656586810309252357233320E-1),
+static const long double P4_5N[NP4_5N + 1] = {
+  -9.791405771694098960254468859195175708252E-10L,
+  -1.917193059944531970421626610188102836352E-7L,
+  -1.393597539508855262243816152893982002084E-5L,
+  -4.881863490846771259880606911667479860077E-4L,
+  -8.946571245022470127331892085881699269853E-3L,
+  -8.707474232568097513415336886103899434251E-2L,
+  -4.362042697474650737898551272505525973766E-1L,
+  -1.032712171267523975431451359962375617386E0L,
+  -9.630502683169895107062182070514713702346E-1L,
+  -2.251804386252969656586810309252357233320E-1L,
 };
 #define NP4_5D 9
-static const _Float128 P4_5D[NP4_5D + 1] = {
-  L(1.392555487577717669739688337895791213139E-8),
-  L(2.748886559120659027172816051276451376854E-6),
-  L(2.024717710644378047477189849678576659290E-4),
-  L(7.244868609350416002930624752604670292469E-3),
-  L(1.373631762292244371102989739300382152416E-1),
-  L(1.412298581400224267910294815260613240668E0),
-  L(7.742495637843445079276397723849017617210E0),
-  L(2.138429269198406512028307045259503811861E1),
-  L(2.651547684548423476506826951831712762610E1),
-  L(1.167499382465291931571685222882909166935E1),
+static const long double P4_5D[NP4_5D + 1] = {
+  1.392555487577717669739688337895791213139E-8L,
+  2.748886559120659027172816051276451376854E-6L,
+  2.024717710644378047477189849678576659290E-4L,
+  7.244868609350416002930624752604670292469E-3L,
+  1.373631762292244371102989739300382152416E-1L,
+  1.412298581400224267910294815260613240668E0L,
+  7.742495637843445079276397723849017617210E0L,
+  2.138429269198406512028307045259503811861E1L,
+  2.651547684548423476506826951831712762610E1L,
+  1.167499382465291931571685222882909166935E1L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -186,30 +184,30 @@ static const _Float128 P4_5D[NP4_5D + 1] = {
    Peak relative error 2.3e-36
    0.25 <= 1/x <= 0.3125  */
 #define NP3r2_4N 9
-static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
-  L(-2.589155123706348361249809342508270121788E-8),
-  L(-3.746254369796115441118148490849195516593E-6),
-  L(-1.985595497390808544622893738135529701062E-4),
-  L(-5.008253705202932091290132760394976551426E-3),
-  L(-6.529469780539591572179155511840853077232E-2),
-  L(-4.468736064761814602927408833818990271514E-1),
-  L(-1.556391252586395038089729428444444823380E0),
-  L(-2.533135309840530224072920725976994981638E0),
-  L(-1.605509621731068453869408718565392869560E0),
-  L(-2.518966692256192789269859830255724429375E-1),
+static const long double P3r2_4N[NP3r2_4N + 1] = {
+  -2.589155123706348361249809342508270121788E-8L,
+  -3.746254369796115441118148490849195516593E-6L,
+  -1.985595497390808544622893738135529701062E-4L,
+  -5.008253705202932091290132760394976551426E-3L,
+  -6.529469780539591572179155511840853077232E-2L,
+  -4.468736064761814602927408833818990271514E-1L,
+  -1.556391252586395038089729428444444823380E0L,
+  -2.533135309840530224072920725976994981638E0L,
+  -1.605509621731068453869408718565392869560E0L,
+  -2.518966692256192789269859830255724429375E-1L,
 };
 #define NP3r2_4D 9
-static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
-  L(3.682353957237979993646169732962573930237E-7),
-  L(5.386741661883067824698973455566332102029E-5),
-  L(2.906881154171822780345134853794241037053E-3),
-  L(7.545832595801289519475806339863492074126E-2),
-  L(1.029405357245594877344360389469584526654E0),
-  L(7.565706120589873131187989560509757626725E0),
-  L(2.951172890699569545357692207898667665796E1),
-  L(5.785723537170311456298467310529815457536E1),
-  L(5.095621464598267889126015412522773474467E1),
-  L(1.602958484169953109437547474953308401442E1),
+static const long double P3r2_4D[NP3r2_4D + 1] = {
+  3.682353957237979993646169732962573930237E-7L,
+  5.386741661883067824698973455566332102029E-5L,
+  2.906881154171822780345134853794241037053E-3L,
+  7.545832595801289519475806339863492074126E-2L,
+  1.029405357245594877344360389469584526654E0L,
+  7.565706120589873131187989560509757626725E0L,
+  2.951172890699569545357692207898667665796E1L,
+  5.785723537170311456298467310529815457536E1L,
+  5.095621464598267889126015412522773474467E1L,
+  1.602958484169953109437547474953308401442E1L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -217,29 +215,29 @@ static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
    Peak relative error 1.0e-35
    0.3125 <= 1/x <= 0.375  */
 #define NP2r7_3r2N 9
-static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
-  L(-1.917322340814391131073820537027234322550E-7),
-  L(-1.966595744473227183846019639723259011906E-5),
-  L(-7.177081163619679403212623526632690465290E-4),
-  L(-1.206467373860974695661544653741899755695E-2),
-  L(-1.008656452188539812154551482286328107316E-1),
-  L(-4.216016116408810856620947307438823892707E-1),
-  L(-8.378631013025721741744285026537009814161E-1),
-  L(-6.973895635309960850033762745957946272579E-1),
-  L(-1.797864718878320770670740413285763554812E-1),
-  L(-4.098025357743657347681137871388402849581E-3),
+static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+  -1.917322340814391131073820537027234322550E-7L,
+  -1.966595744473227183846019639723259011906E-5L,
+  -7.177081163619679403212623526632690465290E-4L,
+  -1.206467373860974695661544653741899755695E-2L,
+  -1.008656452188539812154551482286328107316E-1L,
+  -4.216016116408810856620947307438823892707E-1L,
+  -8.378631013025721741744285026537009814161E-1L,
+  -6.973895635309960850033762745957946272579E-1L,
+  -1.797864718878320770670740413285763554812E-1L,
+  -4.098025357743657347681137871388402849581E-3L,
 };
 #define NP2r7_3r2D 8
-static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
-  L(2.726858489303036441686496086962545034018E-6),
-  L(2.840430827557109238386808968234848081424E-4),
-  L(1.063826772041781947891481054529454088832E-2),
-  L(1.864775537138364773178044431045514405468E-1),
-  L(1.665660052857205170440952607701728254211E0),
-  L(7.723745889544331153080842168958348568395E0),
-  L(1.810726427571829798856428548102077799835E1),
-  L(1.986460672157794440666187503833545388527E1),
-  L(8.645503204552282306364296517220055815488E0),
+static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+  2.726858489303036441686496086962545034018E-6L,
+  2.840430827557109238386808968234848081424E-4L,
+  1.063826772041781947891481054529454088832E-2L,
+  1.864775537138364773178044431045514405468E-1L,
+  1.665660052857205170440952607701728254211E0L,
+  7.723745889544331153080842168958348568395E0L,
+  1.810726427571829798856428548102077799835E1L,
+  1.986460672157794440666187503833545388527E1L,
+  8.645503204552282306364296517220055815488E0L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -247,29 +245,29 @@ static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
    Peak relative error 1.3e-36
    0.3125 <= 1/x <= 0.4375  */
 #define NP2r3_2r7N 9
-static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
-  L(-1.594642785584856746358609622003310312622E-6),
-  L(-1.323238196302221554194031733595194539794E-4),
-  L(-3.856087818696874802689922536987100372345E-3),
-  L(-5.113241710697777193011470733601522047399E-2),
-  L(-3.334229537209911914449990372942022350558E-1),
-  L(-1.075703518198127096179198549659283422832E0),
-  L(-1.634174803414062725476343124267110981807E0),
-  L(-1.030133247434119595616826842367268304880E0),
-  L(-1.989811539080358501229347481000707289391E-1),
-  L(-3.246859189246653459359775001466924610236E-3),
+static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+  -1.594642785584856746358609622003310312622E-6L,
+  -1.323238196302221554194031733595194539794E-4L,
+  -3.856087818696874802689922536987100372345E-3L,
+  -5.113241710697777193011470733601522047399E-2L,
+  -3.334229537209911914449990372942022350558E-1L,
+  -1.075703518198127096179198549659283422832E0L,
+  -1.634174803414062725476343124267110981807E0L,
+  -1.030133247434119595616826842367268304880E0L,
+  -1.989811539080358501229347481000707289391E-1L,
+  -3.246859189246653459359775001466924610236E-3L,
 };
 #define NP2r3_2r7D 8
-static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
-  L(2.267936634217251403663034189684284173018E-5),
-  L(1.918112982168673386858072491437971732237E-3),
-  L(5.771704085468423159125856786653868219522E-2),
-  L(8.056124451167969333717642810661498890507E-1),
-  L(5.687897967531010276788680634413789328776E0),
-  L(2.072596760717695491085444438270778394421E1),
-  L(3.801722099819929988585197088613160496684E1),
-  L(3.254620235902912339534998592085115836829E1),
-  L(1.104847772130720331801884344645060675036E1),
+static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+  2.267936634217251403663034189684284173018E-5L,
+  1.918112982168673386858072491437971732237E-3L,
+  5.771704085468423159125856786653868219522E-2L,
+  8.056124451167969333717642810661498890507E-1L,
+  5.687897967531010276788680634413789328776E0L,
+  2.072596760717695491085444438270778394421E1L,
+  3.801722099819929988585197088613160496684E1L,
+  3.254620235902912339534998592085115836829E1L,
+  1.104847772130720331801884344645060675036E1L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -277,28 +275,28 @@ static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
    Peak relative error 1.2e-35
    0.4375 <= 1/x <= 0.5  */
 #define NP2_2r3N 8
-static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
-  L(-1.001042324337684297465071506097365389123E-4),
-  L(-6.289034524673365824853547252689991418981E-3),
-  L(-1.346527918018624234373664526930736205806E-1),
-  L(-1.268808313614288355444506172560463315102E0),
-  L(-5.654126123607146048354132115649177406163E0),
-  L(-1.186649511267312652171775803270911971693E1),
-  L(-1.094032424931998612551588246779200724257E1),
-  L(-3.728792136814520055025256353193674625267E0),
-  L(-3.000348318524471807839934764596331810608E-1),
+static const long double P2_2r3N[NP2_2r3N + 1] = {
+  -1.001042324337684297465071506097365389123E-4L,
+  -6.289034524673365824853547252689991418981E-3L,
+  -1.346527918018624234373664526930736205806E-1L,
+  -1.268808313614288355444506172560463315102E0L,
+  -5.654126123607146048354132115649177406163E0L,
+  -1.186649511267312652171775803270911971693E1L,
+  -1.094032424931998612551588246779200724257E1L,
+  -3.728792136814520055025256353193674625267E0L,
+  -3.000348318524471807839934764596331810608E-1L,
 };
 #define NP2_2r3D 8
-static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
-  L(1.423705538269770974803901422532055612980E-3),
-  L(9.171476630091439978533535167485230575894E-2),
-  L(2.049776318166637248868444600215942828537E0),
-  L(2.068970329743769804547326701946144899583E1),
-  L(1.025103500560831035592731539565060347709E2),
-  L(2.528088049697570728252145557167066708284E2),
-  L(2.992160327587558573740271294804830114205E2),
-  L(1.540193761146551025832707739468679973036E2),
-  L(2.779516701986912132637672140709452502650E1),
+static const long double P2_2r3D[NP2_2r3D + 1] = {
+  1.423705538269770974803901422532055612980E-3L,
+  9.171476630091439978533535167485230575894E-2L,
+  2.049776318166637248868444600215942828537E0L,
+  2.068970329743769804547326701946144899583E1L,
+  1.025103500560831035592731539565060347709E2L,
+  2.528088049697570728252145557167066708284E2L,
+  2.992160327587558573740271294804830114205E2L,
+  1.540193761146551025832707739468679973036E2L,
+  2.779516701986912132637672140709452502650E1L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -307,31 +305,31 @@ static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
    Peak relative error 2.2e-35
    0 <= 1/x <= .0625  */
 #define NQ16_IN 10
-static const _Float128 Q16_IN[NQ16_IN + 1] = {
-  L(2.343640834407975740545326632205999437469E-18),
-  L(2.667978112927811452221176781536278257448E-15),
-  L(1.178415018484555397390098879501969116536E-12),
-  L(2.622049767502719728905924701288614016597E-10),
-  L(3.196908059607618864801313380896308968673E-8),
-  L(2.179466154171673958770030655199434798494E-6),
-  L(8.139959091628545225221976413795645177291E-5),
-  L(1.563900725721039825236927137885747138654E-3),
-  L(1.355172364265825167113562519307194840307E-2),
-  L(3.928058355906967977269780046844768588532E-2),
-  L(1.107891967702173292405380993183694932208E-2),
+static const long double Q16_IN[NQ16_IN + 1] = {
+  2.343640834407975740545326632205999437469E-18L,
+  2.667978112927811452221176781536278257448E-15L,
+  1.178415018484555397390098879501969116536E-12L,
+  2.622049767502719728905924701288614016597E-10L,
+  3.196908059607618864801313380896308968673E-8L,
+  2.179466154171673958770030655199434798494E-6L,
+  8.139959091628545225221976413795645177291E-5L,
+  1.563900725721039825236927137885747138654E-3L,
+  1.355172364265825167113562519307194840307E-2L,
+  3.928058355906967977269780046844768588532E-2L,
+  1.107891967702173292405380993183694932208E-2L,
 };
 #define NQ16_ID 9
-static const _Float128 Q16_ID[NQ16_ID + 1] = {
-  L(3.199850952578356211091219295199301766718E-17),
-  L(3.652601488020654842194486058637953363918E-14),
-  L(1.620179741394865258354608590461839031281E-11),
-  L(3.629359209474609630056463248923684371426E-9),
-  L(4.473680923894354600193264347733477363305E-7),
-  L(3.106368086644715743265603656011050476736E-5),
-  L(1.198239259946770604954664925153424252622E-3),
-  L(2.446041004004283102372887804475767568272E-2),
-  L(2.403235525011860603014707768815113698768E-1),
-  L(9.491006790682158612266270665136910927149E-1),
+static const long double Q16_ID[NQ16_ID + 1] = {
+  3.199850952578356211091219295199301766718E-17L,
+  3.652601488020654842194486058637953363918E-14L,
+  1.620179741394865258354608590461839031281E-11L,
+  3.629359209474609630056463248923684371426E-9L,
+  4.473680923894354600193264347733477363305E-7L,
+  3.106368086644715743265603656011050476736E-5L,
+  1.198239259946770604954664925153424252622E-3L,
+  2.446041004004283102372887804475767568272E-2L,
+  2.403235525011860603014707768815113698768E-1L,
+  9.491006790682158612266270665136910927149E-1L,
  /* 1.000000000000000000000000000000000000000E0 */
  };
 
@@ -340,34 +338,34 @@ static const _Float128 Q16_ID[NQ16_ID + 1] = {
    Peak relative error 5.1e-36
    0.0625 <= 1/x <= 0.125  */
 #define NQ8_16N 11
-static const _Float128 Q8_16N[NQ8_16N + 1] = {
-  L(1.001954266485599464105669390693597125904E-17),
-  L(7.545499865295034556206475956620160007849E-15),
-  L(2.267838684785673931024792538193202559922E-12),
-  L(3.561909705814420373609574999542459912419E-10),
-  L(3.216201422768092505214730633842924944671E-8),
-  L(1.731194793857907454569364622452058554314E-6),
-  L(5.576944613034537050396518509871004586039E-5),
-  L(1.051787760316848982655967052985391418146E-3),
-  L(1.102852974036687441600678598019883746959E-2),
-  L(5.834647019292460494254225988766702933571E-2),
-  L(1.290281921604364618912425380717127576529E-1),
-  L(7.598886310387075708640370806458926458301E-2),
+static const long double Q8_16N[NQ8_16N + 1] = {
+  1.001954266485599464105669390693597125904E-17L,
+  7.545499865295034556206475956620160007849E-15L,
+  2.267838684785673931024792538193202559922E-12L,
+  3.561909705814420373609574999542459912419E-10L,
+  3.216201422768092505214730633842924944671E-8L,
+  1.731194793857907454569364622452058554314E-6L,
+  5.576944613034537050396518509871004586039E-5L,
+  1.051787760316848982655967052985391418146E-3L,
+  1.102852974036687441600678598019883746959E-2L,
+  5.834647019292460494254225988766702933571E-2L,
+  1.290281921604364618912425380717127576529E-1L,
+  7.598886310387075708640370806458926458301E-2L,
 };
 #define NQ8_16D 11
-static const _Float128 Q8_16D[NQ8_16D + 1] = {
-  L(1.368001558508338469503329967729951830843E-16),
-  L(1.034454121857542147020549303317348297289E-13),
-  L(3.128109209247090744354764050629381674436E-11),
-  L(4.957795214328501986562102573522064468671E-9),
-  L(4.537872468606711261992676606899273588899E-7),
-  L(2.493639207101727713192687060517509774182E-5),
-  L(8.294957278145328349785532236663051405805E-4),
-  L(1.646471258966713577374948205279380115839E-2),
-  L(1.878910092770966718491814497982191447073E-1),
-  L(1.152641605706170353727903052525652504075E0),
-  L(3.383550240669773485412333679367792932235E0),
-  L(3.823875252882035706910024716609908473970E0),
+static const long double Q8_16D[NQ8_16D + 1] = {
+  1.368001558508338469503329967729951830843E-16L,
+  1.034454121857542147020549303317348297289E-13L,
+  3.128109209247090744354764050629381674436E-11L,
+  4.957795214328501986562102573522064468671E-9L,
+  4.537872468606711261992676606899273588899E-7L,
+  2.493639207101727713192687060517509774182E-5L,
+  8.294957278145328349785532236663051405805E-4L,
+  1.646471258966713577374948205279380115839E-2L,
+  1.878910092770966718491814497982191447073E-1L,
+  1.152641605706170353727903052525652504075E0L,
+  3.383550240669773485412333679367792932235E0L,
+  3.823875252882035706910024716609908473970E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -376,32 +374,32 @@ static const _Float128 Q8_16D[NQ8_16D + 1] = {
    Peak relative error 3.9e-35
    0.125 <= 1/x <= 0.1875  */
 #define NQ5_8N 10
-static const _Float128 Q5_8N[NQ5_8N + 1] = {
-  L(1.750399094021293722243426623211733898747E-13),
-  L(6.483426211748008735242909236490115050294E-11),
-  L(9.279430665656575457141747875716899958373E-9),
-  L(6.696634968526907231258534757736576340266E-7),
-  L(2.666560823798895649685231292142838188061E-5),
-  L(6.025087697259436271271562769707550594540E-4),
-  L(7.652807734168613251901945778921336353485E-3),
-  L(5.226269002589406461622551452343519078905E-2),
-  L(1.748390159751117658969324896330142895079E-1),
-  L(2.378188719097006494782174902213083589660E-1),
-  L(8.383984859679804095463699702165659216831E-2),
+static const long double Q5_8N[NQ5_8N + 1] = {
+  1.750399094021293722243426623211733898747E-13L,
+  6.483426211748008735242909236490115050294E-11L,
+  9.279430665656575457141747875716899958373E-9L,
+  6.696634968526907231258534757736576340266E-7L,
+  2.666560823798895649685231292142838188061E-5L,
+  6.025087697259436271271562769707550594540E-4L,
+  7.652807734168613251901945778921336353485E-3L,
+  5.226269002589406461622551452343519078905E-2L,
+  1.748390159751117658969324896330142895079E-1L,
+  2.378188719097006494782174902213083589660E-1L,
+  8.383984859679804095463699702165659216831E-2L,
 };
 #define NQ5_8D 10
-static const _Float128 Q5_8D[NQ5_8D + 1] = {
-  L(2.389878229704327939008104855942987615715E-12),
-  L(8.926142817142546018703814194987786425099E-10),
-  L(1.294065862406745901206588525833274399038E-7),
-  L(9.524139899457666250828752185212769682191E-6),
-  L(3.908332488377770886091936221573123353489E-4),
-  L(9.250427033957236609624199884089916836748E-3),
-  L(1.263420066165922645975830877751588421451E-1),
-  L(9.692527053860420229711317379861733180654E-1),
-  L(3.937813834630430172221329298841520707954E0),
-  L(7.603126427436356534498908111445191312181E0),
-  L(5.670677653334105479259958485084550934305E0),
+static const long double Q5_8D[NQ5_8D + 1] = {
+  2.389878229704327939008104855942987615715E-12L,
+  8.926142817142546018703814194987786425099E-10L,
+  1.294065862406745901206588525833274399038E-7L,
+  9.524139899457666250828752185212769682191E-6L,
+  3.908332488377770886091936221573123353489E-4L,
+  9.250427033957236609624199884089916836748E-3L,
+  1.263420066165922645975830877751588421451E-1L,
+  9.692527053860420229711317379861733180654E-1L,
+  3.937813834630430172221329298841520707954E0L,
+  7.603126427436356534498908111445191312181E0L,
+  5.670677653334105479259958485084550934305E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -410,31 +408,31 @@ static const _Float128 Q5_8D[NQ5_8D + 1] = {
    Peak relative error 3.2e-35
    0.1875 <= 1/x <= 0.25  */
 #define NQ4_5N 10
-static const _Float128 Q4_5N[NQ4_5N + 1] = {
-  L(2.233870042925895644234072357400122854086E-11),
-  L(5.146223225761993222808463878999151699792E-9),
-  L(4.459114531468296461688753521109797474523E-7),
-  L(1.891397692931537975547242165291668056276E-5),
-  L(4.279519145911541776938964806470674565504E-4),
-  L(5.275239415656560634702073291768904783989E-3),
-  L(3.468698403240744801278238473898432608887E-2),
-  L(1.138773146337708415188856882915457888274E-1),
-  L(1.622717518946443013587108598334636458955E-1),
-  L(7.249040006390586123760992346453034628227E-2),
-  L(1.941595365256460232175236758506411486667E-3),
+static const long double Q4_5N[NQ4_5N + 1] = {
+  2.233870042925895644234072357400122854086E-11L,
+  5.146223225761993222808463878999151699792E-9L,
+  4.459114531468296461688753521109797474523E-7L,
+  1.891397692931537975547242165291668056276E-5L,
+  4.279519145911541776938964806470674565504E-4L,
+  5.275239415656560634702073291768904783989E-3L,
+  3.468698403240744801278238473898432608887E-2L,
+  1.138773146337708415188856882915457888274E-1L,
+  1.622717518946443013587108598334636458955E-1L,
+  7.249040006390586123760992346453034628227E-2L,
+  1.941595365256460232175236758506411486667E-3L,
 };
 #define NQ4_5D 9
-static const _Float128 Q4_5D[NQ4_5D + 1] = {
-  L(3.049977232266999249626430127217988047453E-10),
-  L(7.120883230531035857746096928889676144099E-8),
-  L(6.301786064753734446784637919554359588859E-6),
-  L(2.762010530095069598480766869426308077192E-4),
-  L(6.572163250572867859316828886203406361251E-3),
-  L(8.752566114841221958200215255461843397776E-2),
-  L(6.487654992874805093499285311075289932664E-1),
-  L(2.576550017826654579451615283022812801435E0),
-  L(5.056392229924022835364779562707348096036E0),
-  L(4.179770081068251464907531367859072157773E0),
+static const long double Q4_5D[NQ4_5D + 1] = {
+  3.049977232266999249626430127217988047453E-10L,
+  7.120883230531035857746096928889676144099E-8L,
+  6.301786064753734446784637919554359588859E-6L,
+  2.762010530095069598480766869426308077192E-4L,
+  6.572163250572867859316828886203406361251E-3L,
+  8.752566114841221958200215255461843397776E-2L,
+  6.487654992874805093499285311075289932664E-1L,
+  2.576550017826654579451615283022812801435E0L,
+  5.056392229924022835364779562707348096036E0L,
+  4.179770081068251464907531367859072157773E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -443,31 +441,31 @@ static const _Float128 Q4_5D[NQ4_5D + 1] = {
    Peak relative error 1.4e-36
    0.25 <= 1/x <= 0.3125  */
 #define NQ3r2_4N 10
-static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
-  L(6.126167301024815034423262653066023684411E-10),
-  L(1.043969327113173261820028225053598975128E-7),
-  L(6.592927270288697027757438170153763220190E-6),
-  L(2.009103660938497963095652951912071336730E-4),
-  L(3.220543385492643525985862356352195896964E-3),
-  L(2.774405975730545157543417650436941650990E-2),
-  L(1.258114008023826384487378016636555041129E-1),
-  L(2.811724258266902502344701449984698323860E-1),
-  L(2.691837665193548059322831687432415014067E-1),
-  L(7.949087384900985370683770525312735605034E-2),
-  L(1.229509543620976530030153018986910810747E-3),
+static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+  6.126167301024815034423262653066023684411E-10L,
+  1.043969327113173261820028225053598975128E-7L,
+  6.592927270288697027757438170153763220190E-6L,
+  2.009103660938497963095652951912071336730E-4L,
+  3.220543385492643525985862356352195896964E-3L,
+  2.774405975730545157543417650436941650990E-2L,
+  1.258114008023826384487378016636555041129E-1L,
+  2.811724258266902502344701449984698323860E-1L,
+  2.691837665193548059322831687432415014067E-1L,
+  7.949087384900985370683770525312735605034E-2L,
+  1.229509543620976530030153018986910810747E-3L,
 };
 #define NQ3r2_4D 9
-static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
-  L(8.364260446128475461539941389210166156568E-9),
-  L(1.451301850638956578622154585560759862764E-6),
-  L(9.431830010924603664244578867057141839463E-5),
-  L(3.004105101667433434196388593004526182741E-3),
-  L(5.148157397848271739710011717102773780221E-2),
-  L(4.901089301726939576055285374953887874895E-1),
-  L(2.581760991981709901216967665934142240346E0),
-  L(7.257105880775059281391729708630912791847E0),
-  L(1.006014717326362868007913423810737369312E1),
-  L(5.879416600465399514404064187445293212470E0),
+static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+  8.364260446128475461539941389210166156568E-9L,
+  1.451301850638956578622154585560759862764E-6L,
+  9.431830010924603664244578867057141839463E-5L,
+  3.004105101667433434196388593004526182741E-3L,
+  5.148157397848271739710011717102773780221E-2L,
+  4.901089301726939576055285374953887874895E-1L,
+  2.581760991981709901216967665934142240346E0L,
+  7.257105880775059281391729708630912791847E0L,
+  1.006014717326362868007913423810737369312E1L,
+  5.879416600465399514404064187445293212470E0L,
  /* 1.000000000000000000000000000000000000000E0*/
 };
 
@@ -476,30 +474,30 @@ static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
    Peak relative error 3.8e-36
    0.3125 <= 1/x <= 0.375  */
 #define NQ2r7_3r2N 9
-static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
-  L(7.584861620402450302063691901886141875454E-8),
-  L(9.300939338814216296064659459966041794591E-6),
-  L(4.112108906197521696032158235392604947895E-4),
-  L(8.515168851578898791897038357239630654431E-3),
-  L(8.971286321017307400142720556749573229058E-2),
-  L(4.885856732902956303343015636331874194498E-1),
-  L(1.334506268733103291656253500506406045846E0),
-  L(1.681207956863028164179042145803851824654E0),
-  L(8.165042692571721959157677701625853772271E-1),
-  L(9.805848115375053300608712721986235900715E-2),
+static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+  7.584861620402450302063691901886141875454E-8L,
+  9.300939338814216296064659459966041794591E-6L,
+  4.112108906197521696032158235392604947895E-4L,
+  8.515168851578898791897038357239630654431E-3L,
+  8.971286321017307400142720556749573229058E-2L,
+  4.885856732902956303343015636331874194498E-1L,
+  1.334506268733103291656253500506406045846E0L,
+  1.681207956863028164179042145803851824654E0L,
+  8.165042692571721959157677701625853772271E-1L,
+  9.805848115375053300608712721986235900715E-2L,
 };
 #define NQ2r7_3r2D 9
-static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
-  L(1.035586492113036586458163971239438078160E-6),
-  L(1.301999337731768381683593636500979713689E-4),
-  L(5.993695702564527062553071126719088859654E-3),
-  L(1.321184892887881883489141186815457808785E-1),
-  L(1.528766555485015021144963194165165083312E0),
-  L(9.561463309176490874525827051566494939295E0),
-  L(3.203719484883967351729513662089163356911E1),
-  L(5.497294687660930446641539152123568668447E1),
-  L(4.391158169390578768508675452986948391118E1),
-  L(1.347836630730048077907818943625789418378E1),
+static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+  1.035586492113036586458163971239438078160E-6L,
+  1.301999337731768381683593636500979713689E-4L,
+  5.993695702564527062553071126719088859654E-3L,
+  1.321184892887881883489141186815457808785E-1L,
+  1.528766555485015021144963194165165083312E0L,
+  9.561463309176490874525827051566494939295E0L,
+  3.203719484883967351729513662089163356911E1L,
+  5.497294687660930446641539152123568668447E1L,
+  4.391158169390578768508675452986948391118E1L,
+  1.347836630730048077907818943625789418378E1L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -508,29 +506,29 @@ static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
    Peak relative error 2.2e-35
    0.375 <= 1/x <= 0.4375  */
 #define NQ2r3_2r7N 9
-static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
-  L(4.455027774980750211349941766420190722088E-7),
-  L(4.031998274578520170631601850866780366466E-5),
-  L(1.273987274325947007856695677491340636339E-3),
-  L(1.818754543377448509897226554179659122873E-2),
-  L(1.266748858326568264126353051352269875352E-1),
-  L(4.327578594728723821137731555139472880414E-1),
-  L(6.892532471436503074928194969154192615359E-1),
-  L(4.490775818438716873422163588640262036506E-1),
-  L(8.649615949297322440032000346117031581572E-2),
-  L(7.261345286655345047417257611469066147561E-4),
+static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+  4.455027774980750211349941766420190722088E-7L,
+  4.031998274578520170631601850866780366466E-5L,
+  1.273987274325947007856695677491340636339E-3L,
+  1.818754543377448509897226554179659122873E-2L,
+  1.266748858326568264126353051352269875352E-1L,
+  4.327578594728723821137731555139472880414E-1L,
+  6.892532471436503074928194969154192615359E-1L,
+  4.490775818438716873422163588640262036506E-1L,
+  8.649615949297322440032000346117031581572E-2L,
+  7.261345286655345047417257611469066147561E-4L,
 };
 #define NQ2r3_2r7D 8
-static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
-  L(6.082600739680555266312417978064954793142E-6),
-  L(5.693622538165494742945717226571441747567E-4),
-  L(1.901625907009092204458328768129666975975E-2),
-  L(2.958689532697857335456896889409923371570E-1),
-  L(2.343124711045660081603809437993368799568E0),
-  L(9.665894032187458293568704885528192804376E0),
-  L(2.035273104990617136065743426322454881353E1),
-  L(2.044102010478792896815088858740075165531E1),
-  L(8.445937177863155827844146643468706599304E0),
+static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+  6.082600739680555266312417978064954793142E-6L,
+  5.693622538165494742945717226571441747567E-4L,
+  1.901625907009092204458328768129666975975E-2L,
+  2.958689532697857335456896889409923371570E-1L,
+  2.343124711045660081603809437993368799568E0L,
+  9.665894032187458293568704885528192804376E0L,
+  2.035273104990617136065743426322454881353E1L,
+  2.044102010478792896815088858740075165531E1L,
+  8.445937177863155827844146643468706599304E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -539,39 +537,39 @@ static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
    Peak relative error 3.1e-36
    0.4375 <= 1/x <= 0.5  */
 #define NQ2_2r3N 9
-static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
-  L(2.817566786579768804844367382809101929314E-6),
-  L(2.122772176396691634147024348373539744935E-4),
-  L(5.501378031780457828919593905395747517585E-3),
-  L(6.355374424341762686099147452020466524659E-2),
-  L(3.539652320122661637429658698954748337223E-1),
-  L(9.571721066119617436343740541777014319695E-1),
-  L(1.196258777828426399432550698612171955305E0),
-  L(6.069388659458926158392384709893753793967E-1),
-  L(9.026746127269713176512359976978248763621E-2),
-  L(5.317668723070450235320878117210807236375E-4),
+static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+  2.817566786579768804844367382809101929314E-6L,
+  2.122772176396691634147024348373539744935E-4L,
+  5.501378031780457828919593905395747517585E-3L,
+  6.355374424341762686099147452020466524659E-2L,
+  3.539652320122661637429658698954748337223E-1L,
+  9.571721066119617436343740541777014319695E-1L,
+  1.196258777828426399432550698612171955305E0L,
+  6.069388659458926158392384709893753793967E-1L,
+  9.026746127269713176512359976978248763621E-2L,
+  5.317668723070450235320878117210807236375E-4L,
 };
 #define NQ2_2r3D 8
-static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
-  L(3.846924354014260866793741072933159380158E-5),
-  L(3.017562820057704325510067178327449946763E-3),
-  L(8.356305620686867949798885808540444210935E-2),
-  L(1.068314930499906838814019619594424586273E0),
-  L(6.900279623894821067017966573640732685233E0),
-  L(2.307667390886377924509090271780839563141E1),
-  L(3.921043465412723970791036825401273528513E1),
-  L(3.167569478939719383241775717095729233436E1),
-  L(1.051023841699200920276198346301543665909E1),
+static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+  3.846924354014260866793741072933159380158E-5L,
+  3.017562820057704325510067178327449946763E-3L,
+  8.356305620686867949798885808540444210935E-2L,
+  1.068314930499906838814019619594424586273E0L,
+  6.900279623894821067017966573640732685233E0L,
+  2.307667390886377924509090271780839563141E1L,
+  3.921043465412723970791036825401273528513E1L,
+  3.167569478939719383241775717095729233436E1L,
+  1.051023841699200920276198346301543665909E1L,
  /* 1.000000000000000000000000000000000000000E0*/
 };
 
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static _Float128
-neval (_Float128 x, const _Float128 *p, int n)
+static long double
+neval (long double x, const long double *p, int n)
 {
-  _Float128 y;
+  long double y;
 
   p += n;
   y = *p--;
@@ -586,10 +584,10 @@ neval (_Float128 x, const _Float128 *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static _Float128
-deval (_Float128 x, const _Float128 *p, int n)
+static long double
+deval (long double x, const long double *p, int n)
 {
-  _Float128 y;
+  long double y;
 
   p += n;
   y = x + *p--;
@@ -604,10 +602,10 @@ deval (_Float128 x, const _Float128 *p, int n)
 
 /* Bessel function of the first kind, order zero.  */
 
-_Float128
-__ieee754_j0l (_Float128 x)
+long double
+__ieee754_j0l (long double x)
 {
-  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+  long double xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     {
@@ -622,12 +620,12 @@ __ieee754_j0l (_Float128 x)
   xx = fabsl (x);
   if (xx <= 2)
     {
-      if (xx < L(0x1p-57))
+      if (xx < 0x1p-57L)
 	return 1;
       /* 0 <= x <= 2 */
       z = xx * xx;
       p = z * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
-      p -= L(0.25) * z;
+      p -= 0.25L * z;
       p += 1;
       return p;
     }
@@ -651,7 +649,7 @@ __ieee754_j0l (_Float128 x)
 	ss = z / cc;
     }
 
-  if (xx > L(0x1p256))
+  if (xx > 0x1p256L)
     return ONEOSQPI * cc / __ieee754_sqrtl (xx);
 
   xinv = 1 / xx;
@@ -714,7 +712,7 @@ __ieee754_j0l (_Float128 x)
     }
   p = 1 + z * p;
   q = z * xinv * q;
-  q = q - L(0.125) * xinv;
+  q = q - 0.125L * xinv;
   z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
   return z;
 }
@@ -725,37 +723,37 @@ strong_alias (__ieee754_j0l, __j0l_finite)
    Peak absolute error 1.7e-36 (relative where Y0 > 1)
    0 <= x <= 2   */
 #define NY0_2N 7
-static _Float128 Y0_2N[NY0_2N + 1] = {
- L(-1.062023609591350692692296993537002558155E19),
-  L(2.542000883190248639104127452714966858866E19),
- L(-1.984190771278515324281415820316054696545E18),
-  L(4.982586044371592942465373274440222033891E16),
- L(-5.529326354780295177243773419090123407550E14),
-  L(3.013431465522152289279088265336861140391E12),
- L(-7.959436160727126750732203098982718347785E9),
-  L(8.230845651379566339707130644134372793322E6),
+static long double Y0_2N[NY0_2N + 1] = {
+ -1.062023609591350692692296993537002558155E19L,
+  2.542000883190248639104127452714966858866E19L,
+ -1.984190771278515324281415820316054696545E18L,
+  4.982586044371592942465373274440222033891E16L,
+ -5.529326354780295177243773419090123407550E14L,
+  3.013431465522152289279088265336861140391E12L,
+ -7.959436160727126750732203098982718347785E9L,
+  8.230845651379566339707130644134372793322E6L,
 };
 #define NY0_2D 7
-static _Float128 Y0_2D[NY0_2D + 1] = {
-  L(1.438972634353286978700329883122253752192E20),
-  L(1.856409101981569254247700169486907405500E18),
-  L(1.219693352678218589553725579802986255614E16),
-  L(5.389428943282838648918475915779958097958E13),
-  L(1.774125762108874864433872173544743051653E11),
-  L(4.522104832545149534808218252434693007036E8),
-  L(8.872187401232943927082914504125234454930E5),
-  L(1.251945613186787532055610876304669413955E3),
+static long double Y0_2D[NY0_2D + 1] = {
+  1.438972634353286978700329883122253752192E20L,
+  1.856409101981569254247700169486907405500E18L,
+  1.219693352678218589553725579802986255614E16L,
+  5.389428943282838648918475915779958097958E13L,
+  1.774125762108874864433872173544743051653E11L,
+  4.522104832545149534808218252434693007036E8L,
+  8.872187401232943927082914504125234454930E5L,
+  1.251945613186787532055610876304669413955E3L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
-static const _Float128 U0 = L(-7.3804295108687225274343927948483016310862e-02);
+static const long double U0 = -7.3804295108687225274343927948483016310862e-02L;
 
 /* Bessel function of the second kind, order zero.  */
 
-_Float128
- __ieee754_y0l(_Float128 x)
+long double
+ __ieee754_y0l(long double x)
 {
-  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+  long double xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     return 1 / (x + x * x);
@@ -796,7 +794,7 @@ _Float128
 	ss = z / cc;
     }
 
-  if (xx > L(0x1p256))
+  if (xx > 0x1p256L)
     return ONEOSQPI * ss / __ieee754_sqrtl (x);
 
   xinv = 1 / xx;
@@ -859,7 +857,7 @@ _Float128
     }
   p = 1 + z * p;
   q = z * xinv * q;
-  q = q - L(0.125) * xinv;
+  q = q - 0.125L * xinv;
   z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (x);
   return z;
 }
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
index 3cedeec438..5956c97b82 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_j1l.c
@@ -17,8 +17,6 @@
 
 /* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c.  */
 
-#define _Float128 long double
-#define L(x) x ## L
 
 #include <errno.h>
 #include <math.h>
@@ -26,33 +24,33 @@
 #include <float.h>
 
 /* 1 / sqrt(pi) */
-static const _Float128 ONEOSQPI = L(5.6418958354775628694807945156077258584405E-1);
+static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L;
 /* 2 / pi */
-static const _Float128 TWOOPI = L(6.3661977236758134307553505349005744813784E-1);
-static const _Float128 zero = 0;
+static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L;
+static const long double zero = 0;
 
 /* J1(x) = .5x + x x^2 R(x^2)
    Peak relative error 1.9e-35
    0 <= x <= 2  */
 #define NJ0_2N 6
-static const _Float128 J0_2N[NJ0_2N + 1] = {
- L(-5.943799577386942855938508697619735179660E16),
-  L(1.812087021305009192259946997014044074711E15),
- L(-2.761698314264509665075127515729146460895E13),
-  L(2.091089497823600978949389109350658815972E11),
- L(-8.546413231387036372945453565654130054307E8),
-  L(1.797229225249742247475464052741320612261E6),
- L(-1.559552840946694171346552770008812083969E3)
+static const long double J0_2N[NJ0_2N + 1] = {
+ -5.943799577386942855938508697619735179660E16L,
+  1.812087021305009192259946997014044074711E15L,
+ -2.761698314264509665075127515729146460895E13L,
+  2.091089497823600978949389109350658815972E11L,
+ -8.546413231387036372945453565654130054307E8L,
+  1.797229225249742247475464052741320612261E6L,
+ -1.559552840946694171346552770008812083969E3L
 };
 #define NJ0_2D 6
-static const _Float128 J0_2D[NJ0_2D + 1] = {
-  L(9.510079323819108569501613916191477479397E17),
-  L(1.063193817503280529676423936545854693915E16),
-  L(5.934143516050192600795972192791775226920E13),
-  L(2.168000911950620999091479265214368352883E11),
-  L(5.673775894803172808323058205986256928794E8),
-  L(1.080329960080981204840966206372671147224E6),
-  L(1.411951256636576283942477881535283304912E3),
+static const long double J0_2D[NJ0_2D + 1] = {
+  9.510079323819108569501613916191477479397E17L,
+  1.063193817503280529676423936545854693915E16L,
+  5.934143516050192600795972192791775226920E13L,
+  2.168000911950620999091479265214368352883E11L,
+  5.673775894803172808323058205986256928794E8L,
+  1.080329960080981204840966206372671147224E6L,
+  1.411951256636576283942477881535283304912E3L,
  /* 1.000000000000000000000000000000000000000E0L */
 };
 
@@ -60,30 +58,30 @@ static const _Float128 J0_2D[NJ0_2D + 1] = {
    0 <= 1/x <= .0625
    Peak relative error 3.6e-36  */
 #define NP16_IN 9
-static const _Float128 P16_IN[NP16_IN + 1] = {
-  L(5.143674369359646114999545149085139822905E-16),
-  L(4.836645664124562546056389268546233577376E-13),
-  L(1.730945562285804805325011561498453013673E-10),
-  L(3.047976856147077889834905908605310585810E-8),
-  L(2.855227609107969710407464739188141162386E-6),
-  L(1.439362407936705484122143713643023998457E-4),
-  L(3.774489768532936551500999699815873422073E-3),
-  L(4.723962172984642566142399678920790598426E-2),
-  L(2.359289678988743939925017240478818248735E-1),
-  L(3.032580002220628812728954785118117124520E-1),
+static const long double P16_IN[NP16_IN + 1] = {
+  5.143674369359646114999545149085139822905E-16L,
+  4.836645664124562546056389268546233577376E-13L,
+  1.730945562285804805325011561498453013673E-10L,
+  3.047976856147077889834905908605310585810E-8L,
+  2.855227609107969710407464739188141162386E-6L,
+  1.439362407936705484122143713643023998457E-4L,
+  3.774489768532936551500999699815873422073E-3L,
+  4.723962172984642566142399678920790598426E-2L,
+  2.359289678988743939925017240478818248735E-1L,
+  3.032580002220628812728954785118117124520E-1L,
 };
 #define NP16_ID 9
-static const _Float128 P16_ID[NP16_ID + 1] = {
-  L(4.389268795186898018132945193912677177553E-15),
-  L(4.132671824807454334388868363256830961655E-12),
-  L(1.482133328179508835835963635130894413136E-9),
-  L(2.618941412861122118906353737117067376236E-7),
-  L(2.467854246740858470815714426201888034270E-5),
-  L(1.257192927368839847825938545925340230490E-3),
-  L(3.362739031941574274949719324644120720341E-2),
-  L(4.384458231338934105875343439265370178858E-1),
-  L(2.412830809841095249170909628197264854651E0),
-  L(4.176078204111348059102962617368214856874E0),
+static const long double P16_ID[NP16_ID + 1] = {
+  4.389268795186898018132945193912677177553E-15L,
+  4.132671824807454334388868363256830961655E-12L,
+  1.482133328179508835835963635130894413136E-9L,
+  2.618941412861122118906353737117067376236E-7L,
+  2.467854246740858470815714426201888034270E-5L,
+  1.257192927368839847825938545925340230490E-3L,
+  3.362739031941574274949719324644120720341E-2L,
+  4.384458231338934105875343439265370178858E-1L,
+  2.412830809841095249170909628197264854651E0L,
+  4.176078204111348059102962617368214856874E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -91,33 +89,33 @@ static const _Float128 P16_ID[NP16_ID + 1] = {
     0.0625 <= 1/x <= 0.125
     Peak relative error 1.9e-36  */
 #define NP8_16N 11
-static const _Float128 P8_16N[NP8_16N + 1] = {
-  L(2.984612480763362345647303274082071598135E-16),
-  L(1.923651877544126103941232173085475682334E-13),
-  L(4.881258879388869396043760693256024307743E-11),
-  L(6.368866572475045408480898921866869811889E-9),
-  L(4.684818344104910450523906967821090796737E-7),
-  L(2.005177298271593587095982211091300382796E-5),
-  L(4.979808067163957634120681477207147536182E-4),
-  L(6.946005761642579085284689047091173581127E-3),
-  L(5.074601112955765012750207555985299026204E-2),
-  L(1.698599455896180893191766195194231825379E-1),
-  L(1.957536905259237627737222775573623779638E-1),
-  L(2.991314703282528370270179989044994319374E-2),
+static const long double P8_16N[NP8_16N + 1] = {
+  2.984612480763362345647303274082071598135E-16L,
+  1.923651877544126103941232173085475682334E-13L,
+  4.881258879388869396043760693256024307743E-11L,
+  6.368866572475045408480898921866869811889E-9L,
+  4.684818344104910450523906967821090796737E-7L,
+  2.005177298271593587095982211091300382796E-5L,
+  4.979808067163957634120681477207147536182E-4L,
+  6.946005761642579085284689047091173581127E-3L,
+  5.074601112955765012750207555985299026204E-2L,
+  1.698599455896180893191766195194231825379E-1L,
+  1.957536905259237627737222775573623779638E-1L,
+  2.991314703282528370270179989044994319374E-2L,
 };
 #define NP8_16D 10
-static const _Float128 P8_16D[NP8_16D + 1] = {
-  L(2.546869316918069202079580939942463010937E-15),
-  L(1.644650111942455804019788382157745229955E-12),
-  L(4.185430770291694079925607420808011147173E-10),
-  L(5.485331966975218025368698195861074143153E-8),
-  L(4.062884421686912042335466327098932678905E-6),
-  L(1.758139661060905948870523641319556816772E-4),
-  L(4.445143889306356207566032244985607493096E-3),
-  L(6.391901016293512632765621532571159071158E-2),
-  L(4.933040207519900471177016015718145795434E-1),
-  L(1.839144086168947712971630337250761842976E0),
-  L(2.715120873995490920415616716916149586579E0),
+static const long double P8_16D[NP8_16D + 1] = {
+  2.546869316918069202079580939942463010937E-15L,
+  1.644650111942455804019788382157745229955E-12L,
+  4.185430770291694079925607420808011147173E-10L,
+  5.485331966975218025368698195861074143153E-8L,
+  4.062884421686912042335466327098932678905E-6L,
+  1.758139661060905948870523641319556816772E-4L,
+  4.445143889306356207566032244985607493096E-3L,
+  6.391901016293512632765621532571159071158E-2L,
+  4.933040207519900471177016015718145795434E-1L,
+  1.839144086168947712971630337250761842976E0L,
+  2.715120873995490920415616716916149586579E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -125,32 +123,32 @@ static const _Float128 P8_16D[NP8_16D + 1] = {
   0.125 <= 1/x <= 0.1875
   Peak relative error 1.3e-36  */
 #define NP5_8N 10
-static const _Float128 P5_8N[NP5_8N + 1] = {
-  L(2.837678373978003452653763806968237227234E-12),
-  L(9.726641165590364928442128579282742354806E-10),
-  L(1.284408003604131382028112171490633956539E-7),
-  L(8.524624695868291291250573339272194285008E-6),
-  L(3.111516908953172249853673787748841282846E-4),
-  L(6.423175156126364104172801983096596409176E-3),
-  L(7.430220589989104581004416356260692450652E-2),
-  L(4.608315409833682489016656279567605536619E-1),
-  L(1.396870223510964882676225042258855977512E0),
-  L(1.718500293904122365894630460672081526236E0),
-  L(5.465927698800862172307352821870223855365E-1)
+static const long double P5_8N[NP5_8N + 1] = {
+  2.837678373978003452653763806968237227234E-12L,
+  9.726641165590364928442128579282742354806E-10L,
+  1.284408003604131382028112171490633956539E-7L,
+  8.524624695868291291250573339272194285008E-6L,
+  3.111516908953172249853673787748841282846E-4L,
+  6.423175156126364104172801983096596409176E-3L,
+  7.430220589989104581004416356260692450652E-2L,
+  4.608315409833682489016656279567605536619E-1L,
+  1.396870223510964882676225042258855977512E0L,
+  1.718500293904122365894630460672081526236E0L,
+  5.465927698800862172307352821870223855365E-1L
 };
 #define NP5_8D 10
-static const _Float128 P5_8D[NP5_8D + 1] = {
-  L(2.421485545794616609951168511612060482715E-11),
-  L(8.329862750896452929030058039752327232310E-9),
-  L(1.106137992233383429630592081375289010720E-6),
-  L(7.405786153760681090127497796448503306939E-5),
-  L(2.740364785433195322492093333127633465227E-3),
-  L(5.781246470403095224872243564165254652198E-2),
-  L(6.927711353039742469918754111511109983546E-1),
-  L(4.558679283460430281188304515922826156690E0),
-  L(1.534468499844879487013168065728837900009E1),
-  L(2.313927430889218597919624843161569422745E1),
-  L(1.194506341319498844336768473218382828637E1),
+static const long double P5_8D[NP5_8D + 1] = {
+  2.421485545794616609951168511612060482715E-11L,
+  8.329862750896452929030058039752327232310E-9L,
+  1.106137992233383429630592081375289010720E-6L,
+  7.405786153760681090127497796448503306939E-5L,
+  2.740364785433195322492093333127633465227E-3L,
+  5.781246470403095224872243564165254652198E-2L,
+  6.927711353039742469918754111511109983546E-1L,
+  4.558679283460430281188304515922826156690E0L,
+  1.534468499844879487013168065728837900009E1L,
+  2.313927430889218597919624843161569422745E1L,
+  1.194506341319498844336768473218382828637E1L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -158,31 +156,31 @@ static const _Float128 P5_8D[NP5_8D + 1] = {
    Peak relative error 1.4e-36
    0.1875 <= 1/x <= 0.25  */
 #define NP4_5N 10
-static const _Float128 P4_5N[NP4_5N + 1] = {
-  L(1.846029078268368685834261260420933914621E-10),
-  L(3.916295939611376119377869680335444207768E-8),
-  L(3.122158792018920627984597530935323997312E-6),
-  L(1.218073444893078303994045653603392272450E-4),
-  L(2.536420827983485448140477159977981844883E-3),
-  L(2.883011322006690823959367922241169171315E-2),
-  L(1.755255190734902907438042414495469810830E-1),
-  L(5.379317079922628599870898285488723736599E-1),
-  L(7.284904050194300773890303361501726561938E-1),
-  L(3.270110346613085348094396323925000362813E-1),
-  L(1.804473805689725610052078464951722064757E-2),
+static const long double P4_5N[NP4_5N + 1] = {
+  1.846029078268368685834261260420933914621E-10L,
+  3.916295939611376119377869680335444207768E-8L,
+  3.122158792018920627984597530935323997312E-6L,
+  1.218073444893078303994045653603392272450E-4L,
+  2.536420827983485448140477159977981844883E-3L,
+  2.883011322006690823959367922241169171315E-2L,
+  1.755255190734902907438042414495469810830E-1L,
+  5.379317079922628599870898285488723736599E-1L,
+  7.284904050194300773890303361501726561938E-1L,
+  3.270110346613085348094396323925000362813E-1L,
+  1.804473805689725610052078464951722064757E-2L,
 };
 #define NP4_5D 9
-static const _Float128 P4_5D[NP4_5D + 1] = {
-  L(1.575278146806816970152174364308980863569E-9),
-  L(3.361289173657099516191331123405675054321E-7),
-  L(2.704692281550877810424745289838790693708E-5),
-  L(1.070854930483999749316546199273521063543E-3),
-  L(2.282373093495295842598097265627962125411E-2),
-  L(2.692025460665354148328762368240343249830E-1),
-  L(1.739892942593664447220951225734811133759E0),
-  L(5.890727576752230385342377570386657229324E0),
-  L(9.517442287057841500750256954117735128153E0),
-  L(6.100616353935338240775363403030137736013E0),
+static const long double P4_5D[NP4_5D + 1] = {
+  1.575278146806816970152174364308980863569E-9L,
+  3.361289173657099516191331123405675054321E-7L,
+  2.704692281550877810424745289838790693708E-5L,
+  1.070854930483999749316546199273521063543E-3L,
+  2.282373093495295842598097265627962125411E-2L,
+  2.692025460665354148328762368240343249830E-1L,
+  1.739892942593664447220951225734811133759E0L,
+  5.890727576752230385342377570386657229324E0L,
+  9.517442287057841500750256954117735128153E0L,
+  6.100616353935338240775363403030137736013E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -190,30 +188,30 @@ static const _Float128 P4_5D[NP4_5D + 1] = {
    Peak relative error 3.0e-36
    0.25 <= 1/x <= 0.3125  */
 #define NP3r2_4N 9
-static const _Float128 P3r2_4N[NP3r2_4N + 1] = {
-  L(8.240803130988044478595580300846665863782E-8),
-  L(1.179418958381961224222969866406483744580E-5),
-  L(6.179787320956386624336959112503824397755E-4),
-  L(1.540270833608687596420595830747166658383E-2),
-  L(1.983904219491512618376375619598837355076E-1),
-  L(1.341465722692038870390470651608301155565E0),
-  L(4.617865326696612898792238245990854646057E0),
-  L(7.435574801812346424460233180412308000587E0),
-  L(4.671327027414635292514599201278557680420E0),
-  L(7.299530852495776936690976966995187714739E-1),
+static const long double P3r2_4N[NP3r2_4N + 1] = {
+  8.240803130988044478595580300846665863782E-8L,
+  1.179418958381961224222969866406483744580E-5L,
+  6.179787320956386624336959112503824397755E-4L,
+  1.540270833608687596420595830747166658383E-2L,
+  1.983904219491512618376375619598837355076E-1L,
+  1.341465722692038870390470651608301155565E0L,
+  4.617865326696612898792238245990854646057E0L,
+  7.435574801812346424460233180412308000587E0L,
+  4.671327027414635292514599201278557680420E0L,
+  7.299530852495776936690976966995187714739E-1L,
 };
 #define NP3r2_4D 9
-static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
-  L(7.032152009675729604487575753279187576521E-7),
-  L(1.015090352324577615777511269928856742848E-4),
-  L(5.394262184808448484302067955186308730620E-3),
-  L(1.375291438480256110455809354836988584325E-1),
-  L(1.836247144461106304788160919310404376670E0),
-  L(1.314378564254376655001094503090935880349E1),
-  L(4.957184590465712006934452500894672343488E1),
-  L(9.287394244300647738855415178790263465398E1),
-  L(7.652563275535900609085229286020552768399E1),
-  L(2.147042473003074533150718117770093209096E1),
+static const long double P3r2_4D[NP3r2_4D + 1] = {
+  7.032152009675729604487575753279187576521E-7L,
+  1.015090352324577615777511269928856742848E-4L,
+  5.394262184808448484302067955186308730620E-3L,
+  1.375291438480256110455809354836988584325E-1L,
+  1.836247144461106304788160919310404376670E0L,
+  1.314378564254376655001094503090935880349E1L,
+  4.957184590465712006934452500894672343488E1L,
+  9.287394244300647738855415178790263465398E1L,
+  7.652563275535900609085229286020552768399E1L,
+  2.147042473003074533150718117770093209096E1L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -221,29 +219,29 @@ static const _Float128 P3r2_4D[NP3r2_4D + 1] = {
    Peak relative error 1.0e-35
    0.3125 <= 1/x <= 0.375  */
 #define NP2r7_3r2N 9
-static const _Float128 P2r7_3r2N[NP2r7_3r2N + 1] = {
-  L(4.599033469240421554219816935160627085991E-7),
-  L(4.665724440345003914596647144630893997284E-5),
-  L(1.684348845667764271596142716944374892756E-3),
-  L(2.802446446884455707845985913454440176223E-2),
-  L(2.321937586453963310008279956042545173930E-1),
-  L(9.640277413988055668692438709376437553804E-1),
-  L(1.911021064710270904508663334033003246028E0),
-  L(1.600811610164341450262992138893970224971E0),
-  L(4.266299218652587901171386591543457861138E-1),
-  L(1.316470424456061252962568223251247207325E-2),
+static const long double P2r7_3r2N[NP2r7_3r2N + 1] = {
+  4.599033469240421554219816935160627085991E-7L,
+  4.665724440345003914596647144630893997284E-5L,
+  1.684348845667764271596142716944374892756E-3L,
+  2.802446446884455707845985913454440176223E-2L,
+  2.321937586453963310008279956042545173930E-1L,
+  9.640277413988055668692438709376437553804E-1L,
+  1.911021064710270904508663334033003246028E0L,
+  1.600811610164341450262992138893970224971E0L,
+  4.266299218652587901171386591543457861138E-1L,
+  1.316470424456061252962568223251247207325E-2L,
 };
 #define NP2r7_3r2D 8
-static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
-  L(3.924508608545520758883457108453520099610E-6),
-  L(4.029707889408829273226495756222078039823E-4),
-  L(1.484629715787703260797886463307469600219E-2),
-  L(2.553136379967180865331706538897231588685E-1),
-  L(2.229457223891676394409880026887106228740E0),
-  L(1.005708903856384091956550845198392117318E1),
-  L(2.277082659664386953166629360352385889558E1),
-  L(2.384726835193630788249826630376533988245E1),
-  L(9.700989749041320895890113781610939632410E0),
+static const long double P2r7_3r2D[NP2r7_3r2D + 1] = {
+  3.924508608545520758883457108453520099610E-6L,
+  4.029707889408829273226495756222078039823E-4L,
+  1.484629715787703260797886463307469600219E-2L,
+  2.553136379967180865331706538897231588685E-1L,
+  2.229457223891676394409880026887106228740E0L,
+  1.005708903856384091956550845198392117318E1L,
+  2.277082659664386953166629360352385889558E1L,
+  2.384726835193630788249826630376533988245E1L,
+  9.700989749041320895890113781610939632410E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -251,29 +249,29 @@ static const _Float128 P2r7_3r2D[NP2r7_3r2D + 1] = {
    Peak relative error 1.7e-36
    0.3125 <= 1/x <= 0.4375  */
 #define NP2r3_2r7N 9
-static const _Float128 P2r3_2r7N[NP2r3_2r7N + 1] = {
-  L(3.916766777108274628543759603786857387402E-6),
-  L(3.212176636756546217390661984304645137013E-4),
-  L(9.255768488524816445220126081207248947118E-3),
-  L(1.214853146369078277453080641911700735354E-1),
-  L(7.855163309847214136198449861311404633665E-1),
-  L(2.520058073282978403655488662066019816540E0),
-  L(3.825136484837545257209234285382183711466E0),
-  L(2.432569427554248006229715163865569506873E0),
-  L(4.877934835018231178495030117729800489743E-1),
-  L(1.109902737860249670981355149101343427885E-2),
+static const long double P2r3_2r7N[NP2r3_2r7N + 1] = {
+  3.916766777108274628543759603786857387402E-6L,
+  3.212176636756546217390661984304645137013E-4L,
+  9.255768488524816445220126081207248947118E-3L,
+  1.214853146369078277453080641911700735354E-1L,
+  7.855163309847214136198449861311404633665E-1L,
+  2.520058073282978403655488662066019816540E0L,
+  3.825136484837545257209234285382183711466E0L,
+  2.432569427554248006229715163865569506873E0L,
+  4.877934835018231178495030117729800489743E-1L,
+  1.109902737860249670981355149101343427885E-2L,
 };
 #define NP2r3_2r7D 8
-static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
-  L(3.342307880794065640312646341190547184461E-5),
-  L(2.782182891138893201544978009012096558265E-3),
-  L(8.221304931614200702142049236141249929207E-2),
-  L(1.123728246291165812392918571987858010949E0),
-  L(7.740482453652715577233858317133423434590E0),
-  L(2.737624677567945952953322566311201919139E1),
-  L(4.837181477096062403118304137851260715475E1),
-  L(3.941098643468580791437772701093795299274E1),
-  L(1.245821247166544627558323920382547533630E1),
+static const long double P2r3_2r7D[NP2r3_2r7D + 1] = {
+  3.342307880794065640312646341190547184461E-5L,
+  2.782182891138893201544978009012096558265E-3L,
+  8.221304931614200702142049236141249929207E-2L,
+  1.123728246291165812392918571987858010949E0L,
+  7.740482453652715577233858317133423434590E0L,
+  2.737624677567945952953322566311201919139E1L,
+  4.837181477096062403118304137851260715475E1L,
+  3.941098643468580791437772701093795299274E1L,
+  1.245821247166544627558323920382547533630E1L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -281,28 +279,28 @@ static const _Float128 P2r3_2r7D[NP2r3_2r7D + 1] = {
    Peak relative error 1.7e-35
    0.4375 <= 1/x <= 0.5  */
 #define NP2_2r3N 8
-static const _Float128 P2_2r3N[NP2_2r3N + 1] = {
-  L(3.397930802851248553545191160608731940751E-4),
-  L(2.104020902735482418784312825637833698217E-2),
-  L(4.442291771608095963935342749477836181939E-1),
-  L(4.131797328716583282869183304291833754967E0),
-  L(1.819920169779026500146134832455189917589E1),
-  L(3.781779616522937565300309684282401791291E1),
-  L(3.459605449728864218972931220783543410347E1),
-  L(1.173594248397603882049066603238568316561E1),
-  L(9.455702270242780642835086549285560316461E-1),
+static const long double P2_2r3N[NP2_2r3N + 1] = {
+  3.397930802851248553545191160608731940751E-4L,
+  2.104020902735482418784312825637833698217E-2L,
+  4.442291771608095963935342749477836181939E-1L,
+  4.131797328716583282869183304291833754967E0L,
+  1.819920169779026500146134832455189917589E1L,
+  3.781779616522937565300309684282401791291E1L,
+  3.459605449728864218972931220783543410347E1L,
+  1.173594248397603882049066603238568316561E1L,
+  9.455702270242780642835086549285560316461E-1L,
 };
 #define NP2_2r3D 8
-static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
-  L(2.899568897241432883079888249845707400614E-3),
-  L(1.831107138190848460767699919531132426356E-1),
-  L(3.999350044057883839080258832758908825165E0),
-  L(3.929041535867957938340569419874195303712E1),
-  L(1.884245613422523323068802689915538908291E2),
-  L(4.461469948819229734353852978424629815929E2),
-  L(5.004998753999796821224085972610636347903E2),
-  L(2.386342520092608513170837883757163414100E2),
-  L(3.791322528149347975999851588922424189957E1),
+static const long double P2_2r3D[NP2_2r3D + 1] = {
+  2.899568897241432883079888249845707400614E-3L,
+  1.831107138190848460767699919531132426356E-1L,
+  3.999350044057883839080258832758908825165E0L,
+  3.929041535867957938340569419874195303712E1L,
+  1.884245613422523323068802689915538908291E2L,
+  4.461469948819229734353852978424629815929E2L,
+  5.004998753999796821224085972610636347903E2L,
+  2.386342520092608513170837883757163414100E2L,
+  3.791322528149347975999851588922424189957E1L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -311,31 +309,31 @@ static const _Float128 P2_2r3D[NP2_2r3D + 1] = {
    Peak relative error 8.0e-36
    0 <= 1/x <= .0625  */
 #define NQ16_IN 10
-static const _Float128 Q16_IN[NQ16_IN + 1] = {
-  L(-3.917420835712508001321875734030357393421E-18),
-  L(-4.440311387483014485304387406538069930457E-15),
-  L(-1.951635424076926487780929645954007139616E-12),
-  L(-4.318256438421012555040546775651612810513E-10),
-  L(-5.231244131926180765270446557146989238020E-8),
-  L(-3.540072702902043752460711989234732357653E-6),
-  L(-1.311017536555269966928228052917534882984E-4),
-  L(-2.495184669674631806622008769674827575088E-3),
-  L(-2.141868222987209028118086708697998506716E-2),
-  L(-6.184031415202148901863605871197272650090E-2),
-  L(-1.922298704033332356899546792898156493887E-2),
+static const long double Q16_IN[NQ16_IN + 1] = {
+  -3.917420835712508001321875734030357393421E-18L,
+  -4.440311387483014485304387406538069930457E-15L,
+  -1.951635424076926487780929645954007139616E-12L,
+  -4.318256438421012555040546775651612810513E-10L,
+  -5.231244131926180765270446557146989238020E-8L,
+  -3.540072702902043752460711989234732357653E-6L,
+  -1.311017536555269966928228052917534882984E-4L,
+  -2.495184669674631806622008769674827575088E-3L,
+  -2.141868222987209028118086708697998506716E-2L,
+  -6.184031415202148901863605871197272650090E-2L,
+  -1.922298704033332356899546792898156493887E-2L,
 };
 #define NQ16_ID 9
-static const _Float128 Q16_ID[NQ16_ID + 1] = {
-  L(3.820418034066293517479619763498400162314E-17),
-  L(4.340702810799239909648911373329149354911E-14),
-  L(1.914985356383416140706179933075303538524E-11),
-  L(4.262333682610888819476498617261895474330E-9),
-  L(5.213481314722233980346462747902942182792E-7),
-  L(3.585741697694069399299005316809954590558E-5),
-  L(1.366513429642842006385029778105539457546E-3),
-  L(2.745282599850704662726337474371355160594E-2),
-  L(2.637644521611867647651200098449903330074E-1),
-  L(1.006953426110765984590782655598680488746E0),
+static const long double Q16_ID[NQ16_ID + 1] = {
+  3.820418034066293517479619763498400162314E-17L,
+  4.340702810799239909648911373329149354911E-14L,
+  1.914985356383416140706179933075303538524E-11L,
+  4.262333682610888819476498617261895474330E-9L,
+  5.213481314722233980346462747902942182792E-7L,
+  3.585741697694069399299005316809954590558E-5L,
+  1.366513429642842006385029778105539457546E-3L,
+  2.745282599850704662726337474371355160594E-2L,
+  2.637644521611867647651200098449903330074E-1L,
+  1.006953426110765984590782655598680488746E0L,
  /* 1.000000000000000000000000000000000000000E0 */
  };
 
@@ -344,34 +342,34 @@ static const _Float128 Q16_ID[NQ16_ID + 1] = {
    Peak relative error 1.9e-36
    0.0625 <= 1/x <= 0.125  */
 #define NQ8_16N 11
-static const _Float128 Q8_16N[NQ8_16N + 1] = {
-  L(-2.028630366670228670781362543615221542291E-17),
-  L(-1.519634620380959966438130374006858864624E-14),
-  L(-4.540596528116104986388796594639405114524E-12),
-  L(-7.085151756671466559280490913558388648274E-10),
-  L(-6.351062671323970823761883833531546885452E-8),
-  L(-3.390817171111032905297982523519503522491E-6),
-  L(-1.082340897018886970282138836861233213972E-4),
-  L(-2.020120801187226444822977006648252379508E-3),
-  L(-2.093169910981725694937457070649605557555E-2),
-  L(-1.092176538874275712359269481414448063393E-1),
-  L(-2.374790947854765809203590474789108718733E-1),
-  L(-1.365364204556573800719985118029601401323E-1),
+static const long double Q8_16N[NQ8_16N + 1] = {
+  -2.028630366670228670781362543615221542291E-17L,
+  -1.519634620380959966438130374006858864624E-14L,
+  -4.540596528116104986388796594639405114524E-12L,
+  -7.085151756671466559280490913558388648274E-10L,
+  -6.351062671323970823761883833531546885452E-8L,
+  -3.390817171111032905297982523519503522491E-6L,
+  -1.082340897018886970282138836861233213972E-4L,
+  -2.020120801187226444822977006648252379508E-3L,
+  -2.093169910981725694937457070649605557555E-2L,
+  -1.092176538874275712359269481414448063393E-1L,
+  -2.374790947854765809203590474789108718733E-1L,
+  -1.365364204556573800719985118029601401323E-1L,
 };
 #define NQ8_16D 11
-static const _Float128 Q8_16D[NQ8_16D + 1] = {
-  L(1.978397614733632533581207058069628242280E-16),
-  L(1.487361156806202736877009608336766720560E-13),
-  L(4.468041406888412086042576067133365913456E-11),
-  L(7.027822074821007443672290507210594648877E-9),
-  L(6.375740580686101224127290062867976007374E-7),
-  L(3.466887658320002225888644977076410421940E-5),
-  L(1.138625640905289601186353909213719596986E-3),
-  L(2.224470799470414663443449818235008486439E-2),
-  L(2.487052928527244907490589787691478482358E-1),
-  L(1.483927406564349124649083853892380899217E0),
-  L(4.182773513276056975777258788903489507705E0),
-  L(4.419665392573449746043880892524360870944E0),
+static const long double Q8_16D[NQ8_16D + 1] = {
+  1.978397614733632533581207058069628242280E-16L,
+  1.487361156806202736877009608336766720560E-13L,
+  4.468041406888412086042576067133365913456E-11L,
+  7.027822074821007443672290507210594648877E-9L,
+  6.375740580686101224127290062867976007374E-7L,
+  3.466887658320002225888644977076410421940E-5L,
+  1.138625640905289601186353909213719596986E-3L,
+  2.224470799470414663443449818235008486439E-2L,
+  2.487052928527244907490589787691478482358E-1L,
+  1.483927406564349124649083853892380899217E0L,
+  4.182773513276056975777258788903489507705E0L,
+  4.419665392573449746043880892524360870944E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -380,32 +378,32 @@ static const _Float128 Q8_16D[NQ8_16D + 1] = {
    Peak relative error 1.5e-35
    0.125 <= 1/x <= 0.1875  */
 #define NQ5_8N 10
-static const _Float128 Q5_8N[NQ5_8N + 1] = {
-  L(-3.656082407740970534915918390488336879763E-13),
-  L(-1.344660308497244804752334556734121771023E-10),
-  L(-1.909765035234071738548629788698150760791E-8),
-  L(-1.366668038160120210269389551283666716453E-6),
-  L(-5.392327355984269366895210704976314135683E-5),
-  L(-1.206268245713024564674432357634540343884E-3),
-  L(-1.515456784370354374066417703736088291287E-2),
-  L(-1.022454301137286306933217746545237098518E-1),
-  L(-3.373438906472495080504907858424251082240E-1),
-  L(-4.510782522110845697262323973549178453405E-1),
-  L(-1.549000892545288676809660828213589804884E-1),
+static const long double Q5_8N[NQ5_8N + 1] = {
+  -3.656082407740970534915918390488336879763E-13L,
+  -1.344660308497244804752334556734121771023E-10L,
+  -1.909765035234071738548629788698150760791E-8L,
+  -1.366668038160120210269389551283666716453E-6L,
+  -5.392327355984269366895210704976314135683E-5L,
+  -1.206268245713024564674432357634540343884E-3L,
+  -1.515456784370354374066417703736088291287E-2L,
+  -1.022454301137286306933217746545237098518E-1L,
+  -3.373438906472495080504907858424251082240E-1L,
+  -4.510782522110845697262323973549178453405E-1L,
+  -1.549000892545288676809660828213589804884E-1L,
 };
 #define NQ5_8D 10
-static const _Float128 Q5_8D[NQ5_8D + 1] = {
-  L(3.565550843359501079050699598913828460036E-12),
-  L(1.321016015556560621591847454285330528045E-9),
-  L(1.897542728662346479999969679234270605975E-7),
-  L(1.381720283068706710298734234287456219474E-5),
-  L(5.599248147286524662305325795203422873725E-4),
-  L(1.305442352653121436697064782499122164843E-2),
-  L(1.750234079626943298160445750078631894985E-1),
-  L(1.311420542073436520965439883806946678491E0),
-  L(5.162757689856842406744504211089724926650E0),
-  L(9.527760296384704425618556332087850581308E0),
-  L(6.604648207463236667912921642545100248584E0),
+static const long double Q5_8D[NQ5_8D + 1] = {
+  3.565550843359501079050699598913828460036E-12L,
+  1.321016015556560621591847454285330528045E-9L,
+  1.897542728662346479999969679234270605975E-7L,
+  1.381720283068706710298734234287456219474E-5L,
+  5.599248147286524662305325795203422873725E-4L,
+  1.305442352653121436697064782499122164843E-2L,
+  1.750234079626943298160445750078631894985E-1L,
+  1.311420542073436520965439883806946678491E0L,
+  5.162757689856842406744504211089724926650E0L,
+  9.527760296384704425618556332087850581308E0L,
+  6.604648207463236667912921642545100248584E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -414,31 +412,31 @@ static const _Float128 Q5_8D[NQ5_8D + 1] = {
    Peak relative error 1.3e-35
    0.1875 <= 1/x <= 0.25  */
 #define NQ4_5N 10
-static const _Float128 Q4_5N[NQ4_5N + 1] = {
-  L(-4.079513568708891749424783046520200903755E-11),
-  L(-9.326548104106791766891812583019664893311E-9),
-  L(-8.016795121318423066292906123815687003356E-7),
-  L(-3.372350544043594415609295225664186750995E-5),
-  L(-7.566238665947967882207277686375417983917E-4),
-  L(-9.248861580055565402130441618521591282617E-3),
-  L(-6.033106131055851432267702948850231270338E-2),
-  L(-1.966908754799996793730369265431584303447E-1),
-  L(-2.791062741179964150755788226623462207560E-1),
-  L(-1.255478605849190549914610121863534191666E-1),
-  L(-4.320429862021265463213168186061696944062E-3),
+static const long double Q4_5N[NQ4_5N + 1] = {
+  -4.079513568708891749424783046520200903755E-11L,
+  -9.326548104106791766891812583019664893311E-9L,
+  -8.016795121318423066292906123815687003356E-7L,
+  -3.372350544043594415609295225664186750995E-5L,
+  -7.566238665947967882207277686375417983917E-4L,
+  -9.248861580055565402130441618521591282617E-3L,
+  -6.033106131055851432267702948850231270338E-2L,
+  -1.966908754799996793730369265431584303447E-1L,
+  -2.791062741179964150755788226623462207560E-1L,
+  -1.255478605849190549914610121863534191666E-1L,
+  -4.320429862021265463213168186061696944062E-3L,
 };
 #define NQ4_5D 9
-static const _Float128 Q4_5D[NQ4_5D + 1] = {
-  L(3.978497042580921479003851216297330701056E-10),
-  L(9.203304163828145809278568906420772246666E-8),
-  L(8.059685467088175644915010485174545743798E-6),
-  L(3.490187375993956409171098277561669167446E-4),
-  L(8.189109654456872150100501732073810028829E-3),
-  L(1.072572867311023640958725265762483033769E-1),
-  L(7.790606862409960053675717185714576937994E-1),
-  L(3.016049768232011196434185423512777656328E0),
-  L(5.722963851442769787733717162314477949360E0),
-  L(4.510527838428473279647251350931380867663E0),
+static const long double Q4_5D[NQ4_5D + 1] = {
+  3.978497042580921479003851216297330701056E-10L,
+  9.203304163828145809278568906420772246666E-8L,
+  8.059685467088175644915010485174545743798E-6L,
+  3.490187375993956409171098277561669167446E-4L,
+  8.189109654456872150100501732073810028829E-3L,
+  1.072572867311023640958725265762483033769E-1L,
+  7.790606862409960053675717185714576937994E-1L,
+  3.016049768232011196434185423512777656328E0L,
+  5.722963851442769787733717162314477949360E0L,
+  4.510527838428473279647251350931380867663E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -447,30 +445,30 @@ static const _Float128 Q4_5D[NQ4_5D + 1] = {
    Peak relative error 2.1e-35
    0.25 <= 1/x <= 0.3125  */
 #define NQ3r2_4N 9
-static const _Float128 Q3r2_4N[NQ3r2_4N + 1] = {
-  L(-1.087480809271383885936921889040388133627E-8),
-  L(-1.690067828697463740906962973479310170932E-6),
-  L(-9.608064416995105532790745641974762550982E-5),
-  L(-2.594198839156517191858208513873961837410E-3),
-  L(-3.610954144421543968160459863048062977822E-2),
-  L(-2.629866798251843212210482269563961685666E-1),
-  L(-9.709186825881775885917984975685752956660E-1),
-  L(-1.667521829918185121727268867619982417317E0),
-  L(-1.109255082925540057138766105229900943501E0),
-  L(-1.812932453006641348145049323713469043328E-1),
+static const long double Q3r2_4N[NQ3r2_4N + 1] = {
+  -1.087480809271383885936921889040388133627E-8L,
+  -1.690067828697463740906962973479310170932E-6L,
+  -9.608064416995105532790745641974762550982E-5L,
+  -2.594198839156517191858208513873961837410E-3L,
+  -3.610954144421543968160459863048062977822E-2L,
+  -2.629866798251843212210482269563961685666E-1L,
+  -9.709186825881775885917984975685752956660E-1L,
+  -1.667521829918185121727268867619982417317E0L,
+  -1.109255082925540057138766105229900943501E0L,
+  -1.812932453006641348145049323713469043328E-1L,
 };
 #define NQ3r2_4D 9
-static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
-  L(1.060552717496912381388763753841473407026E-7),
-  L(1.676928002024920520786883649102388708024E-5),
-  L(9.803481712245420839301400601140812255737E-4),
-  L(2.765559874262309494758505158089249012930E-2),
-  L(4.117921827792571791298862613287549140706E-1),
-  L(3.323769515244751267093378361930279161413E0),
-  L(1.436602494405814164724810151689705353670E1),
-  L(3.163087869617098638064881410646782408297E1),
-  L(3.198181264977021649489103980298349589419E1),
-  L(1.203649258862068431199471076202897823272E1),
+static const long double Q3r2_4D[NQ3r2_4D + 1] = {
+  1.060552717496912381388763753841473407026E-7L,
+  1.676928002024920520786883649102388708024E-5L,
+  9.803481712245420839301400601140812255737E-4L,
+  2.765559874262309494758505158089249012930E-2L,
+  4.117921827792571791298862613287549140706E-1L,
+  3.323769515244751267093378361930279161413E0L,
+  1.436602494405814164724810151689705353670E1L,
+  3.163087869617098638064881410646782408297E1L,
+  3.198181264977021649489103980298349589419E1L,
+  1.203649258862068431199471076202897823272E1L,
  /* 1.000000000000000000000000000000000000000E0  */
 };
 
@@ -479,30 +477,30 @@ static const _Float128 Q3r2_4D[NQ3r2_4D + 1] = {
    Peak relative error 1.6e-36
    0.3125 <= 1/x <= 0.375  */
 #define NQ2r7_3r2N 9
-static const _Float128 Q2r7_3r2N[NQ2r7_3r2N + 1] = {
-  L(-1.723405393982209853244278760171643219530E-7),
-  L(-2.090508758514655456365709712333460087442E-5),
-  L(-9.140104013370974823232873472192719263019E-4),
-  L(-1.871349499990714843332742160292474780128E-2),
-  L(-1.948930738119938669637865956162512983416E-1),
-  L(-1.048764684978978127908439526343174139788E0),
-  L(-2.827714929925679500237476105843643064698E0),
-  L(-3.508761569156476114276988181329773987314E0),
-  L(-1.669332202790211090973255098624488308989E0),
-  L(-1.930796319299022954013840684651016077770E-1),
+static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = {
+  -1.723405393982209853244278760171643219530E-7L,
+  -2.090508758514655456365709712333460087442E-5L,
+  -9.140104013370974823232873472192719263019E-4L,
+  -1.871349499990714843332742160292474780128E-2L,
+  -1.948930738119938669637865956162512983416E-1L,
+  -1.048764684978978127908439526343174139788E0L,
+  -2.827714929925679500237476105843643064698E0L,
+  -3.508761569156476114276988181329773987314E0L,
+  -1.669332202790211090973255098624488308989E0L,
+  -1.930796319299022954013840684651016077770E-1L,
 };
 #define NQ2r7_3r2D 9
-static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
-  L(1.680730662300831976234547482334347983474E-6),
-  L(2.084241442440551016475972218719621841120E-4),
-  L(9.445316642108367479043541702688736295579E-3),
-  L(2.044637889456631896650179477133252184672E-1),
-  L(2.316091982244297350829522534435350078205E0),
-  L(1.412031891783015085196708811890448488865E1),
-  L(4.583830154673223384837091077279595496149E1),
-  L(7.549520609270909439885998474045974122261E1),
-  L(5.697605832808113367197494052388203310638E1),
-  L(1.601496240876192444526383314589371686234E1),
+static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = {
+  1.680730662300831976234547482334347983474E-6L,
+  2.084241442440551016475972218719621841120E-4L,
+  9.445316642108367479043541702688736295579E-3L,
+  2.044637889456631896650179477133252184672E-1L,
+  2.316091982244297350829522534435350078205E0L,
+  1.412031891783015085196708811890448488865E1L,
+  4.583830154673223384837091077279595496149E1L,
+  7.549520609270909439885998474045974122261E1L,
+  5.697605832808113367197494052388203310638E1L,
+  1.601496240876192444526383314589371686234E1L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -511,29 +509,29 @@ static const _Float128 Q2r7_3r2D[NQ2r7_3r2D + 1] = {
    Peak relative error 9.5e-36
    0.375 <= 1/x <= 0.4375  */
 #define NQ2r3_2r7N 9
-static const _Float128 Q2r3_2r7N[NQ2r3_2r7N + 1] = {
-  L(-8.603042076329122085722385914954878953775E-7),
-  L(-7.701746260451647874214968882605186675720E-5),
-  L(-2.407932004380727587382493696877569654271E-3),
-  L(-3.403434217607634279028110636919987224188E-2),
-  L(-2.348707332185238159192422084985713102877E-1),
-  L(-7.957498841538254916147095255700637463207E-1),
-  L(-1.258469078442635106431098063707934348577E0),
-  L(-8.162415474676345812459353639449971369890E-1),
-  L(-1.581783890269379690141513949609572806898E-1),
-  L(-1.890595651683552228232308756569450822905E-3),
+static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = {
+  -8.603042076329122085722385914954878953775E-7L,
+  -7.701746260451647874214968882605186675720E-5L,
+  -2.407932004380727587382493696877569654271E-3L,
+  -3.403434217607634279028110636919987224188E-2L,
+  -2.348707332185238159192422084985713102877E-1L,
+  -7.957498841538254916147095255700637463207E-1L,
+  -1.258469078442635106431098063707934348577E0L,
+  -8.162415474676345812459353639449971369890E-1L,
+  -1.581783890269379690141513949609572806898E-1L,
+  -1.890595651683552228232308756569450822905E-3L,
 };
 #define NQ2r3_2r7D 8
-static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
-  L(8.390017524798316921170710533381568175665E-6),
-  L(7.738148683730826286477254659973968763659E-4),
-  L(2.541480810958665794368759558791634341779E-2),
-  L(3.878879789711276799058486068562386244873E-1),
-  L(3.003783779325811292142957336802456109333E0),
-  L(1.206480374773322029883039064575464497400E1),
-  L(2.458414064785315978408974662900438351782E1),
-  L(2.367237826273668567199042088835448715228E1),
-  L(9.231451197519171090875569102116321676763E0),
+static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = {
+  8.390017524798316921170710533381568175665E-6L,
+  7.738148683730826286477254659973968763659E-4L,
+  2.541480810958665794368759558791634341779E-2L,
+  3.878879789711276799058486068562386244873E-1L,
+  3.003783779325811292142957336802456109333E0L,
+  1.206480374773322029883039064575464497400E1L,
+  2.458414064785315978408974662900438351782E1L,
+  2.367237826273668567199042088835448715228E1L,
+  9.231451197519171090875569102116321676763E0L,
  /* 1.000000000000000000000000000000000000000E0 */
 };
 
@@ -542,39 +540,39 @@ static const _Float128 Q2r3_2r7D[NQ2r3_2r7D + 1] = {
    Peak relative error 1.4e-36
    0.4375 <= 1/x <= 0.5  */
 #define NQ2_2r3N 9
-static const _Float128 Q2_2r3N[NQ2_2r3N + 1] = {
-  L(-5.552507516089087822166822364590806076174E-6),
-  L(-4.135067659799500521040944087433752970297E-4),
-  L(-1.059928728869218962607068840646564457980E-2),
-  L(-1.212070036005832342565792241385459023801E-1),
-  L(-6.688350110633603958684302153362735625156E-1),
-  L(-1.793587878197360221340277951304429821582E0),
-  L(-2.225407682237197485644647380483725045326E0),
-  L(-1.123402135458940189438898496348239744403E0),
-  L(-1.679187241566347077204805190763597299805E-1),
-  L(-1.458550613639093752909985189067233504148E-3),
+static const long double Q2_2r3N[NQ2_2r3N + 1] = {
+  -5.552507516089087822166822364590806076174E-6L,
+  -4.135067659799500521040944087433752970297E-4L,
+  -1.059928728869218962607068840646564457980E-2L,
+  -1.212070036005832342565792241385459023801E-1L,
+  -6.688350110633603958684302153362735625156E-1L,
+  -1.793587878197360221340277951304429821582E0L,
+  -2.225407682237197485644647380483725045326E0L,
+  -1.123402135458940189438898496348239744403E0L,
+  -1.679187241566347077204805190763597299805E-1L,
+  -1.458550613639093752909985189067233504148E-3L,
 };
 #define NQ2_2r3D 8
-static const _Float128 Q2_2r3D[NQ2_2r3D + 1] = {
-  L(5.415024336507980465169023996403597916115E-5),
-  L(4.179246497380453022046357404266022870788E-3),
-  L(1.136306384261959483095442402929502368598E-1),
-  L(1.422640343719842213484515445393284072830E0),
-  L(8.968786703393158374728850922289204805764E0),
-  L(2.914542473339246127533384118781216495934E1),
-  L(4.781605421020380669870197378210457054685E1),
-  L(3.693865837171883152382820584714795072937E1),
-  L(1.153220502744204904763115556224395893076E1),
+static const long double Q2_2r3D[NQ2_2r3D + 1] = {
+  5.415024336507980465169023996403597916115E-5L,
+  4.179246497380453022046357404266022870788E-3L,
+  1.136306384261959483095442402929502368598E-1L,
+  1.422640343719842213484515445393284072830E0L,
+  8.968786703393158374728850922289204805764E0L,
+  2.914542473339246127533384118781216495934E1L,
+  4.781605421020380669870197378210457054685E1L,
+  3.693865837171883152382820584714795072937E1L,
+  1.153220502744204904763115556224395893076E1L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static _Float128
-neval (_Float128 x, const _Float128 *p, int n)
+static long double
+neval (long double x, const long double *p, int n)
 {
-  _Float128 y;
+  long double y;
 
   p += n;
   y = *p--;
@@ -589,10 +587,10 @@ neval (_Float128 x, const _Float128 *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static _Float128
-deval (_Float128 x, const _Float128 *p, int n)
+static long double
+deval (long double x, const long double *p, int n)
 {
-  _Float128 y;
+  long double y;
 
   p += n;
   y = x + *p--;
@@ -607,10 +605,10 @@ deval (_Float128 x, const _Float128 *p, int n)
 
 /* Bessel function of the first kind, order one.  */
 
-_Float128
-__ieee754_j1l (_Float128 x)
+long double
+__ieee754_j1l (long double x)
 {
-  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+  long double xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     {
@@ -622,9 +620,9 @@ __ieee754_j1l (_Float128 x)
   if (x == 0)
     return x;
   xx = fabsl (x);
-  if (xx <= L(0x1p-58))
+  if (xx <= 0x1p-58L)
     {
-      _Float128 ret = x * L(0.5);
+      long double ret = x * 0.5L;
       math_check_force_underflow (ret);
       if (ret == 0)
 	__set_errno (ERANGE);
@@ -635,7 +633,7 @@ __ieee754_j1l (_Float128 x)
       /* 0 <= x <= 2 */
       z = xx * xx;
       p = xx * z * neval (z, J0_2N, NJ0_2N) / deval (z, J0_2D, NJ0_2D);
-      p += L(0.5) * xx;
+      p += 0.5L * xx;
       if (x < 0)
 	p = -p;
       return p;
@@ -659,7 +657,7 @@ __ieee754_j1l (_Float128 x)
 	ss = z / cc;
     }
 
-  if (xx > L(0x1p256))
+  if (xx > 0x1p256L)
     {
       z = ONEOSQPI * cc / __ieee754_sqrtl (xx);
       if (x < 0)
@@ -727,7 +725,7 @@ __ieee754_j1l (_Float128 x)
     }
   p = 1 + z * p;
   q = z * q;
-  q = q * xinv + L(0.375) * xinv;
+  q = q * xinv + 0.375L * xinv;
   z = ONEOSQPI * (p * cc - q * ss) / __ieee754_sqrtl (xx);
   if (x < 0)
     z = -z;
@@ -740,36 +738,36 @@ strong_alias (__ieee754_j1l, __j1l_finite)
    Peak relative error 6.2e-38
    0 <= x <= 2   */
 #define NY0_2N 7
-static _Float128 Y0_2N[NY0_2N + 1] = {
-  L(-6.804415404830253804408698161694720833249E19),
-  L(1.805450517967019908027153056150465849237E19),
-  L(-8.065747497063694098810419456383006737312E17),
-  L(1.401336667383028259295830955439028236299E16),
-  L(-1.171654432898137585000399489686629680230E14),
-  L(5.061267920943853732895341125243428129150E11),
-  L(-1.096677850566094204586208610960870217970E9),
-  L(9.541172044989995856117187515882879304461E5),
+static long double Y0_2N[NY0_2N + 1] = {
+  -6.804415404830253804408698161694720833249E19L,
+  1.805450517967019908027153056150465849237E19L,
+  -8.065747497063694098810419456383006737312E17L,
+  1.401336667383028259295830955439028236299E16L,
+  -1.171654432898137585000399489686629680230E14L,
+  5.061267920943853732895341125243428129150E11L,
+  -1.096677850566094204586208610960870217970E9L,
+  9.541172044989995856117187515882879304461E5L,
 };
 #define NY0_2D 7
-static _Float128 Y0_2D[NY0_2D + 1] = {
-  L(3.470629591820267059538637461549677594549E20),
-  L(4.120796439009916326855848107545425217219E18),
-  L(2.477653371652018249749350657387030814542E16),
-  L(9.954678543353888958177169349272167762797E13),
-  L(2.957927997613630118216218290262851197754E11),
-  L(6.748421382188864486018861197614025972118E8),
-  L(1.173453425218010888004562071020305709319E6),
-  L(1.450335662961034949894009554536003377187E3),
+static long double Y0_2D[NY0_2D + 1] = {
+  3.470629591820267059538637461549677594549E20L,
+  4.120796439009916326855848107545425217219E18L,
+  2.477653371652018249749350657387030814542E16L,
+  9.954678543353888958177169349272167762797E13L,
+  2.957927997613630118216218290262851197754E11L,
+  6.748421382188864486018861197614025972118E8L,
+  1.173453425218010888004562071020305709319E6L,
+  1.450335662961034949894009554536003377187E3L,
   /* 1.000000000000000000000000000000000000000E0 */
 };
 
 
 /* Bessel function of the second kind, order one.  */
 
-_Float128
-__ieee754_y1l (_Float128 x)
+long double
+__ieee754_y1l (long double x)
 {
-  _Float128 xx, xinv, z, p, q, c, s, cc, ss;
+  long double xx, xinv, z, p, q, c, s, cc, ss;
 
   if (! isfinite (x))
     return 1 / (x + x * x);
@@ -816,7 +814,7 @@ __ieee754_y1l (_Float128 x)
 	ss = z / cc;
     }
 
-  if (xx > L(0x1p256))
+  if (xx > 0x1p256L)
     return ONEOSQPI * ss / __ieee754_sqrtl (xx);
 
   xinv = 1 / xx;
@@ -879,7 +877,7 @@ __ieee754_y1l (_Float128 x)
     }
   p = 1 + z * p;
   q = z * q;
-  q = q * xinv + L(0.375) * xinv;
+  q = q * xinv + 0.375L * xinv;
   z = ONEOSQPI * (p * ss + q * cc) / __ieee754_sqrtl (xx);
   return z;
 }
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
index f3e184c622..474773e81d 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c
@@ -17,42 +17,40 @@
 
 /* This file was copied from sysdeps/ieee754/ldbl-128/e_lgammal_r.c.  */
 
-#define _Float128 long double
-#define L(x) x ## L
 
 #include <math.h>
 #include <math_private.h>
 #include <float.h>
 
-static const _Float128 PIL = L(3.1415926535897932384626433832795028841972E0);
+static const long double PIL = 3.1415926535897932384626433832795028841972E0L;
 #if LDBL_MANT_DIG == 106
-static const _Float128 MAXLGM = L(0x5.d53649e2d469dbc1f01e99fd66p+1012);
+static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L;
 #else
-static const _Float128 MAXLGM = L(1.0485738685148938358098967157129705071571E4928);
+static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
 #endif
-static const _Float128 one = 1;
-static const _Float128 huge = LDBL_MAX;
+static const long double one = 1;
+static const long double huge = LDBL_MAX;
 
 /* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
    1/x <= 0.0741 (x >= 13.495...)
    Peak relative error 1.5e-36  */
-static const _Float128 ls2pi = L(9.1893853320467274178032973640561763986140E-1);
+static const long double ls2pi = 9.1893853320467274178032973640561763986140E-1L;
 #define NRASY 12
-static const _Float128 RASY[NRASY + 1] =
+static const long double RASY[NRASY + 1] =
 {
-  L(8.333333333333333333333333333310437112111E-2),
- L(-2.777777777777777777777774789556228296902E-3),
-  L(7.936507936507936507795933938448586499183E-4),
- L(-5.952380952380952041799269756378148574045E-4),
-  L(8.417508417507928904209891117498524452523E-4),
- L(-1.917526917481263997778542329739806086290E-3),
-  L(6.410256381217852504446848671499409919280E-3),
- L(-2.955064066900961649768101034477363301626E-2),
-  L(1.796402955865634243663453415388336954675E-1),
- L(-1.391522089007758553455753477688592767741E0),
-  L(1.326130089598399157988112385013829305510E1),
- L(-1.420412699593782497803472576479997819149E2),
-  L(1.218058922427762808938869872528846787020E3)
+  8.333333333333333333333333333310437112111E-2L,
+ -2.777777777777777777777774789556228296902E-3L,
+  7.936507936507936507795933938448586499183E-4L,
+ -5.952380952380952041799269756378148574045E-4L,
+  8.417508417507928904209891117498524452523E-4L,
+ -1.917526917481263997778542329739806086290E-3L,
+  6.410256381217852504446848671499409919280E-3L,
+ -2.955064066900961649768101034477363301626E-2L,
+  1.796402955865634243663453415388336954675E-1L,
+ -1.391522089007758553455753477688592767741E0L,
+  1.326130089598399157988112385013829305510E1L,
+ -1.420412699593782497803472576479997819149E2L,
+  1.218058922427762808938869872528846787020E3L
 };
 
 
@@ -60,30 +58,30 @@ static const _Float128 RASY[NRASY + 1] =
    -0.5 <= x <= 0.5
    12.5 <= x+13 <= 13.5
    Peak relative error 1.1e-36  */
-static const _Float128 lgam13a = L(1.9987213134765625E1);
-static const _Float128 lgam13b = L(1.3608962611495173623870550785125024484248E-6);
+static const long double lgam13a = 1.9987213134765625E1L;
+static const long double lgam13b = 1.3608962611495173623870550785125024484248E-6L;
 #define NRN13 7
-static const _Float128 RN13[NRN13 + 1] =
+static const long double RN13[NRN13 + 1] =
 {
-  L(8.591478354823578150238226576156275285700E11),
-  L(2.347931159756482741018258864137297157668E11),
-  L(2.555408396679352028680662433943000804616E10),
-  L(1.408581709264464345480765758902967123937E9),
-  L(4.126759849752613822953004114044451046321E7),
-  L(6.133298899622688505854211579222889943778E5),
-  L(3.929248056293651597987893340755876578072E3),
-  L(6.850783280018706668924952057996075215223E0)
+  8.591478354823578150238226576156275285700E11L,
+  2.347931159756482741018258864137297157668E11L,
+  2.555408396679352028680662433943000804616E10L,
+  1.408581709264464345480765758902967123937E9L,
+  4.126759849752613822953004114044451046321E7L,
+  6.133298899622688505854211579222889943778E5L,
+  3.929248056293651597987893340755876578072E3L,
+  6.850783280018706668924952057996075215223E0L
 };
 #define NRD13 6
-static const _Float128 RD13[NRD13 + 1] =
-{
-  L(3.401225382297342302296607039352935541669E11),
-  L(8.756765276918037910363513243563234551784E10),
-  L(8.873913342866613213078554180987647243903E9),
-  L(4.483797255342763263361893016049310017973E8),
-  L(1.178186288833066430952276702931512870676E7),
-  L(1.519928623743264797939103740132278337476E5),
-  L(7.989298844938119228411117593338850892311E2)
+static const long double RD13[NRD13 + 1] =
+{
+  3.401225382297342302296607039352935541669E11L,
+  8.756765276918037910363513243563234551784E10L,
+  8.873913342866613213078554180987647243903E9L,
+  4.483797255342763263361893016049310017973E8L,
+  1.178186288833066430952276702931512870676E7L,
+  1.519928623743264797939103740132278337476E5L,
+  7.989298844938119228411117593338850892311E2L
  /* 1.0E0L */
 };
 
@@ -92,30 +90,30 @@ static const _Float128 RD13[NRD13 + 1] =
    -0.5 <= x <= 0.5
    11.5 <= x+12 <= 12.5
    Peak relative error 4.1e-36  */
-static const _Float128 lgam12a = L(1.75023040771484375E1);
-static const _Float128 lgam12b = L(3.7687254483392876529072161996717039575982E-6);
+static const long double lgam12a = 1.75023040771484375E1L;
+static const long double lgam12b = 3.7687254483392876529072161996717039575982E-6L;
 #define NRN12 7
-static const _Float128 RN12[NRN12 + 1] =
+static const long double RN12[NRN12 + 1] =
 {
-  L(4.709859662695606986110997348630997559137E11),
-  L(1.398713878079497115037857470168777995230E11),
-  L(1.654654931821564315970930093932954900867E10),
-  L(9.916279414876676861193649489207282144036E8),
-  L(3.159604070526036074112008954113411389879E7),
-  L(5.109099197547205212294747623977502492861E5),
-  L(3.563054878276102790183396740969279826988E3),
-  L(6.769610657004672719224614163196946862747E0)
+  4.709859662695606986110997348630997559137E11L,
+  1.398713878079497115037857470168777995230E11L,
+  1.654654931821564315970930093932954900867E10L,
+  9.916279414876676861193649489207282144036E8L,
+  3.159604070526036074112008954113411389879E7L,
+  5.109099197547205212294747623977502492861E5L,
+  3.563054878276102790183396740969279826988E3L,
+  6.769610657004672719224614163196946862747E0L
 };
 #define NRD12 6
-static const _Float128 RD12[NRD12 + 1] =
-{
-  L(1.928167007860968063912467318985802726613E11),
-  L(5.383198282277806237247492369072266389233E10),
-  L(5.915693215338294477444809323037871058363E9),
-  L(3.241438287570196713148310560147925781342E8),
-  L(9.236680081763754597872713592701048455890E6),
-  L(1.292246897881650919242713651166596478850E5),
-  L(7.366532445427159272584194816076600211171E2)
+static const long double RD12[NRD12 + 1] =
+{
+  1.928167007860968063912467318985802726613E11L,
+  5.383198282277806237247492369072266389233E10L,
+  5.915693215338294477444809323037871058363E9L,
+  3.241438287570196713148310560147925781342E8L,
+  9.236680081763754597872713592701048455890E6L,
+  1.292246897881650919242713651166596478850E5L,
+  7.366532445427159272584194816076600211171E2L
  /* 1.0E0L */
 };
 
@@ -124,30 +122,30 @@ static const _Float128 RD12[NRD12 + 1] =
    -0.5 <= x <= 0.5
    10.5 <= x+11 <= 11.5
    Peak relative error 1.8e-35  */
-static const _Float128 lgam11a = L(1.5104400634765625E1);
-static const _Float128 lgam11b = L(1.1938309890295225709329251070371882250744E-5);
+static const long double lgam11a = 1.5104400634765625E1L;
+static const long double lgam11b = 1.1938309890295225709329251070371882250744E-5L;
 #define NRN11 7
-static const _Float128 RN11[NRN11 + 1] =
+static const long double RN11[NRN11 + 1] =
 {
-  L(2.446960438029415837384622675816736622795E11),
-  L(7.955444974446413315803799763901729640350E10),
-  L(1.030555327949159293591618473447420338444E10),
-  L(6.765022131195302709153994345470493334946E8),
-  L(2.361892792609204855279723576041468347494E7),
-  L(4.186623629779479136428005806072176490125E5),
-  L(3.202506022088912768601325534149383594049E3),
-  L(6.681356101133728289358838690666225691363E0)
+  2.446960438029415837384622675816736622795E11L,
+  7.955444974446413315803799763901729640350E10L,
+  1.030555327949159293591618473447420338444E10L,
+  6.765022131195302709153994345470493334946E8L,
+  2.361892792609204855279723576041468347494E7L,
+  4.186623629779479136428005806072176490125E5L,
+  3.202506022088912768601325534149383594049E3L,
+  6.681356101133728289358838690666225691363E0L
 };
 #define NRD11 6
-static const _Float128 RD11[NRD11 + 1] =
-{
-  L(1.040483786179428590683912396379079477432E11),
-  L(3.172251138489229497223696648369823779729E10),
-  L(3.806961885984850433709295832245848084614E9),
-  L(2.278070344022934913730015420611609620171E8),
-  L(7.089478198662651683977290023829391596481E6),
-  L(1.083246385105903533237139380509590158658E5),
-  L(6.744420991491385145885727942219463243597E2)
+static const long double RD11[NRD11 + 1] =
+{
+  1.040483786179428590683912396379079477432E11L,
+  3.172251138489229497223696648369823779729E10L,
+  3.806961885984850433709295832245848084614E9L,
+  2.278070344022934913730015420611609620171E8L,
+  7.089478198662651683977290023829391596481E6L,
+  1.083246385105903533237139380509590158658E5L,
+  6.744420991491385145885727942219463243597E2L
  /* 1.0E0L */
 };
 
@@ -156,31 +154,31 @@ static const _Float128 RD11[NRD11 + 1] =
    -0.5 <= x <= 0.5
    9.5 <= x+10 <= 10.5
    Peak relative error 5.4e-37  */
-static const _Float128 lgam10a = L(1.280181884765625E1);
-static const _Float128 lgam10b = L(8.6324252196112077178745667061642811492557E-6);
+static const long double lgam10a = 1.280181884765625E1L;
+static const long double lgam10b = 8.6324252196112077178745667061642811492557E-6L;
 #define NRN10 7
-static const _Float128 RN10[NRN10 + 1] =
+static const long double RN10[NRN10 + 1] =
 {
-  L(-1.239059737177249934158597996648808363783E14),
-  L(-4.725899566371458992365624673357356908719E13),
-  L(-7.283906268647083312042059082837754850808E12),
-  L(-5.802855515464011422171165179767478794637E11),
-  L(-2.532349691157548788382820303182745897298E10),
-  L(-5.884260178023777312587193693477072061820E8),
-  L(-6.437774864512125749845840472131829114906E6),
-  L(-2.350975266781548931856017239843273049384E4)
+  -1.239059737177249934158597996648808363783E14L,
+  -4.725899566371458992365624673357356908719E13L,
+  -7.283906268647083312042059082837754850808E12L,
+  -5.802855515464011422171165179767478794637E11L,
+  -2.532349691157548788382820303182745897298E10L,
+  -5.884260178023777312587193693477072061820E8L,
+  -6.437774864512125749845840472131829114906E6L,
+  -2.350975266781548931856017239843273049384E4L
 };
 #define NRD10 7
-static const _Float128 RD10[NRD10 + 1] =
-{
-  L(-5.502645997581822567468347817182347679552E13),
-  L(-1.970266640239849804162284805400136473801E13),
-  L(-2.819677689615038489384974042561531409392E12),
-  L(-2.056105863694742752589691183194061265094E11),
-  L(-8.053670086493258693186307810815819662078E9),
-  L(-1.632090155573373286153427982504851867131E8),
-  L(-1.483575879240631280658077826889223634921E6),
-  L(-4.002806669713232271615885826373550502510E3)
+static const long double RD10[NRD10 + 1] =
+{
+  -5.502645997581822567468347817182347679552E13L,
+  -1.970266640239849804162284805400136473801E13L,
+  -2.819677689615038489384974042561531409392E12L,
+  -2.056105863694742752589691183194061265094E11L,
+  -8.053670086493258693186307810815819662078E9L,
+  -1.632090155573373286153427982504851867131E8L,
+  -1.483575879240631280658077826889223634921E6L,
+  -4.002806669713232271615885826373550502510E3L
  /* 1.0E0L */
 };
 
@@ -189,31 +187,31 @@ static const _Float128 RD10[NRD10 + 1] =
    -0.5 <= x <= 0.5
    8.5 <= x+9 <= 9.5
    Peak relative error 3.6e-36  */
-static const _Float128 lgam9a = L(1.06045989990234375E1);
-static const _Float128 lgam9b = L(3.9037218127284172274007216547549861681400E-6);
+static const long double lgam9a = 1.06045989990234375E1L;
+static const long double lgam9b = 3.9037218127284172274007216547549861681400E-6L;
 #define NRN9 7
-static const _Float128 RN9[NRN9 + 1] =
+static const long double RN9[NRN9 + 1] =
 {
-  L(-4.936332264202687973364500998984608306189E13),
-  L(-2.101372682623700967335206138517766274855E13),
-  L(-3.615893404644823888655732817505129444195E12),
-  L(-3.217104993800878891194322691860075472926E11),
-  L(-1.568465330337375725685439173603032921399E10),
-  L(-4.073317518162025744377629219101510217761E8),
-  L(-4.983232096406156139324846656819246974500E6),
-  L(-2.036280038903695980912289722995505277253E4)
+  -4.936332264202687973364500998984608306189E13L,
+  -2.101372682623700967335206138517766274855E13L,
+  -3.615893404644823888655732817505129444195E12L,
+  -3.217104993800878891194322691860075472926E11L,
+  -1.568465330337375725685439173603032921399E10L,
+  -4.073317518162025744377629219101510217761E8L,
+  -4.983232096406156139324846656819246974500E6L,
+  -2.036280038903695980912289722995505277253E4L
 };
 #define NRD9 7
-static const _Float128 RD9[NRD9 + 1] =
-{
-  L(-2.306006080437656357167128541231915480393E13),
-  L(-9.183606842453274924895648863832233799950E12),
-  L(-1.461857965935942962087907301194381010380E12),
-  L(-1.185728254682789754150068652663124298303E11),
-  L(-5.166285094703468567389566085480783070037E9),
-  L(-1.164573656694603024184768200787835094317E8),
-  L(-1.177343939483908678474886454113163527909E6),
-  L(-3.529391059783109732159524500029157638736E3)
+static const long double RD9[NRD9 + 1] =
+{
+  -2.306006080437656357167128541231915480393E13L,
+  -9.183606842453274924895648863832233799950E12L,
+  -1.461857965935942962087907301194381010380E12L,
+  -1.185728254682789754150068652663124298303E11L,
+  -5.166285094703468567389566085480783070037E9L,
+  -1.164573656694603024184768200787835094317E8L,
+  -1.177343939483908678474886454113163527909E6L,
+  -3.529391059783109732159524500029157638736E3L
   /* 1.0E0L */
 };
 
@@ -222,32 +220,32 @@ static const _Float128 RD9[NRD9 + 1] =
    -0.5 <= x <= 0.5
    7.5 <= x+8 <= 8.5
    Peak relative error 2.4e-37  */
-static const _Float128 lgam8a = L(8.525146484375E0);
-static const _Float128 lgam8b = L(1.4876690414300165531036347125050759667737E-5);
+static const long double lgam8a = 8.525146484375E0L;
+static const long double lgam8b = 1.4876690414300165531036347125050759667737E-5L;
 #define NRN8 8
-static const _Float128 RN8[NRN8 + 1] =
-{
-  L(6.600775438203423546565361176829139703289E11),
-  L(3.406361267593790705240802723914281025800E11),
-  L(7.222460928505293914746983300555538432830E10),
-  L(8.102984106025088123058747466840656458342E9),
-  L(5.157620015986282905232150979772409345927E8),
-  L(1.851445288272645829028129389609068641517E7),
-  L(3.489261702223124354745894067468953756656E5),
-  L(2.892095396706665774434217489775617756014E3),
-  L(6.596977510622195827183948478627058738034E0)
+static const long double RN8[NRN8 + 1] =
+{
+  6.600775438203423546565361176829139703289E11L,
+  3.406361267593790705240802723914281025800E11L,
+  7.222460928505293914746983300555538432830E10L,
+  8.102984106025088123058747466840656458342E9L,
+  5.157620015986282905232150979772409345927E8L,
+  1.851445288272645829028129389609068641517E7L,
+  3.489261702223124354745894067468953756656E5L,
+  2.892095396706665774434217489775617756014E3L,
+  6.596977510622195827183948478627058738034E0L
 };
 #define NRD8 7
-static const _Float128 RD8[NRD8 + 1] =
-{
-  L(3.274776546520735414638114828622673016920E11),
-  L(1.581811207929065544043963828487733970107E11),
-  L(3.108725655667825188135393076860104546416E10),
-  L(3.193055010502912617128480163681842165730E9),
-  L(1.830871482669835106357529710116211541839E8),
-  L(5.790862854275238129848491555068073485086E6),
-  L(9.305213264307921522842678835618803553589E4),
-  L(6.216974105861848386918949336819572333622E2)
+static const long double RD8[NRD8 + 1] =
+{
+  3.274776546520735414638114828622673016920E11L,
+  1.581811207929065544043963828487733970107E11L,
+  3.108725655667825188135393076860104546416E10L,
+  3.193055010502912617128480163681842165730E9L,
+  1.830871482669835106357529710116211541839E8L,
+  5.790862854275238129848491555068073485086E6L,
+  9.305213264307921522842678835618803553589E4L,
+  6.216974105861848386918949336819572333622E2L
   /* 1.0E0L */
 };
 
@@ -256,32 +254,32 @@ static const _Float128 RD8[NRD8 + 1] =
    -0.5 <= x <= 0.5
    6.5 <= x+7 <= 7.5
    Peak relative error 3.2e-36  */
-static const _Float128 lgam7a = L(6.5792388916015625E0);
-static const _Float128 lgam7b = L(1.2320408538495060178292903945321122583007E-5);
+static const long double lgam7a = 6.5792388916015625E0L;
+static const long double lgam7b = 1.2320408538495060178292903945321122583007E-5L;
 #define NRN7 8
-static const _Float128 RN7[NRN7 + 1] =
-{
-  L(2.065019306969459407636744543358209942213E11),
-  L(1.226919919023736909889724951708796532847E11),
-  L(2.996157990374348596472241776917953749106E10),
-  L(3.873001919306801037344727168434909521030E9),
-  L(2.841575255593761593270885753992732145094E8),
-  L(1.176342515359431913664715324652399565551E7),
-  L(2.558097039684188723597519300356028511547E5),
-  L(2.448525238332609439023786244782810774702E3),
-  L(6.460280377802030953041566617300902020435E0)
+static const long double RN7[NRN7 + 1] =
+{
+  2.065019306969459407636744543358209942213E11L,
+  1.226919919023736909889724951708796532847E11L,
+  2.996157990374348596472241776917953749106E10L,
+  3.873001919306801037344727168434909521030E9L,
+  2.841575255593761593270885753992732145094E8L,
+  1.176342515359431913664715324652399565551E7L,
+  2.558097039684188723597519300356028511547E5L,
+  2.448525238332609439023786244782810774702E3L,
+  6.460280377802030953041566617300902020435E0L
 };
 #define NRD7 7
-static const _Float128 RD7[NRD7 + 1] =
-{
-  L(1.102646614598516998880874785339049304483E11),
-  L(6.099297512712715445879759589407189290040E10),
-  L(1.372898136289611312713283201112060238351E10),
-  L(1.615306270420293159907951633566635172343E9),
-  L(1.061114435798489135996614242842561967459E8),
-  L(3.845638971184305248268608902030718674691E6),
-  L(7.081730675423444975703917836972720495507E4),
-  L(5.423122582741398226693137276201344096370E2)
+static const long double RD7[NRD7 + 1] =
+{
+  1.102646614598516998880874785339049304483E11L,
+  6.099297512712715445879759589407189290040E10L,
+  1.372898136289611312713283201112060238351E10L,
+  1.615306270420293159907951633566635172343E9L,
+  1.061114435798489135996614242842561967459E8L,
+  3.845638971184305248268608902030718674691E6L,
+  7.081730675423444975703917836972720495507E4L,
+  5.423122582741398226693137276201344096370E2L
   /* 1.0E0L */
 };
 
@@ -290,33 +288,33 @@ static const _Float128 RD7[NRD7 + 1] =
    -0.5 <= x <= 0.5
    5.5 <= x+6 <= 6.5
    Peak relative error 6.2e-37  */
-static const _Float128 lgam6a = L(4.7874908447265625E0);
-static const _Float128 lgam6b = L(8.9805548349424770093452324304839959231517E-7);
+static const long double lgam6a = 4.7874908447265625E0L;
+static const long double lgam6b = 8.9805548349424770093452324304839959231517E-7L;
 #define NRN6 8
-static const _Float128 RN6[NRN6 + 1] =
-{
-  L(-3.538412754670746879119162116819571823643E13),
-  L(-2.613432593406849155765698121483394257148E13),
-  L(-8.020670732770461579558867891923784753062E12),
-  L(-1.322227822931250045347591780332435433420E12),
-  L(-1.262809382777272476572558806855377129513E11),
-  L(-7.015006277027660872284922325741197022467E9),
-  L(-2.149320689089020841076532186783055727299E8),
-  L(-3.167210585700002703820077565539658995316E6),
-  L(-1.576834867378554185210279285358586385266E4)
+static const long double RN6[NRN6 + 1] =
+{
+  -3.538412754670746879119162116819571823643E13L,
+  -2.613432593406849155765698121483394257148E13L,
+  -8.020670732770461579558867891923784753062E12L,
+  -1.322227822931250045347591780332435433420E12L,
+  -1.262809382777272476572558806855377129513E11L,
+  -7.015006277027660872284922325741197022467E9L,
+  -2.149320689089020841076532186783055727299E8L,
+  -3.167210585700002703820077565539658995316E6L,
+  -1.576834867378554185210279285358586385266E4L
 };
 #define NRD6 8
-static const _Float128 RD6[NRD6 + 1] =
-{
-  L(-2.073955870771283609792355579558899389085E13),
-  L(-1.421592856111673959642750863283919318175E13),
-  L(-4.012134994918353924219048850264207074949E12),
-  L(-6.013361045800992316498238470888523722431E11),
-  L(-5.145382510136622274784240527039643430628E10),
-  L(-2.510575820013409711678540476918249524123E9),
-  L(-6.564058379709759600836745035871373240904E7),
-  L(-7.861511116647120540275354855221373571536E5),
-  L(-2.821943442729620524365661338459579270561E3)
+static const long double RD6[NRD6 + 1] =
+{
+  -2.073955870771283609792355579558899389085E13L,
+  -1.421592856111673959642750863283919318175E13L,
+  -4.012134994918353924219048850264207074949E12L,
+  -6.013361045800992316498238470888523722431E11L,
+  -5.145382510136622274784240527039643430628E10L,
+  -2.510575820013409711678540476918249524123E9L,
+  -6.564058379709759600836745035871373240904E7L,
+  -7.861511116647120540275354855221373571536E5L,
+  -2.821943442729620524365661338459579270561E3L
   /* 1.0E0L */
 };
 
@@ -325,34 +323,34 @@ static const _Float128 RD6[NRD6 + 1] =
    -0.5 <= x <= 0.5
    4.5 <= x+5 <= 5.5
    Peak relative error 3.4e-37  */
-static const _Float128 lgam5a = L(3.17803955078125E0);
-static const _Float128 lgam5b = L(1.4279566695619646941601297055408873990961E-5);
+static const long double lgam5a = 3.17803955078125E0L;
+static const long double lgam5b = 1.4279566695619646941601297055408873990961E-5L;
 #define NRN5 9
-static const _Float128 RN5[NRN5 + 1] =
-{
-  L(2.010952885441805899580403215533972172098E11),
-  L(1.916132681242540921354921906708215338584E11),
-  L(7.679102403710581712903937970163206882492E10),
-  L(1.680514903671382470108010973615268125169E10),
-  L(2.181011222911537259440775283277711588410E9),
-  L(1.705361119398837808244780667539728356096E8),
-  L(7.792391565652481864976147945997033946360E6),
-  L(1.910741381027985291688667214472560023819E5),
-  L(2.088138241893612679762260077783794329559E3),
-  L(6.330318119566998299106803922739066556550E0)
+static const long double RN5[NRN5 + 1] =
+{
+  2.010952885441805899580403215533972172098E11L,
+  1.916132681242540921354921906708215338584E11L,
+  7.679102403710581712903937970163206882492E10L,
+  1.680514903671382470108010973615268125169E10L,
+  2.181011222911537259440775283277711588410E9L,
+  1.705361119398837808244780667539728356096E8L,
+  7.792391565652481864976147945997033946360E6L,
+  1.910741381027985291688667214472560023819E5L,
+  2.088138241893612679762260077783794329559E3L,
+  6.330318119566998299106803922739066556550E0L
 };
 #define NRD5 8
-static const _Float128 RD5[NRD5 + 1] =
-{
-  L(1.335189758138651840605141370223112376176E11),
-  L(1.174130445739492885895466097516530211283E11),
-  L(4.308006619274572338118732154886328519910E10),
-  L(8.547402888692578655814445003283720677468E9),
-  L(9.934628078575618309542580800421370730906E8),
-  L(6.847107420092173812998096295422311820672E7),
-  L(2.698552646016599923609773122139463150403E6),
-  L(5.526516251532464176412113632726150253215E4),
-  L(4.772343321713697385780533022595450486932E2)
+static const long double RD5[NRD5 + 1] =
+{
+  1.335189758138651840605141370223112376176E11L,
+  1.174130445739492885895466097516530211283E11L,
+  4.308006619274572338118732154886328519910E10L,
+  8.547402888692578655814445003283720677468E9L,
+  9.934628078575618309542580800421370730906E8L,
+  6.847107420092173812998096295422311820672E7L,
+  2.698552646016599923609773122139463150403E6L,
+  5.526516251532464176412113632726150253215E4L,
+  4.772343321713697385780533022595450486932E2L
   /* 1.0E0L */
 };
 
@@ -361,35 +359,35 @@ static const _Float128 RD5[NRD5 + 1] =
    -0.5 <= x <= 0.5
    3.5 <= x+4 <= 4.5
    Peak relative error 6.7e-37  */
-static const _Float128 lgam4a = L(1.791748046875E0);
-static const _Float128 lgam4b = L(1.1422353055000812477358380702272722990692E-5);
+static const long double lgam4a = 1.791748046875E0L;
+static const long double lgam4b = 1.1422353055000812477358380702272722990692E-5L;
 #define NRN4 9
-static const _Float128 RN4[NRN4 + 1] =
-{
-  L(-1.026583408246155508572442242188887829208E13),
-  L(-1.306476685384622809290193031208776258809E13),
-  L(-7.051088602207062164232806511992978915508E12),
-  L(-2.100849457735620004967624442027793656108E12),
-  L(-3.767473790774546963588549871673843260569E11),
-  L(-4.156387497364909963498394522336575984206E10),
-  L(-2.764021460668011732047778992419118757746E9),
-  L(-1.036617204107109779944986471142938641399E8),
-  L(-1.895730886640349026257780896972598305443E6),
-  L(-1.180509051468390914200720003907727988201E4)
+static const long double RN4[NRN4 + 1] =
+{
+  -1.026583408246155508572442242188887829208E13L,
+  -1.306476685384622809290193031208776258809E13L,
+  -7.051088602207062164232806511992978915508E12L,
+  -2.100849457735620004967624442027793656108E12L,
+  -3.767473790774546963588549871673843260569E11L,
+  -4.156387497364909963498394522336575984206E10L,
+  -2.764021460668011732047778992419118757746E9L,
+  -1.036617204107109779944986471142938641399E8L,
+  -1.895730886640349026257780896972598305443E6L,
+  -1.180509051468390914200720003907727988201E4L
 };
 #define NRD4 9
-static const _Float128 RD4[NRD4 + 1] =
-{
-  L(-8.172669122056002077809119378047536240889E12),
-  L(-9.477592426087986751343695251801814226960E12),
-  L(-4.629448850139318158743900253637212801682E12),
-  L(-1.237965465892012573255370078308035272942E12),
-  L(-1.971624313506929845158062177061297598956E11),
-  L(-1.905434843346570533229942397763361493610E10),
-  L(-1.089409357680461419743730978512856675984E9),
-  L(-3.416703082301143192939774401370222822430E7),
-  L(-4.981791914177103793218433195857635265295E5),
-  L(-2.192507743896742751483055798411231453733E3)
+static const long double RD4[NRD4 + 1] =
+{
+  -8.172669122056002077809119378047536240889E12L,
+  -9.477592426087986751343695251801814226960E12L,
+  -4.629448850139318158743900253637212801682E12L,
+  -1.237965465892012573255370078308035272942E12L,
+  -1.971624313506929845158062177061297598956E11L,
+  -1.905434843346570533229942397763361493610E10L,
+  -1.089409357680461419743730978512856675984E9L,
+  -3.416703082301143192939774401370222822430E7L,
+  -4.981791914177103793218433195857635265295E5L,
+  -2.192507743896742751483055798411231453733E3L
   /* 1.0E0L */
 };
 
@@ -398,36 +396,36 @@ static const _Float128 RD4[NRD4 + 1] =
    -0.25 <= x <= 0.5
    2.75 <= x+3 <= 3.5
    Peak relative error 6.0e-37  */
-static const _Float128 lgam3a = L(6.93145751953125E-1);
-static const _Float128 lgam3b = L(1.4286068203094172321214581765680755001344E-6);
+static const long double lgam3a = 6.93145751953125E-1L;
+static const long double lgam3b = 1.4286068203094172321214581765680755001344E-6L;
 
 #define NRN3 9
-static const _Float128 RN3[NRN3 + 1] =
-{
-  L(-4.813901815114776281494823863935820876670E11),
-  L(-8.425592975288250400493910291066881992620E11),
-  L(-6.228685507402467503655405482985516909157E11),
-  L(-2.531972054436786351403749276956707260499E11),
-  L(-6.170200796658926701311867484296426831687E10),
-  L(-9.211477458528156048231908798456365081135E9),
-  L(-8.251806236175037114064561038908691305583E8),
-  L(-4.147886355917831049939930101151160447495E7),
-  L(-1.010851868928346082547075956946476932162E6),
-  L(-8.333374463411801009783402800801201603736E3)
+static const long double RN3[NRN3 + 1] =
+{
+  -4.813901815114776281494823863935820876670E11L,
+  -8.425592975288250400493910291066881992620E11L,
+  -6.228685507402467503655405482985516909157E11L,
+  -2.531972054436786351403749276956707260499E11L,
+  -6.170200796658926701311867484296426831687E10L,
+  -9.211477458528156048231908798456365081135E9L,
+  -8.251806236175037114064561038908691305583E8L,
+  -4.147886355917831049939930101151160447495E7L,
+  -1.010851868928346082547075956946476932162E6L,
+  -8.333374463411801009783402800801201603736E3L
 };
 #define NRD3 9
-static const _Float128 RD3[NRD3 + 1] =
-{
-  L(-5.216713843111675050627304523368029262450E11),
-  L(-8.014292925418308759369583419234079164391E11),
-  L(-5.180106858220030014546267824392678611990E11),
-  L(-1.830406975497439003897734969120997840011E11),
-  L(-3.845274631904879621945745960119924118925E10),
-  L(-4.891033385370523863288908070309417710903E9),
-  L(-3.670172254411328640353855768698287474282E8),
-  L(-1.505316381525727713026364396635522516989E7),
-  L(-2.856327162923716881454613540575964890347E5),
-  L(-1.622140448015769906847567212766206894547E3)
+static const long double RD3[NRD3 + 1] =
+{
+  -5.216713843111675050627304523368029262450E11L,
+  -8.014292925418308759369583419234079164391E11L,
+  -5.180106858220030014546267824392678611990E11L,
+  -1.830406975497439003897734969120997840011E11L,
+  -3.845274631904879621945745960119924118925E10L,
+  -4.891033385370523863288908070309417710903E9L,
+  -3.670172254411328640353855768698287474282E8L,
+  -1.505316381525727713026364396635522516989E7L,
+  -2.856327162923716881454613540575964890347E5L,
+  -1.622140448015769906847567212766206894547E3L
   /* 1.0E0L */
 };
 
@@ -435,33 +433,33 @@ static const _Float128 RD3[NRD3 + 1] =
 /* log gamma(x+2.5) = log gamma(2.5) +  x P(x)/Q(x)
    -0.125 <= x <= 0.25
    2.375 <= x+2.5 <= 2.75  */
-static const _Float128 lgam2r5a = L(2.8466796875E-1);
-static const _Float128 lgam2r5b = L(1.4901722919159632494669682701924320137696E-5);
+static const long double lgam2r5a = 2.8466796875E-1L;
+static const long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L;
 #define NRN2r5 8
-static const _Float128 RN2r5[NRN2r5 + 1] =
-{
-  L(-4.676454313888335499356699817678862233205E9),
-  L(-9.361888347911187924389905984624216340639E9),
-  L(-7.695353600835685037920815799526540237703E9),
-  L(-3.364370100981509060441853085968900734521E9),
-  L(-8.449902011848163568670361316804900559863E8),
-  L(-1.225249050950801905108001246436783022179E8),
-  L(-9.732972931077110161639900388121650470926E6),
-  L(-3.695711763932153505623248207576425983573E5),
-  L(-4.717341584067827676530426007495274711306E3)
+static const long double RN2r5[NRN2r5 + 1] =
+{
+  -4.676454313888335499356699817678862233205E9L,
+  -9.361888347911187924389905984624216340639E9L,
+  -7.695353600835685037920815799526540237703E9L,
+  -3.364370100981509060441853085968900734521E9L,
+  -8.449902011848163568670361316804900559863E8L,
+  -1.225249050950801905108001246436783022179E8L,
+  -9.732972931077110161639900388121650470926E6L,
+  -3.695711763932153505623248207576425983573E5L,
+  -4.717341584067827676530426007495274711306E3L
 };
 #define NRD2r5 8
-static const _Float128 RD2r5[NRD2r5 + 1] =
-{
-  L(-6.650657966618993679456019224416926875619E9),
-  L(-1.099511409330635807899718829033488771623E10),
-  L(-7.482546968307837168164311101447116903148E9),
-  L(-2.702967190056506495988922973755870557217E9),
-  L(-5.570008176482922704972943389590409280950E8),
-  L(-6.536934032192792470926310043166993233231E7),
-  L(-4.101991193844953082400035444146067511725E6),
-  L(-1.174082735875715802334430481065526664020E5),
-  L(-9.932840389994157592102947657277692978511E2)
+static const long double RD2r5[NRD2r5 + 1] =
+{
+  -6.650657966618993679456019224416926875619E9L,
+  -1.099511409330635807899718829033488771623E10L,
+  -7.482546968307837168164311101447116903148E9L,
+  -2.702967190056506495988922973755870557217E9L,
+  -5.570008176482922704972943389590409280950E8L,
+  -6.536934032192792470926310043166993233231E7L,
+  -4.101991193844953082400035444146067511725E6L,
+  -1.174082735875715802334430481065526664020E5L,
+  -9.932840389994157592102947657277692978511E2L
   /* 1.0E0L */
 };
 
@@ -471,32 +469,32 @@ static const _Float128 RD2r5[NRD2r5 + 1] =
    1.875 <= x+2 <= 2.375
    Peak relative error 4.6e-36  */
 #define NRN2 9
-static const _Float128 RN2[NRN2 + 1] =
-{
-  L(-3.716661929737318153526921358113793421524E9),
-  L(-1.138816715030710406922819131397532331321E10),
-  L(-1.421017419363526524544402598734013569950E10),
-  L(-9.510432842542519665483662502132010331451E9),
-  L(-3.747528562099410197957514973274474767329E9),
-  L(-8.923565763363912474488712255317033616626E8),
-  L(-1.261396653700237624185350402781338231697E8),
-  L(-9.918402520255661797735331317081425749014E6),
-  L(-3.753996255897143855113273724233104768831E5),
-  L(-4.778761333044147141559311805999540765612E3)
+static const long double RN2[NRN2 + 1] =
+{
+  -3.716661929737318153526921358113793421524E9L,
+  -1.138816715030710406922819131397532331321E10L,
+  -1.421017419363526524544402598734013569950E10L,
+  -9.510432842542519665483662502132010331451E9L,
+  -3.747528562099410197957514973274474767329E9L,
+  -8.923565763363912474488712255317033616626E8L,
+  -1.261396653700237624185350402781338231697E8L,
+  -9.918402520255661797735331317081425749014E6L,
+  -3.753996255897143855113273724233104768831E5L,
+  -4.778761333044147141559311805999540765612E3L
 };
 #define NRD2 9
-static const _Float128 RD2[NRD2 + 1] =
-{
-  L(-8.790916836764308497770359421351673950111E9),
-  L(-2.023108608053212516399197678553737477486E10),
-  L(-1.958067901852022239294231785363504458367E10),
-  L(-1.035515043621003101254252481625188704529E10),
-  L(-3.253884432621336737640841276619272224476E9),
-  L(-6.186383531162456814954947669274235815544E8),
-  L(-6.932557847749518463038934953605969951466E7),
-  L(-4.240731768287359608773351626528479703758E6),
-  L(-1.197343995089189188078944689846348116630E5),
-  L(-1.004622911670588064824904487064114090920E3)
+static const long double RD2[NRD2 + 1] =
+{
+  -8.790916836764308497770359421351673950111E9L,
+  -2.023108608053212516399197678553737477486E10L,
+  -1.958067901852022239294231785363504458367E10L,
+  -1.035515043621003101254252481625188704529E10L,
+  -3.253884432621336737640841276619272224476E9L,
+  -6.186383531162456814954947669274235815544E8L,
+  -6.932557847749518463038934953605969951466E7L,
+  -4.240731768287359608773351626528479703758E6L,
+  -1.197343995089189188078944689846348116630E5L,
+  -1.004622911670588064824904487064114090920E3L
 /* 1.0E0 */
 };
 
@@ -505,33 +503,33 @@ static const _Float128 RD2[NRD2 + 1] =
    -0.125 <= x <= +0.125
    1.625 <= x+1.75 <= 1.875
    Peak relative error 9.2e-37 */
-static const _Float128 lgam1r75a = L(-8.441162109375E-2);
-static const _Float128 lgam1r75b = L(1.0500073264444042213965868602268256157604E-5);
+static const long double lgam1r75a = -8.441162109375E-2L;
+static const long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L;
 #define NRN1r75 8
-static const _Float128 RN1r75[NRN1r75 + 1] =
-{
-  L(-5.221061693929833937710891646275798251513E7),
-  L(-2.052466337474314812817883030472496436993E8),
-  L(-2.952718275974940270675670705084125640069E8),
-  L(-2.132294039648116684922965964126389017840E8),
-  L(-8.554103077186505960591321962207519908489E7),
-  L(-1.940250901348870867323943119132071960050E7),
-  L(-2.379394147112756860769336400290402208435E6),
-  L(-1.384060879999526222029386539622255797389E5),
-  L(-2.698453601378319296159355612094598695530E3)
+static const long double RN1r75[NRN1r75 + 1] =
+{
+  -5.221061693929833937710891646275798251513E7L,
+  -2.052466337474314812817883030472496436993E8L,
+  -2.952718275974940270675670705084125640069E8L,
+  -2.132294039648116684922965964126389017840E8L,
+  -8.554103077186505960591321962207519908489E7L,
+  -1.940250901348870867323943119132071960050E7L,
+  -2.379394147112756860769336400290402208435E6L,
+  -1.384060879999526222029386539622255797389E5L,
+  -2.698453601378319296159355612094598695530E3L
 };
 #define NRD1r75 8
-static const _Float128 RD1r75[NRD1r75 + 1] =
-{
-  L(-2.109754689501705828789976311354395393605E8),
-  L(-5.036651829232895725959911504899241062286E8),
-  L(-4.954234699418689764943486770327295098084E8),
-  L(-2.589558042412676610775157783898195339410E8),
-  L(-7.731476117252958268044969614034776883031E7),
-  L(-1.316721702252481296030801191240867486965E7),
-  L(-1.201296501404876774861190604303728810836E6),
-  L(-5.007966406976106636109459072523610273928E4),
-  L(-6.155817990560743422008969155276229018209E2)
+static const long double RD1r75[NRD1r75 + 1] =
+{
+  -2.109754689501705828789976311354395393605E8L,
+  -5.036651829232895725959911504899241062286E8L,
+  -4.954234699418689764943486770327295098084E8L,
+  -2.589558042412676610775157783898195339410E8L,
+  -7.731476117252958268044969614034776883031E7L,
+  -1.316721702252481296030801191240867486965E7L,
+  -1.201296501404876774861190604303728810836E6L,
+  -5.007966406976106636109459072523610273928E4L,
+  -6.155817990560743422008969155276229018209E2L
   /* 1.0E0L */
 };
 
@@ -540,35 +538,35 @@ static const _Float128 RD1r75[NRD1r75 + 1] =
    -0.0867 <= x <= +0.1634
    1.374932... <= x+x0 <= 1.625032...
    Peak relative error 4.0e-36  */
-static const _Float128 x0a = L(1.4616241455078125);
-static const _Float128 x0b = L(7.9994605498412626595423257213002588621246E-6);
-static const _Float128 y0a = L(-1.21490478515625E-1);
-static const _Float128 y0b = L(4.1879797753919044854428223084178486438269E-6);
+static const long double x0a = 1.4616241455078125L;
+static const long double x0b = 7.9994605498412626595423257213002588621246E-6L;
+static const long double y0a = -1.21490478515625E-1L;
+static const long double y0b = 4.1879797753919044854428223084178486438269E-6L;
 #define NRN1r5 8
-static const _Float128 RN1r5[NRN1r5 + 1] =
-{
-  L(6.827103657233705798067415468881313128066E5),
-  L(1.910041815932269464714909706705242148108E6),
-  L(2.194344176925978377083808566251427771951E6),
-  L(1.332921400100891472195055269688876427962E6),
-  L(4.589080973377307211815655093824787123508E5),
-  L(8.900334161263456942727083580232613796141E4),
-  L(9.053840838306019753209127312097612455236E3),
-  L(4.053367147553353374151852319743594873771E2),
-  L(5.040631576303952022968949605613514584950E0)
+static const long double RN1r5[NRN1r5 + 1] =
+{
+  6.827103657233705798067415468881313128066E5L,
+  1.910041815932269464714909706705242148108E6L,
+  2.194344176925978377083808566251427771951E6L,
+  1.332921400100891472195055269688876427962E6L,
+  4.589080973377307211815655093824787123508E5L,
+  8.900334161263456942727083580232613796141E4L,
+  9.053840838306019753209127312097612455236E3L,
+  4.053367147553353374151852319743594873771E2L,
+  5.040631576303952022968949605613514584950E0L
 };
 #define NRD1r5 8
-static const _Float128 RD1r5[NRD1r5 + 1] =
-{
-  L(1.411036368843183477558773688484699813355E6),
-  L(4.378121767236251950226362443134306184849E6),
-  L(5.682322855631723455425929877581697918168E6),
-  L(3.999065731556977782435009349967042222375E6),
-  L(1.653651390456781293163585493620758410333E6),
-  L(4.067774359067489605179546964969435858311E5),
-  L(5.741463295366557346748361781768833633256E4),
-  L(4.226404539738182992856094681115746692030E3),
-  L(1.316980975410327975566999780608618774469E2),
+static const long double RD1r5[NRD1r5 + 1] =
+{
+  1.411036368843183477558773688484699813355E6L,
+  4.378121767236251950226362443134306184849E6L,
+  5.682322855631723455425929877581697918168E6L,
+  3.999065731556977782435009349967042222375E6L,
+  1.653651390456781293163585493620758410333E6L,
+  4.067774359067489605179546964969435858311E5L,
+  5.741463295366557346748361781768833633256E4L,
+  4.226404539738182992856094681115746692030E3L,
+  1.316980975410327975566999780608618774469E2L,
   /* 1.0E0L */
 };
 
@@ -577,34 +575,34 @@ static const _Float128 RD1r5[NRD1r5 + 1] =
    -.125 <= x <= +.125
    1.125 <= x+1.25 <= 1.375
    Peak relative error = 4.9e-36 */
-static const _Float128 lgam1r25a = L(-9.82818603515625E-2);
-static const _Float128 lgam1r25b = L(1.0023929749338536146197303364159774377296E-5);
+static const long double lgam1r25a = -9.82818603515625E-2L;
+static const long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L;
 #define NRN1r25 9
-static const _Float128 RN1r25[NRN1r25 + 1] =
-{
-  L(-9.054787275312026472896002240379580536760E4),
-  L(-8.685076892989927640126560802094680794471E4),
-  L(2.797898965448019916967849727279076547109E5),
-  L(6.175520827134342734546868356396008898299E5),
-  L(5.179626599589134831538516906517372619641E5),
-  L(2.253076616239043944538380039205558242161E5),
-  L(5.312653119599957228630544772499197307195E4),
-  L(6.434329437514083776052669599834938898255E3),
-  L(3.385414416983114598582554037612347549220E2),
-  L(4.907821957946273805080625052510832015792E0)
+static const long double RN1r25[NRN1r25 + 1] =
+{
+  -9.054787275312026472896002240379580536760E4L,
+  -8.685076892989927640126560802094680794471E4L,
+  2.797898965448019916967849727279076547109E5L,
+  6.175520827134342734546868356396008898299E5L,
+  5.179626599589134831538516906517372619641E5L,
+  2.253076616239043944538380039205558242161E5L,
+  5.312653119599957228630544772499197307195E4L,
+  6.434329437514083776052669599834938898255E3L,
+  3.385414416983114598582554037612347549220E2L,
+  4.907821957946273805080625052510832015792E0L
 };
 #define NRD1r25 8
-static const _Float128 RD1r25[NRD1r25 + 1] =
-{
-  L(3.980939377333448005389084785896660309000E5),
-  L(1.429634893085231519692365775184490465542E6),
-  L(2.145438946455476062850151428438668234336E6),
-  L(1.743786661358280837020848127465970357893E6),
-  L(8.316364251289743923178092656080441655273E5),
-  L(2.355732939106812496699621491135458324294E5),
-  L(3.822267399625696880571810137601310855419E4),
-  L(3.228463206479133236028576845538387620856E3),
-  L(1.152133170470059555646301189220117965514E2)
+static const long double RD1r25[NRD1r25 + 1] =
+{
+  3.980939377333448005389084785896660309000E5L,
+  1.429634893085231519692365775184490465542E6L,
+  2.145438946455476062850151428438668234336E6L,
+  1.743786661358280837020848127465970357893E6L,
+  8.316364251289743923178092656080441655273E5L,
+  2.355732939106812496699621491135458324294E5L,
+  3.822267399625696880571810137601310855419E4L,
+  3.228463206479133236028576845538387620856E3L,
+  1.152133170470059555646301189220117965514E2L
   /* 1.0E0L */
 };
 
@@ -614,29 +612,29 @@ static const _Float128 RD1r25[NRD1r25 + 1] =
    1.0 <= x+1 <= 1.125
    Peak relative error 1.1e-35  */
 #define NRN1 8
-static const _Float128 RN1[NRN1 + 1] =
-{
-  L(-9.987560186094800756471055681088744738818E3),
-  L(-2.506039379419574361949680225279376329742E4),
-  L(-1.386770737662176516403363873617457652991E4),
-  L(1.439445846078103202928677244188837130744E4),
-  L(2.159612048879650471489449668295139990693E4),
-  L(1.047439813638144485276023138173676047079E4),
-  L(2.250316398054332592560412486630769139961E3),
-  L(1.958510425467720733041971651126443864041E2),
-  L(4.516830313569454663374271993200291219855E0)
+static const long double RN1[NRN1 + 1] =
+{
+  -9.987560186094800756471055681088744738818E3L,
+  -2.506039379419574361949680225279376329742E4L,
+  -1.386770737662176516403363873617457652991E4L,
+  1.439445846078103202928677244188837130744E4L,
+  2.159612048879650471489449668295139990693E4L,
+  1.047439813638144485276023138173676047079E4L,
+  2.250316398054332592560412486630769139961E3L,
+  1.958510425467720733041971651126443864041E2L,
+  4.516830313569454663374271993200291219855E0L
 };
 #define NRD1 7
-static const _Float128 RD1[NRD1 + 1] =
-{
-  L(1.730299573175751778863269333703788214547E4),
-  L(6.807080914851328611903744668028014678148E4),
-  L(1.090071629101496938655806063184092302439E5),
-  L(9.124354356415154289343303999616003884080E4),
-  L(4.262071638655772404431164427024003253954E4),
-  L(1.096981664067373953673982635805821283581E4),
-  L(1.431229503796575892151252708527595787588E3),
-  L(7.734110684303689320830401788262295992921E1)
+static const long double RD1[NRD1 + 1] =
+{
+  1.730299573175751778863269333703788214547E4L,
+  6.807080914851328611903744668028014678148E4L,
+  1.090071629101496938655806063184092302439E5L,
+  9.124354356415154289343303999616003884080E4L,
+  4.262071638655772404431164427024003253954E4L,
+  1.096981664067373953673982635805821283581E4L,
+  1.431229503796575892151252708527595787588E3L,
+  7.734110684303689320830401788262295992921E1L
  /* 1.0E0 */
 };
 
@@ -646,40 +644,40 @@ static const _Float128 RD1[NRD1 + 1] =
    0.875 <= x+1 <= 1.0
    Peak relative error 7.0e-37  */
 #define NRNr9 8
-static const _Float128 RNr9[NRNr9 + 1] =
-{
-  L(4.441379198241760069548832023257571176884E5),
-  L(1.273072988367176540909122090089580368732E6),
-  L(9.732422305818501557502584486510048387724E5),
-  L(-5.040539994443998275271644292272870348684E5),
-  L(-1.208719055525609446357448132109723786736E6),
-  L(-7.434275365370936547146540554419058907156E5),
-  L(-2.075642969983377738209203358199008185741E5),
-  L(-2.565534860781128618589288075109372218042E4),
-  L(-1.032901669542994124131223797515913955938E3),
+static const long double RNr9[NRNr9 + 1] =
+{
+  4.441379198241760069548832023257571176884E5L,
+  1.273072988367176540909122090089580368732E6L,
+  9.732422305818501557502584486510048387724E5L,
+  -5.040539994443998275271644292272870348684E5L,
+  -1.208719055525609446357448132109723786736E6L,
+  -7.434275365370936547146540554419058907156E5L,
+  -2.075642969983377738209203358199008185741E5L,
+  -2.565534860781128618589288075109372218042E4L,
+  -1.032901669542994124131223797515913955938E3L,
 };
 #define NRDr9 8
-static const _Float128 RDr9[NRDr9 + 1] =
-{
-  L(-7.694488331323118759486182246005193998007E5),
-  L(-3.301918855321234414232308938454112213751E6),
-  L(-5.856830900232338906742924836032279404702E6),
-  L(-5.540672519616151584486240871424021377540E6),
-  L(-3.006530901041386626148342989181721176919E6),
-  L(-9.350378280513062139466966374330795935163E5),
-  L(-1.566179100031063346901755685375732739511E5),
-  L(-1.205016539620260779274902967231510804992E4),
-  L(-2.724583156305709733221564484006088794284E2)
+static const long double RDr9[NRDr9 + 1] =
+{
+  -7.694488331323118759486182246005193998007E5L,
+  -3.301918855321234414232308938454112213751E6L,
+  -5.856830900232338906742924836032279404702E6L,
+  -5.540672519616151584486240871424021377540E6L,
+  -3.006530901041386626148342989181721176919E6L,
+  -9.350378280513062139466966374330795935163E5L,
+  -1.566179100031063346901755685375732739511E5L,
+  -1.205016539620260779274902967231510804992E4L,
+  -2.724583156305709733221564484006088794284E2L
 /* 1.0E0 */
 };
 
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static _Float128
-neval (_Float128 x, const _Float128 *p, int n)
+static long double
+neval (long double x, const long double *p, int n)
 {
-  _Float128 y;
+  long double y;
 
   p += n;
   y = *p--;
@@ -694,10 +692,10 @@ neval (_Float128 x, const _Float128 *p, int n)
 
 /* Evaluate x^n+1  +  P[n] x^(n)  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
-static _Float128
-deval (_Float128 x, const _Float128 *p, int n)
+static long double
+deval (long double x, const long double *p, int n)
 {
-  _Float128 y;
+  long double y;
 
   p += n;
   y = x + *p--;
@@ -710,10 +708,10 @@ deval (_Float128 x, const _Float128 *p, int n)
 }
 
 
-_Float128
-__ieee754_lgammal_r (_Float128 x, int *signgamp)
+long double
+__ieee754_lgammal_r (long double x, int *signgamp)
 {
-  _Float128 p, q, w, z, nx;
+  long double p, q, w, z, nx;
   int i, nn;
 
   *signgamp = 1;
@@ -735,15 +733,15 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
       p = __floorl (q);
       if (p == q)
 	return (one / __fabsl (p - p));
-      _Float128 halfp = p * L(0.5);
+      long double halfp = p * 0.5L;
       if (halfp == __floorl (halfp))
 	*signgamp = -1;
       else
 	*signgamp = 1;
-      if (q < L(0x1p-120))
+      if (q < 0x1p-120L)
 	return -__logl (q);
       z = q - p;
-      if (z > L(0.5))
+      if (z > 0.5L)
 	{
 	  p += 1;
 	  z = p - q;
@@ -754,16 +752,16 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
       return (z);
     }
 
-  if (x < L(13.5))
+  if (x < 13.5L)
     {
       p = 0;
-      nx = __floorl (x + L(0.5));
+      nx = __floorl (x + 0.5L);
       nn = nx;
       switch (nn)
 	{
 	case 0:
 	  /* log gamma (x + 1) = log(x) + log gamma(x) */
-	  if (x < L(0x1p-120))
+	  if (x < 0x1p-120L)
 	    return -__logl (x);
 	  else if (x <= 0.125)
 	    {
@@ -771,7 +769,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 	    }
 	  else if (x <= 0.375)
 	    {
-	      z = x - L(0.25);
+	      z = x - 0.25L;
 	      p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
 	      p += lgam1r25b;
 	      p += lgam1r25a;
@@ -787,7 +785,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 	    }
 	  else if (x <= 0.875)
 	    {
-	      z = x - L(0.75);
+	      z = x - 0.75L;
 	      p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
 	      p += lgam1r75b;
 	      p += lgam1r75a;
@@ -801,7 +799,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 	  break;
 
 	case 1:
-	  if (x < L(0.875))
+	  if (x < 0.875L)
 	    {
 	      if (x <= 0.625)
 		{
@@ -814,7 +812,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 		}
 	      else if (x <= 0.875)
 		{
-		  z = x - L(0.75);
+		  z = x - 0.75L;
 		  p = z * neval (z, RN1r75, NRN1r75)
 			/ deval (z, RD1r75, NRD1r75);
 		  p += lgam1r75b;
@@ -834,14 +832,14 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 	    }
 	  else if (x == 1)
 	    p = 0;
-	  else if (x <= L(1.125))
+	  else if (x <= 1.125L)
 	    {
 	      z = x - 1;
 	      p = z * neval (z, RN1, NRN1) / deval (z, RD1, NRD1);
 	    }
 	  else if (x <= 1.375)
 	    {
-	      z = x - L(1.25);
+	      z = x - 1.25L;
 	      p = z * neval (z, RN1r25, NRN1r25) / deval (z, RD1r25, NRD1r25);
 	      p += lgam1r25b;
 	      p += lgam1r25a;
@@ -859,7 +857,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 	  break;
 
 	case 2:
-	  if (x < L(1.625))
+	  if (x < 1.625L)
 	    {
 	      z = x - x0a;
 	      z = z - x0b;
@@ -868,23 +866,23 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 	      p = p + y0b;
 	      p = p + y0a;
 	    }
-	  else if (x < L(1.875))
+	  else if (x < 1.875L)
 	    {
-	      z = x - L(1.75);
+	      z = x - 1.75L;
 	      p = z * neval (z, RN1r75, NRN1r75) / deval (z, RD1r75, NRD1r75);
 	      p += lgam1r75b;
 	      p += lgam1r75a;
 	    }
 	  else if (x == 2)
 	    p = 0;
-	  else if (x < L(2.375))
+	  else if (x < 2.375L)
 	    {
 	      z = x - 2;
 	      p = z * neval (z, RN2, NRN2) / deval (z, RD2, NRD2);
 	    }
 	  else
 	    {
-	      z = x - L(2.5);
+	      z = x - 2.5L;
 	      p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
 	      p += lgam2r5b;
 	      p += lgam2r5a;
@@ -894,7 +892,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
 	case 3:
 	  if (x < 2.75)
 	    {
-	      z = x - L(2.5);
+	      z = x - 2.5L;
 	      p = z * neval (z, RN2r5, NRN2r5) / deval (z, RD2r5, NRD2r5);
 	      p += lgam2r5b;
 	      p += lgam2r5a;
@@ -984,11 +982,11 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp)
   if (x > MAXLGM)
     return (*signgamp * huge * huge);
 
-  if (x > L(0x1p120))
+  if (x > 0x1p120L)
     return x * (__logl (x) - 1);
   q = ls2pi - x;
-  q = (x - L(0.5)) * __logl (x) + q;
-  if (x > L(1.0e18))
+  q = (x - 0.5L) * __logl (x) + q;
+  if (x > 1.0e18L)
     return (q);
 
   p = 1 / (x * x);
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
index 615707ca98..317d238057 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_cbrtl.c
@@ -19,24 +19,22 @@
 
 /* This file was copied from sysdeps/ieee754/ldbl-128/e_j0l.c.  */
 
-#define _Float128 long double
-#define L(x) x ## L
 
 #include <math_ldbl_opt.h>
 #include <math.h>
 #include <math_private.h>
 
-static const _Float128 CBRT2 = L(1.259921049894873164767210607278228350570251);
-static const _Float128 CBRT4 = L(1.587401051968199474751705639272308260391493);
-static const _Float128 CBRT2I = L(0.7937005259840997373758528196361541301957467);
-static const _Float128 CBRT4I = L(0.6299605249474365823836053036391141752851257);
+static const long double CBRT2 = 1.259921049894873164767210607278228350570251L;
+static const long double CBRT4 = 1.587401051968199474751705639272308260391493L;
+static const long double CBRT2I = 0.7937005259840997373758528196361541301957467L;
+static const long double CBRT4I = 0.6299605249474365823836053036391141752851257L;
 
 
-_Float128
-__cbrtl (_Float128 x)
+long double
+__cbrtl (long double x)
 {
   int e, rem, sign;
-  _Float128 z;
+  long double z;
 
   if (!isfinite (x))
     return x + x;
@@ -58,11 +56,11 @@ __cbrtl (_Float128 x)
 
   /* Approximate cube root of number between .5 and 1,
      peak relative error = 1.2e-6  */
-  x = ((((L(1.3584464340920900529734e-1) * x
-	  - L(6.3986917220457538402318e-1)) * x
-	 + L(1.2875551670318751538055e0)) * x
-	- L(1.4897083391357284957891e0)) * x
-       + L(1.3304961236013647092521e0)) * x + L(3.7568280825958912391243e-1);
+  x = ((((1.3584464340920900529734e-1L * x
+	  - 6.3986917220457538402318e-1L) * x
+	 + 1.2875551670318751538055e0L) * x
+	- 1.4897083391357284957891e0L) * x
+       + 1.3304961236013647092521e0L) * x + 3.7568280825958912391243e-1L;
 
   /* exponent divided by 3 */
   if (e >= 0)
@@ -92,9 +90,9 @@ __cbrtl (_Float128 x)
   x = __ldexpl (x, e);
 
   /* Newton iteration */
-  x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
-  x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
-  x -= (x - (z / (x * x))) * L(0.3333333333333333333333333333333333333333);
+  x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+  x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
+  x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L;
 
   if (sign < 0)
     x = -x;
diff --git a/sysdeps/ieee754/ldbl-128ibm/t_expl.h b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
index 0ab0877301..e2fe4dd2ef 100644
--- a/sysdeps/ieee754/ldbl-128ibm/t_expl.h
+++ b/sysdeps/ieee754/ldbl-128ibm/t_expl.h
@@ -28,945 +28,943 @@
    __expl_table[T_EXPL_ARGN+2*i] == i/S+s
    where absl(s) <= 2^-54 and absl(r) <= 2^-212.  */
 
-#define _Float128 long double
-#define L(x) x ## L
 
-static const _Float128 __expl_table [] = {
- L(-3.47656250000000000584188889839535373E-01), /* bffd640000000000002b1b04213cf000 */
-  L(6.90417668990715641167244540876988960E-32), /* 3f97667c3fdb588a6ae1af8748357a17 */
- L(-3.43749999999999981853132895957607418E-01), /* bffd5ffffffffffffac4ff5f4050b000 */
- L(-7.16021898043268093462818380603370350E-33), /* bf94296c8219427edc1431ac2498583e */
- L(-3.39843750000000013418643523138766329E-01), /* bffd5c000000000003de1f027a30e000 */
-  L(8.16920774283317801641347327589583265E-32), /* 3f97a82b65774bdca1b4440d749ed8d3 */
- L(-3.35937500000000014998092453039303051E-01), /* bffd5800000000000452a9f4d8857000 */
- L(-6.55865578425428447938248396879359670E-32), /* bf97548b7d240f3d034b395e6eecfac8 */
- L(-3.32031250000000000981984049529998541E-01), /* bffd540000000000004875277cda5000 */
-  L(6.91213046334032232108944519541512737E-32), /* 3f9766e5f925338a19045c94443b66e1 */
- L(-3.28124999999999986646017645350399708E-01), /* bffd4ffffffffffffc26a667bf44d000 */
- L(-6.16281060996110316602421505683742661E-32), /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
- L(-3.24218749999999991645717430645867963E-01), /* bffd4bfffffffffffd97901063e48000 */
- L(-7.90797211087760527593856542417304137E-32), /* bf979a9afaaca1ada6a8ed1c80584d60 */
- L(-3.20312499999999998918211610690789652E-01), /* bffd47ffffffffffffb02d9856d71000 */
-  L(8.64024799457616856987630373786503376E-32), /* 3f97c0a098623f95579d5d9b2b67342d */
- L(-3.16406249999999998153974811017181883E-01), /* bffd43ffffffffffff77c991f1076000 */
- L(-2.73176610180696076418536105483668404E-32), /* bf961baeccb32f9b1fcbb8e60468e95a */
- L(-3.12500000000000011420976192575972779E-01), /* bffd400000000000034ab8240483d000 */
-  L(7.16573502812389453744433792609989420E-32), /* 3f977410f4c2cfc4335f28446c0fb363 */
- L(-3.08593750000000001735496343854851414E-01), /* bffd3c000000000000800e995c176000 */
- L(-1.56292999645122272621237565671593071E-32), /* bf95449b9cbdaff6ac1246adb2c826ac */
- L(-3.04687499999999982592401295899221626E-01), /* bffd37fffffffffffafb8bc1e061a000 */
-  L(6.48993208584888904958594509625158417E-32), /* 3f9750f9fe8366d82d77afa0031a92e1 */
- L(-3.00781249999999999230616898937763959E-01), /* bffd33ffffffffffffc73ac39da54000 */
-  L(6.57082437496961397305801409357792029E-32), /* 3f97552d3cb598ea80135cf3feb27ec4 */
- L(-2.96874999999999998788769281703245722E-01), /* bffd2fffffffffffffa6a07fa5021000 */
- L(-3.26588297198283968096426564544269170E-32), /* bf9653260fc1802f46b629aee171809b */
- L(-2.92968750000000015318089182805941695E-01), /* bffd2c0000000000046a468614bd6000 */
- L(-1.73291974845198589684358727559290718E-32), /* bf9567e9d158f52e483c8d8dcb5961dd */
- L(-2.89062500000000007736778942676309681E-01), /* bffd280000000000023adf9f4c3d3000 */
- L(-6.83629745986675744404029225571026236E-32), /* bf9762f5face6281c1daf1c6aedbdb45 */
- L(-2.85156250000000001367091555763661937E-01), /* bffd2400000000000064dfa11e3fb000 */
- L(-5.44898442619766878281110054067026237E-32), /* bf971aed6d2db9f542986a785edae072 */
- L(-2.81249999999999986958718100227029406E-01), /* bffd1ffffffffffffc3db9265ca9d000 */
-  L(1.13007318374506125723591889451107046E-32), /* 3f94d569fe387f456a97902907ac3856 */
- L(-2.77343750000000000356078829380495179E-01), /* bffd1c0000000000001a462390083000 */
- L(-4.98979365468978332358409063436543102E-32), /* bf970315bbf3e0d14b5c94c900702d4c */
- L(-2.73437499999999990276993957508540484E-01), /* bffd17fffffffffffd32919bcdc94000 */
- L(-8.79390484115892344533724650295100871E-32), /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
- L(-2.69531250000000002434203866460082225E-01), /* bffd14000000000000b39ccf9e130000 */
-  L(9.44060754687026590886751809927191596E-32), /* 3f97ea2f32cfecca5c64a26137a9210f */
- L(-2.65624999999999997296320716986257179E-01), /* bffd0fffffffffffff3880f13a2bc000 */
-  L(2.07142664067265697791007875348396921E-32), /* 3f95ae37ee685b9122fbe377bd205ee4 */
- L(-2.61718750000000010237478733739017956E-01), /* bffd0c000000000002f3648179d40000 */
- L(-6.10552936159265665298996309192680256E-32), /* bf973d0467d31e407515a3cca0f3b4e2 */
- L(-2.57812500000000011948220522778370303E-01), /* bffd08000000000003719f81275bd000 */
-  L(6.72477169058908902499239631466443836E-32), /* 3f975d2b8c475d3160cf72d227d8e6f9 */
- L(-2.53906249999999991822993360536596860E-01), /* bffd03fffffffffffda4a4b62f818000 */
- L(-2.44868296623215865054704392917190994E-32), /* bf95fc92516c6d057d29fc2528855976 */
- L(-2.49999999999999986862019457428548084E-01), /* bffcfffffffffffff86d2d20d5ff4000 */
- L(-3.85302898949105073614122724961613078E-32), /* bf96901f147cb7d643af71b6129ce929 */
- L(-2.46093750000000000237554160737318435E-01), /* bffcf8000000000000230e8ade26b000 */
- L(-1.52823675242678363494345369284988589E-32), /* bf953d6700c5f3fc303f79d0ec8c680a */
- L(-2.42187500000000003023380963205457065E-01), /* bffcf0000000000001be2c1a78bb0000 */
- L(-7.78402037952209709489481182714311699E-34), /* bf9102ab1f3998e887f0ee4cf940faa5 */
- L(-2.38281249999999995309623303145485725E-01), /* bffce7fffffffffffd4bd2940f43f000 */
- L(-3.54307216794236899443913216397197696E-32), /* bf966fef03ab69c3f289436205b21d02 */
- L(-2.34374999999999998425804947623207526E-01), /* bffcdfffffffffffff17b097a6092000 */
- L(-2.86038428948386602859761879407549696E-32), /* bf96290a0eba0131efe3a05fe188f2e3 */
- L(-2.30468749999999993822207406785200832E-01), /* bffcd7fffffffffffc70519834eae000 */
- L(-2.54339521031747516806893838749365762E-32), /* bf96081f0ad7f9107ae6cddb32c178ab */
- L(-2.26562499999999997823524030344489884E-01), /* bffccffffffffffffebecf10093df000 */
-  L(4.31904611473158635644635628922959401E-32), /* 3f96c083f0b1faa7c4c686193e38d67c */
- L(-2.22656250000000004835132405125162742E-01), /* bffcc8000000000002c98a233f19f000 */
-  L(2.54709791629335691650310168420597566E-33), /* 3f92a735903f5eed07a716ab931e20d9 */
- L(-2.18749999999999988969454021829236626E-01), /* bffcbffffffffffff9a42dc14ce36000 */
- L(-3.77236096429336082213752014054909454E-32), /* bf9687be8e5b2fca54d3e81157eac660 */
- L(-2.14843750000000010613256919115758495E-01), /* bffcb80000000000061e3d828ecac000 */
- L(-4.55194148712216691177097854305964738E-32), /* bf96d8b35c776aa3e1a4768271380503 */
- L(-2.10937499999999993204656148110447201E-01), /* bffcaffffffffffffc152f2aea118000 */
- L(-2.95044199165561453749332254271716417E-32), /* bf96326433b00b2439094d9bef22ddd1 */
- L(-2.07031250000000012233944895423355677E-01), /* bffca80000000000070d695ee0e94000 */
-  L(1.93146788688385419095981415411012357E-32), /* 3f959126729135a5e390d4bb802a0bde */
- L(-2.03125000000000008030983633336321863E-01), /* bffca0000000000004a129fbc51af000 */
-  L(2.37361904671826193563212931215900137E-32), /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
- L(-1.99218750000000001763815712796132779E-01), /* bffc98000000000001044b12d9950000 */
- L(-3.63171243370923753295192486732883239E-33), /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
- L(-1.95312500000000004883660234506677272E-01), /* bffc90000000000002d0b3779d1f9000 */
- L(-3.19989507343607877747980892249711601E-33), /* bf9309d63de96bb3ef744c865f22f1bd */
- L(-1.91406250000000013720152363227519348E-01), /* bffc88000000000007e8bcb387121000 */
- L(-1.89295754093147174148371614722178860E-32), /* bf958926e2e67dfe812c508290add2e7 */
- L(-1.87500000000000000182342082774432620E-01), /* bffc800000000000001ae8b06a39f000 */
- L(-2.96812835183184815200854214892983927E-32), /* bf96343a62d156bbe71f55d14ca4b6e5 */
- L(-1.83593750000000012410147185883290345E-01), /* bffc78000000000007276a1adda8d000 */
- L(-2.02191931237489669058466239995304587E-32), /* bf95a3efab92d26ec2df90df036a117f */
- L(-1.79687499999999997439177363346082917E-01), /* bffc6ffffffffffffe8616db2927d000 */
- L(-9.92752326937775530007399526834009465E-33), /* bf949c5f88ed17041e1a3f1829d543cd */
- L(-1.75781249999999995824373974504785174E-01), /* bffc67fffffffffffd97c94f13ea3000 */
-  L(1.44184772065335613487885714828816178E-32), /* 3f952b75c63476e7fcc2f5841c27bcce */
- L(-1.71874999999999986685050259043077809E-01), /* bffc5ffffffffffff8530f6bc531a000 */
- L(-3.49007014971241147689894940544402482E-32), /* bf966a6dfaa012aea8ffe6d90b02330f */
- L(-1.67968749999999997316058782350439701E-01), /* bffc57fffffffffffe73eb914f2aa000 */
-  L(3.34025733574205019081305778794376391E-32), /* 3f965adf4572561fd5456a6c13d8babf */
- L(-1.64062499999999993322730602128318480E-01), /* bffc4ffffffffffffc269be4f68f3000 */
- L(-1.83345916769684984022099095506340635E-32), /* bf957ccb69026cb2f6024c211576d5f4 */
- L(-1.60156249999999992419000744447607979E-01), /* bffc47fffffffffffba13df21784a000 */
-  L(2.73442789798110494773517431626534726E-32), /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
- L(-1.56249999999999987665010524130393080E-01), /* bffc3ffffffffffff8e3ad45e7508000 */
-  L(2.02695576464836145806428118889332191E-32), /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
- L(-1.52343749999999989905291167951491803E-01), /* bffc37fffffffffffa2e48aecfc24000 */
- L(-3.61436631548815190395331054871041524E-32), /* bf967756567ebd108075ae527cc2e7f0 */
- L(-1.48437500000000006686107754967759751E-01), /* bffc30000000000003dab20261b3c000 */
- L(-2.15524270159131591469319477922198390E-32), /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
- L(-1.44531250000000005132889939177166485E-01), /* bffc28000000000002f57b1969e7b000 */
-  L(2.74741116529653547935086189244019604E-32), /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
- L(-1.40625000000000000707469094533647325E-01), /* bffc2000000000000068676d3d5c4000 */
-  L(4.40607097220049957013547629906723266E-33), /* 3f936e0ac425daf795b42913cf0ef881 */
- L(-1.36718749999999995713752139187543306E-01), /* bffc17fffffffffffd87762255991000 */
- L(-3.73751317180116492404578048203389108E-32), /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
- L(-1.32812500000000007198453630478482191E-01), /* bffc10000000000004264de3a4379000 */
- L(-3.97050085179660203884930593717220728E-32), /* bf969c52048de14be3c9c1971e50869c */
- L(-1.28906250000000006070486371645733082E-01), /* bffc080000000000037fd87db2cb0000 */
-  L(3.59610068058504988294019521946586131E-32), /* 3f967570c10687cb8e9ebd0b280abf5a */
- L(-1.25000000000000003700729208608337966E-01), /* bffc00000000000002222198bbc74000 */
-  L(3.23464851393124362331846965931995969E-33), /* 3f930cb95da3bfc847e593716c91d57a */
- L(-1.21093750000000013729038501177102555E-01), /* bffbf000000000000fd418d1f5fda000 */
-  L(2.45242487730722066611358741283977619E-32), /* 3f95fd5945ad86a464292e26ac192a84 */
- L(-1.17187499999999999765305306880205578E-01), /* bffbdfffffffffffffbabaf869845000 */
- L(-1.14557520298960389903199646350205537E-32), /* bf94dbda735322179d9bcf392e1dd06d */
- L(-1.13281250000000009579647893740755690E-01), /* bffbd000000000000b0b69bae7ab9000 */
-  L(2.37873962873837390105423621772752350E-32), /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
- L(-1.09375000000000008981153004560108539E-01), /* bffbc000000000000a5ac4bc1d2c3000 */
-  L(1.53152444860014076105003555837231015E-32), /* 3f953e15ce931e12ef9a152522e32bdd */
- L(-1.05468749999999992399063850363228723E-01), /* bffbaffffffffffff73c998091408000 */
- L(-8.75920903597804862471749360196688834E-33), /* bf946bd7e310a01bae5687ebdc47fcc5 */
- L(-1.01562500000000007685885179918350550E-01), /* bffba0000000000008dc7910a648c000 */
- L(-4.63820993797174451904075397785059501E-33), /* bf938153d0e54001a472da180fb5e8aa */
- L(-9.76562499999999887262211517861331814E-02), /* bffb8ffffffffffff300915aa6fd6000 */
- L(-2.63767025974952608658936466715705903E-33), /* bf92b64215bb8d520be5404620d38088 */
- L(-9.37499999999999939650246024457439795E-02), /* bffb7ffffffffffff90aca26bd0fc000 */
- L(-1.72047822349322956713582039121348377E-32), /* bf9565545015c5b9b56d02cfefca2c7d */
- L(-8.98437500000000033088896383977486369E-02), /* bffb70000000000003d09ca1e3cbe000 */
-  L(3.04831994420989436248526129869697270E-33), /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
- L(-8.59374999999999947312400115121319225E-02), /* bffb5ffffffffffff9ecefc03376e000 */
-  L(1.50416954438393392150792422537312281E-32), /* 3f9538675ee99bd722fad0023c09c915 */
- L(-8.20312500000000054182280847004695514E-02), /* bffb500000000000063f2dbd40200000 */
-  L(2.68399664523430004488075638997207289E-33), /* 3f92bdf49766629882c49a3da88928ed */
- L(-7.81250000000000114767533968079748798E-02), /* bffb4000000000000d3b56f81ba70000 */
-  L(1.72318124201659121296305402819694281E-32), /* 3f9565e407aaabfb359e8a567d760de3 */
- L(-7.42187500000000035531829472486812869E-02), /* bffb3000000000000418b6e9b5388000 */
-  L(2.09401756478514117051383998628099655E-32), /* 3f95b2e91221fcd74be0a86d8ad658d2 */
- L(-7.03124999999999987474933134860732535E-02), /* bffb1ffffffffffffe8e53453d2ac000 */
-  L(2.28515798224350800271565551341211666E-32), /* 3f95da9bd6adf00894f05b5cc5530125 */
- L(-6.64062500000000042267533361089054159E-02), /* bffb10000000000004df8473dbcf2000 */
-  L(1.97576478800281368377376002585430031E-32), /* 3f959a59acbddb2f53bd3096b66370e9 */
- L(-6.25000000000000066329769382774201686E-02), /* bffb00000000000007a5b5914e336000 */
- L(-1.46422615813786836245343723048221678E-33), /* bf91e69295f069fc0c4a9db181ea25a3 */
- L(-5.85937500000000002823707957982406053E-02), /* bffae0000000000000a6aeab10592000 */
-  L(9.25637741701318872896718218457555829E-33), /* 3f94807eb021f1f40a37d4015b1eb76b */
- L(-5.46875000000000081586888005226044448E-02), /* bffac0000000000012d00a3171e3a000 */
- L(-4.87144542459404765480424673678105050E-33), /* bf9394b42faba6b7036fe7b36269daf3 */
- L(-5.07812499999999927720348253140567013E-02), /* bffa9fffffffffffef555cc8dd914000 */
- L(-3.01901021987395945826043649523451725E-33), /* bf92f59e7e3025691f290f8f67277faf */
- L(-4.68749999999999935349476738962633103E-02), /* bffa7ffffffffffff117b4ea2b876000 */
-  L(1.21521638219189777347767475937119750E-32), /* 3f94f8c7f88c5b56674b94d984ac8ecb */
- L(-4.29687500000000056305562847814228219E-02), /* bffa6000000000000cfbb19be30c0000 */
- L(-1.18643699217679276275559592978275214E-32), /* bf94ecd39f0833a876550e83eb012b99 */
- L(-3.90624999999999962692914526031373542E-02), /* bffa3ffffffffffff765c743922f9000 */
- L(-4.91277156857520035712509544689973679E-33), /* bf939823189996193872e58ac0dececb */
- L(-3.51562500000000108152468207687602886E-02), /* bffa20000000000018f031e41177f000 */
-  L(1.18599806302656253755207072755609820E-32), /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
- L(-3.12500000000000077376981036742289578E-02), /* bffa00000000000011d787e0b386f000 */
-  L(9.97730386477005171963635210799577079E-33), /* 3f949e70e498c46a0173ac0d46c699fc */
- L(-2.73437500000000139436129596418623235E-02), /* bff9c00000000000404db66e70a08000 */
-  L(2.25755321633070123579875157841633859E-33), /* 3f927719b1a93074bdf9f3c2cb784785 */
- L(-2.34375000000000088003629211828324876E-02), /* bff98000000000002895a27d45feb000 */
-  L(2.84374279216848803102126617873942975E-33), /* 3f92d87f70e749d6da6c260b68dc210b */
- L(-1.95312500000000107408831063404855424E-02), /* bff9400000000000318898ba69f71000 */
-  L(2.47348089686935458989103979140011912E-33), /* 3f929afa3de45086fe909fdddb41edce */
- L(-1.56250000000000081443917555362290635E-02), /* bff9000000000000258f335e9cdd6000 */
- L(-2.43379314483517422161458863218426254E-33), /* bf9294621c8a9ccacf2b020ec19cad27 */
- L(-1.17187500000000051490597418161403184E-02), /* bff88000000000002f7ddfa26221f000 */
-  L(1.83405297208145390679150568810924707E-33), /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
- L(-7.81249999999999715861805208310174953E-03), /* bff7ffffffffffffcb95f3fff157d000 */
-  L(3.51548384878710915171654413641872451E-34), /* 3f8fd349b76c22966f77a39fc37ed704 */
- L(-3.90625000000000309326013918295097128E-03), /* bff7000000000000390f820c8e153000 */
-  L(6.38058004651791109324060099097251911E-36), /* 3f8a0f665d3ac25a1ac94d688273dbcd */
+static const long double __expl_table [] = {
+ -3.47656250000000000584188889839535373E-01L, /* bffd640000000000002b1b04213cf000 */
+  6.90417668990715641167244540876988960E-32L, /* 3f97667c3fdb588a6ae1af8748357a17 */
+ -3.43749999999999981853132895957607418E-01L, /* bffd5ffffffffffffac4ff5f4050b000 */
+ -7.16021898043268093462818380603370350E-33L, /* bf94296c8219427edc1431ac2498583e */
+ -3.39843750000000013418643523138766329E-01L, /* bffd5c000000000003de1f027a30e000 */
+  8.16920774283317801641347327589583265E-32L, /* 3f97a82b65774bdca1b4440d749ed8d3 */
+ -3.35937500000000014998092453039303051E-01L, /* bffd5800000000000452a9f4d8857000 */
+ -6.55865578425428447938248396879359670E-32L, /* bf97548b7d240f3d034b395e6eecfac8 */
+ -3.32031250000000000981984049529998541E-01L, /* bffd540000000000004875277cda5000 */
+  6.91213046334032232108944519541512737E-32L, /* 3f9766e5f925338a19045c94443b66e1 */
+ -3.28124999999999986646017645350399708E-01L, /* bffd4ffffffffffffc26a667bf44d000 */
+ -6.16281060996110316602421505683742661E-32L, /* bf973ffdcdcffb6fbffc86b2b8d42f5d */
+ -3.24218749999999991645717430645867963E-01L, /* bffd4bfffffffffffd97901063e48000 */
+ -7.90797211087760527593856542417304137E-32L, /* bf979a9afaaca1ada6a8ed1c80584d60 */
+ -3.20312499999999998918211610690789652E-01L, /* bffd47ffffffffffffb02d9856d71000 */
+  8.64024799457616856987630373786503376E-32L, /* 3f97c0a098623f95579d5d9b2b67342d */
+ -3.16406249999999998153974811017181883E-01L, /* bffd43ffffffffffff77c991f1076000 */
+ -2.73176610180696076418536105483668404E-32L, /* bf961baeccb32f9b1fcbb8e60468e95a */
+ -3.12500000000000011420976192575972779E-01L, /* bffd400000000000034ab8240483d000 */
+  7.16573502812389453744433792609989420E-32L, /* 3f977410f4c2cfc4335f28446c0fb363 */
+ -3.08593750000000001735496343854851414E-01L, /* bffd3c000000000000800e995c176000 */
+ -1.56292999645122272621237565671593071E-32L, /* bf95449b9cbdaff6ac1246adb2c826ac */
+ -3.04687499999999982592401295899221626E-01L, /* bffd37fffffffffffafb8bc1e061a000 */
+  6.48993208584888904958594509625158417E-32L, /* 3f9750f9fe8366d82d77afa0031a92e1 */
+ -3.00781249999999999230616898937763959E-01L, /* bffd33ffffffffffffc73ac39da54000 */
+  6.57082437496961397305801409357792029E-32L, /* 3f97552d3cb598ea80135cf3feb27ec4 */
+ -2.96874999999999998788769281703245722E-01L, /* bffd2fffffffffffffa6a07fa5021000 */
+ -3.26588297198283968096426564544269170E-32L, /* bf9653260fc1802f46b629aee171809b */
+ -2.92968750000000015318089182805941695E-01L, /* bffd2c0000000000046a468614bd6000 */
+ -1.73291974845198589684358727559290718E-32L, /* bf9567e9d158f52e483c8d8dcb5961dd */
+ -2.89062500000000007736778942676309681E-01L, /* bffd280000000000023adf9f4c3d3000 */
+ -6.83629745986675744404029225571026236E-32L, /* bf9762f5face6281c1daf1c6aedbdb45 */
+ -2.85156250000000001367091555763661937E-01L, /* bffd2400000000000064dfa11e3fb000 */
+ -5.44898442619766878281110054067026237E-32L, /* bf971aed6d2db9f542986a785edae072 */
+ -2.81249999999999986958718100227029406E-01L, /* bffd1ffffffffffffc3db9265ca9d000 */
+  1.13007318374506125723591889451107046E-32L, /* 3f94d569fe387f456a97902907ac3856 */
+ -2.77343750000000000356078829380495179E-01L, /* bffd1c0000000000001a462390083000 */
+ -4.98979365468978332358409063436543102E-32L, /* bf970315bbf3e0d14b5c94c900702d4c */
+ -2.73437499999999990276993957508540484E-01L, /* bffd17fffffffffffd32919bcdc94000 */
+ -8.79390484115892344533724650295100871E-32L, /* bf97c89b0b89cc19c3ab2b60da9bbbc3 */
+ -2.69531250000000002434203866460082225E-01L, /* bffd14000000000000b39ccf9e130000 */
+  9.44060754687026590886751809927191596E-32L, /* 3f97ea2f32cfecca5c64a26137a9210f */
+ -2.65624999999999997296320716986257179E-01L, /* bffd0fffffffffffff3880f13a2bc000 */
+  2.07142664067265697791007875348396921E-32L, /* 3f95ae37ee685b9122fbe377bd205ee4 */
+ -2.61718750000000010237478733739017956E-01L, /* bffd0c000000000002f3648179d40000 */
+ -6.10552936159265665298996309192680256E-32L, /* bf973d0467d31e407515a3cca0f3b4e2 */
+ -2.57812500000000011948220522778370303E-01L, /* bffd08000000000003719f81275bd000 */
+  6.72477169058908902499239631466443836E-32L, /* 3f975d2b8c475d3160cf72d227d8e6f9 */
+ -2.53906249999999991822993360536596860E-01L, /* bffd03fffffffffffda4a4b62f818000 */
+ -2.44868296623215865054704392917190994E-32L, /* bf95fc92516c6d057d29fc2528855976 */
+ -2.49999999999999986862019457428548084E-01L, /* bffcfffffffffffff86d2d20d5ff4000 */
+ -3.85302898949105073614122724961613078E-32L, /* bf96901f147cb7d643af71b6129ce929 */
+ -2.46093750000000000237554160737318435E-01L, /* bffcf8000000000000230e8ade26b000 */
+ -1.52823675242678363494345369284988589E-32L, /* bf953d6700c5f3fc303f79d0ec8c680a */
+ -2.42187500000000003023380963205457065E-01L, /* bffcf0000000000001be2c1a78bb0000 */
+ -7.78402037952209709489481182714311699E-34L, /* bf9102ab1f3998e887f0ee4cf940faa5 */
+ -2.38281249999999995309623303145485725E-01L, /* bffce7fffffffffffd4bd2940f43f000 */
+ -3.54307216794236899443913216397197696E-32L, /* bf966fef03ab69c3f289436205b21d02 */
+ -2.34374999999999998425804947623207526E-01L, /* bffcdfffffffffffff17b097a6092000 */
+ -2.86038428948386602859761879407549696E-32L, /* bf96290a0eba0131efe3a05fe188f2e3 */
+ -2.30468749999999993822207406785200832E-01L, /* bffcd7fffffffffffc70519834eae000 */
+ -2.54339521031747516806893838749365762E-32L, /* bf96081f0ad7f9107ae6cddb32c178ab */
+ -2.26562499999999997823524030344489884E-01L, /* bffccffffffffffffebecf10093df000 */
+  4.31904611473158635644635628922959401E-32L, /* 3f96c083f0b1faa7c4c686193e38d67c */
+ -2.22656250000000004835132405125162742E-01L, /* bffcc8000000000002c98a233f19f000 */
+  2.54709791629335691650310168420597566E-33L, /* 3f92a735903f5eed07a716ab931e20d9 */
+ -2.18749999999999988969454021829236626E-01L, /* bffcbffffffffffff9a42dc14ce36000 */
+ -3.77236096429336082213752014054909454E-32L, /* bf9687be8e5b2fca54d3e81157eac660 */
+ -2.14843750000000010613256919115758495E-01L, /* bffcb80000000000061e3d828ecac000 */
+ -4.55194148712216691177097854305964738E-32L, /* bf96d8b35c776aa3e1a4768271380503 */
+ -2.10937499999999993204656148110447201E-01L, /* bffcaffffffffffffc152f2aea118000 */
+ -2.95044199165561453749332254271716417E-32L, /* bf96326433b00b2439094d9bef22ddd1 */
+ -2.07031250000000012233944895423355677E-01L, /* bffca80000000000070d695ee0e94000 */
+  1.93146788688385419095981415411012357E-32L, /* 3f959126729135a5e390d4bb802a0bde */
+ -2.03125000000000008030983633336321863E-01L, /* bffca0000000000004a129fbc51af000 */
+  2.37361904671826193563212931215900137E-32L, /* 3f95ecfb3c4ba1b97ea3ad45cbb1e68a */
+ -1.99218750000000001763815712796132779E-01L, /* bffc98000000000001044b12d9950000 */
+ -3.63171243370923753295192486732883239E-33L, /* bf932db5fb3f27c38e0fa7bbcfc64f55 */
+ -1.95312500000000004883660234506677272E-01L, /* bffc90000000000002d0b3779d1f9000 */
+ -3.19989507343607877747980892249711601E-33L, /* bf9309d63de96bb3ef744c865f22f1bd */
+ -1.91406250000000013720152363227519348E-01L, /* bffc88000000000007e8bcb387121000 */
+ -1.89295754093147174148371614722178860E-32L, /* bf958926e2e67dfe812c508290add2e7 */
+ -1.87500000000000000182342082774432620E-01L, /* bffc800000000000001ae8b06a39f000 */
+ -2.96812835183184815200854214892983927E-32L, /* bf96343a62d156bbe71f55d14ca4b6e5 */
+ -1.83593750000000012410147185883290345E-01L, /* bffc78000000000007276a1adda8d000 */
+ -2.02191931237489669058466239995304587E-32L, /* bf95a3efab92d26ec2df90df036a117f */
+ -1.79687499999999997439177363346082917E-01L, /* bffc6ffffffffffffe8616db2927d000 */
+ -9.92752326937775530007399526834009465E-33L, /* bf949c5f88ed17041e1a3f1829d543cd */
+ -1.75781249999999995824373974504785174E-01L, /* bffc67fffffffffffd97c94f13ea3000 */
+  1.44184772065335613487885714828816178E-32L, /* 3f952b75c63476e7fcc2f5841c27bcce */
+ -1.71874999999999986685050259043077809E-01L, /* bffc5ffffffffffff8530f6bc531a000 */
+ -3.49007014971241147689894940544402482E-32L, /* bf966a6dfaa012aea8ffe6d90b02330f */
+ -1.67968749999999997316058782350439701E-01L, /* bffc57fffffffffffe73eb914f2aa000 */
+  3.34025733574205019081305778794376391E-32L, /* 3f965adf4572561fd5456a6c13d8babf */
+ -1.64062499999999993322730602128318480E-01L, /* bffc4ffffffffffffc269be4f68f3000 */
+ -1.83345916769684984022099095506340635E-32L, /* bf957ccb69026cb2f6024c211576d5f4 */
+ -1.60156249999999992419000744447607979E-01L, /* bffc47fffffffffffba13df21784a000 */
+  2.73442789798110494773517431626534726E-32L, /* 3f961bf58ff22c9b30f1e2b39f26d7d5 */
+ -1.56249999999999987665010524130393080E-01L, /* bffc3ffffffffffff8e3ad45e7508000 */
+  2.02695576464836145806428118889332191E-32L, /* 3f95a4fb7435a4a2f71de81eb8ae75d1 */
+ -1.52343749999999989905291167951491803E-01L, /* bffc37fffffffffffa2e48aecfc24000 */
+ -3.61436631548815190395331054871041524E-32L, /* bf967756567ebd108075ae527cc2e7f0 */
+ -1.48437500000000006686107754967759751E-01L, /* bffc30000000000003dab20261b3c000 */
+ -2.15524270159131591469319477922198390E-32L, /* bf95bfa05b82ef3a708c4f0395e9fcf6 */
+ -1.44531250000000005132889939177166485E-01L, /* bffc28000000000002f57b1969e7b000 */
+  2.74741116529653547935086189244019604E-32L, /* 3f961d4eb77c1185d34fe1b04a3f3cf5 */
+ -1.40625000000000000707469094533647325E-01L, /* bffc2000000000000068676d3d5c4000 */
+  4.40607097220049957013547629906723266E-33L, /* 3f936e0ac425daf795b42913cf0ef881 */
+ -1.36718749999999995713752139187543306E-01L, /* bffc17fffffffffffd87762255991000 */
+ -3.73751317180116492404578048203389108E-32L, /* bf9684202491e9cbb7ceb67d9ff7e0c9 */
+ -1.32812500000000007198453630478482191E-01L, /* bffc10000000000004264de3a4379000 */
+ -3.97050085179660203884930593717220728E-32L, /* bf969c52048de14be3c9c1971e50869c */
+ -1.28906250000000006070486371645733082E-01L, /* bffc080000000000037fd87db2cb0000 */
+  3.59610068058504988294019521946586131E-32L, /* 3f967570c10687cb8e9ebd0b280abf5a */
+ -1.25000000000000003700729208608337966E-01L, /* bffc00000000000002222198bbc74000 */
+  3.23464851393124362331846965931995969E-33L, /* 3f930cb95da3bfc847e593716c91d57a */
+ -1.21093750000000013729038501177102555E-01L, /* bffbf000000000000fd418d1f5fda000 */
+  2.45242487730722066611358741283977619E-32L, /* 3f95fd5945ad86a464292e26ac192a84 */
+ -1.17187499999999999765305306880205578E-01L, /* bffbdfffffffffffffbabaf869845000 */
+ -1.14557520298960389903199646350205537E-32L, /* bf94dbda735322179d9bcf392e1dd06d */
+ -1.13281250000000009579647893740755690E-01L, /* bffbd000000000000b0b69bae7ab9000 */
+  2.37873962873837390105423621772752350E-32L, /* 3f95ee0b7e0bd5ac1f6fab1e2a71abc3 */
+ -1.09375000000000008981153004560108539E-01L, /* bffbc000000000000a5ac4bc1d2c3000 */
+  1.53152444860014076105003555837231015E-32L, /* 3f953e15ce931e12ef9a152522e32bdd */
+ -1.05468749999999992399063850363228723E-01L, /* bffbaffffffffffff73c998091408000 */
+ -8.75920903597804862471749360196688834E-33L, /* bf946bd7e310a01bae5687ebdc47fcc5 */
+ -1.01562500000000007685885179918350550E-01L, /* bffba0000000000008dc7910a648c000 */
+ -4.63820993797174451904075397785059501E-33L, /* bf938153d0e54001a472da180fb5e8aa */
+ -9.76562499999999887262211517861331814E-02L, /* bffb8ffffffffffff300915aa6fd6000 */
+ -2.63767025974952608658936466715705903E-33L, /* bf92b64215bb8d520be5404620d38088 */
+ -9.37499999999999939650246024457439795E-02L, /* bffb7ffffffffffff90aca26bd0fc000 */
+ -1.72047822349322956713582039121348377E-32L, /* bf9565545015c5b9b56d02cfefca2c7d */
+ -8.98437500000000033088896383977486369E-02L, /* bffb70000000000003d09ca1e3cbe000 */
+  3.04831994420989436248526129869697270E-33L, /* 3f92fa7d30d2ed90e7ebbd6231fd08b1 */
+ -8.59374999999999947312400115121319225E-02L, /* bffb5ffffffffffff9ecefc03376e000 */
+  1.50416954438393392150792422537312281E-32L, /* 3f9538675ee99bd722fad0023c09c915 */
+ -8.20312500000000054182280847004695514E-02L, /* bffb500000000000063f2dbd40200000 */
+  2.68399664523430004488075638997207289E-33L, /* 3f92bdf49766629882c49a3da88928ed */
+ -7.81250000000000114767533968079748798E-02L, /* bffb4000000000000d3b56f81ba70000 */
+  1.72318124201659121296305402819694281E-32L, /* 3f9565e407aaabfb359e8a567d760de3 */
+ -7.42187500000000035531829472486812869E-02L, /* bffb3000000000000418b6e9b5388000 */
+  2.09401756478514117051383998628099655E-32L, /* 3f95b2e91221fcd74be0a86d8ad658d2 */
+ -7.03124999999999987474933134860732535E-02L, /* bffb1ffffffffffffe8e53453d2ac000 */
+  2.28515798224350800271565551341211666E-32L, /* 3f95da9bd6adf00894f05b5cc5530125 */
+ -6.64062500000000042267533361089054159E-02L, /* bffb10000000000004df8473dbcf2000 */
+  1.97576478800281368377376002585430031E-32L, /* 3f959a59acbddb2f53bd3096b66370e9 */
+ -6.25000000000000066329769382774201686E-02L, /* bffb00000000000007a5b5914e336000 */
+ -1.46422615813786836245343723048221678E-33L, /* bf91e69295f069fc0c4a9db181ea25a3 */
+ -5.85937500000000002823707957982406053E-02L, /* bffae0000000000000a6aeab10592000 */
+  9.25637741701318872896718218457555829E-33L, /* 3f94807eb021f1f40a37d4015b1eb76b */
+ -5.46875000000000081586888005226044448E-02L, /* bffac0000000000012d00a3171e3a000 */
+ -4.87144542459404765480424673678105050E-33L, /* bf9394b42faba6b7036fe7b36269daf3 */
+ -5.07812499999999927720348253140567013E-02L, /* bffa9fffffffffffef555cc8dd914000 */
+ -3.01901021987395945826043649523451725E-33L, /* bf92f59e7e3025691f290f8f67277faf */
+ -4.68749999999999935349476738962633103E-02L, /* bffa7ffffffffffff117b4ea2b876000 */
+  1.21521638219189777347767475937119750E-32L, /* 3f94f8c7f88c5b56674b94d984ac8ecb */
+ -4.29687500000000056305562847814228219E-02L, /* bffa6000000000000cfbb19be30c0000 */
+ -1.18643699217679276275559592978275214E-32L, /* bf94ecd39f0833a876550e83eb012b99 */
+ -3.90624999999999962692914526031373542E-02L, /* bffa3ffffffffffff765c743922f9000 */
+ -4.91277156857520035712509544689973679E-33L, /* bf939823189996193872e58ac0dececb */
+ -3.51562500000000108152468207687602886E-02L, /* bffa20000000000018f031e41177f000 */
+  1.18599806302656253755207072755609820E-32L, /* 3f94eca4f23e787fab73ce8f6b9b8d64 */
+ -3.12500000000000077376981036742289578E-02L, /* bffa00000000000011d787e0b386f000 */
+  9.97730386477005171963635210799577079E-33L, /* 3f949e70e498c46a0173ac0d46c699fc */
+ -2.73437500000000139436129596418623235E-02L, /* bff9c00000000000404db66e70a08000 */
+  2.25755321633070123579875157841633859E-33L, /* 3f927719b1a93074bdf9f3c2cb784785 */
+ -2.34375000000000088003629211828324876E-02L, /* bff98000000000002895a27d45feb000 */
+  2.84374279216848803102126617873942975E-33L, /* 3f92d87f70e749d6da6c260b68dc210b */
+ -1.95312500000000107408831063404855424E-02L, /* bff9400000000000318898ba69f71000 */
+  2.47348089686935458989103979140011912E-33L, /* 3f929afa3de45086fe909fdddb41edce */
+ -1.56250000000000081443917555362290635E-02L, /* bff9000000000000258f335e9cdd6000 */
+ -2.43379314483517422161458863218426254E-33L, /* bf9294621c8a9ccacf2b020ec19cad27 */
+ -1.17187500000000051490597418161403184E-02L, /* bff88000000000002f7ddfa26221f000 */
+  1.83405297208145390679150568810924707E-33L, /* 3f9230bbfc5d5fe1b534fbcda0465bb9 */
+ -7.81249999999999715861805208310174953E-03L, /* bff7ffffffffffffcb95f3fff157d000 */
+  3.51548384878710915171654413641872451E-34L, /* 3f8fd349b76c22966f77a39fc37ed704 */
+ -3.90625000000000309326013918295097128E-03L, /* bff7000000000000390f820c8e153000 */
+  6.38058004651791109324060099097251911E-36L, /* 3f8a0f665d3ac25a1ac94d688273dbcd */
 #define T_EXPL_ARG1 (2*89)
-  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
-  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
-  L(3.90625000000000245479958859972588985E-03), /* 3ff70000000000002d48769ac9874000 */
- L(-6.58439598384342854976169982902779828E-36), /* bf8a1811b923e6c626b07ef29761482a */
-  L(7.81250000000001311374391093664996358E-03), /* 3ff800000000000078f3f3cd89111000 */
-  L(2.60265650555493781464273319671555602E-33), /* 3f92b070c3b635b87af426735a71fc87 */
-  L(1.17187500000000269581156218247101912E-02), /* 3ff8800000000000f8a50d02fe20d000 */
-  L(1.00961747974945520631836275894919326E-33), /* 3f914f80c1a4f8042044fe3b757b030b */
-  L(1.56249999999999797878275270751825475E-02), /* 3ff8ffffffffffff45935b69da62e000 */
-  L(2.03174577741375590087897353146748580E-33), /* 3f925194e863496e0f6e91cbf6b22e26 */
-  L(1.95312499999999760319884511789111533E-02), /* 3ff93fffffffffff917790ff9a8f4000 */
-  L(4.62788519658803722282100289809515007E-33), /* 3f9380783ba81295feeb3e4879d7d52d */
-  L(2.34374999999999822953909016349145918E-02), /* 3ff97fffffffffffae5a163bd3cd5000 */
- L(-3.19499956304699705390404384504876533E-33), /* bf93096e2037ced8194cf344c692f8d6 */
-  L(2.73437500000000137220327275871555682E-02), /* 3ff9c000000000003f481dea5dd51000 */
- L(-2.25757776523031994464630107442723424E-33), /* bf92771abcf988a02b414bf2614e3734 */
-  L(3.12499999999999790857640618332718621E-02), /* 3ff9ffffffffffff9f8cd40b51509000 */
- L(-4.22479470489989916319395454536511458E-33), /* bf935efb7245612f371deca17cb7b30c */
-  L(3.51562499999999840753382405747597346E-02), /* 3ffa1fffffffffffdb47bd275f722000 */
-  L(1.08459658374118041980976756063083500E-34), /* 3f8e2055d18b7117c9db1c318b1e889b */
-  L(3.90624999999999989384433621470426757E-02), /* 3ffa3ffffffffffffd8d5e18b042e000 */
- L(-7.41674226146122000759491297811091830E-33), /* bf94341454e48029e5b0205d91baffdc */
-  L(4.29687500000000107505739500500200462E-02), /* 3ffa60000000000018ca04cd9085c000 */
- L(-4.74689012756713017494437969420919847E-34), /* bf903b7c268103c6f7fbaaa24142e287 */
-  L(4.68749999999999978700749928325717352E-02), /* 3ffa7ffffffffffffb16b6d5479e3000 */
- L(-1.06208165308448830117773486334902917E-32), /* bf94b92be4b3b5b5a596a0a5187cc955 */
-  L(5.07812499999999815072625435955786253E-02), /* 3ffa9fffffffffffd55bd086d5cbc000 */
- L(-9.37038897148383660401929567549111394E-33), /* bf94853b111b0175b491c80d00419416 */
-  L(5.46874999999999809511553152189867394E-02), /* 3ffabfffffffffffd4138bfa74a61000 */
-  L(1.06642963074562437340498606682822123E-32), /* 3f94bafa3fe991b39255d563dfa05d89 */
-  L(5.85937500000000184331996330905145551E-02), /* 3ffae000000000002a810a5f2f8bf000 */
- L(-1.76639977694797200820296641773791945E-34), /* bf8ed596f07ce4408f1705c8ec16864c */
-  L(6.25000000000000021544696744852045001E-02), /* 3ffb000000000000027be32045e2b000 */
-  L(1.68616371995798354366633034788947149E-32), /* 3f955e33d7440794d8a1b25233d086ab */
-  L(6.64062499999999965563110718495802889E-02), /* 3ffb0ffffffffffffc079a38a3fed000 */
- L(-1.82463217667830160048872113565316215E-32), /* bf957af6163bcdb97cefab44a942482a */
-  L(7.03124999999999759989183341261898222E-02), /* 3ffb1fffffffffffe454218acea05000 */
- L(-1.07843770101525495515646940862541503E-32), /* bf94bff72aada26d94e76e71c07e0580 */
-  L(7.42187499999999898968873730710101412E-02), /* 3ffb2ffffffffffff45a166496dc1000 */
-  L(1.28629441689592874462780757154138223E-32), /* 3f950b2724597b8b93ce1e9d1cf4d035 */
-  L(7.81249999999999957198938523510804668E-02), /* 3ffb3ffffffffffffb10bc52adbc5000 */
-  L(1.13297573459968118467100063135856856E-33), /* 3f91787eea895b3c245899cf34ad0abd */
-  L(8.20312500000000199911640621145851159E-02), /* 3ffb500000000000170c59a661a89000 */
- L(-1.51161335208135146756554123073528707E-32), /* bf9539f326c5ca84e7db5401566f3775 */
-  L(8.59375000000000134175373433347670743E-02), /* 3ffb6000000000000f78287547af0000 */
-  L(1.09763629458404270323909815379924900E-32), /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
-  L(8.98437500000000036533922600308306335E-02), /* 3ffb70000000000004364a83b7a14000 */
-  L(3.11459653680110433194288029777718358E-33), /* 3f9302c0248136d65cebeab69488d949 */
-  L(9.37500000000000184977946245216914691E-02), /* 3ffb800000000000155395d870b17000 */
- L(-4.66656154468277949130395786965043927E-33), /* bf9383aec9b993b6db492b1ede786d8a */
-  L(9.76562500000000237839723100419376084E-02), /* 3ffb9000000000001b6bca237f6c4000 */
- L(-1.03028043424658760249140747856831301E-32), /* bf94abf6352e3d2bb398e47919a343fb */
-  L(1.01562500000000012345545575236836572E-01), /* 3ffba000000000000e3bc30cd9a1f000 */
-  L(2.15755372310795701322789783729456319E-32), /* 3f95c01b3b819edd9d07548fafd61550 */
-  L(1.05468749999999976493840484471911438E-01), /* 3ffbafffffffffffe4e634cd77985000 */
-  L(1.78771847038773333029677216592309083E-32), /* 3f95734b6ae650f33dd43c49a1df9fc0 */
-  L(1.09375000000000002267015055992785402E-01), /* 3ffbc00000000000029d1ad08de7b000 */
-  L(6.23263106693943817730045115112427717E-33), /* 3f9402e4b39ce2198a45e1d045868cd6 */
-  L(1.13281250000000022354208618429577398E-01), /* 3ffbd0000000000019c5cc3f9d2b5000 */
-  L(5.40514416644786448581426756221178868E-33), /* 3f93c10ab4021472c662f69435de9269 */
-  L(1.17187500000000013252367133076817603E-01), /* 3ffbe000000000000f47688cc561b000 */
- L(-7.12412585457324989451327215568641325E-33), /* bf9427ecb343a8d1758990565fcfbf45 */
-  L(1.21093750000000020759863992944300792E-01), /* 3ffbf0000000000017ef3af97bf04000 */
-  L(6.26591408357572503875647872077266444E-33), /* 3f940446a09a2da771b45fc075514d12 */
-  L(1.25000000000000004739659392396765618E-01), /* 3ffc00000000000002bb7344ecd89000 */
- L(-1.55611398459729463981000080101758830E-32), /* bf95433135febefa9e6aa4db39e263d2 */
-  L(1.28906249999999982360888081057894783E-01), /* 3ffc07fffffffffff5d4ed3154361000 */
- L(-1.77531518652835570781208599686606474E-32), /* bf9570b7f225ea076f97f418d11359c1 */
-  L(1.32812500000000010568583998727400436E-01), /* 3ffc1000000000000617a5d09526a000 */
-  L(2.12104021624990594668286391598300893E-32), /* 3f95b885d767a1048d93055927a27adc */
-  L(1.36718749999999998434125157367005292E-01), /* 3ffc17ffffffffffff18eaebc7970000 */
-  L(2.50454798592543203967309921276955297E-32), /* 3f9604164e5598528a76faff26cd1c97 */
-  L(1.40625000000000015550032422969330356E-01), /* 3ffc20000000000008f6c79d8928c000 */
-  L(7.80972982879849783680252962992639832E-33), /* 3f9444674acf2b3225c7647e0d95edf3 */
-  L(1.44531250000000012402535562111122522E-01), /* 3ffc28000000000007264a8bc1ff1000 */
-  L(2.79662468716455159585514763921671876E-32), /* 3f96226b095bd78aa650faf95a221993 */
-  L(1.48437500000000007761020440087419948E-01), /* 3ffc3000000000000479530ff8fe3000 */
-  L(2.15518492972728435680556239996258527E-32), /* 3f95bf9d49295e73a957906a029768cb */
-  L(1.52343750000000001733189947520484032E-01), /* 3ffc38000000000000ffc6109f71f000 */
-  L(8.34032236093545825619420380704500188E-33), /* 3f945a71851226a1d0ce5e656693153e */
-  L(1.56249999999999988073295321246958484E-01), /* 3ffc3ffffffffffff91fedd62ae0f000 */
-  L(2.44119337150624789345260194989620908E-32), /* 3f95fb041a57bc1c1280680ac1620bea */
-  L(1.60156250000000002076894210913572460E-01), /* 3ffc48000000000001327ed84a199000 */
- L(-7.36124501128859978061216696286151753E-33), /* bf9431c62f01e59d2c1e00f195a0037f */
-  L(1.64062500000000000950861276373482172E-01), /* 3ffc500000000000008c5285fba85000 */
- L(-4.80566184447001164583855800470217373E-33), /* bf938f3d1fcafd390f22f80e6c19421f */
-  L(1.67968749999999989878071706155265999E-01), /* 3ffc57fffffffffffa2a445c548c5000 */
- L(-4.42154428718618459799673088733365064E-32), /* bf96cb28cf1c1b28006d53ffe633b22a */
-  L(1.71874999999999999459734108403218175E-01), /* 3ffc5fffffffffffffb04554e9dd4000 */
- L(-3.29736288190321377985697972236270628E-32), /* bf96566af0ebc852e84be12859b24a31 */
-  L(1.75781249999999997987525759778901845E-01), /* 3ffc67fffffffffffed702df6ffff000 */
- L(-1.28800728638468399687523924685844352E-32), /* bf950b8236b88ca0c1b739dc91a7e3fc */
-  L(1.79687500000000004929565820437175783E-01), /* 3ffc70000000000002d779bb32d2e000 */
-  L(1.60624461317978482424582320675174225E-32), /* 3f954d9a9cc0c963fd081f3dc922d04e */
-  L(1.83593750000000016873727045739708856E-01), /* 3ffc78000000000009ba1f6263c9a000 */
- L(-3.83390389582056606880506003118452558E-32), /* bf968e22a5d826f77f19ee788474df22 */
-  L(1.87500000000000013443068740761666872E-01), /* 3ffc80000000000007bfd8c72a1bf000 */
- L(-2.74141662712926256150154726565203091E-32), /* bf961caf5ac59c7f941f928e324c2cc1 */
-  L(1.91406249999999981494101786848611970E-01), /* 3ffc87fffffffffff55502eeae001000 */
-  L(3.68992437075565165346469517256118001E-32), /* 3f967f2f03f9096793372a27b92ad79d */
-  L(1.95312499999999989069921848800501648E-01), /* 3ffc8ffffffffffff9b3015280394000 */
-  L(3.69712249337856518452988332367785220E-32), /* 3f967fee5fdb5bd501ff93516999faa0 */
-  L(1.99218750000000021148042946919300804E-01), /* 3ffc9800000000000c30e67939095000 */
-  L(2.50142536781142175091322844848566649E-32), /* 3f9603c34ae58e10b300b07137ee618a */
-  L(2.03124999999999977732559198825437141E-01), /* 3ffc9ffffffffffff329e7df079e4000 */
- L(-2.41951877287895024779300892731537816E-32), /* bf95f683aefe6965f080df8f59dd34a1 */
-  L(2.07031249999999996744030653771913124E-01), /* 3ffca7fffffffffffe1f80f4b73ca000 */
- L(-1.94346475904454000031592792989765585E-32), /* bf9593a44f87870a3d100d498501ecc7 */
-  L(2.10937500000000000251399259834392298E-01), /* 3ffcb000000000000025199873310000 */
- L(-1.33528748788094249098998693871759411E-33), /* bf91bbb9b25c813668d6103d08acac35 */
-  L(2.14843749999999993936323609611875097E-01), /* 3ffcb7fffffffffffc8128c866236000 */
-  L(1.14839877977014974625242788556545292E-32), /* 3f94dd06b4655c9b83a1305b240e7a42 */
-  L(2.18750000000000015181732784749663837E-01), /* 3ffcc0000000000008c06da5fff24000 */
-  L(1.42689085313142539755499441881408391E-32), /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
-  L(2.22656249999999992172647770539596569E-01), /* 3ffcc7fffffffffffb7ce2fe531f6000 */
- L(-3.34421462850496887359128610229650547E-32), /* bf965b487962b5c2d9056ca6ac0c2e5c */
-  L(2.26562499999999989595607223847082419E-01), /* 3ffccffffffffffffa0095277be5c000 */
- L(-3.08983588107248752517344356508205569E-32), /* bf9640dded57157f8eded311213bdbcd */
-  L(2.30468749999999979130462438434567117E-01), /* 3ffcd7fffffffffff3f8332996560000 */
- L(-3.01407539802851697849105682795217019E-32), /* bf9638ffde35dbdfe1a1ffe45185de5d */
-  L(2.34375000000000012194252337217891971E-01), /* 3ffce0000000000007078dd402c86000 */
- L(-8.46879710915628592284714319904522657E-33), /* bf945fc7b29a2ac6c9eff9eb258a510f */
-  L(2.38281249999999982991877076137149870E-01), /* 3ffce7fffffffffff6320b486eece000 */
- L(-2.93563878880439245627127095245798544E-32), /* bf9630daaa4f40ff05caf29ace2ea7d4 */
-  L(2.42187499999999981447559841442773990E-01), /* 3ffceffffffffffff54e24a09a8d5000 */
- L(-4.56766746558806021264215486909850481E-32), /* bf96da556dee11f3113e5a3467b908e6 */
-  L(2.46093749999999991067720539980207318E-01), /* 3ffcf7fffffffffffad9d405dcb5d000 */
-  L(2.14033004219908074003010247652128251E-32), /* 3f95bc8776e8f9ae098884aa664cc3df */
-  L(2.50000000000000016613825838126835953E-01), /* 3ffd00000000000004c9e24c12bb3000 */
-  L(2.57617532593749185996714235009382870E-32), /* 3f960b867cc01178c0ec68226c6cb47d */
-  L(2.53906250000000013372004437827044321E-01), /* 3ffd04000000000003daae05b3168000 */
-  L(7.20177123439204414298152646284640101E-32), /* 3f9775eff59ddad7e7530b83934af87f */
-  L(2.57812499999999995765234725413886085E-01), /* 3ffd07fffffffffffec7878bad9d5000 */
-  L(6.51253187532920882777046064603770602E-32), /* 3f975226659ca241402e71c2011583b0 */
-  L(2.61718750000000007647689994011222248E-01), /* 3ffd0c000000000002344cc793a0f000 */
-  L(3.02370610028725823590045201871491395E-32), /* 3f9639ffe55fa2fa011674448b4e5b96 */
-  L(2.65624999999999986893899042596554269E-01), /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
- L(-2.07683715950724761146070082510569258E-32), /* bf95af579a92e872fef81abfdf06bae8 */
-  L(2.69531249999999979842788204900639327E-01), /* 3ffd13fffffffffffa30a908d67db000 */
-  L(8.71465252506557329027658736641075706E-32), /* 3f97c47d99e19830447a42b1c0ffac61 */
-  L(2.73437500000000006712165837793818271E-01), /* 3ffd18000000000001ef453a58edb000 */
- L(-6.62704045767568912140550474455810301E-32), /* bf9758187a204dcb06ece46588aeeaba */
-  L(2.77343749999999994411329302988535617E-01), /* 3ffd1bfffffffffffe63a0fec9c9e000 */
- L(-4.87273466291944117406493607771338767E-32), /* bf96fa0381b0844a0be46bac2d673f0c */
-  L(2.81250000000000012677892447379453135E-01), /* 3ffd20000000000003a7769e125d6000 */
- L(-8.55871796664700790726282049552906783E-32), /* bf97bc64e01332cf7616b0091b8dff2c */
-  L(2.85156249999999998558643013736363981E-01), /* 3ffd23ffffffffffff95a5894bccf000 */
- L(-1.33068334720606220176455289635046875E-32), /* bf95145f43290ecf5b7adcb24697bc73 */
-  L(2.89062500000000008831431235621753924E-01), /* 3ffd280000000000028ba504fac59000 */
- L(-9.34157398616814623985483776710704237E-32), /* bf97e50ad1115b941fcb5f0c88a428f7 */
-  L(2.92968750000000019840235286110877063E-01), /* 3ffd2c000000000005b7f372d184f000 */
-  L(4.99302093775173155906059132992249671E-33), /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
-  L(2.96875000000000015867911730971630513E-01), /* 3ffd3000000000000492d860c79db000 */
-  L(7.86107787827057767235127454590866211E-33), /* 3f944689517ee8f16cdb97d6a6938f32 */
-  L(3.00781250000000015814100002286124758E-01), /* 3ffd340000000000048edfe73a17d000 */
- L(-1.65419431293024229981937172317171504E-32), /* bf9557900e3efca16c89646b57f68dc0 */
-  L(3.04687499999999985213157159965287195E-01), /* 3ffd37fffffffffffbbcec6f99b36000 */
-  L(9.68753602893894024018934325652944198E-32), /* 3f97f70170e5458660c33a7e8d43d049 */
-  L(3.08593749999999989969324338045156215E-01), /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
-  L(7.10268609610294706092252562643261106E-32), /* 3f9770cae45cdf615010401a4b37d8d4 */
-  L(3.12500000000000002971606591018488854E-01), /* 3ffd40000000000000db440fbc06b000 */
-  L(6.38924218802905979887732294952782964E-32), /* 3f974bbf988bb5622bd8fbaa46e8b811 */
-  L(3.16406250000000006594921047402056305E-01), /* 3ffd44000000000001e69e8954814000 */
-  L(3.96079878754651470094149874444850097E-32), /* 3f969b5017b9fa7a1e86975258c73d3d */
-  L(3.20312500000000006713799366908329147E-01), /* 3ffd48000000000001ef64159c065000 */
- L(-1.86401314975634286055150437995880517E-32), /* bf958323f0434911794e5fb8bfe136ba */
-  L(3.24218749999999987061246567584951210E-01), /* 3ffd4bfffffffffffc4549db9b928000 */
- L(-3.18643523744758601387071062700407431E-32), /* bf964ae5fa7e26c2c3981bed12e14372 */
-  L(3.28124999999999991782776266707412953E-01), /* 3ffd4ffffffffffffda1ad0840ca8000 */
- L(-4.46964199751314296839915534813144652E-32), /* bf96d0277729ffd74727150df6d15547 */
-  L(3.32031250000000000393816557756032682E-01), /* 3ffd540000000000001d0efc04fad000 */
- L(-9.03246333902065439930373230002688649E-33), /* bf947731a008748cc6dee948839ef7ae */
-  L(3.35937499999999983810482995064392173E-01), /* 3ffd57fffffffffffb556cab8ae61000 */
-  L(5.27742727066129518825981597650621794E-32), /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
-  L(3.39843750000000004310441349760912471E-01), /* 3ffd5c0000000000013e0def5ddc4000 */
- L(-3.85927263474732591932884416445586106E-32), /* bf9690c51088ef3db9ca000829c450c2 */
-  L(3.43749999999999990248130003997484364E-01), /* 3ffd5ffffffffffffd3070624a0af000 */
-  L(9.62005170171527308106468341512327487E-34), /* 3f913fae595cea84432eb01430817fca */
-  L(3.47656250000000004085726414568625697E-01), /* 3ffd640000000000012d79309e291000 */
- L(-6.59664093705705297250259434519072507E-32), /* bf97568465eafb0e662e64a5dbfaf35f */
+  0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+  0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+  3.90625000000000245479958859972588985E-03L, /* 3ff70000000000002d48769ac9874000 */
+ -6.58439598384342854976169982902779828E-36L, /* bf8a1811b923e6c626b07ef29761482a */
+  7.81250000000001311374391093664996358E-03L, /* 3ff800000000000078f3f3cd89111000 */
+  2.60265650555493781464273319671555602E-33L, /* 3f92b070c3b635b87af426735a71fc87 */
+  1.17187500000000269581156218247101912E-02L, /* 3ff8800000000000f8a50d02fe20d000 */
+  1.00961747974945520631836275894919326E-33L, /* 3f914f80c1a4f8042044fe3b757b030b */
+  1.56249999999999797878275270751825475E-02L, /* 3ff8ffffffffffff45935b69da62e000 */
+  2.03174577741375590087897353146748580E-33L, /* 3f925194e863496e0f6e91cbf6b22e26 */
+  1.95312499999999760319884511789111533E-02L, /* 3ff93fffffffffff917790ff9a8f4000 */
+  4.62788519658803722282100289809515007E-33L, /* 3f9380783ba81295feeb3e4879d7d52d */
+  2.34374999999999822953909016349145918E-02L, /* 3ff97fffffffffffae5a163bd3cd5000 */
+ -3.19499956304699705390404384504876533E-33L, /* bf93096e2037ced8194cf344c692f8d6 */
+  2.73437500000000137220327275871555682E-02L, /* 3ff9c000000000003f481dea5dd51000 */
+ -2.25757776523031994464630107442723424E-33L, /* bf92771abcf988a02b414bf2614e3734 */
+  3.12499999999999790857640618332718621E-02L, /* 3ff9ffffffffffff9f8cd40b51509000 */
+ -4.22479470489989916319395454536511458E-33L, /* bf935efb7245612f371deca17cb7b30c */
+  3.51562499999999840753382405747597346E-02L, /* 3ffa1fffffffffffdb47bd275f722000 */
+  1.08459658374118041980976756063083500E-34L, /* 3f8e2055d18b7117c9db1c318b1e889b */
+  3.90624999999999989384433621470426757E-02L, /* 3ffa3ffffffffffffd8d5e18b042e000 */
+ -7.41674226146122000759491297811091830E-33L, /* bf94341454e48029e5b0205d91baffdc */
+  4.29687500000000107505739500500200462E-02L, /* 3ffa60000000000018ca04cd9085c000 */
+ -4.74689012756713017494437969420919847E-34L, /* bf903b7c268103c6f7fbaaa24142e287 */
+  4.68749999999999978700749928325717352E-02L, /* 3ffa7ffffffffffffb16b6d5479e3000 */
+ -1.06208165308448830117773486334902917E-32L, /* bf94b92be4b3b5b5a596a0a5187cc955 */
+  5.07812499999999815072625435955786253E-02L, /* 3ffa9fffffffffffd55bd086d5cbc000 */
+ -9.37038897148383660401929567549111394E-33L, /* bf94853b111b0175b491c80d00419416 */
+  5.46874999999999809511553152189867394E-02L, /* 3ffabfffffffffffd4138bfa74a61000 */
+  1.06642963074562437340498606682822123E-32L, /* 3f94bafa3fe991b39255d563dfa05d89 */
+  5.85937500000000184331996330905145551E-02L, /* 3ffae000000000002a810a5f2f8bf000 */
+ -1.76639977694797200820296641773791945E-34L, /* bf8ed596f07ce4408f1705c8ec16864c */
+  6.25000000000000021544696744852045001E-02L, /* 3ffb000000000000027be32045e2b000 */
+  1.68616371995798354366633034788947149E-32L, /* 3f955e33d7440794d8a1b25233d086ab */
+  6.64062499999999965563110718495802889E-02L, /* 3ffb0ffffffffffffc079a38a3fed000 */
+ -1.82463217667830160048872113565316215E-32L, /* bf957af6163bcdb97cefab44a942482a */
+  7.03124999999999759989183341261898222E-02L, /* 3ffb1fffffffffffe454218acea05000 */
+ -1.07843770101525495515646940862541503E-32L, /* bf94bff72aada26d94e76e71c07e0580 */
+  7.42187499999999898968873730710101412E-02L, /* 3ffb2ffffffffffff45a166496dc1000 */
+  1.28629441689592874462780757154138223E-32L, /* 3f950b2724597b8b93ce1e9d1cf4d035 */
+  7.81249999999999957198938523510804668E-02L, /* 3ffb3ffffffffffffb10bc52adbc5000 */
+  1.13297573459968118467100063135856856E-33L, /* 3f91787eea895b3c245899cf34ad0abd */
+  8.20312500000000199911640621145851159E-02L, /* 3ffb500000000000170c59a661a89000 */
+ -1.51161335208135146756554123073528707E-32L, /* bf9539f326c5ca84e7db5401566f3775 */
+  8.59375000000000134175373433347670743E-02L, /* 3ffb6000000000000f78287547af0000 */
+  1.09763629458404270323909815379924900E-32L, /* 3f94c7f0b61b6e3e27d44b9f5bbc7e9d */
+  8.98437500000000036533922600308306335E-02L, /* 3ffb70000000000004364a83b7a14000 */
+  3.11459653680110433194288029777718358E-33L, /* 3f9302c0248136d65cebeab69488d949 */
+  9.37500000000000184977946245216914691E-02L, /* 3ffb800000000000155395d870b17000 */
+ -4.66656154468277949130395786965043927E-33L, /* bf9383aec9b993b6db492b1ede786d8a */
+  9.76562500000000237839723100419376084E-02L, /* 3ffb9000000000001b6bca237f6c4000 */
+ -1.03028043424658760249140747856831301E-32L, /* bf94abf6352e3d2bb398e47919a343fb */
+  1.01562500000000012345545575236836572E-01L, /* 3ffba000000000000e3bc30cd9a1f000 */
+  2.15755372310795701322789783729456319E-32L, /* 3f95c01b3b819edd9d07548fafd61550 */
+  1.05468749999999976493840484471911438E-01L, /* 3ffbafffffffffffe4e634cd77985000 */
+  1.78771847038773333029677216592309083E-32L, /* 3f95734b6ae650f33dd43c49a1df9fc0 */
+  1.09375000000000002267015055992785402E-01L, /* 3ffbc00000000000029d1ad08de7b000 */
+  6.23263106693943817730045115112427717E-33L, /* 3f9402e4b39ce2198a45e1d045868cd6 */
+  1.13281250000000022354208618429577398E-01L, /* 3ffbd0000000000019c5cc3f9d2b5000 */
+  5.40514416644786448581426756221178868E-33L, /* 3f93c10ab4021472c662f69435de9269 */
+  1.17187500000000013252367133076817603E-01L, /* 3ffbe000000000000f47688cc561b000 */
+ -7.12412585457324989451327215568641325E-33L, /* bf9427ecb343a8d1758990565fcfbf45 */
+  1.21093750000000020759863992944300792E-01L, /* 3ffbf0000000000017ef3af97bf04000 */
+  6.26591408357572503875647872077266444E-33L, /* 3f940446a09a2da771b45fc075514d12 */
+  1.25000000000000004739659392396765618E-01L, /* 3ffc00000000000002bb7344ecd89000 */
+ -1.55611398459729463981000080101758830E-32L, /* bf95433135febefa9e6aa4db39e263d2 */
+  1.28906249999999982360888081057894783E-01L, /* 3ffc07fffffffffff5d4ed3154361000 */
+ -1.77531518652835570781208599686606474E-32L, /* bf9570b7f225ea076f97f418d11359c1 */
+  1.32812500000000010568583998727400436E-01L, /* 3ffc1000000000000617a5d09526a000 */
+  2.12104021624990594668286391598300893E-32L, /* 3f95b885d767a1048d93055927a27adc */
+  1.36718749999999998434125157367005292E-01L, /* 3ffc17ffffffffffff18eaebc7970000 */
+  2.50454798592543203967309921276955297E-32L, /* 3f9604164e5598528a76faff26cd1c97 */
+  1.40625000000000015550032422969330356E-01L, /* 3ffc20000000000008f6c79d8928c000 */
+  7.80972982879849783680252962992639832E-33L, /* 3f9444674acf2b3225c7647e0d95edf3 */
+  1.44531250000000012402535562111122522E-01L, /* 3ffc28000000000007264a8bc1ff1000 */
+  2.79662468716455159585514763921671876E-32L, /* 3f96226b095bd78aa650faf95a221993 */
+  1.48437500000000007761020440087419948E-01L, /* 3ffc3000000000000479530ff8fe3000 */
+  2.15518492972728435680556239996258527E-32L, /* 3f95bf9d49295e73a957906a029768cb */
+  1.52343750000000001733189947520484032E-01L, /* 3ffc38000000000000ffc6109f71f000 */
+  8.34032236093545825619420380704500188E-33L, /* 3f945a71851226a1d0ce5e656693153e */
+  1.56249999999999988073295321246958484E-01L, /* 3ffc3ffffffffffff91fedd62ae0f000 */
+  2.44119337150624789345260194989620908E-32L, /* 3f95fb041a57bc1c1280680ac1620bea */
+  1.60156250000000002076894210913572460E-01L, /* 3ffc48000000000001327ed84a199000 */
+ -7.36124501128859978061216696286151753E-33L, /* bf9431c62f01e59d2c1e00f195a0037f */
+  1.64062500000000000950861276373482172E-01L, /* 3ffc500000000000008c5285fba85000 */
+ -4.80566184447001164583855800470217373E-33L, /* bf938f3d1fcafd390f22f80e6c19421f */
+  1.67968749999999989878071706155265999E-01L, /* 3ffc57fffffffffffa2a445c548c5000 */
+ -4.42154428718618459799673088733365064E-32L, /* bf96cb28cf1c1b28006d53ffe633b22a */
+  1.71874999999999999459734108403218175E-01L, /* 3ffc5fffffffffffffb04554e9dd4000 */
+ -3.29736288190321377985697972236270628E-32L, /* bf96566af0ebc852e84be12859b24a31 */
+  1.75781249999999997987525759778901845E-01L, /* 3ffc67fffffffffffed702df6ffff000 */
+ -1.28800728638468399687523924685844352E-32L, /* bf950b8236b88ca0c1b739dc91a7e3fc */
+  1.79687500000000004929565820437175783E-01L, /* 3ffc70000000000002d779bb32d2e000 */
+  1.60624461317978482424582320675174225E-32L, /* 3f954d9a9cc0c963fd081f3dc922d04e */
+  1.83593750000000016873727045739708856E-01L, /* 3ffc78000000000009ba1f6263c9a000 */
+ -3.83390389582056606880506003118452558E-32L, /* bf968e22a5d826f77f19ee788474df22 */
+  1.87500000000000013443068740761666872E-01L, /* 3ffc80000000000007bfd8c72a1bf000 */
+ -2.74141662712926256150154726565203091E-32L, /* bf961caf5ac59c7f941f928e324c2cc1 */
+  1.91406249999999981494101786848611970E-01L, /* 3ffc87fffffffffff55502eeae001000 */
+  3.68992437075565165346469517256118001E-32L, /* 3f967f2f03f9096793372a27b92ad79d */
+  1.95312499999999989069921848800501648E-01L, /* 3ffc8ffffffffffff9b3015280394000 */
+  3.69712249337856518452988332367785220E-32L, /* 3f967fee5fdb5bd501ff93516999faa0 */
+  1.99218750000000021148042946919300804E-01L, /* 3ffc9800000000000c30e67939095000 */
+  2.50142536781142175091322844848566649E-32L, /* 3f9603c34ae58e10b300b07137ee618a */
+  2.03124999999999977732559198825437141E-01L, /* 3ffc9ffffffffffff329e7df079e4000 */
+ -2.41951877287895024779300892731537816E-32L, /* bf95f683aefe6965f080df8f59dd34a1 */
+  2.07031249999999996744030653771913124E-01L, /* 3ffca7fffffffffffe1f80f4b73ca000 */
+ -1.94346475904454000031592792989765585E-32L, /* bf9593a44f87870a3d100d498501ecc7 */
+  2.10937500000000000251399259834392298E-01L, /* 3ffcb000000000000025199873310000 */
+ -1.33528748788094249098998693871759411E-33L, /* bf91bbb9b25c813668d6103d08acac35 */
+  2.14843749999999993936323609611875097E-01L, /* 3ffcb7fffffffffffc8128c866236000 */
+  1.14839877977014974625242788556545292E-32L, /* 3f94dd06b4655c9b83a1305b240e7a42 */
+  2.18750000000000015181732784749663837E-01L, /* 3ffcc0000000000008c06da5fff24000 */
+  1.42689085313142539755499441881408391E-32L, /* 3f95285a87dfa7ea7dad5b3be8c669f4 */
+  2.22656249999999992172647770539596569E-01L, /* 3ffcc7fffffffffffb7ce2fe531f6000 */
+ -3.34421462850496887359128610229650547E-32L, /* bf965b487962b5c2d9056ca6ac0c2e5c */
+  2.26562499999999989595607223847082419E-01L, /* 3ffccffffffffffffa0095277be5c000 */
+ -3.08983588107248752517344356508205569E-32L, /* bf9640dded57157f8eded311213bdbcd */
+  2.30468749999999979130462438434567117E-01L, /* 3ffcd7fffffffffff3f8332996560000 */
+ -3.01407539802851697849105682795217019E-32L, /* bf9638ffde35dbdfe1a1ffe45185de5d */
+  2.34375000000000012194252337217891971E-01L, /* 3ffce0000000000007078dd402c86000 */
+ -8.46879710915628592284714319904522657E-33L, /* bf945fc7b29a2ac6c9eff9eb258a510f */
+  2.38281249999999982991877076137149870E-01L, /* 3ffce7fffffffffff6320b486eece000 */
+ -2.93563878880439245627127095245798544E-32L, /* bf9630daaa4f40ff05caf29ace2ea7d4 */
+  2.42187499999999981447559841442773990E-01L, /* 3ffceffffffffffff54e24a09a8d5000 */
+ -4.56766746558806021264215486909850481E-32L, /* bf96da556dee11f3113e5a3467b908e6 */
+  2.46093749999999991067720539980207318E-01L, /* 3ffcf7fffffffffffad9d405dcb5d000 */
+  2.14033004219908074003010247652128251E-32L, /* 3f95bc8776e8f9ae098884aa664cc3df */
+  2.50000000000000016613825838126835953E-01L, /* 3ffd00000000000004c9e24c12bb3000 */
+  2.57617532593749185996714235009382870E-32L, /* 3f960b867cc01178c0ec68226c6cb47d */
+  2.53906250000000013372004437827044321E-01L, /* 3ffd04000000000003daae05b3168000 */
+  7.20177123439204414298152646284640101E-32L, /* 3f9775eff59ddad7e7530b83934af87f */
+  2.57812499999999995765234725413886085E-01L, /* 3ffd07fffffffffffec7878bad9d5000 */
+  6.51253187532920882777046064603770602E-32L, /* 3f975226659ca241402e71c2011583b0 */
+  2.61718750000000007647689994011222248E-01L, /* 3ffd0c000000000002344cc793a0f000 */
+  3.02370610028725823590045201871491395E-32L, /* 3f9639ffe55fa2fa011674448b4e5b96 */
+  2.65624999999999986893899042596554269E-01L, /* 3ffd0ffffffffffffc38f0c0a1e9f000 */
+ -2.07683715950724761146070082510569258E-32L, /* bf95af579a92e872fef81abfdf06bae8 */
+  2.69531249999999979842788204900639327E-01L, /* 3ffd13fffffffffffa30a908d67db000 */
+  8.71465252506557329027658736641075706E-32L, /* 3f97c47d99e19830447a42b1c0ffac61 */
+  2.73437500000000006712165837793818271E-01L, /* 3ffd18000000000001ef453a58edb000 */
+ -6.62704045767568912140550474455810301E-32L, /* bf9758187a204dcb06ece46588aeeaba */
+  2.77343749999999994411329302988535617E-01L, /* 3ffd1bfffffffffffe63a0fec9c9e000 */
+ -4.87273466291944117406493607771338767E-32L, /* bf96fa0381b0844a0be46bac2d673f0c */
+  2.81250000000000012677892447379453135E-01L, /* 3ffd20000000000003a7769e125d6000 */
+ -8.55871796664700790726282049552906783E-32L, /* bf97bc64e01332cf7616b0091b8dff2c */
+  2.85156249999999998558643013736363981E-01L, /* 3ffd23ffffffffffff95a5894bccf000 */
+ -1.33068334720606220176455289635046875E-32L, /* bf95145f43290ecf5b7adcb24697bc73 */
+  2.89062500000000008831431235621753924E-01L, /* 3ffd280000000000028ba504fac59000 */
+ -9.34157398616814623985483776710704237E-32L, /* bf97e50ad1115b941fcb5f0c88a428f7 */
+  2.92968750000000019840235286110877063E-01L, /* 3ffd2c000000000005b7f372d184f000 */
+  4.99302093775173155906059132992249671E-33L, /* 3f939ecdcfb97bad3f8dbec5df5ec67d */
+  2.96875000000000015867911730971630513E-01L, /* 3ffd3000000000000492d860c79db000 */
+  7.86107787827057767235127454590866211E-33L, /* 3f944689517ee8f16cdb97d6a6938f32 */
+  3.00781250000000015814100002286124758E-01L, /* 3ffd340000000000048edfe73a17d000 */
+ -1.65419431293024229981937172317171504E-32L, /* bf9557900e3efca16c89646b57f68dc0 */
+  3.04687499999999985213157159965287195E-01L, /* 3ffd37fffffffffffbbcec6f99b36000 */
+  9.68753602893894024018934325652944198E-32L, /* 3f97f70170e5458660c33a7e8d43d049 */
+  3.08593749999999989969324338045156215E-01L, /* 3ffd3bfffffffffffd1bdde4d0fb1000 */
+  7.10268609610294706092252562643261106E-32L, /* 3f9770cae45cdf615010401a4b37d8d4 */
+  3.12500000000000002971606591018488854E-01L, /* 3ffd40000000000000db440fbc06b000 */
+  6.38924218802905979887732294952782964E-32L, /* 3f974bbf988bb5622bd8fbaa46e8b811 */
+  3.16406250000000006594921047402056305E-01L, /* 3ffd44000000000001e69e8954814000 */
+  3.96079878754651470094149874444850097E-32L, /* 3f969b5017b9fa7a1e86975258c73d3d */
+  3.20312500000000006713799366908329147E-01L, /* 3ffd48000000000001ef64159c065000 */
+ -1.86401314975634286055150437995880517E-32L, /* bf958323f0434911794e5fb8bfe136ba */
+  3.24218749999999987061246567584951210E-01L, /* 3ffd4bfffffffffffc4549db9b928000 */
+ -3.18643523744758601387071062700407431E-32L, /* bf964ae5fa7e26c2c3981bed12e14372 */
+  3.28124999999999991782776266707412953E-01L, /* 3ffd4ffffffffffffda1ad0840ca8000 */
+ -4.46964199751314296839915534813144652E-32L, /* bf96d0277729ffd74727150df6d15547 */
+  3.32031250000000000393816557756032682E-01L, /* 3ffd540000000000001d0efc04fad000 */
+ -9.03246333902065439930373230002688649E-33L, /* bf947731a008748cc6dee948839ef7ae */
+  3.35937499999999983810482995064392173E-01L, /* 3ffd57fffffffffffb556cab8ae61000 */
+  5.27742727066129518825981597650621794E-32L, /* 3f9712050a6ddbf1cabf1b971f4b5d0b */
+  3.39843750000000004310441349760912471E-01L, /* 3ffd5c0000000000013e0def5ddc4000 */
+ -3.85927263474732591932884416445586106E-32L, /* bf9690c51088ef3db9ca000829c450c2 */
+  3.43749999999999990248130003997484364E-01L, /* 3ffd5ffffffffffffd3070624a0af000 */
+  9.62005170171527308106468341512327487E-34L, /* 3f913fae595cea84432eb01430817fca */
+  3.47656250000000004085726414568625697E-01L, /* 3ffd640000000000012d79309e291000 */
+ -6.59664093705705297250259434519072507E-32L, /* bf97568465eafb0e662e64a5dbfaf35f */
 
- L(-1.98364257812501251077851763965418372E-03), /* bff6040000000001cd90f658cf0b1000 */
- L(-3.71984513103117734260309047540278737E-34), /* bf8fee73c54483194782aac4a6154d11 */
- L(-1.95312500000000378520649630233891879E-03), /* bff60000000000008ba643bb5e2e8000 */
- L(-1.12194202736719050440745599339855038E-34), /* bf8e2a436aeff7bc529873354f47a3f5 */
- L(-1.92260742187499397430259771221991482E-03), /* bff5f7fffffffffe4361cb51170da000 */
- L(-2.30068299876822157331268484824540848E-34), /* bf8f31d02f85cfe8c0cc02276ce0f437 */
- L(-1.89208984375001137424603270262074989E-03), /* bff5f0000000000347456ed490c23000 */
- L(-1.15012507244426243338260435466985403E-34), /* bf8e31c174d5677a937a34ad8d2a70b4 */
- L(-1.86157226562500172319250342061336738E-03), /* bff5e800000000007f262fa3617b4000 */
- L(-3.12438344643346437509767736937785561E-34), /* bf8f9f4d426a2457c273d34ef7d9bde9 */
- L(-1.83105468749999505256246872355430379E-03), /* bff5dffffffffffe92f18c1c2b6fa000 */
- L(-5.91130415288336591179087455220308942E-35), /* bf8d3a4c80b42dc036bae446c9807f78 */
- L(-1.80053710937499445182387245573120522E-03), /* bff5d7fffffffffe669dea82b4a4c000 */
- L(-1.92396289352411531324908916321392100E-34), /* bf8eff7a2123fb573ba9778550d669bd */
- L(-1.77001953125000387737631542516323906E-03), /* bff5d000000000011e19915c3ddb7000 */
-  L(7.91101758977203355387806553469731354E-36), /* 3f8a507f5a70faaccf469e3461873dea */
- L(-1.73950195312500034854670281415554486E-03), /* bff5c8000000000019b7dc6ef97bd000 */
-  L(1.55906551582436824067407021178835755E-34), /* 3f8e9e7880333e34955aebcde3cfb053 */
- L(-1.70898437499998955782591472611429852E-03), /* bff5bffffffffffcfd80e88aa6b96000 */
-  L(8.22951661962611381718215899498500357E-35), /* 3f8db58e6031a779b59f6ece191de7cc */
- L(-1.67846679687500586652037711131708544E-03), /* bff5b80000000001b0df6fd21c133000 */
- L(-8.96642618848426299713145894522897419E-35), /* bf8ddcbcab46d531801bfae4121f2f8a */
- L(-1.64794921875000109499161354039904782E-03), /* bff5b0000000000050cbce8915575000 */
- L(-2.88077905394253859590587789680486639E-34), /* bf8f7eebd4dd860ef73b674d5e707959 */
- L(-1.61743164062501133830507079150388351E-03), /* bff5a80000000003449e8700c3e82000 */
- L(-3.68271725851639066312899986829350273E-34), /* bf8fe9845fe20a5fe74059e0cae185d6 */
- L(-1.58691406249999015546015764131101956E-03), /* bff59ffffffffffd2999e668cdd28000 */
-  L(8.48197657099957029953716507898788812E-35), /* 3f8dc2faaebb97392e451b07b28c4b12 */
- L(-1.55639648437500317366570219290722587E-03), /* bff5980000000000ea2cd9a40d256000 */
- L(-3.45156704719737676412949957712570373E-36), /* bf8925a079505516c8e317ac1ff53255 */
- L(-1.52587890625000568759013197767046039E-03), /* bff5900000000001a3ab8a3f6b698000 */
- L(-1.01902948542497496574967177677556729E-34), /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
- L(-1.49536132812500945889014955936485340E-03), /* bff5880000000002b9f1621b57743000 */
- L(-3.32264697086631598830366079048117140E-34), /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
- L(-1.46484374999999931883259902869504725E-03), /* bff57fffffffffffcdbd1c90e1b4a000 */
- L(-1.76487524793892929381101031660811433E-34), /* bf8ed52f2f724bc1ae870b18356337b4 */
- L(-1.43432617187498876325946983333888768E-03), /* bff577fffffffffcc2dff8faa5570000 */
- L(-3.54550084538495708816233114576143814E-34), /* bf8fd74724576915868c1e8ce9f430f1 */
- L(-1.40380859374999215367421282192718062E-03), /* bff56ffffffffffdbd0b18aac65ed000 */
- L(-1.90585907028351204486765167064669639E-34), /* bf8efaaa0c0e23e50c11b2120348054f */
- L(-1.37329101562499692341771212945644892E-03), /* bff567ffffffffff1cfd00f1b0577000 */
- L(-3.59631150411372589637918252836880320E-34), /* bf8fde08239ac74942a46298ea4fb715 */
- L(-1.34277343749999137467356674296739172E-03), /* bff55ffffffffffd839030b05d53d000 */
- L(-1.49571076125940368185068762485268117E-35), /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
- L(-1.31225585937499247038404301859788734E-03), /* bff557fffffffffdd469936e691e3000 */
-  L(3.10375845385355395586146533282311300E-34), /* 3f8f9c8f6d63b7a4145716ffd92491fb */
- L(-1.28173828124999024755581675764821898E-03), /* bff54ffffffffffd306589b0ab21d000 */
- L(-1.98541096105909793397376077900810019E-34), /* bf8f07e808bbb1e35106c294ffbb9687 */
- L(-1.25122070312500340204619591143332523E-03), /* bff5480000000000fb06d5f16ad2c000 */
-  L(3.62884195935761446237911443317457521E-34), /* 3f8fe25b17d623178a386a6fa6c5afb2 */
- L(-1.22070312499999591578388993012071279E-03), /* bff53ffffffffffed2a356c440074000 */
- L(-2.96756662615653130862526710937493307E-35), /* bf8c3b90d8ff2a991e5bd16718fb0645 */
- L(-1.19018554687498821966212632349422735E-03), /* bff537fffffffffc9ac3b585dda89000 */
-  L(1.44659971891167323357060028901142644E-34), /* 3f8e809279ab249edf1dad9fe13fb0bf */
- L(-1.15966796875000160938908064907298384E-03), /* bff530000000000076c0800db9639000 */
-  L(2.50088010538742402346270685365928513E-34), /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
- L(-1.12915039062500267151512523291939657E-03), /* bff5280000000000c51f7e7315137000 */
-  L(7.56402096465615210500092443924888831E-35), /* 3f8d922c1e485d99aea2668ed32b55a6 */
- L(-1.09863281249998665006360103291051571E-03), /* bff51ffffffffffc26f2d4c9ce2ba000 */
-  L(1.43982174467233642713619821353592061E-34), /* 3f8e7ec530b3d92b6303bec1c81214d1 */
- L(-1.06811523437500522742248711752028025E-03), /* bff518000000000181b7380f10446000 */
-  L(5.41265133745862349181293024531133174E-35), /* 3f8d1fc9313d018b30e790e06b6be723 */
- L(-1.03759765624999980942114138999770552E-03), /* bff50ffffffffffff1f01130490e1000 */
-  L(1.21525139612685854366189534669623436E-34), /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
- L(-1.00708007812499602697537601515759439E-03), /* bff507fffffffffedad7afcce7051000 */
-  L(1.00020246351201558505328236381833392E-34), /* 3f8e09e640992512b1300744a7e984ed */
- L(-9.76562499999992592487302113340463694E-04), /* bff4fffffffffffbbad8151f8adf6000 */
- L(-1.64984406575162932060422892046851002E-34), /* bf8eb69a919986e8054b86fc34300f24 */
- L(-9.46044921874989085824996924138179594E-04), /* bff4effffffffff9b55a204fd9792000 */
- L(-9.29539174108308550334255350011347171E-35), /* bf8dee3a50ed896b4656fa577a1df3d7 */
- L(-9.15527343750013735214860599791540029E-04), /* bff4e00000000007eaf5bf103f82d000 */
-  L(3.07557018309280519949818825519490586E-35), /* 3f8c470cfbef77d32c74cb8042f6ee81 */
- L(-8.85009765625012292294986105781516428E-04), /* bff4d000000000071605c65403b97000 */
-  L(4.77499983783821950338363358545463558E-35), /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
- L(-8.54492187499986941239470706817188192E-04), /* bff4bffffffffff878ddf9cab264a000 */
- L(-1.60128240346239526958630011447901568E-34), /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
- L(-8.23974609374996290174598690241743810E-04), /* bff4affffffffffddc86c249ebe06000 */
-  L(1.61677540391961912631535763471935882E-34), /* 3f8eadd00841366b0dc2bc262c2c8c36 */
- L(-7.93457031249988696952538334288757473E-04), /* bff49ffffffffff97bf6f0aa85a5f000 */
-  L(1.22318577008381887076634753347515709E-34), /* 3f8e452db5b5d250878f71040da06d14 */
- L(-7.62939453124996723316499040007097041E-04), /* bff48ffffffffffe1c7265b431108000 */
- L(-1.03845161748762410745671891558398468E-34), /* bf8e14115ad884c96d1a820c73647220 */
- L(-7.32421874999998242520117923997325794E-04), /* bff47ffffffffffefca4498b7aa8a000 */
-  L(5.64005211953031009549514026639438083E-35), /* 3f8d2be06950f68f1a6d8ff829a6928e */
- L(-7.01904296874999772890934814265622012E-04), /* bff46fffffffffffde7c0fe5d8041000 */
-  L(5.90245467325173644235991233229525762E-35), /* 3f8d39d40cc49002189243c194b1db0e */
- L(-6.71386718750008699269643939210658742E-04), /* bff460000000000503c91d798b60c000 */
- L(-5.20515801723324452151498579012322191E-35), /* bf8d14c0f08a6a9285b32b8bda003eb5 */
- L(-6.40869140625005499535275057463709988E-04), /* bff45000000000032b969184e9751000 */
- L(-6.69469163285461870099846471658294534E-35), /* bf8d63f36bab7b24d936c9380e3d3fa6 */
- L(-6.10351562499999293780097329596079841E-04), /* bff43fffffffffff97c7c433e35ed000 */
- L(-1.16941808547394177991845382085515086E-34), /* bf8e36e27886f10b234a7dd8fc588bf0 */
- L(-5.79833984375000068291972326409994795E-04), /* bff43000000000000a13ff6dcf2bf000 */
-  L(1.17885044988246219185041488459766001E-34), /* 3f8e3964677e001a00412aab52790842 */
- L(-5.49316406249990904622170867910987793E-04), /* bff41ffffffffffac1c25739c716b000 */
- L(-3.31875702128137033065075734368960972E-35), /* bf8c60e928d8982c3c99aef4f885a121 */
- L(-5.18798828125011293653756992177727236E-04), /* bff410000000000682a62cff36775000 */
- L(-5.69971237642088463334239430962628187E-35), /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
- L(-4.88281249999990512232251384917893121E-04), /* bff3fffffffffff50fb48992320df000 */
-  L(1.02144616714408655325510171265051108E-35), /* 3f8ab279a3626612710b9b3ac71734ac */
- L(-4.57763671874997554564967307956493434E-04), /* bff3dffffffffffd2e3c272e3cca9000 */
- L(-8.25484058867957231164162481843653503E-35), /* bf8db6e71158e7bf93e2e683f07aa841 */
- L(-4.27246093749991203999790346349633286E-04), /* bff3bffffffffff5dbe103cba0eb2000 */
- L(-3.51191203319375193921924105905691755E-35), /* bf8c757356d0f3dd7fbefc0dd419ab50 */
- L(-3.96728515624986649402960638705483281E-04), /* bff39ffffffffff09b996882706ec000 */
- L(-5.51925962073095883016589497244931171E-36), /* bf89d586d49f22289cfc860bebb99056 */
- L(-3.66210937499999945095511981300980754E-04), /* bff37fffffffffffefcb88bfc7df6000 */
- L(-2.11696465278144529364423332249588595E-35), /* bf8bc23a84d28e5496c874ef9833be25 */
- L(-3.35693359374992480958458008559640163E-04), /* bff35ffffffffff754c548a8798f2000 */
- L(-8.58941791799705081104736787493668352E-35), /* bf8dc8b1192fb7c3662826d43acb7c68 */
- L(-3.05175781250009811036303273640122156E-04), /* bff340000000000b4fb4f1aad1c76000 */
- L(-8.61173897858769926480551302277426632E-35), /* bf8dc9e0eabb1c0b33051011b64769fa */
- L(-2.74658203124987298321920308390303850E-04), /* bff31ffffffffff15b2056ac252fd000 */
-  L(3.35152809454778381053519808988046631E-37), /* 3f85c82fb59ff8d7c80d44e635420ab1 */
- L(-2.44140624999999992770514819575735516E-04), /* bff2fffffffffffffbbb82d6a7636000 */
-  L(3.54445837111124472730013879165516908E-35), /* 3f8c78e955b01378be647b1c92aa9a77 */
- L(-2.13623046875012756463165168672749438E-04), /* bff2c0000000001d6a1635fea6bbf000 */
-  L(1.50050816288650121729916777279129473E-35), /* 3f8b3f1f6f616a61129a58e131cbd31d */
- L(-1.83105468749991323078784464300306893E-04), /* bff27fffffffffebfe0cbd0c82399000 */
- L(-9.14919506501448661140572099029756008E-37), /* bf873754bacaa9d9513b6127e791eb47 */
- L(-1.52587890625013337032336300236461546E-04), /* bff240000000001ec0cb57f2cc995000 */
-  L(2.84906084373176180870418394956384516E-35), /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
- L(-1.22070312499990746786116828458007518E-04), /* bff1ffffffffffd553bbb49f35a34000 */
-  L(6.71618008964968339584520728412444537E-36), /* 3f8a1dacb99c60071fc9cd2349495bf0 */
- L(-9.15527343750029275602791047595142231E-05), /* bff180000000000d8040cd6ecde28000 */
- L(-1.95753652091078750312541716951402172E-35), /* bf8ba0526cfb24d8d59122f1c7a09a14 */
- L(-6.10351562499913258461494008080572701E-05), /* bff0ffffffffffaffebbb92d7f6a9000 */
-  L(5.69868489273961111703398456218119973E-36), /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
- L(-3.05175781250092882818419203884960853E-05), /* bff0000000000055ab55de88fac1d000 */
-  L(9.03341100018476837609128961872915953E-36), /* 3f8a803d229fa3a0e834a63abb06662b */
+ -1.98364257812501251077851763965418372E-03L, /* bff6040000000001cd90f658cf0b1000 */
+ -3.71984513103117734260309047540278737E-34L, /* bf8fee73c54483194782aac4a6154d11 */
+ -1.95312500000000378520649630233891879E-03L, /* bff60000000000008ba643bb5e2e8000 */
+ -1.12194202736719050440745599339855038E-34L, /* bf8e2a436aeff7bc529873354f47a3f5 */
+ -1.92260742187499397430259771221991482E-03L, /* bff5f7fffffffffe4361cb51170da000 */
+ -2.30068299876822157331268484824540848E-34L, /* bf8f31d02f85cfe8c0cc02276ce0f437 */
+ -1.89208984375001137424603270262074989E-03L, /* bff5f0000000000347456ed490c23000 */
+ -1.15012507244426243338260435466985403E-34L, /* bf8e31c174d5677a937a34ad8d2a70b4 */
+ -1.86157226562500172319250342061336738E-03L, /* bff5e800000000007f262fa3617b4000 */
+ -3.12438344643346437509767736937785561E-34L, /* bf8f9f4d426a2457c273d34ef7d9bde9 */
+ -1.83105468749999505256246872355430379E-03L, /* bff5dffffffffffe92f18c1c2b6fa000 */
+ -5.91130415288336591179087455220308942E-35L, /* bf8d3a4c80b42dc036bae446c9807f78 */
+ -1.80053710937499445182387245573120522E-03L, /* bff5d7fffffffffe669dea82b4a4c000 */
+ -1.92396289352411531324908916321392100E-34L, /* bf8eff7a2123fb573ba9778550d669bd */
+ -1.77001953125000387737631542516323906E-03L, /* bff5d000000000011e19915c3ddb7000 */
+  7.91101758977203355387806553469731354E-36L, /* 3f8a507f5a70faaccf469e3461873dea */
+ -1.73950195312500034854670281415554486E-03L, /* bff5c8000000000019b7dc6ef97bd000 */
+  1.55906551582436824067407021178835755E-34L, /* 3f8e9e7880333e34955aebcde3cfb053 */
+ -1.70898437499998955782591472611429852E-03L, /* bff5bffffffffffcfd80e88aa6b96000 */
+  8.22951661962611381718215899498500357E-35L, /* 3f8db58e6031a779b59f6ece191de7cc */
+ -1.67846679687500586652037711131708544E-03L, /* bff5b80000000001b0df6fd21c133000 */
+ -8.96642618848426299713145894522897419E-35L, /* bf8ddcbcab46d531801bfae4121f2f8a */
+ -1.64794921875000109499161354039904782E-03L, /* bff5b0000000000050cbce8915575000 */
+ -2.88077905394253859590587789680486639E-34L, /* bf8f7eebd4dd860ef73b674d5e707959 */
+ -1.61743164062501133830507079150388351E-03L, /* bff5a80000000003449e8700c3e82000 */
+ -3.68271725851639066312899986829350273E-34L, /* bf8fe9845fe20a5fe74059e0cae185d6 */
+ -1.58691406249999015546015764131101956E-03L, /* bff59ffffffffffd2999e668cdd28000 */
+  8.48197657099957029953716507898788812E-35L, /* 3f8dc2faaebb97392e451b07b28c4b12 */
+ -1.55639648437500317366570219290722587E-03L, /* bff5980000000000ea2cd9a40d256000 */
+ -3.45156704719737676412949957712570373E-36L, /* bf8925a079505516c8e317ac1ff53255 */
+ -1.52587890625000568759013197767046039E-03L, /* bff5900000000001a3ab8a3f6b698000 */
+ -1.01902948542497496574967177677556729E-34L, /* bf8e0ee78d94d9b5ad3d63ae35c9b554 */
+ -1.49536132812500945889014955936485340E-03L, /* bff5880000000002b9f1621b57743000 */
+ -3.32264697086631598830366079048117140E-34L, /* bf8fb9a7d14c32289204fbb0c9eb20e0 */
+ -1.46484374999999931883259902869504725E-03L, /* bff57fffffffffffcdbd1c90e1b4a000 */
+ -1.76487524793892929381101031660811433E-34L, /* bf8ed52f2f724bc1ae870b18356337b4 */
+ -1.43432617187498876325946983333888768E-03L, /* bff577fffffffffcc2dff8faa5570000 */
+ -3.54550084538495708816233114576143814E-34L, /* bf8fd74724576915868c1e8ce9f430f1 */
+ -1.40380859374999215367421282192718062E-03L, /* bff56ffffffffffdbd0b18aac65ed000 */
+ -1.90585907028351204486765167064669639E-34L, /* bf8efaaa0c0e23e50c11b2120348054f */
+ -1.37329101562499692341771212945644892E-03L, /* bff567ffffffffff1cfd00f1b0577000 */
+ -3.59631150411372589637918252836880320E-34L, /* bf8fde08239ac74942a46298ea4fb715 */
+ -1.34277343749999137467356674296739172E-03L, /* bff55ffffffffffd839030b05d53d000 */
+ -1.49571076125940368185068762485268117E-35L, /* bf8b3e1a3d5c684b27a9f835b1d8d3c9 */
+ -1.31225585937499247038404301859788734E-03L, /* bff557fffffffffdd469936e691e3000 */
+  3.10375845385355395586146533282311300E-34L, /* 3f8f9c8f6d63b7a4145716ffd92491fb */
+ -1.28173828124999024755581675764821898E-03L, /* bff54ffffffffffd306589b0ab21d000 */
+ -1.98541096105909793397376077900810019E-34L, /* bf8f07e808bbb1e35106c294ffbb9687 */
+ -1.25122070312500340204619591143332523E-03L, /* bff5480000000000fb06d5f16ad2c000 */
+  3.62884195935761446237911443317457521E-34L, /* 3f8fe25b17d623178a386a6fa6c5afb2 */
+ -1.22070312499999591578388993012071279E-03L, /* bff53ffffffffffed2a356c440074000 */
+ -2.96756662615653130862526710937493307E-35L, /* bf8c3b90d8ff2a991e5bd16718fb0645 */
+ -1.19018554687498821966212632349422735E-03L, /* bff537fffffffffc9ac3b585dda89000 */
+  1.44659971891167323357060028901142644E-34L, /* 3f8e809279ab249edf1dad9fe13fb0bf */
+ -1.15966796875000160938908064907298384E-03L, /* bff530000000000076c0800db9639000 */
+  2.50088010538742402346270685365928513E-34L, /* 3f8f4c6c8a483b60201d30c1a83c3cb7 */
+ -1.12915039062500267151512523291939657E-03L, /* bff5280000000000c51f7e7315137000 */
+  7.56402096465615210500092443924888831E-35L, /* 3f8d922c1e485d99aea2668ed32b55a6 */
+ -1.09863281249998665006360103291051571E-03L, /* bff51ffffffffffc26f2d4c9ce2ba000 */
+  1.43982174467233642713619821353592061E-34L, /* 3f8e7ec530b3d92b6303bec1c81214d1 */
+ -1.06811523437500522742248711752028025E-03L, /* bff518000000000181b7380f10446000 */
+  5.41265133745862349181293024531133174E-35L, /* 3f8d1fc9313d018b30e790e06b6be723 */
+ -1.03759765624999980942114138999770552E-03L, /* bff50ffffffffffff1f01130490e1000 */
+  1.21525139612685854366189534669623436E-34L, /* 3f8e4311b96b6fcde412caf3f0d86fb9 */
+ -1.00708007812499602697537601515759439E-03L, /* bff507fffffffffedad7afcce7051000 */
+  1.00020246351201558505328236381833392E-34L, /* 3f8e09e640992512b1300744a7e984ed */
+ -9.76562499999992592487302113340463694E-04L, /* bff4fffffffffffbbad8151f8adf6000 */
+ -1.64984406575162932060422892046851002E-34L, /* bf8eb69a919986e8054b86fc34300f24 */
+ -9.46044921874989085824996924138179594E-04L, /* bff4effffffffff9b55a204fd9792000 */
+ -9.29539174108308550334255350011347171E-35L, /* bf8dee3a50ed896b4656fa577a1df3d7 */
+ -9.15527343750013735214860599791540029E-04L, /* bff4e00000000007eaf5bf103f82d000 */
+  3.07557018309280519949818825519490586E-35L, /* 3f8c470cfbef77d32c74cb8042f6ee81 */
+ -8.85009765625012292294986105781516428E-04L, /* bff4d000000000071605c65403b97000 */
+  4.77499983783821950338363358545463558E-35L, /* 3f8cfbc3dc18884c4c4f9e07d90d7bd3 */
+ -8.54492187499986941239470706817188192E-04L, /* bff4bffffffffff878ddf9cab264a000 */
+ -1.60128240346239526958630011447901568E-34L, /* bf8ea9b1a21e19e2d5bd84b0fbffcf95 */
+ -8.23974609374996290174598690241743810E-04L, /* bff4affffffffffddc86c249ebe06000 */
+  1.61677540391961912631535763471935882E-34L, /* 3f8eadd00841366b0dc2bc262c2c8c36 */
+ -7.93457031249988696952538334288757473E-04L, /* bff49ffffffffff97bf6f0aa85a5f000 */
+  1.22318577008381887076634753347515709E-34L, /* 3f8e452db5b5d250878f71040da06d14 */
+ -7.62939453124996723316499040007097041E-04L, /* bff48ffffffffffe1c7265b431108000 */
+ -1.03845161748762410745671891558398468E-34L, /* bf8e14115ad884c96d1a820c73647220 */
+ -7.32421874999998242520117923997325794E-04L, /* bff47ffffffffffefca4498b7aa8a000 */
+  5.64005211953031009549514026639438083E-35L, /* 3f8d2be06950f68f1a6d8ff829a6928e */
+ -7.01904296874999772890934814265622012E-04L, /* bff46fffffffffffde7c0fe5d8041000 */
+  5.90245467325173644235991233229525762E-35L, /* 3f8d39d40cc49002189243c194b1db0e */
+ -6.71386718750008699269643939210658742E-04L, /* bff460000000000503c91d798b60c000 */
+ -5.20515801723324452151498579012322191E-35L, /* bf8d14c0f08a6a9285b32b8bda003eb5 */
+ -6.40869140625005499535275057463709988E-04L, /* bff45000000000032b969184e9751000 */
+ -6.69469163285461870099846471658294534E-35L, /* bf8d63f36bab7b24d936c9380e3d3fa6 */
+ -6.10351562499999293780097329596079841E-04L, /* bff43fffffffffff97c7c433e35ed000 */
+ -1.16941808547394177991845382085515086E-34L, /* bf8e36e27886f10b234a7dd8fc588bf0 */
+ -5.79833984375000068291972326409994795E-04L, /* bff43000000000000a13ff6dcf2bf000 */
+  1.17885044988246219185041488459766001E-34L, /* 3f8e3964677e001a00412aab52790842 */
+ -5.49316406249990904622170867910987793E-04L, /* bff41ffffffffffac1c25739c716b000 */
+ -3.31875702128137033065075734368960972E-35L, /* bf8c60e928d8982c3c99aef4f885a121 */
+ -5.18798828125011293653756992177727236E-04L, /* bff410000000000682a62cff36775000 */
+ -5.69971237642088463334239430962628187E-35L, /* bf8d2f0c76f8757d61cd1abc7ea7d066 */
+ -4.88281249999990512232251384917893121E-04L, /* bff3fffffffffff50fb48992320df000 */
+  1.02144616714408655325510171265051108E-35L, /* 3f8ab279a3626612710b9b3ac71734ac */
+ -4.57763671874997554564967307956493434E-04L, /* bff3dffffffffffd2e3c272e3cca9000 */
+ -8.25484058867957231164162481843653503E-35L, /* bf8db6e71158e7bf93e2e683f07aa841 */
+ -4.27246093749991203999790346349633286E-04L, /* bff3bffffffffff5dbe103cba0eb2000 */
+ -3.51191203319375193921924105905691755E-35L, /* bf8c757356d0f3dd7fbefc0dd419ab50 */
+ -3.96728515624986649402960638705483281E-04L, /* bff39ffffffffff09b996882706ec000 */
+ -5.51925962073095883016589497244931171E-36L, /* bf89d586d49f22289cfc860bebb99056 */
+ -3.66210937499999945095511981300980754E-04L, /* bff37fffffffffffefcb88bfc7df6000 */
+ -2.11696465278144529364423332249588595E-35L, /* bf8bc23a84d28e5496c874ef9833be25 */
+ -3.35693359374992480958458008559640163E-04L, /* bff35ffffffffff754c548a8798f2000 */
+ -8.58941791799705081104736787493668352E-35L, /* bf8dc8b1192fb7c3662826d43acb7c68 */
+ -3.05175781250009811036303273640122156E-04L, /* bff340000000000b4fb4f1aad1c76000 */
+ -8.61173897858769926480551302277426632E-35L, /* bf8dc9e0eabb1c0b33051011b64769fa */
+ -2.74658203124987298321920308390303850E-04L, /* bff31ffffffffff15b2056ac252fd000 */
+  3.35152809454778381053519808988046631E-37L, /* 3f85c82fb59ff8d7c80d44e635420ab1 */
+ -2.44140624999999992770514819575735516E-04L, /* bff2fffffffffffffbbb82d6a7636000 */
+  3.54445837111124472730013879165516908E-35L, /* 3f8c78e955b01378be647b1c92aa9a77 */
+ -2.13623046875012756463165168672749438E-04L, /* bff2c0000000001d6a1635fea6bbf000 */
+  1.50050816288650121729916777279129473E-35L, /* 3f8b3f1f6f616a61129a58e131cbd31d */
+ -1.83105468749991323078784464300306893E-04L, /* bff27fffffffffebfe0cbd0c82399000 */
+ -9.14919506501448661140572099029756008E-37L, /* bf873754bacaa9d9513b6127e791eb47 */
+ -1.52587890625013337032336300236461546E-04L, /* bff240000000001ec0cb57f2cc995000 */
+  2.84906084373176180870418394956384516E-35L, /* 3f8c2ef6d03a7e6ab087c4f099e4de89 */
+ -1.22070312499990746786116828458007518E-04L, /* bff1ffffffffffd553bbb49f35a34000 */
+  6.71618008964968339584520728412444537E-36L, /* 3f8a1dacb99c60071fc9cd2349495bf0 */
+ -9.15527343750029275602791047595142231E-05L, /* bff180000000000d8040cd6ecde28000 */
+ -1.95753652091078750312541716951402172E-35L, /* bf8ba0526cfb24d8d59122f1c7a09a14 */
+ -6.10351562499913258461494008080572701E-05L, /* bff0ffffffffffaffebbb92d7f6a9000 */
+  5.69868489273961111703398456218119973E-36L, /* 3f89e4ca5df09ef4a4386dd5b3bf0331 */
+ -3.05175781250092882818419203884960853E-05L, /* bff0000000000055ab55de88fac1d000 */
+  9.03341100018476837609128961872915953E-36L, /* 3f8a803d229fa3a0e834a63abb06662b */
 #define T_EXPL_ARG2 (2*T_EXPL_ARG1 + 2 + 2*65)
-  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
-  L(0.00000000000000000000000000000000000E+00), /* 00000000000000000000000000000000 */
-  L(3.05175781249814607084128277672749162E-05), /* 3feffffffffffeaa02abb9102f499000 */
-  L(1.00271855391179733380665816525889949E-36), /* 3f8755351afa042ac3f58114824d4c10 */
-  L(6.10351562500179243748093427073421439E-05), /* 3ff1000000000052a95de07a4c26d000 */
-  L(1.67231624299180373502350811501181670E-36), /* 3f881c87a53691cae9d77f4e40d66616 */
-  L(9.15527343749970728685313252158399200E-05), /* 3ff17ffffffffff28040cc2acde28000 */
-  L(2.43665747834893104318707597514407880E-36), /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
-  L(1.22070312500027751961838150070880064E-04), /* 3ff200000000003ffddde6c153b53000 */
- L(-1.73322146370624186623546452226755405E-35), /* bf8b709d8d658ed5dbbe943de56ee84e */
-  L(1.52587890624995916105682628143179430E-04), /* 3ff23ffffffffff6954b56e285d23000 */
-  L(1.23580432650945898349135528000443828E-35), /* 3f8b06d396601dde16de7d7bc27346e6 */
-  L(1.83105468750008670314358488289621794E-04), /* 3ff2800000000013fe0cdc8c823b7000 */
-  L(4.30446229148833293310207915930740796E-35), /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
-  L(2.13623046875005741337455947623248132E-04), /* 3ff2c0000000000d3d1662de21a3f000 */
- L(-3.96110759869520786681660669615255057E-35), /* bf8ca5379b04ff4a31aab0ceacc917e6 */
-  L(2.44140624999981493573336463433440506E-04), /* 3ff2ffffffffffd553bbdf48e0534000 */
- L(-1.39617373942387888957350179316792928E-35), /* bf8b28eeedc286015802b63f96b8c5cd */
-  L(2.74658203124984920706309918754626834E-04), /* 3ff31fffffffffee9d60c8439ec1d000 */
- L(-3.16168080483901830349738314447356223E-36), /* bf890cf74f81c77a611abc1243812444 */
-  L(3.05175781250008648918265055410966055E-04), /* 3ff3400000000009f8b5c9a346636000 */
-  L(8.54421306185008998867856704677221443E-35), /* 3f8dc649cd40922fc08adc6b6b20ead0 */
-  L(3.35693359374988945462612499316774515E-04), /* 3ff35ffffffffff34146c540f15b2000 */
-  L(7.96443137431639500475160850431097078E-35), /* 3f8da77638ed3148fc4d99d1c9e13446 */
-  L(3.66210937500027690542093987739604535E-04), /* 3ff380000000001fecce34bea89c4000 */
-  L(2.14507323877752361258862577769090367E-35), /* 3f8bc834e554d38894cf91957b0253d3 */
-  L(3.96728515625003928083564943615052121E-04), /* 3ff3a00000000004875d9a4acf6ab000 */
-  L(4.88358523466632050664019922448605508E-35), /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
-  L(4.27246093750017799227172345607351585E-04), /* 3ff3c00000000014856794c3ee850000 */
-  L(6.66520494592631402182216588784828935E-35), /* 3f8d6262118fcdb59b8f16108f5f1a6c */
-  L(4.57763671875002108342364320152138181E-04), /* 3ff3e000000000026e45d855410b9000 */
-  L(7.21799615960261390920033272189522298E-35), /* 3f8d7fc645cff8879462296af975c9fd */
-  L(4.88281249999999768797631616370963356E-04), /* 3ff3ffffffffffffbbc2d7cc004df000 */
- L(-5.30564629906905979452258114088325361E-35), /* bf8d1a18b71929a30d67a217a27ae851 */
-  L(5.18798828124997339054881383202487041E-04), /* 3ff40ffffffffffe775055eea5851000 */
- L(-4.03682911253647925867848180522846377E-35), /* bf8cad44f0f3e5199d8a589d9332acad */
-  L(5.49316406249980511907933706754958501E-04), /* 3ff41ffffffffff4c410b29bb62fb000 */
- L(-2.08166843948323917121806956728438051E-35), /* bf8bbab8cf691403249fe5b699e25143 */
-  L(5.79833984374989593561576568548497165E-04), /* 3ff42ffffffffffa0047df328d817000 */
- L(-1.72745033420153042445343706432627539E-34), /* bf8ecb3c2d7d3a9e6e960576be901fdf */
-  L(6.10351562500008540711511259540838154E-04), /* 3ff4400000000004ec62f54f8c271000 */
-  L(7.41889382604319545724663095428976499E-35), /* 3f8d8a74c002c81a47c93b8e05d15f8e */
-  L(6.40869140625020444702875407535884986E-04), /* 3ff450000000000bc91b09718515d000 */
- L(-4.47321009727305792048065440180490107E-35), /* bf8cdbac5c8fe70822081d8993eb5cb6 */
-  L(6.71386718750007531635964622352684074E-04), /* 3ff460000000000457792973db05c000 */
-  L(5.13698959677949336513874456684462092E-35), /* 3f8d112114436949c5ef38d8049004ab */
-  L(7.01904296875006634673332887754430334E-04), /* 3ff4700000000003d31adf2cb8b1d000 */
- L(-8.25665755717729437292989870760751482E-35), /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
-  L(7.32421874999998244664170215504673504E-04), /* 3ff47ffffffffffefcf5498bd5c8a000 */
- L(-5.64005234937832153139057628112753364E-35), /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
-  L(7.62939453125017456345986752604096408E-04), /* 3ff490000000000a101a1b093d4a8000 */
- L(-1.11084094120417622468550608896588329E-34), /* bf8e274feabd2d94f6694507a46accb1 */
-  L(7.93457031249987558617598988993908016E-04), /* 3ff49ffffffffff8d3f9dcab74bbf000 */
- L(-1.22966480225449015129079129940978828E-34), /* bf8e46e6a65eef8fa9e42eddf3da305e */
-  L(8.23974609374997378723747633335135819E-04), /* 3ff4affffffffffe7d2afbaa55b26000 */
- L(-1.62270010016794279091906973366704963E-34), /* bf8eaf633f057ebdb664a34566401c4e */
-  L(8.54492187500023938282350821569920958E-04), /* 3ff4c0000000000dccaabce399e59000 */
- L(-1.39076361712838158775374263169606160E-34), /* bf8e71ba779364b3bbdba7841f2c4ca1 */
-  L(8.85009765624987932362186815286691297E-04), /* 3ff4cffffffffff90b218886edc2a000 */
-  L(4.07328275060905585228261577392403980E-35), /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
-  L(9.15527343749975579461305518559161974E-04), /* 3ff4dffffffffff1ec2a21f25df33000 */
-  L(1.16855112459192484947855553716334015E-35), /* 3f8af10bf319e9f5270cf249eeffbe5c */
-  L(9.46044921875016761584725882821122521E-04), /* 3ff4f00000000009a992c46c16d71000 */
-  L(9.51660680007524262741115611071680436E-35), /* 3f8df9fd56e81f8edf133843910ee831 */
-  L(9.76562499999974118878133088548272636E-04), /* 3ff4fffffffffff1149edc46a6df6000 */
- L(-5.65271128977550656964071208289181661E-36), /* bf89e0e12689dd721aa2314c81eb6429 */
-  L(1.00708007812498671732140389760347830E-03), /* 3ff507fffffffffc2be94b90ed091000 */
- L(-1.43355074891483635310132767255371379E-34), /* bf8e7d1a688c247b16022daab1316d55 */
-  L(1.03759765625002637786192745235343007E-03), /* 3ff51000000000079a57b966bc158000 */
-  L(2.95905815240957629366749917020106928E-34), /* 3f8f895387fc73bb38f8a1b254c01a60 */
-  L(1.06811523437500860568717813047520763E-03), /* 3ff51800000000027afcd5b35f5e6000 */
- L(-5.98328495358586628195372356742878314E-35), /* bf8d3e204130013bf6328f1b70ff8c76 */
-  L(1.09863281250001439958487251556220070E-03), /* 3ff5200000000004268077c6c66bd000 */
-  L(2.41371837889426603334113000868144760E-34), /* 3f8f40d6948edf864054ccf151f9815e */
-  L(1.12915039062501298413451613770002366E-03), /* 3ff5280000000003be0f5dd8fe81b000 */
- L(-1.28815268997394164973472617519705703E-34), /* bf8e567321172ea089dce4bc8354ecb7 */
-  L(1.15966796874997272036339054191407232E-03), /* 3ff52ffffffffff8231e3bcfff1e8000 */
-  L(1.02996064554316248496839462594377804E-34), /* 3f8e11cf7d402789244f68e2d4f985b1 */
-  L(1.19018554687502744121802585360546796E-03), /* 3ff5380000000007e8cdf3f8f6c20000 */
- L(-1.43453217726255628994625761307322163E-34), /* bf8e7d5d3370d85a374f5f4802fc517a */
-  L(1.22070312499997743541996266398850614E-03), /* 3ff53ffffffffff97f0722561f454000 */
- L(-1.41086259180534339713692694428211646E-34), /* bf8e77125519ff76244dfec5fbd58402 */
-  L(1.25122070312501024092560690174507039E-03), /* 3ff5480000000002f3a59d8820691000 */
-  L(3.84102646020099293168698506729765213E-34), /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
-  L(1.28173828124997986521442660131425390E-03), /* 3ff54ffffffffffa3250a764439d9000 */
-  L(1.44644589735033114377952806106652650E-34), /* 3f8e808801b80dcf38323cdbfdca2549 */
-  L(1.31225585937501665804856968749058137E-03), /* 3ff5580000000004cd25a414c6d62000 */
-  L(1.67474574742200577294563576414361377E-34), /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
-  L(1.34277343749997290265837386401818888E-03), /* 3ff55ffffffffff83091b042cfd59000 */
- L(-1.55650565030381326742591837551559103E-34), /* bf8e9dca490d7fecfadba9625ffb91c5 */
-  L(1.37329101562497720784949380297774268E-03), /* 3ff567fffffffff96e3c7312f5ccf000 */
-  L(1.65279335325630026116581677369221748E-34), /* 3f8eb763496f5bd7404f2298b402074f */
-  L(1.40380859374999099958354100336136647E-03), /* 3ff56ffffffffffd67e2f09f2a381000 */
-  L(1.89919944388961890195706641264717076E-34), /* 3f8ef8e4d0ffdfeba982aa8829501389 */
-  L(1.43432617187497484122173130998160625E-03), /* 3ff577fffffffff8bf9c1d71af8a8000 */
-  L(2.57638517142061429772064578590009568E-34), /* 3f8f5675d82c1cc4ada70fd3a957b89a */
-  L(1.46484374999999929342158925502052945E-03), /* 3ff57fffffffffffcbdd1c7671b46000 */
-  L(1.76487201934184070490166772482073801E-34), /* 3f8ed52ef732458f6e4c5c07504f33cc */
-  L(1.49536132812502318451070466256902933E-03), /* 3ff5880000000006aeb7066c8ad43000 */
-  L(2.38068367275295804321313550609246656E-34), /* 3f8f3c7277ae6fc390ace5e06c0b025b */
-  L(1.52587890625000448053340248672949543E-03), /* 3ff59000000000014a9ae2104b3bc000 */
-  L(1.01174455568392813258454590274740959E-34), /* 3f8e0cf7c434762991bb38e12acee215 */
-  L(1.55639648437501113499837053523090913E-03), /* 3ff5980000000003359e2c204355e000 */
- L(-2.82398418808099749023517211651363693E-35), /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
-  L(1.58691406249999937955142588308171026E-03), /* 3ff59fffffffffffd2380ecbc87c2000 */
- L(-1.27361695572422741562701199136538047E-34), /* bf8e5295e0e206dfb0f0266c07225448 */
-  L(1.61743164062498000531048954475329309E-03), /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
- L(-1.22606548862580061633942923016222044E-34), /* bf8e45f1b17bb61039d21a351bb207b8 */
-  L(1.64794921875001835451453858682255576E-03), /* 3ff5b000000000054a52fa20f6565000 */
-  L(1.39132339594152335892305491425264583E-34), /* 3f8e71e0904c5449b414ee49b191cef2 */
-  L(1.67846679687501263995029340691547953E-03), /* 3ff5b80000000003a4a9e912c910b000 */
-  L(6.67245854693585315412242764786197029E-35), /* 3f8d62c4ccac1e7511a617d469468ccd */
-  L(1.70898437500002646861403514115369655E-03), /* 3ff5c00000000007a109fbaa7e015000 */
-  L(6.87367172354719289559624829652240928E-36), /* 3f8a245fa835eceb42bae8128d9336db */
-  L(1.73950195312501174308226096992992128E-03), /* 3ff5c80000000003627c8d637a005000 */
- L(-2.20824271875474985927385878948759352E-34), /* bf8f25869b1cbefb25e735992f232f57 */
-  L(1.77001953124997491747605207736194513E-03), /* 3ff5cffffffffff8c53c84b6883b8000 */
-  L(3.43123048533596296514343180408963705E-34), /* 3f8fc816b91d173ddadbbf09b1287906 */
-  L(1.80053710937497698911127570705069398E-03), /* 3ff5d7fffffffff95e1899f4a8430000 */
-  L(3.99231237340890073475077494556136100E-35), /* 3f8ca889148f62fa854da5674df41279 */
-  L(1.83105468750002267094899598630423914E-03), /* 3ff5e0000000000688d21e62ba674000 */
- L(-3.22274595655810623999007524769365273E-34), /* bf8fac605cb9ae01eb719675ced25560 */
-  L(1.86157226562500499224728040579690330E-03), /* 3ff5e80000000001705ce28a6d89e000 */
-  L(3.07094985075881613489605622068441083E-34), /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
-  L(1.89208984374998234666824993196980949E-03), /* 3ff5effffffffffae969fdc7cd8cf000 */
- L(-3.06287628722973914692165056776495733E-34), /* bf8f9720477d9cfa10e464df7f91020c */
-  L(1.92260742187501225343755557292811682E-03), /* 3ff5f800000000038824e428ed49a000 */
-  L(6.30049124729794620592961282769623368E-35), /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
-  L(1.95312499999998514894032051116231258E-03), /* 3ff5fffffffffffbb82f6a04f1ae0000 */
- L(-6.14610057507500948543216998736262902E-35), /* bf8d46c862d39255370e7974d48daa7e */
-  L(1.98364257812501222021119324146882732E-03), /* 3ff6040000000001c2d8a1aa5188d000 */
-  L(3.71942298418113774118754986159801984E-34), /* 3f8fee6567d9940495519ffe62cbc9a4 */
+  0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+  0.00000000000000000000000000000000000E+00L, /* 00000000000000000000000000000000 */
+  3.05175781249814607084128277672749162E-05L, /* 3feffffffffffeaa02abb9102f499000 */
+  1.00271855391179733380665816525889949E-36L, /* 3f8755351afa042ac3f58114824d4c10 */
+  6.10351562500179243748093427073421439E-05L, /* 3ff1000000000052a95de07a4c26d000 */
+  1.67231624299180373502350811501181670E-36L, /* 3f881c87a53691cae9d77f4e40d66616 */
+  9.15527343749970728685313252158399200E-05L, /* 3ff17ffffffffff28040cc2acde28000 */
+  2.43665747834893104318707597514407880E-36L, /* 3f889e9366c7c6c6a2ecb78dc9b0509e */
+  1.22070312500027751961838150070880064E-04L, /* 3ff200000000003ffddde6c153b53000 */
+ -1.73322146370624186623546452226755405E-35L, /* bf8b709d8d658ed5dbbe943de56ee84e */
+  1.52587890624995916105682628143179430E-04L, /* 3ff23ffffffffff6954b56e285d23000 */
+  1.23580432650945898349135528000443828E-35L, /* 3f8b06d396601dde16de7d7bc27346e6 */
+  1.83105468750008670314358488289621794E-04L, /* 3ff2800000000013fe0cdc8c823b7000 */
+  4.30446229148833293310207915930740796E-35L, /* 3f8cc9ba9bfe554a4f7f2fece291eb23 */
+  2.13623046875005741337455947623248132E-04L, /* 3ff2c0000000000d3d1662de21a3f000 */
+ -3.96110759869520786681660669615255057E-35L, /* bf8ca5379b04ff4a31aab0ceacc917e6 */
+  2.44140624999981493573336463433440506E-04L, /* 3ff2ffffffffffd553bbdf48e0534000 */
+ -1.39617373942387888957350179316792928E-35L, /* bf8b28eeedc286015802b63f96b8c5cd */
+  2.74658203124984920706309918754626834E-04L, /* 3ff31fffffffffee9d60c8439ec1d000 */
+ -3.16168080483901830349738314447356223E-36L, /* bf890cf74f81c77a611abc1243812444 */
+  3.05175781250008648918265055410966055E-04L, /* 3ff3400000000009f8b5c9a346636000 */
+  8.54421306185008998867856704677221443E-35L, /* 3f8dc649cd40922fc08adc6b6b20ead0 */
+  3.35693359374988945462612499316774515E-04L, /* 3ff35ffffffffff34146c540f15b2000 */
+  7.96443137431639500475160850431097078E-35L, /* 3f8da77638ed3148fc4d99d1c9e13446 */
+  3.66210937500027690542093987739604535E-04L, /* 3ff380000000001fecce34bea89c4000 */
+  2.14507323877752361258862577769090367E-35L, /* 3f8bc834e554d38894cf91957b0253d3 */
+  3.96728515625003928083564943615052121E-04L, /* 3ff3a00000000004875d9a4acf6ab000 */
+  4.88358523466632050664019922448605508E-35L, /* 3f8d03a7eaeef1a9f78c71a12c44dd28 */
+  4.27246093750017799227172345607351585E-04L, /* 3ff3c00000000014856794c3ee850000 */
+  6.66520494592631402182216588784828935E-35L, /* 3f8d6262118fcdb59b8f16108f5f1a6c */
+  4.57763671875002108342364320152138181E-04L, /* 3ff3e000000000026e45d855410b9000 */
+  7.21799615960261390920033272189522298E-35L, /* 3f8d7fc645cff8879462296af975c9fd */
+  4.88281249999999768797631616370963356E-04L, /* 3ff3ffffffffffffbbc2d7cc004df000 */
+ -5.30564629906905979452258114088325361E-35L, /* bf8d1a18b71929a30d67a217a27ae851 */
+  5.18798828124997339054881383202487041E-04L, /* 3ff40ffffffffffe775055eea5851000 */
+ -4.03682911253647925867848180522846377E-35L, /* bf8cad44f0f3e5199d8a589d9332acad */
+  5.49316406249980511907933706754958501E-04L, /* 3ff41ffffffffff4c410b29bb62fb000 */
+ -2.08166843948323917121806956728438051E-35L, /* bf8bbab8cf691403249fe5b699e25143 */
+  5.79833984374989593561576568548497165E-04L, /* 3ff42ffffffffffa0047df328d817000 */
+ -1.72745033420153042445343706432627539E-34L, /* bf8ecb3c2d7d3a9e6e960576be901fdf */
+  6.10351562500008540711511259540838154E-04L, /* 3ff4400000000004ec62f54f8c271000 */
+  7.41889382604319545724663095428976499E-35L, /* 3f8d8a74c002c81a47c93b8e05d15f8e */
+  6.40869140625020444702875407535884986E-04L, /* 3ff450000000000bc91b09718515d000 */
+ -4.47321009727305792048065440180490107E-35L, /* bf8cdbac5c8fe70822081d8993eb5cb6 */
+  6.71386718750007531635964622352684074E-04L, /* 3ff460000000000457792973db05c000 */
+  5.13698959677949336513874456684462092E-35L, /* 3f8d112114436949c5ef38d8049004ab */
+  7.01904296875006634673332887754430334E-04L, /* 3ff4700000000003d31adf2cb8b1d000 */
+ -8.25665755717729437292989870760751482E-35L, /* bf8db6ffcc8ef71f8e648e3a8b160f5a */
+  7.32421874999998244664170215504673504E-04L, /* 3ff47ffffffffffefcf5498bd5c8a000 */
+ -5.64005234937832153139057628112753364E-35L, /* bf8d2be06a1dfe90e7bf90fba7c12a98 */
+  7.62939453125017456345986752604096408E-04L, /* 3ff490000000000a101a1b093d4a8000 */
+ -1.11084094120417622468550608896588329E-34L, /* bf8e274feabd2d94f6694507a46accb1 */
+  7.93457031249987558617598988993908016E-04L, /* 3ff49ffffffffff8d3f9dcab74bbf000 */
+ -1.22966480225449015129079129940978828E-34L, /* bf8e46e6a65eef8fa9e42eddf3da305e */
+  8.23974609374997378723747633335135819E-04L, /* 3ff4affffffffffe7d2afbaa55b26000 */
+ -1.62270010016794279091906973366704963E-34L, /* bf8eaf633f057ebdb664a34566401c4e */
+  8.54492187500023938282350821569920958E-04L, /* 3ff4c0000000000dccaabce399e59000 */
+ -1.39076361712838158775374263169606160E-34L, /* bf8e71ba779364b3bbdba7841f2c4ca1 */
+  8.85009765624987932362186815286691297E-04L, /* 3ff4cffffffffff90b218886edc2a000 */
+  4.07328275060905585228261577392403980E-35L, /* 3f8cb1254dbb6ea4b8cfa5ed4cf28d24 */
+  9.15527343749975579461305518559161974E-04L, /* 3ff4dffffffffff1ec2a21f25df33000 */
+  1.16855112459192484947855553716334015E-35L, /* 3f8af10bf319e9f5270cf249eeffbe5c */
+  9.46044921875016761584725882821122521E-04L, /* 3ff4f00000000009a992c46c16d71000 */
+  9.51660680007524262741115611071680436E-35L, /* 3f8df9fd56e81f8edf133843910ee831 */
+  9.76562499999974118878133088548272636E-04L, /* 3ff4fffffffffff1149edc46a6df6000 */
+ -5.65271128977550656964071208289181661E-36L, /* bf89e0e12689dd721aa2314c81eb6429 */
+  1.00708007812498671732140389760347830E-03L, /* 3ff507fffffffffc2be94b90ed091000 */
+ -1.43355074891483635310132767255371379E-34L, /* bf8e7d1a688c247b16022daab1316d55 */
+  1.03759765625002637786192745235343007E-03L, /* 3ff51000000000079a57b966bc158000 */
+  2.95905815240957629366749917020106928E-34L, /* 3f8f895387fc73bb38f8a1b254c01a60 */
+  1.06811523437500860568717813047520763E-03L, /* 3ff51800000000027afcd5b35f5e6000 */
+ -5.98328495358586628195372356742878314E-35L, /* bf8d3e204130013bf6328f1b70ff8c76 */
+  1.09863281250001439958487251556220070E-03L, /* 3ff5200000000004268077c6c66bd000 */
+  2.41371837889426603334113000868144760E-34L, /* 3f8f40d6948edf864054ccf151f9815e */
+  1.12915039062501298413451613770002366E-03L, /* 3ff5280000000003be0f5dd8fe81b000 */
+ -1.28815268997394164973472617519705703E-34L, /* bf8e567321172ea089dce4bc8354ecb7 */
+  1.15966796874997272036339054191407232E-03L, /* 3ff52ffffffffff8231e3bcfff1e8000 */
+  1.02996064554316248496839462594377804E-34L, /* 3f8e11cf7d402789244f68e2d4f985b1 */
+  1.19018554687502744121802585360546796E-03L, /* 3ff5380000000007e8cdf3f8f6c20000 */
+ -1.43453217726255628994625761307322163E-34L, /* bf8e7d5d3370d85a374f5f4802fc517a */
+  1.22070312499997743541996266398850614E-03L, /* 3ff53ffffffffff97f0722561f454000 */
+ -1.41086259180534339713692694428211646E-34L, /* bf8e77125519ff76244dfec5fbd58402 */
+  1.25122070312501024092560690174507039E-03L, /* 3ff5480000000002f3a59d8820691000 */
+  3.84102646020099293168698506729765213E-34L, /* 3f8ffe8f5b86f9c3569c8f26e19b1f50 */
+  1.28173828124997986521442660131425390E-03L, /* 3ff54ffffffffffa3250a764439d9000 */
+  1.44644589735033114377952806106652650E-34L, /* 3f8e808801b80dcf38323cdbfdca2549 */
+  1.31225585937501665804856968749058137E-03L, /* 3ff5580000000004cd25a414c6d62000 */
+  1.67474574742200577294563576414361377E-34L, /* 3f8ebd394a151dbda4f81d5d83c0f1e9 */
+  1.34277343749997290265837386401818888E-03L, /* 3ff55ffffffffff83091b042cfd59000 */
+ -1.55650565030381326742591837551559103E-34L, /* bf8e9dca490d7fecfadba9625ffb91c5 */
+  1.37329101562497720784949380297774268E-03L, /* 3ff567fffffffff96e3c7312f5ccf000 */
+  1.65279335325630026116581677369221748E-34L, /* 3f8eb763496f5bd7404f2298b402074f */
+  1.40380859374999099958354100336136647E-03L, /* 3ff56ffffffffffd67e2f09f2a381000 */
+  1.89919944388961890195706641264717076E-34L, /* 3f8ef8e4d0ffdfeba982aa8829501389 */
+  1.43432617187497484122173130998160625E-03L, /* 3ff577fffffffff8bf9c1d71af8a8000 */
+  2.57638517142061429772064578590009568E-34L, /* 3f8f5675d82c1cc4ada70fd3a957b89a */
+  1.46484374999999929342158925502052945E-03L, /* 3ff57fffffffffffcbdd1c7671b46000 */
+  1.76487201934184070490166772482073801E-34L, /* 3f8ed52ef732458f6e4c5c07504f33cc */
+  1.49536132812502318451070466256902933E-03L, /* 3ff5880000000006aeb7066c8ad43000 */
+  2.38068367275295804321313550609246656E-34L, /* 3f8f3c7277ae6fc390ace5e06c0b025b */
+  1.52587890625000448053340248672949543E-03L, /* 3ff59000000000014a9ae2104b3bc000 */
+  1.01174455568392813258454590274740959E-34L, /* 3f8e0cf7c434762991bb38e12acee215 */
+  1.55639648437501113499837053523090913E-03L, /* 3ff5980000000003359e2c204355e000 */
+ -2.82398418808099749023517211651363693E-35L, /* bf8c2c4c2971d88caa95e15fb1ccb1a1 */
+  1.58691406249999937955142588308171026E-03L, /* 3ff59fffffffffffd2380ecbc87c2000 */
+ -1.27361695572422741562701199136538047E-34L, /* bf8e5295e0e206dfb0f0266c07225448 */
+  1.61743164062498000531048954475329309E-03L, /* 3ff5a7fffffffffa3ca6fe61ed94c000 */
+ -1.22606548862580061633942923016222044E-34L, /* bf8e45f1b17bb61039d21a351bb207b8 */
+  1.64794921875001835451453858682255576E-03L, /* 3ff5b000000000054a52fa20f6565000 */
+  1.39132339594152335892305491425264583E-34L, /* 3f8e71e0904c5449b414ee49b191cef2 */
+  1.67846679687501263995029340691547953E-03L, /* 3ff5b80000000003a4a9e912c910b000 */
+  6.67245854693585315412242764786197029E-35L, /* 3f8d62c4ccac1e7511a617d469468ccd */
+  1.70898437500002646861403514115369655E-03L, /* 3ff5c00000000007a109fbaa7e015000 */
+  6.87367172354719289559624829652240928E-36L, /* 3f8a245fa835eceb42bae8128d9336db */
+  1.73950195312501174308226096992992128E-03L, /* 3ff5c80000000003627c8d637a005000 */
+ -2.20824271875474985927385878948759352E-34L, /* bf8f25869b1cbefb25e735992f232f57 */
+  1.77001953124997491747605207736194513E-03L, /* 3ff5cffffffffff8c53c84b6883b8000 */
+  3.43123048533596296514343180408963705E-34L, /* 3f8fc816b91d173ddadbbf09b1287906 */
+  1.80053710937497698911127570705069398E-03L, /* 3ff5d7fffffffff95e1899f4a8430000 */
+  3.99231237340890073475077494556136100E-35L, /* 3f8ca889148f62fa854da5674df41279 */
+  1.83105468750002267094899598630423914E-03L, /* 3ff5e0000000000688d21e62ba674000 */
+ -3.22274595655810623999007524769365273E-34L, /* bf8fac605cb9ae01eb719675ced25560 */
+  1.86157226562500499224728040579690330E-03L, /* 3ff5e80000000001705ce28a6d89e000 */
+  3.07094985075881613489605622068441083E-34L, /* 3f8f98330225ec7e2c8f3c0d1c432b91 */
+  1.89208984374998234666824993196980949E-03L, /* 3ff5effffffffffae969fdc7cd8cf000 */
+ -3.06287628722973914692165056776495733E-34L, /* bf8f9720477d9cfa10e464df7f91020c */
+  1.92260742187501225343755557292811682E-03L, /* 3ff5f800000000038824e428ed49a000 */
+  6.30049124729794620592961282769623368E-35L, /* 3f8d4efdd7cd4336d88a6aa49e1e96bc */
+  1.95312499999998514894032051116231258E-03L, /* 3ff5fffffffffffbb82f6a04f1ae0000 */
+ -6.14610057507500948543216998736262902E-35L, /* bf8d46c862d39255370e7974d48daa7e */
+  1.98364257812501222021119324146882732E-03L, /* 3ff6040000000001c2d8a1aa5188d000 */
+  3.71942298418113774118754986159801984E-34L, /* 3f8fee6567d9940495519ffe62cbc9a4 */
 
-  L(7.06341639425619532977052017486130353E-01), /* 3ffe69a59c8245a9ac00000000000000 */
-  L(7.09106182437398424589503065362805501E-01), /* 3ffe6b0ff72deb89d000000000000000 */
-  L(7.11881545564596485142772053222870454E-01), /* 3ffe6c7bbce9a6d93000000000000000 */
-  L(7.14667771155948150507697391731198877E-01), /* 3ffe6de8ef213d71e000000000000000 */
-  L(7.17464901725936049503573599395167548E-01), /* 3ffe6f578f41e1a9e400000000000000 */
-  L(7.20272979955439790478166628417966422E-01), /* 3ffe70c79eba33c06c00000000000000 */
-  L(7.23092048692387218133958981525211129E-01), /* 3ffe72391efa434c7400000000000000 */
-  L(7.25922150952408251622927082280511968E-01), /* 3ffe73ac117390acd800000000000000 */
-  L(7.28763329919491220643124052003258839E-01), /* 3ffe752077990e79d000000000000000 */
-  L(7.31615628946641782803794740175362676E-01), /* 3ffe769652df22f7e000000000000000 */
-  L(7.34479091556544505525749855223693885E-01), /* 3ffe780da4bba98c4800000000000000 */
-  L(7.37353761442226890432394270646909717E-01), /* 3ffe79866ea5f432d400000000000000 */
-  L(7.40239682467726090031590047146892175E-01), /* 3ffe7b00b216ccf53000000000000000 */
-  L(7.43136898668758316688354170764796436E-01), /* 3ffe7c7c70887763c000000000000000 */
-  L(7.46045454253390638577059235103661194E-01), /* 3ffe7df9ab76b20fd000000000000000 */
-  L(7.48965393602715662213498148958024103E-01), /* 3ffe7f78645eb8076400000000000000 */
-  L(7.51896761271528629722027403659012634E-01), /* 3ffe80f89cbf42526400000000000000 */
-  L(7.54839601989007347171423134568613023E-01), /* 3ffe827a561889716000000000000000 */
-  L(7.57793960659394638668118204805068672E-01), /* 3ffe83fd91ec46ddc000000000000000 */
-  L(7.60759882362683631518152083117456641E-01), /* 3ffe858251bdb68b8c00000000000000 */
-  L(7.63737412355305483879774897104653064E-01), /* 3ffe87089711986c9400000000000000 */
-  L(7.66726596070820082262642358728044201E-01), /* 3ffe8890636e31f54400000000000000 */
-  L(7.69727479120609181517664865168626420E-01), /* 3ffe8a19b85b4fa2d800000000000000 */
-  L(7.72740107294572486917871856348938309E-01), /* 3ffe8ba4976246833800000000000000 */
-  L(7.75764526561826289752232810315035749E-01), /* 3ffe8d31020df5be4400000000000000 */
-  L(7.78800783071404878477039801509818062E-01), /* 3ffe8ebef9eac820b000000000000000 */
-  L(7.81848923152964780936002853195532225E-01), /* 3ffe904e8086b5a87800000000000000 */
-  L(7.84908993317491698871180005880887620E-01), /* 3ffe91df97714512d800000000000000 */
-  L(7.87981040258010162480317717381694820E-01), /* 3ffe9372403b8d6bcc00000000000000 */
-  L(7.91065110850296016042904057030682452E-01), /* 3ffe95067c78379f2800000000000000 */
-  L(7.94161252153591734614934694036492147E-01), /* 3ffe969c4dbb800b4800000000000000 */
-  L(7.97269511411324433014513601847284008E-01), /* 3ffe9833b59b38154400000000000000 */
-  L(8.00389936051826789142893403550260700E-01), /* 3ffe99ccb5aec7bec800000000000000 */
-  L(8.03522573689060742863077280162542593E-01), /* 3ffe9b674f8f2f3d7c00000000000000 */
-  L(8.06667472123343942680406826184480451E-01), /* 3ffe9d0384d70893f800000000000000 */
-  L(8.09824679342079301047618855591281317E-01), /* 3ffe9ea15722892c7800000000000000 */
-  L(8.12994243520486992160556383169023320E-01), /* 3ffea040c80f8374f000000000000000 */
-  L(8.16176213022339780422953481320291758E-01), /* 3ffea1e1d93d687d0000000000000000 */
-  L(8.19370636400700819157449927843117621E-01), /* 3ffea3848c4d49954c00000000000000 */
-  L(8.22577562398664585696650419777142815E-01), /* 3ffea528e2e1d9f09800000000000000 */
-  L(8.25797039950100647542896581398963463E-01), /* 3ffea6cede9f70467c00000000000000 */
-  L(8.29029118180400342863478613253391813E-01), /* 3ffea876812c0877bc00000000000000 */
-  L(8.32273846407226292054559735333896242E-01), /* 3ffeaa1fcc2f45343800000000000000 */
-  L(8.35531274141265073440720811959181447E-01), /* 3ffeabcac15271a2a400000000000000 */
-  L(8.38801451086982535754188461396552157E-01), /* 3ffead7762408309bc00000000000000 */
-  L(8.42084427143382358016410194068157580E-01), /* 3ffeaf25b0a61a7b4c00000000000000 */
-  L(8.45380252404767357221615498019673396E-01), /* 3ffeb0d5ae318680c400000000000000 */
-  L(8.48688977161503960155997106085123960E-01), /* 3ffeb2875c92c4c99400000000000000 */
-  L(8.52010651900789478530029441571969073E-01), /* 3ffeb43abd7b83db1c00000000000000 */
-  L(8.55345327307422548246407245642330963E-01), /* 3ffeb5efd29f24c26400000000000000 */
-  L(8.58693054264576483003423845730139874E-01), /* 3ffeb7a69db2bcc77800000000000000 */
-  L(8.62053883854575708767242758767679334E-01), /* 3ffeb95f206d17228000000000000000 */
-  L(8.65427867359675251357487013592617586E-01), /* 3ffebb195c86b6b29000000000000000 */
-  L(8.68815056262843166123843730019871145E-01), /* 3ffebcd553b9d7b62000000000000000 */
-  L(8.72215502248546159513864495238522068E-01), /* 3ffebe9307c271855000000000000000 */
-  L(8.75629257203538208242932228131394368E-01), /* 3ffec0527a5e384ddc00000000000000 */
-  L(8.79056373217652342599848225290770642E-01), /* 3ffec213ad4c9ed0d800000000000000 */
-  L(8.82496902584595399599010079327854328E-01), /* 3ffec3d6a24ed8221800000000000000 */
-  L(8.85950897802745995779361010136199184E-01), /* 3ffec59b5b27d9696800000000000000 */
-  L(8.89418411575955636383383762222365476E-01), /* 3ffec761d99c5ba58800000000000000 */
-  L(8.92899496814352794382685374330321793E-01), /* 3ffec92a1f72dd70d400000000000000 */
-  L(8.96394206635150403439382671422208659E-01), /* 3ffecaf42e73a4c7d800000000000000 */
-  L(8.99902594363456265202927397695020773E-01), /* 3ffeccc00868c0d18800000000000000 */
-  L(9.03424713533086704009278378180169966E-01), /* 3ffece8daf1e0ba94c00000000000000 */
-  L(9.06960617887383580004723171441582963E-01), /* 3ffed05d24612c2af000000000000000 */
-  L(9.10510361380034133338412516422977205E-01), /* 3ffed22e6a0197c02c00000000000000 */
-  L(9.14073998175894436579724811053893063E-01), /* 3ffed40181d094303400000000000000 */
-  L(9.17651582651815816982221463149471674E-01), /* 3ffed5d66da13970f400000000000000 */
-  L(9.21243169397474526149949269893113524E-01), /* 3ffed7ad2f48737a2000000000000000 */
-  L(9.24848813216204823639543519675498828E-01), /* 3ffed985c89d041a3000000000000000 */
-  L(9.28468569125835141431224428743007593E-01), /* 3ffedb603b7784cd1800000000000000 */
-  L(9.32102492359527579068867453315760940E-01), /* 3ffedd3c89b26894e000000000000000 */
-  L(9.35750638366620729469147477175283711E-01), /* 3ffedf1ab529fdd41c00000000000000 */
-  L(9.39413062813475779888605643463961314E-01), /* 3ffee0fabfbc702a3c00000000000000 */
-  L(9.43089821584325888048638830696290825E-01), /* 3ffee2dcab49ca51b400000000000000 */
-  L(9.46780970782128888929563004239753354E-01), /* 3ffee4c079b3f8000400000000000000 */
-  L(9.50486566729423443256052905780961737E-01), /* 3ffee6a62cdec7c7b000000000000000 */
-  L(9.54206665969188322362626308859034907E-01), /* 3ffee88dc6afecfbfc00000000000000 */
-  L(9.57941325265705301283958306157728657E-01), /* 3ffeea77490f0196b000000000000000 */
-  L(9.61690601605425299247542625380447134E-01), /* 3ffeec62b5e5881fb000000000000000 */
-  L(9.65454552197837823079851204965962097E-01), /* 3ffeee500f1eed967000000000000000 */
-  L(9.69233234476344074348475032820715569E-01), /* 3ffef03f56a88b5d7800000000000000 */
-  L(9.73026706099133165128733935489435680E-01), /* 3ffef2308e71a927a800000000000000 */
-  L(9.76835024950062025261843245971249416E-01), /* 3ffef423b86b7ee79000000000000000 */
-  L(9.80658249139538557015427500118676107E-01), /* 3ffef618d68936c09c00000000000000 */
-  L(9.84496437005408397968864164795377292E-01), /* 3ffef80feabfeefa4800000000000000 */
-  L(9.88349647113845042323276857132441364E-01), /* 3ffefa08f706bbf53800000000000000 */
-  L(9.92217938260243514925207364285597578E-01), /* 3ffefc03fd56aa225000000000000000 */
-  L(9.96101369470117486981664001177705359E-01), /* 3ffefe00ffaabffbbc00000000000000 */
+  7.06341639425619532977052017486130353E-01L, /* 3ffe69a59c8245a9ac00000000000000 */
+  7.09106182437398424589503065362805501E-01L, /* 3ffe6b0ff72deb89d000000000000000 */
+  7.11881545564596485142772053222870454E-01L, /* 3ffe6c7bbce9a6d93000000000000000 */
+  7.14667771155948150507697391731198877E-01L, /* 3ffe6de8ef213d71e000000000000000 */
+  7.17464901725936049503573599395167548E-01L, /* 3ffe6f578f41e1a9e400000000000000 */
+  7.20272979955439790478166628417966422E-01L, /* 3ffe70c79eba33c06c00000000000000 */
+  7.23092048692387218133958981525211129E-01L, /* 3ffe72391efa434c7400000000000000 */
+  7.25922150952408251622927082280511968E-01L, /* 3ffe73ac117390acd800000000000000 */
+  7.28763329919491220643124052003258839E-01L, /* 3ffe752077990e79d000000000000000 */
+  7.31615628946641782803794740175362676E-01L, /* 3ffe769652df22f7e000000000000000 */
+  7.34479091556544505525749855223693885E-01L, /* 3ffe780da4bba98c4800000000000000 */
+  7.37353761442226890432394270646909717E-01L, /* 3ffe79866ea5f432d400000000000000 */
+  7.40239682467726090031590047146892175E-01L, /* 3ffe7b00b216ccf53000000000000000 */
+  7.43136898668758316688354170764796436E-01L, /* 3ffe7c7c70887763c000000000000000 */
+  7.46045454253390638577059235103661194E-01L, /* 3ffe7df9ab76b20fd000000000000000 */
+  7.48965393602715662213498148958024103E-01L, /* 3ffe7f78645eb8076400000000000000 */
+  7.51896761271528629722027403659012634E-01L, /* 3ffe80f89cbf42526400000000000000 */
+  7.54839601989007347171423134568613023E-01L, /* 3ffe827a561889716000000000000000 */
+  7.57793960659394638668118204805068672E-01L, /* 3ffe83fd91ec46ddc000000000000000 */
+  7.60759882362683631518152083117456641E-01L, /* 3ffe858251bdb68b8c00000000000000 */
+  7.63737412355305483879774897104653064E-01L, /* 3ffe87089711986c9400000000000000 */
+  7.66726596070820082262642358728044201E-01L, /* 3ffe8890636e31f54400000000000000 */
+  7.69727479120609181517664865168626420E-01L, /* 3ffe8a19b85b4fa2d800000000000000 */
+  7.72740107294572486917871856348938309E-01L, /* 3ffe8ba4976246833800000000000000 */
+  7.75764526561826289752232810315035749E-01L, /* 3ffe8d31020df5be4400000000000000 */
+  7.78800783071404878477039801509818062E-01L, /* 3ffe8ebef9eac820b000000000000000 */
+  7.81848923152964780936002853195532225E-01L, /* 3ffe904e8086b5a87800000000000000 */
+  7.84908993317491698871180005880887620E-01L, /* 3ffe91df97714512d800000000000000 */
+  7.87981040258010162480317717381694820E-01L, /* 3ffe9372403b8d6bcc00000000000000 */
+  7.91065110850296016042904057030682452E-01L, /* 3ffe95067c78379f2800000000000000 */
+  7.94161252153591734614934694036492147E-01L, /* 3ffe969c4dbb800b4800000000000000 */
+  7.97269511411324433014513601847284008E-01L, /* 3ffe9833b59b38154400000000000000 */
+  8.00389936051826789142893403550260700E-01L, /* 3ffe99ccb5aec7bec800000000000000 */
+  8.03522573689060742863077280162542593E-01L, /* 3ffe9b674f8f2f3d7c00000000000000 */
+  8.06667472123343942680406826184480451E-01L, /* 3ffe9d0384d70893f800000000000000 */
+  8.09824679342079301047618855591281317E-01L, /* 3ffe9ea15722892c7800000000000000 */
+  8.12994243520486992160556383169023320E-01L, /* 3ffea040c80f8374f000000000000000 */
+  8.16176213022339780422953481320291758E-01L, /* 3ffea1e1d93d687d0000000000000000 */
+  8.19370636400700819157449927843117621E-01L, /* 3ffea3848c4d49954c00000000000000 */
+  8.22577562398664585696650419777142815E-01L, /* 3ffea528e2e1d9f09800000000000000 */
+  8.25797039950100647542896581398963463E-01L, /* 3ffea6cede9f70467c00000000000000 */
+  8.29029118180400342863478613253391813E-01L, /* 3ffea876812c0877bc00000000000000 */
+  8.32273846407226292054559735333896242E-01L, /* 3ffeaa1fcc2f45343800000000000000 */
+  8.35531274141265073440720811959181447E-01L, /* 3ffeabcac15271a2a400000000000000 */
+  8.38801451086982535754188461396552157E-01L, /* 3ffead7762408309bc00000000000000 */
+  8.42084427143382358016410194068157580E-01L, /* 3ffeaf25b0a61a7b4c00000000000000 */
+  8.45380252404767357221615498019673396E-01L, /* 3ffeb0d5ae318680c400000000000000 */
+  8.48688977161503960155997106085123960E-01L, /* 3ffeb2875c92c4c99400000000000000 */
+  8.52010651900789478530029441571969073E-01L, /* 3ffeb43abd7b83db1c00000000000000 */
+  8.55345327307422548246407245642330963E-01L, /* 3ffeb5efd29f24c26400000000000000 */
+  8.58693054264576483003423845730139874E-01L, /* 3ffeb7a69db2bcc77800000000000000 */
+  8.62053883854575708767242758767679334E-01L, /* 3ffeb95f206d17228000000000000000 */
+  8.65427867359675251357487013592617586E-01L, /* 3ffebb195c86b6b29000000000000000 */
+  8.68815056262843166123843730019871145E-01L, /* 3ffebcd553b9d7b62000000000000000 */
+  8.72215502248546159513864495238522068E-01L, /* 3ffebe9307c271855000000000000000 */
+  8.75629257203538208242932228131394368E-01L, /* 3ffec0527a5e384ddc00000000000000 */
+  8.79056373217652342599848225290770642E-01L, /* 3ffec213ad4c9ed0d800000000000000 */
+  8.82496902584595399599010079327854328E-01L, /* 3ffec3d6a24ed8221800000000000000 */
+  8.85950897802745995779361010136199184E-01L, /* 3ffec59b5b27d9696800000000000000 */
+  8.89418411575955636383383762222365476E-01L, /* 3ffec761d99c5ba58800000000000000 */
+  8.92899496814352794382685374330321793E-01L, /* 3ffec92a1f72dd70d400000000000000 */
+  8.96394206635150403439382671422208659E-01L, /* 3ffecaf42e73a4c7d800000000000000 */
+  8.99902594363456265202927397695020773E-01L, /* 3ffeccc00868c0d18800000000000000 */
+  9.03424713533086704009278378180169966E-01L, /* 3ffece8daf1e0ba94c00000000000000 */
+  9.06960617887383580004723171441582963E-01L, /* 3ffed05d24612c2af000000000000000 */
+  9.10510361380034133338412516422977205E-01L, /* 3ffed22e6a0197c02c00000000000000 */
+  9.14073998175894436579724811053893063E-01L, /* 3ffed40181d094303400000000000000 */
+  9.17651582651815816982221463149471674E-01L, /* 3ffed5d66da13970f400000000000000 */
+  9.21243169397474526149949269893113524E-01L, /* 3ffed7ad2f48737a2000000000000000 */
+  9.24848813216204823639543519675498828E-01L, /* 3ffed985c89d041a3000000000000000 */
+  9.28468569125835141431224428743007593E-01L, /* 3ffedb603b7784cd1800000000000000 */
+  9.32102492359527579068867453315760940E-01L, /* 3ffedd3c89b26894e000000000000000 */
+  9.35750638366620729469147477175283711E-01L, /* 3ffedf1ab529fdd41c00000000000000 */
+  9.39413062813475779888605643463961314E-01L, /* 3ffee0fabfbc702a3c00000000000000 */
+  9.43089821584325888048638830696290825E-01L, /* 3ffee2dcab49ca51b400000000000000 */
+  9.46780970782128888929563004239753354E-01L, /* 3ffee4c079b3f8000400000000000000 */
+  9.50486566729423443256052905780961737E-01L, /* 3ffee6a62cdec7c7b000000000000000 */
+  9.54206665969188322362626308859034907E-01L, /* 3ffee88dc6afecfbfc00000000000000 */
+  9.57941325265705301283958306157728657E-01L, /* 3ffeea77490f0196b000000000000000 */
+  9.61690601605425299247542625380447134E-01L, /* 3ffeec62b5e5881fb000000000000000 */
+  9.65454552197837823079851204965962097E-01L, /* 3ffeee500f1eed967000000000000000 */
+  9.69233234476344074348475032820715569E-01L, /* 3ffef03f56a88b5d7800000000000000 */
+  9.73026706099133165128733935489435680E-01L, /* 3ffef2308e71a927a800000000000000 */
+  9.76835024950062025261843245971249416E-01L, /* 3ffef423b86b7ee79000000000000000 */
+  9.80658249139538557015427500118676107E-01L, /* 3ffef618d68936c09c00000000000000 */
+  9.84496437005408397968864164795377292E-01L, /* 3ffef80feabfeefa4800000000000000 */
+  9.88349647113845042323276857132441364E-01L, /* 3ffefa08f706bbf53800000000000000 */
+  9.92217938260243514925207364285597578E-01L, /* 3ffefc03fd56aa225000000000000000 */
+  9.96101369470117486981664001177705359E-01L, /* 3ffefe00ffaabffbbc00000000000000 */
 #define T_EXPL_RES1 (T_EXPL_ARG2 + 2 + 2*65 + 89)
-  L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
-  L(1.00391388933834757590801700644078664E+00), /* 3fff0100802ab5577800000000000000 */
-  L(1.00784309720644799091004983893071767E+00), /* 3fff0202015600445c00000000000000 */
-  L(1.01178768355933151879000320150225889E+00), /* 3fff0304848362076c00000000000000 */
-  L(1.01574770858668572692806719715008512E+00), /* 3fff04080ab55de39000000000000000 */
-  L(1.01972323271377413034244341361045372E+00), /* 3fff050c94ef7a206c00000000000000 */
-  L(1.02371431660235789884438872832106426E+00), /* 3fff06122436410dd000000000000000 */
-  L(1.02772102115162167201845022646011785E+00), /* 3fff0718b98f42085000000000000000 */
-  L(1.03174340749910264936062276319717057E+00), /* 3fff08205601127ec800000000000000 */
-  L(1.03578153702162378824169763902318664E+00), /* 3fff0928fa934ef90800000000000000 */
-  L(1.03983547133622999947277776300325058E+00), /* 3fff0a32a84e9c1f5800000000000000 */
-  L(1.04390527230112850620713516036630608E+00), /* 3fff0b3d603ca7c32800000000000000 */
-  L(1.04799100201663270004459604933799710E+00), /* 3fff0c49236829e8bc00000000000000 */
-  L(1.05209272282610977189420964350574650E+00), /* 3fff0d55f2dce5d1e800000000000000 */
-  L(1.05621049731693195106174698594259098E+00), /* 3fff0e63cfa7ab09d000000000000000 */
-  L(1.06034438832143151909548350886325352E+00), /* 3fff0f72bad65671b800000000000000 */
-  L(1.06449445891785943185681162503897212E+00), /* 3fff1082b577d34ed800000000000000 */
-  L(1.06866077243134810492719566354935523E+00), /* 3fff1193c09c1c595c00000000000000 */
-  L(1.07284339243487741866189821848820429E+00), /* 3fff12a5dd543ccc4c00000000000000 */
-  L(1.07704238275024494209120007326419000E+00), /* 3fff13b90cb25176a400000000000000 */
-  L(1.08125780744903959851299646288680378E+00), /* 3fff14cd4fc989cd6400000000000000 */
-  L(1.08548973085361949442173568058933597E+00), /* 3fff15e2a7ae28fecc00000000000000 */
-  L(1.08973821753809324563988525369495619E+00), /* 3fff16f9157587069400000000000000 */
-  L(1.09400333232930546678574046381982043E+00), /* 3fff18109a3611c35000000000000000 */
-  L(1.09828514030782586896606289883493446E+00), /* 3fff192937074e0cd800000000000000 */
-  L(1.10258370680894224324930519287590869E+00), /* 3fff1a42ed01d8cbc800000000000000 */
-  L(1.10689909742365749645287564817408565E+00), /* 3fff1b5dbd3f68122400000000000000 */
-  L(1.11123137799969046168868658241990488E+00), /* 3fff1c79a8dacc350c00000000000000 */
-  L(1.11558061464248076122274255794764031E+00), /* 3fff1d96b0eff0e79400000000000000 */
-  L(1.11994687371619722204840741142106708E+00), /* 3fff1eb4d69bde569c00000000000000 */
-  L(1.12433022184475073235176978414529003E+00), /* 3fff1fd41afcba45e800000000000000 */
-  L(1.12873072591281087273529237791080959E+00), /* 3fff20f47f31c92e4800000000000000 */
-  L(1.13314845306682632219974493636982515E+00), /* 3fff2216045b6f5cd000000000000000 */
-  L(1.13758347071604959399593326452304609E+00), /* 3fff2338ab9b32134800000000000000 */
-  L(1.14203584653356560174586320499656722E+00), /* 3fff245c7613b8a9b000000000000000 */
-  L(1.14650564845732405583333957110880874E+00), /* 3fff258164e8cdb0d800000000000000 */
-  L(1.15099294469117646722011727433709893E+00), /* 3fff26a7793f60164400000000000000 */
-  L(1.15549780370591653744227755851170514E+00), /* 3fff27ceb43d84490400000000000000 */
-  L(1.16002029424032515603215642840950750E+00), /* 3fff28f7170a755fd800000000000000 */
-  L(1.16456048530221917269855680387991015E+00), /* 3fff2a20a2ce96406400000000000000 */
-  L(1.16911844616950438835445424956560601E+00), /* 3fff2b4b58b372c79400000000000000 */
-  L(1.17369424639123270948104504896036815E+00), /* 3fff2c7739e3c0f32c00000000000000 */
-  L(1.17828795578866324378353169777255971E+00), /* 3fff2da4478b620c7400000000000000 */
-  L(1.18289964445632783673900689791480545E+00), /* 3fff2ed282d763d42400000000000000 */
-  L(1.18752938276310060494722620205720887E+00), /* 3fff3001ecf601af7000000000000000 */
-  L(1.19217724135327157730657177125976887E+00), /* 3fff31328716a5d63c00000000000000 */
-  L(1.19684329114762477708211463323095813E+00), /* 3fff32645269ea829000000000000000 */
-  L(1.20152760334452030077656559114984702E+00), /* 3fff339750219b212c00000000000000 */
-  L(1.20623024942098072687102217059873510E+00), /* 3fff34cb8170b5835400000000000000 */
-  L(1.21095130113378179892436037334846333E+00), /* 3fff3600e78b6b11d000000000000000 */
-  L(1.21569083052054743854242246925423387E+00), /* 3fff373783a722012400000000000000 */
-  L(1.22044890990084875515009343871497549E+00), /* 3fff386f56fa7686e800000000000000 */
-  L(1.22522561187730755216662714701669756E+00), /* 3fff39a862bd3c106400000000000000 */
-  L(1.23002100933670455162882717559114099E+00), /* 3fff3ae2a8287e7a8000000000000000 */
-  L(1.23483517545109100499445276000187732E+00), /* 3fff3c1e2876834aa800000000000000 */
-  L(1.23966818367890557750499169742397498E+00), /* 3fff3d5ae4e2cae92c00000000000000 */
-  L(1.24452010776609517384017067342938390E+00), /* 3fff3e98deaa11dcbc00000000000000 */
-  L(1.24939102174724003813111039562500082E+00), /* 3fff3fd8170a52071800000000000000 */
-  L(1.25428099994668373895478907797951251E+00), /* 3fff41188f42c3e32000000000000000 */
-  L(1.25919011697966698459794088194030337E+00), /* 3fff425a4893dfc3f800000000000000 */
-  L(1.26411844775346637881341393949696794E+00), /* 3fff439d443f5f159000000000000000 */
-  L(1.26906606746853711786826579555054195E+00), /* 3fff44e183883d9e4800000000000000 */
-  L(1.27403305161966090564007458851847332E+00), /* 3fff462707b2bac20c00000000000000 */
-  L(1.27901947599709753244923149395617656E+00), /* 3fff476dd2045ac67800000000000000 */
-  L(1.28402541668774150540599521264084615E+00), /* 3fff48b5e3c3e8186800000000000000 */
-  L(1.28905095007628295311619126550795045E+00), /* 3fff49ff3e397492bc00000000000000 */
-  L(1.29409615284637330434591717676084954E+00), /* 3fff4b49e2ae5ac67400000000000000 */
-  L(1.29916110198179535206719492634874769E+00), /* 3fff4c95d26d3f440800000000000000 */
-  L(1.30424587476763775839572190307080746E+00), /* 3fff4de30ec211e60000000000000000 */
-  L(1.30935054879147461104338390214252286E+00), /* 3fff4f3198fa0f1cf800000000000000 */
-  L(1.31447520194454914310711046709911898E+00), /* 3fff50817263c13cd000000000000000 */
-  L(1.31961991242296217130558488861424848E+00), /* 3fff51d29c4f01cb3000000000000000 */
-  L(1.32478475872886558573071624778094701E+00), /* 3fff5325180cfacf7800000000000000 */
-  L(1.32996981967165983640200010995613411E+00), /* 3fff5478e6f02823d000000000000000 */
-  L(1.33517517436919680440254865061433520E+00), /* 3fff55ce0a4c58c7bc00000000000000 */
-  L(1.34040090224898678084031189428060316E+00), /* 3fff57248376b033d800000000000000 */
-  L(1.34564708304941055283521222918352578E+00), /* 3fff587c53c5a7af0400000000000000 */
-  L(1.35091379682093615244298234756570309E+00), /* 3fff59d57c910fa4e000000000000000 */
-  L(1.35620112392734021300455538039386738E+00), /* 3fff5b2fff3210fd9400000000000000 */
-  L(1.36150914504693443252136830778908916E+00), /* 3fff5c8bdd032e770800000000000000 */
-  L(1.36683794117379636690046140756749082E+00), /* 3fff5de9176045ff5400000000000000 */
-  L(1.37218759361900544124779344201670028E+00), /* 3fff5f47afa69210a800000000000000 */
-  L(1.37755818401188367960941150158760138E+00), /* 3fff60a7a734ab0e8800000000000000 */
-  L(1.38294979430124120867162673675920814E+00), /* 3fff6208ff6a88a46000000000000000 */
-  L(1.38836250675662681297595213436579797E+00), /* 3fff636bb9a983258400000000000000 */
-  L(1.39379640396958309755959248832368758E+00), /* 3fff64cfd75454ee7c00000000000000 */
-  L(1.39925156885490681313299887733592186E+00), /* 3fff663559cf1bc7c400000000000000 */
-  L(1.40472808465191417726103395580139477E+00), /* 3fff679c427f5a49f400000000000000 */
-  L(1.41022603492571069194738697660795879E+00), /* 3fff690492cbf9432c00000000000000 */
-  L(1.41574550356846662335641440222389065E+00), /* 3fff6a6e4c1d491e1800000000000000 */
+  1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+  1.00391388933834757590801700644078664E+00L, /* 3fff0100802ab5577800000000000000 */
+  1.00784309720644799091004983893071767E+00L, /* 3fff0202015600445c00000000000000 */
+  1.01178768355933151879000320150225889E+00L, /* 3fff0304848362076c00000000000000 */
+  1.01574770858668572692806719715008512E+00L, /* 3fff04080ab55de39000000000000000 */
+  1.01972323271377413034244341361045372E+00L, /* 3fff050c94ef7a206c00000000000000 */
+  1.02371431660235789884438872832106426E+00L, /* 3fff06122436410dd000000000000000 */
+  1.02772102115162167201845022646011785E+00L, /* 3fff0718b98f42085000000000000000 */
+  1.03174340749910264936062276319717057E+00L, /* 3fff08205601127ec800000000000000 */
+  1.03578153702162378824169763902318664E+00L, /* 3fff0928fa934ef90800000000000000 */
+  1.03983547133622999947277776300325058E+00L, /* 3fff0a32a84e9c1f5800000000000000 */
+  1.04390527230112850620713516036630608E+00L, /* 3fff0b3d603ca7c32800000000000000 */
+  1.04799100201663270004459604933799710E+00L, /* 3fff0c49236829e8bc00000000000000 */
+  1.05209272282610977189420964350574650E+00L, /* 3fff0d55f2dce5d1e800000000000000 */
+  1.05621049731693195106174698594259098E+00L, /* 3fff0e63cfa7ab09d000000000000000 */
+  1.06034438832143151909548350886325352E+00L, /* 3fff0f72bad65671b800000000000000 */
+  1.06449445891785943185681162503897212E+00L, /* 3fff1082b577d34ed800000000000000 */
+  1.06866077243134810492719566354935523E+00L, /* 3fff1193c09c1c595c00000000000000 */
+  1.07284339243487741866189821848820429E+00L, /* 3fff12a5dd543ccc4c00000000000000 */
+  1.07704238275024494209120007326419000E+00L, /* 3fff13b90cb25176a400000000000000 */
+  1.08125780744903959851299646288680378E+00L, /* 3fff14cd4fc989cd6400000000000000 */
+  1.08548973085361949442173568058933597E+00L, /* 3fff15e2a7ae28fecc00000000000000 */
+  1.08973821753809324563988525369495619E+00L, /* 3fff16f9157587069400000000000000 */
+  1.09400333232930546678574046381982043E+00L, /* 3fff18109a3611c35000000000000000 */
+  1.09828514030782586896606289883493446E+00L, /* 3fff192937074e0cd800000000000000 */
+  1.10258370680894224324930519287590869E+00L, /* 3fff1a42ed01d8cbc800000000000000 */
+  1.10689909742365749645287564817408565E+00L, /* 3fff1b5dbd3f68122400000000000000 */
+  1.11123137799969046168868658241990488E+00L, /* 3fff1c79a8dacc350c00000000000000 */
+  1.11558061464248076122274255794764031E+00L, /* 3fff1d96b0eff0e79400000000000000 */
+  1.11994687371619722204840741142106708E+00L, /* 3fff1eb4d69bde569c00000000000000 */
+  1.12433022184475073235176978414529003E+00L, /* 3fff1fd41afcba45e800000000000000 */
+  1.12873072591281087273529237791080959E+00L, /* 3fff20f47f31c92e4800000000000000 */
+  1.13314845306682632219974493636982515E+00L, /* 3fff2216045b6f5cd000000000000000 */
+  1.13758347071604959399593326452304609E+00L, /* 3fff2338ab9b32134800000000000000 */
+  1.14203584653356560174586320499656722E+00L, /* 3fff245c7613b8a9b000000000000000 */
+  1.14650564845732405583333957110880874E+00L, /* 3fff258164e8cdb0d800000000000000 */
+  1.15099294469117646722011727433709893E+00L, /* 3fff26a7793f60164400000000000000 */
+  1.15549780370591653744227755851170514E+00L, /* 3fff27ceb43d84490400000000000000 */
+  1.16002029424032515603215642840950750E+00L, /* 3fff28f7170a755fd800000000000000 */
+  1.16456048530221917269855680387991015E+00L, /* 3fff2a20a2ce96406400000000000000 */
+  1.16911844616950438835445424956560601E+00L, /* 3fff2b4b58b372c79400000000000000 */
+  1.17369424639123270948104504896036815E+00L, /* 3fff2c7739e3c0f32c00000000000000 */
+  1.17828795578866324378353169777255971E+00L, /* 3fff2da4478b620c7400000000000000 */
+  1.18289964445632783673900689791480545E+00L, /* 3fff2ed282d763d42400000000000000 */
+  1.18752938276310060494722620205720887E+00L, /* 3fff3001ecf601af7000000000000000 */
+  1.19217724135327157730657177125976887E+00L, /* 3fff31328716a5d63c00000000000000 */
+  1.19684329114762477708211463323095813E+00L, /* 3fff32645269ea829000000000000000 */
+  1.20152760334452030077656559114984702E+00L, /* 3fff339750219b212c00000000000000 */
+  1.20623024942098072687102217059873510E+00L, /* 3fff34cb8170b5835400000000000000 */
+  1.21095130113378179892436037334846333E+00L, /* 3fff3600e78b6b11d000000000000000 */
+  1.21569083052054743854242246925423387E+00L, /* 3fff373783a722012400000000000000 */
+  1.22044890990084875515009343871497549E+00L, /* 3fff386f56fa7686e800000000000000 */
+  1.22522561187730755216662714701669756E+00L, /* 3fff39a862bd3c106400000000000000 */
+  1.23002100933670455162882717559114099E+00L, /* 3fff3ae2a8287e7a8000000000000000 */
+  1.23483517545109100499445276000187732E+00L, /* 3fff3c1e2876834aa800000000000000 */
+  1.23966818367890557750499169742397498E+00L, /* 3fff3d5ae4e2cae92c00000000000000 */
+  1.24452010776609517384017067342938390E+00L, /* 3fff3e98deaa11dcbc00000000000000 */
+  1.24939102174724003813111039562500082E+00L, /* 3fff3fd8170a52071800000000000000 */
+  1.25428099994668373895478907797951251E+00L, /* 3fff41188f42c3e32000000000000000 */
+  1.25919011697966698459794088194030337E+00L, /* 3fff425a4893dfc3f800000000000000 */
+  1.26411844775346637881341393949696794E+00L, /* 3fff439d443f5f159000000000000000 */
+  1.26906606746853711786826579555054195E+00L, /* 3fff44e183883d9e4800000000000000 */
+  1.27403305161966090564007458851847332E+00L, /* 3fff462707b2bac20c00000000000000 */
+  1.27901947599709753244923149395617656E+00L, /* 3fff476dd2045ac67800000000000000 */
+  1.28402541668774150540599521264084615E+00L, /* 3fff48b5e3c3e8186800000000000000 */
+  1.28905095007628295311619126550795045E+00L, /* 3fff49ff3e397492bc00000000000000 */
+  1.29409615284637330434591717676084954E+00L, /* 3fff4b49e2ae5ac67400000000000000 */
+  1.29916110198179535206719492634874769E+00L, /* 3fff4c95d26d3f440800000000000000 */
+  1.30424587476763775839572190307080746E+00L, /* 3fff4de30ec211e60000000000000000 */
+  1.30935054879147461104338390214252286E+00L, /* 3fff4f3198fa0f1cf800000000000000 */
+  1.31447520194454914310711046709911898E+00L, /* 3fff50817263c13cd000000000000000 */
+  1.31961991242296217130558488861424848E+00L, /* 3fff51d29c4f01cb3000000000000000 */
+  1.32478475872886558573071624778094701E+00L, /* 3fff5325180cfacf7800000000000000 */
+  1.32996981967165983640200010995613411E+00L, /* 3fff5478e6f02823d000000000000000 */
+  1.33517517436919680440254865061433520E+00L, /* 3fff55ce0a4c58c7bc00000000000000 */
+  1.34040090224898678084031189428060316E+00L, /* 3fff57248376b033d800000000000000 */
+  1.34564708304941055283521222918352578E+00L, /* 3fff587c53c5a7af0400000000000000 */
+  1.35091379682093615244298234756570309E+00L, /* 3fff59d57c910fa4e000000000000000 */
+  1.35620112392734021300455538039386738E+00L, /* 3fff5b2fff3210fd9400000000000000 */
+  1.36150914504693443252136830778908916E+00L, /* 3fff5c8bdd032e770800000000000000 */
+  1.36683794117379636690046140756749082E+00L, /* 3fff5de9176045ff5400000000000000 */
+  1.37218759361900544124779344201670028E+00L, /* 3fff5f47afa69210a800000000000000 */
+  1.37755818401188367960941150158760138E+00L, /* 3fff60a7a734ab0e8800000000000000 */
+  1.38294979430124120867162673675920814E+00L, /* 3fff6208ff6a88a46000000000000000 */
+  1.38836250675662681297595213436579797E+00L, /* 3fff636bb9a983258400000000000000 */
+  1.39379640396958309755959248832368758E+00L, /* 3fff64cfd75454ee7c00000000000000 */
+  1.39925156885490681313299887733592186E+00L, /* 3fff663559cf1bc7c400000000000000 */
+  1.40472808465191417726103395580139477E+00L, /* 3fff679c427f5a49f400000000000000 */
+  1.41022603492571069194738697660795879E+00L, /* 3fff690492cbf9432c00000000000000 */
+  1.41574550356846662335641440222389065E+00L, /* 3fff6a6e4c1d491e1800000000000000 */
 
-  L(9.98018323540573404351050612604012713E-01), /* 3ffefefc41f8d4bdb000000000000000 */
-  L(9.98048781107475468932221929208026268E-01), /* 3ffeff003ff556aa8800000000000000 */
-  L(9.98079239603882895082165305211674422E-01), /* 3ffeff043df9d4986000000000000000 */
-  L(9.98109699029824021243584297735651489E-01), /* 3ffeff083c064e972c00000000000000 */
-  L(9.98140159385327269125909310787392315E-01), /* 3ffeff0c3a1ac4b6ec00000000000000 */
-  L(9.98170620670420977171843901487591211E-01), /* 3ffeff10383737079400000000000000 */
-  L(9.98201082885133511579667242585856002E-01), /* 3ffeff14365ba5991c00000000000000 */
-  L(9.98231546029493238547658506831794512E-01), /* 3ffeff183488107b7c00000000000000 */
-  L(9.98262010103528552029672482603928074E-01), /* 3ffeff1c32bc77beb000000000000000 */
-  L(9.98292475107267818223988342651864514E-01), /* 3ffeff2030f8db72b000000000000000 */
-  L(9.98322941040739375573309644096298143E-01), /* 3ffeff242f3d3ba77000000000000000 */
-  L(9.98353407903971645787066790944663808E-01), /* 3ffeff282d89986cf000000000000000 */
-  L(9.98383875696992967307963340317655820E-01), /* 3ffeff2c2bddf1d32400000000000000 */
-  L(9.98414344419831761845429696222709026E-01), /* 3ffeff302a3a47ea0c00000000000000 */
-  L(9.98444814072516340086593800151604228E-01), /* 3ffeff34289e9ac19800000000000000 */
-  L(9.98475284655075123740886056111776270E-01), /* 3ffeff38270aea69c800000000000000 */
-  L(9.98505756167536479006585636852832977E-01), /* 3ffeff3c257f36f29400000000000000 */
-  L(9.98536228609928799837547330753295682E-01), /* 3ffeff4023fb806bf800000000000000 */
-  L(9.98566701982280452432050310562772211E-01), /* 3ffeff44227fc6e5ec00000000000000 */
-  L(9.98597176284619802988373749030870385E-01), /* 3ffeff48210c0a706800000000000000 */
-  L(9.98627651516975245460372434536111541E-01), /* 3ffeff4c1fa04b1b6800000000000000 */
-  L(9.98658127679375173801901155457017012E-01), /* 3ffeff501e3c88f6e800000000000000 */
-  L(9.98688604771847954211239084543194622E-01), /* 3ffeff541ce0c412e000000000000000 */
-  L(9.98719082794421980642241010173165705E-01), /* 3ffeff581b8cfc7f4c00000000000000 */
-  L(9.98749561747125619293186105096538085E-01), /* 3ffeff5c1a41324c2400000000000000 */
-  L(9.98780041629987291873504773320746608E-01), /* 3ffeff6018fd65896800000000000000 */
-  L(9.98810522443035364581476187595399097E-01), /* 3ffeff6417c196471000000000000000 */
-  L(9.98841004186298203615379520670103375E-01), /* 3ffeff68168dc4951400000000000000 */
-  L(9.98871486859804230684645176552294288E-01), /* 3ffeff6c1561f0837400000000000000 */
-  L(9.98901970463581839743127943620493170E-01), /* 3ffeff70143e1a222c00000000000000 */
-  L(9.98932454997659369233531378995394334E-01), /* 3ffeff74132241813000000000000000 */
-  L(9.98962940462065268620861502313346136E-01), /* 3ffeff78120e66b08400000000000000 */
-  L(9.98993426856827904103397486323956400E-01), /* 3ffeff7c110289c02000000000000000 */
-  L(9.99023914181975669634994119405746460E-01), /* 3ffeff800ffeaac00000000000000000 */
-  L(9.99054402437536959169506189937237650E-01), /* 3ffeff840f02c9c02000000000000000 */
-  L(9.99084891623540138905212870668037795E-01), /* 3ffeff880e0ee6d07800000000000000 */
-  L(9.99115381740013658307120181234495249E-01), /* 3ffeff8c0d2302010c00000000000000 */
-  L(9.99145872786985911329082910015131347E-01), /* 3ffeff900c3f1b61d800000000000000 */
-  L(9.99176364764485236413804614130640402E-01), /* 3ffeff940b633302d000000000000000 */
-  L(9.99206857672540083026291313217370771E-01), /* 3ffeff980a8f48f3f800000000000000 */
-  L(9.99237351511178817364822180024930276E-01), /* 3ffeff9c09c35d454800000000000000 */
-  L(9.99267846280429861138827618560753763E-01), /* 3ffeffa008ff7006c000000000000000 */
-  L(9.99298341980321608302162417203362565E-01), /* 3ffeffa4084381485c00000000000000 */
-  L(9.99328838610882452808681364331278019E-01), /* 3ffeffa8078f911a1800000000000000 */
-  L(9.99359336172140816367814863951934967E-01), /* 3ffeffac06e39f8bf400000000000000 */
-  L(9.99389834664125092933417704443854745E-01), /* 3ffeffb0063facadec00000000000000 */
-  L(9.99420334086863676459344674185558688E-01), /* 3ffeffb405a3b88ffc00000000000000 */
-  L(9.99450834440384988655026177184481639E-01), /* 3ffeffb8050fc3422400000000000000 */
-  L(9.99481335724717395718741386190231424E-01), /* 3ffeffbc0483ccd45c00000000000000 */
-  L(9.99511837939889374871071936468069907E-01), /* 3ffeffc003ffd556ac00000000000000 */
-  L(9.99542341085929264554721385138691403E-01), /* 3ffeffc40383dcd90800000000000000 */
-  L(9.99572845162865514234695751838444266E-01), /* 3ffeffc8030fe36b7400000000000000 */
-  L(9.99603350170726517864849824945849832E-01), /* 3ffeffcc02a3e91dec00000000000000 */
-  L(9.99633856109540669399038392839429434E-01), /* 3ffeffd0023fee006c00000000000000 */
-  L(9.99664362979336418302267475155531429E-01), /* 3ffeffd401e3f222f800000000000000 */
-  L(9.99694870780142130772816244643763639E-01), /* 3ffeffd8018ff5958800000000000000 */
-  L(9.99725379511986284031266336569387931E-01), /* 3ffeffdc0143f8682400000000000000 */
-  L(9.99755889174897216520321308053098619E-01), /* 3ffeffe000fffaaac000000000000000 */
-  L(9.99786399768903377704987178731244057E-01), /* 3ffeffe400c3fc6d6000000000000000 */
-  L(9.99816911294033217050269968240172602E-01), /* 3ffeffe8008ffdc00800000000000000 */
-  L(9.99847423750315072998873233700578567E-01), /* 3ffeffec0063feb2ac00000000000000 */
-  L(9.99877937137777450526954226006637327E-01), /* 3ffefff0003fff555800000000000000 */
-  L(9.99908451456448688077216502279043198E-01), /* 3ffefff40023ffb80000000000000000 */
-  L(9.99938966706357262870241697783058044E-01), /* 3ffefff8000fffeaac00000000000000 */
-  L(9.99969482887531541104308985268289689E-01), /* 3ffefffc0003fffd5400000000000000 */
+  9.98018323540573404351050612604012713E-01L, /* 3ffefefc41f8d4bdb000000000000000 */
+  9.98048781107475468932221929208026268E-01L, /* 3ffeff003ff556aa8800000000000000 */
+  9.98079239603882895082165305211674422E-01L, /* 3ffeff043df9d4986000000000000000 */
+  9.98109699029824021243584297735651489E-01L, /* 3ffeff083c064e972c00000000000000 */
+  9.98140159385327269125909310787392315E-01L, /* 3ffeff0c3a1ac4b6ec00000000000000 */
+  9.98170620670420977171843901487591211E-01L, /* 3ffeff10383737079400000000000000 */
+  9.98201082885133511579667242585856002E-01L, /* 3ffeff14365ba5991c00000000000000 */
+  9.98231546029493238547658506831794512E-01L, /* 3ffeff183488107b7c00000000000000 */
+  9.98262010103528552029672482603928074E-01L, /* 3ffeff1c32bc77beb000000000000000 */
+  9.98292475107267818223988342651864514E-01L, /* 3ffeff2030f8db72b000000000000000 */
+  9.98322941040739375573309644096298143E-01L, /* 3ffeff242f3d3ba77000000000000000 */
+  9.98353407903971645787066790944663808E-01L, /* 3ffeff282d89986cf000000000000000 */
+  9.98383875696992967307963340317655820E-01L, /* 3ffeff2c2bddf1d32400000000000000 */
+  9.98414344419831761845429696222709026E-01L, /* 3ffeff302a3a47ea0c00000000000000 */
+  9.98444814072516340086593800151604228E-01L, /* 3ffeff34289e9ac19800000000000000 */
+  9.98475284655075123740886056111776270E-01L, /* 3ffeff38270aea69c800000000000000 */
+  9.98505756167536479006585636852832977E-01L, /* 3ffeff3c257f36f29400000000000000 */
+  9.98536228609928799837547330753295682E-01L, /* 3ffeff4023fb806bf800000000000000 */
+  9.98566701982280452432050310562772211E-01L, /* 3ffeff44227fc6e5ec00000000000000 */
+  9.98597176284619802988373749030870385E-01L, /* 3ffeff48210c0a706800000000000000 */
+  9.98627651516975245460372434536111541E-01L, /* 3ffeff4c1fa04b1b6800000000000000 */
+  9.98658127679375173801901155457017012E-01L, /* 3ffeff501e3c88f6e800000000000000 */
+  9.98688604771847954211239084543194622E-01L, /* 3ffeff541ce0c412e000000000000000 */
+  9.98719082794421980642241010173165705E-01L, /* 3ffeff581b8cfc7f4c00000000000000 */
+  9.98749561747125619293186105096538085E-01L, /* 3ffeff5c1a41324c2400000000000000 */
+  9.98780041629987291873504773320746608E-01L, /* 3ffeff6018fd65896800000000000000 */
+  9.98810522443035364581476187595399097E-01L, /* 3ffeff6417c196471000000000000000 */
+  9.98841004186298203615379520670103375E-01L, /* 3ffeff68168dc4951400000000000000 */
+  9.98871486859804230684645176552294288E-01L, /* 3ffeff6c1561f0837400000000000000 */
+  9.98901970463581839743127943620493170E-01L, /* 3ffeff70143e1a222c00000000000000 */
+  9.98932454997659369233531378995394334E-01L, /* 3ffeff74132241813000000000000000 */
+  9.98962940462065268620861502313346136E-01L, /* 3ffeff78120e66b08400000000000000 */
+  9.98993426856827904103397486323956400E-01L, /* 3ffeff7c110289c02000000000000000 */
+  9.99023914181975669634994119405746460E-01L, /* 3ffeff800ffeaac00000000000000000 */
+  9.99054402437536959169506189937237650E-01L, /* 3ffeff840f02c9c02000000000000000 */
+  9.99084891623540138905212870668037795E-01L, /* 3ffeff880e0ee6d07800000000000000 */
+  9.99115381740013658307120181234495249E-01L, /* 3ffeff8c0d2302010c00000000000000 */
+  9.99145872786985911329082910015131347E-01L, /* 3ffeff900c3f1b61d800000000000000 */
+  9.99176364764485236413804614130640402E-01L, /* 3ffeff940b633302d000000000000000 */
+  9.99206857672540083026291313217370771E-01L, /* 3ffeff980a8f48f3f800000000000000 */
+  9.99237351511178817364822180024930276E-01L, /* 3ffeff9c09c35d454800000000000000 */
+  9.99267846280429861138827618560753763E-01L, /* 3ffeffa008ff7006c000000000000000 */
+  9.99298341980321608302162417203362565E-01L, /* 3ffeffa4084381485c00000000000000 */
+  9.99328838610882452808681364331278019E-01L, /* 3ffeffa8078f911a1800000000000000 */
+  9.99359336172140816367814863951934967E-01L, /* 3ffeffac06e39f8bf400000000000000 */
+  9.99389834664125092933417704443854745E-01L, /* 3ffeffb0063facadec00000000000000 */
+  9.99420334086863676459344674185558688E-01L, /* 3ffeffb405a3b88ffc00000000000000 */
+  9.99450834440384988655026177184481639E-01L, /* 3ffeffb8050fc3422400000000000000 */
+  9.99481335724717395718741386190231424E-01L, /* 3ffeffbc0483ccd45c00000000000000 */
+  9.99511837939889374871071936468069907E-01L, /* 3ffeffc003ffd556ac00000000000000 */
+  9.99542341085929264554721385138691403E-01L, /* 3ffeffc40383dcd90800000000000000 */
+  9.99572845162865514234695751838444266E-01L, /* 3ffeffc8030fe36b7400000000000000 */
+  9.99603350170726517864849824945849832E-01L, /* 3ffeffcc02a3e91dec00000000000000 */
+  9.99633856109540669399038392839429434E-01L, /* 3ffeffd0023fee006c00000000000000 */
+  9.99664362979336418302267475155531429E-01L, /* 3ffeffd401e3f222f800000000000000 */
+  9.99694870780142130772816244643763639E-01L, /* 3ffeffd8018ff5958800000000000000 */
+  9.99725379511986284031266336569387931E-01L, /* 3ffeffdc0143f8682400000000000000 */
+  9.99755889174897216520321308053098619E-01L, /* 3ffeffe000fffaaac000000000000000 */
+  9.99786399768903377704987178731244057E-01L, /* 3ffeffe400c3fc6d6000000000000000 */
+  9.99816911294033217050269968240172602E-01L, /* 3ffeffe8008ffdc00800000000000000 */
+  9.99847423750315072998873233700578567E-01L, /* 3ffeffec0063feb2ac00000000000000 */
+  9.99877937137777450526954226006637327E-01L, /* 3ffefff0003fff555800000000000000 */
+  9.99908451456448688077216502279043198E-01L, /* 3ffefff40023ffb80000000000000000 */
+  9.99938966706357262870241697783058044E-01L, /* 3ffefff8000fffeaac00000000000000 */
+  9.99969482887531541104308985268289689E-01L, /* 3ffefffc0003fffd5400000000000000 */
 #define T_EXPL_RES2 (T_EXPL_RES1 + 1 + 89 + 65)
-  L(1.00000000000000000000000000000000000E+00), /* 3fff0000000000000000000000000000 */
-  L(1.00003051804379100575559391472779680E+00), /* 3fff0002000200015400000000000000 */
-  L(1.00006103701893306334724798034585547E+00), /* 3fff00040008000aac00000000000000 */
-  L(1.00009155692545448346209013834595680E+00), /* 3fff0006001200240000000000000000 */
-  L(1.00012207776338379883185325525118969E+00), /* 3fff0008002000555800000000000000 */
-  L(1.00015259953274932014366527255333494E+00), /* 3fff000a003200a6ac00000000000000 */
-  L(1.00018312223357958012925905677548144E+00), /* 3fff000c004801200400000000000000 */
-  L(1.00021364586590294498691378066723701E+00), /* 3fff000e006201c95c00000000000000 */
-  L(1.00024417042974783642605984823603649E+00), /* 3fff0010008002aab400000000000000 */
-  L(1.00027469592514273166727889474714175E+00), /* 3fff001200a203cc1000000000000000 */
-  L(1.00030522235211605242000132420798764E+00), /* 3fff001400c805357000000000000000 */
-  L(1.00033574971069616488250630936818197E+00), /* 3fff001600f206eed000000000000000 */
-  L(1.00036627800091160178652671675081365E+00), /* 3fff0018012009003800000000000000 */
-  L(1.00039680722279067381919048784766346E+00), /* 3fff001a01520b71a000000000000000 */
-  L(1.00042733737636191371223048918182030E+00), /* 3fff001c01880e4b1000000000000000 */
-  L(1.00045786846165368766392589350289200E+00), /* 3fff001e01c211948400000000000000 */
-  L(1.00048840047869447289485833607614040E+00), /* 3fff0020020015560000000000000000 */
-  L(1.00051893342751269111445822090900037E+00), /* 3fff0022024219978400000000000000 */
-  L(1.00054946730813676403215595200890675E+00), /* 3fff002402881e611000000000000000 */
-  L(1.00058000212059516886853316464112140E+00), /* 3fff002602d223baa800000000000000 */
-  L(1.00061053786491632733302026281307917E+00), /* 3fff0028032029ac4c00000000000000 */
-  L(1.00064107454112866113504765053221490E+00), /* 3fff002a0372303dfc00000000000000 */
-  L(1.00067161214926059198404573180596344E+00), /* 3fff002c03c83777b800000000000000 */
-  L(1.00070215068934059710059614189958666E+00), /* 3fff002e04223f618400000000000000 */
-  L(1.00073269016139709819412928482051939E+00), /* 3fff0030048048036000000000000000 */
-  L(1.00076323056545857248522679583402351E+00), /* 3fff003204e251655000000000000000 */
-  L(1.00079377190155338617216784768970683E+00), /* 3fff003405485b8f5000000000000000 */
-  L(1.00082431416971007198668530691065826E+00), /* 3fff003605b266896800000000000000 */
-  L(1.00085485736995705163820957750431262E+00), /* 3fff00380620725b9800000000000000 */
-  L(1.00088540150232269132501983222027775E+00), /* 3fff003a06927f0ddc00000000000000 */
-  L(1.00091594656683552377884893758164253E+00), /* 3fff003c07088ca83c00000000000000 */
-  L(1.00094649256352402622027852885366883E+00), /* 3fff003e07829b32bc00000000000000 */
-  L(1.00097703949241650933643654752813745E+00), /* 3fff00400800aab55400000000000000 */
-  L(1.00100758735354156137020709138596430E+00), /* 3fff00420882bb381000000000000000 */
-  L(1.00103813614692760403102056443458423E+00), /* 3fff00440908ccc2f000000000000000 */
-  L(1.00106868587260300351715613942360505E+00), /* 3fff00460992df5df000000000000000 */
-  L(1.00109923653059629256034668287611566E+00), /* 3fff00480a20f3111800000000000000 */
-  L(1.00112978812093589287002259879955091E+00), /* 3fff004a0ab307e46800000000000000 */
-  L(1.00116034064365022615561429120134562E+00), /* 3fff004c0b491ddfe000000000000000 */
-  L(1.00119089409876788066000585786241572E+00), /* 3fff004e0be3350b8c00000000000000 */
-  L(1.00122144848631711155917400901671499E+00), /* 3fff00500c814d6f6000000000000000 */
-  L(1.00125200380632656260715407370298635E+00), /* 3fff00520d2367136c00000000000000 */
-  L(1.00128256005882454449107399341301061E+00), /* 3fff00540dc981ffa800000000000000 */
-  L(1.00131311724383964545381786592770368E+00), /* 3fff00560e739e3c2000000000000000 */
-  L(1.00134367536140017618251363273884635E+00), /* 3fff00580f21bbd0cc00000000000000 */
-  L(1.00137423441153472492004539162735455E+00), /* 3fff005a0fd3dac5b800000000000000 */
-  L(1.00140479439427171337584354660066310E+00), /* 3fff005c1089fb22e400000000000000 */
-  L(1.00143535530963956325933850166620687E+00), /* 3fff005e11441cf05000000000000000 */
-  L(1.00146591715766680730226312334707472E+00), /* 3fff0060120240360400000000000000 */
-  L(1.00149647993838186721404781565070152E+00), /* 3fff006212c464fc0000000000000000 */
-  L(1.00152704365181316470412298258452211E+00), /* 3fff0064138a8b4a4400000000000000 */
-  L(1.00155760829798923250422149067162536E+00), /* 3fff00661454b328d800000000000000 */
-  L(1.00158817387693849232377374391944613E+00), /* 3fff00681522dc9fbc00000000000000 */
-  L(1.00161874038868942138336137759324629E+00), /* 3fff006a15f507b6f400000000000000 */
-  L(1.00164930783327055241471725821611471E+00), /* 3fff006c16cb34768800000000000000 */
-  L(1.00167987621071025161612055853765924E+00), /* 3fff006e17a562e67400000000000000 */
-  L(1.00171044552103705171930414508096874E+00), /* 3fff00701883930ec000000000000000 */
-  L(1.00174101576427937443369842185347807E+00), /* 3fff00721965c4f76c00000000000000 */
-  L(1.00177158694046569697988502412044909E+00), /* 3fff00741a4bf8a87c00000000000000 */
-  L(1.00180215904962455208959681840497069E+00), /* 3fff00761b362e29f800000000000000 */
-  L(1.00183273209178441698341543997230474E+00), /* 3fff00781c246583e400000000000000 */
-  L(1.00186330606697365785962006157205906E+00), /* 3fff007a1d169ebe3c00000000000000 */
-  L(1.00189388097522080744994354972732253E+00), /* 3fff007c1e0cd9e10800000000000000 */
-  L(1.00192445681655439848611877096118405E+00), /* 3fff007e1f0716f45000000000000000 */
-  L(1.00195503359100279716642489802325144E+00), /* 3fff0080200556001000000000000000 */
-  L(1.00198561129859459173374602869444061E+00), /* 3fff00822107970c5400000000000000 */
+  1.00000000000000000000000000000000000E+00L, /* 3fff0000000000000000000000000000 */
+  1.00003051804379100575559391472779680E+00L, /* 3fff0002000200015400000000000000 */
+  1.00006103701893306334724798034585547E+00L, /* 3fff00040008000aac00000000000000 */
+  1.00009155692545448346209013834595680E+00L, /* 3fff0006001200240000000000000000 */
+  1.00012207776338379883185325525118969E+00L, /* 3fff0008002000555800000000000000 */
+  1.00015259953274932014366527255333494E+00L, /* 3fff000a003200a6ac00000000000000 */
+  1.00018312223357958012925905677548144E+00L, /* 3fff000c004801200400000000000000 */
+  1.00021364586590294498691378066723701E+00L, /* 3fff000e006201c95c00000000000000 */
+  1.00024417042974783642605984823603649E+00L, /* 3fff0010008002aab400000000000000 */
+  1.00027469592514273166727889474714175E+00L, /* 3fff001200a203cc1000000000000000 */
+  1.00030522235211605242000132420798764E+00L, /* 3fff001400c805357000000000000000 */
+  1.00033574971069616488250630936818197E+00L, /* 3fff001600f206eed000000000000000 */
+  1.00036627800091160178652671675081365E+00L, /* 3fff0018012009003800000000000000 */
+  1.00039680722279067381919048784766346E+00L, /* 3fff001a01520b71a000000000000000 */
+  1.00042733737636191371223048918182030E+00L, /* 3fff001c01880e4b1000000000000000 */
+  1.00045786846165368766392589350289200E+00L, /* 3fff001e01c211948400000000000000 */
+  1.00048840047869447289485833607614040E+00L, /* 3fff0020020015560000000000000000 */
+  1.00051893342751269111445822090900037E+00L, /* 3fff0022024219978400000000000000 */
+  1.00054946730813676403215595200890675E+00L, /* 3fff002402881e611000000000000000 */
+  1.00058000212059516886853316464112140E+00L, /* 3fff002602d223baa800000000000000 */
+  1.00061053786491632733302026281307917E+00L, /* 3fff0028032029ac4c00000000000000 */
+  1.00064107454112866113504765053221490E+00L, /* 3fff002a0372303dfc00000000000000 */
+  1.00067161214926059198404573180596344E+00L, /* 3fff002c03c83777b800000000000000 */
+  1.00070215068934059710059614189958666E+00L, /* 3fff002e04223f618400000000000000 */
+  1.00073269016139709819412928482051939E+00L, /* 3fff0030048048036000000000000000 */
+  1.00076323056545857248522679583402351E+00L, /* 3fff003204e251655000000000000000 */
+  1.00079377190155338617216784768970683E+00L, /* 3fff003405485b8f5000000000000000 */
+  1.00082431416971007198668530691065826E+00L, /* 3fff003605b266896800000000000000 */
+  1.00085485736995705163820957750431262E+00L, /* 3fff00380620725b9800000000000000 */
+  1.00088540150232269132501983222027775E+00L, /* 3fff003a06927f0ddc00000000000000 */
+  1.00091594656683552377884893758164253E+00L, /* 3fff003c07088ca83c00000000000000 */
+  1.00094649256352402622027852885366883E+00L, /* 3fff003e07829b32bc00000000000000 */
+  1.00097703949241650933643654752813745E+00L, /* 3fff00400800aab55400000000000000 */
+  1.00100758735354156137020709138596430E+00L, /* 3fff00420882bb381000000000000000 */
+  1.00103813614692760403102056443458423E+00L, /* 3fff00440908ccc2f000000000000000 */
+  1.00106868587260300351715613942360505E+00L, /* 3fff00460992df5df000000000000000 */
+  1.00109923653059629256034668287611566E+00L, /* 3fff00480a20f3111800000000000000 */
+  1.00112978812093589287002259879955091E+00L, /* 3fff004a0ab307e46800000000000000 */
+  1.00116034064365022615561429120134562E+00L, /* 3fff004c0b491ddfe000000000000000 */
+  1.00119089409876788066000585786241572E+00L, /* 3fff004e0be3350b8c00000000000000 */
+  1.00122144848631711155917400901671499E+00L, /* 3fff00500c814d6f6000000000000000 */
+  1.00125200380632656260715407370298635E+00L, /* 3fff00520d2367136c00000000000000 */
+  1.00128256005882454449107399341301061E+00L, /* 3fff00540dc981ffa800000000000000 */
+  1.00131311724383964545381786592770368E+00L, /* 3fff00560e739e3c2000000000000000 */
+  1.00134367536140017618251363273884635E+00L, /* 3fff00580f21bbd0cc00000000000000 */
+  1.00137423441153472492004539162735455E+00L, /* 3fff005a0fd3dac5b800000000000000 */
+  1.00140479439427171337584354660066310E+00L, /* 3fff005c1089fb22e400000000000000 */
+  1.00143535530963956325933850166620687E+00L, /* 3fff005e11441cf05000000000000000 */
+  1.00146591715766680730226312334707472E+00L, /* 3fff0060120240360400000000000000 */
+  1.00149647993838186721404781565070152E+00L, /* 3fff006212c464fc0000000000000000 */
+  1.00152704365181316470412298258452211E+00L, /* 3fff0064138a8b4a4400000000000000 */
+  1.00155760829798923250422149067162536E+00L, /* 3fff00661454b328d800000000000000 */
+  1.00158817387693849232377374391944613E+00L, /* 3fff00681522dc9fbc00000000000000 */
+  1.00161874038868942138336137759324629E+00L, /* 3fff006a15f507b6f400000000000000 */
+  1.00164930783327055241471725821611471E+00L, /* 3fff006c16cb34768800000000000000 */
+  1.00167987621071025161612055853765924E+00L, /* 3fff006e17a562e67400000000000000 */
+  1.00171044552103705171930414508096874E+00L, /* 3fff00701883930ec000000000000000 */
+  1.00174101576427937443369842185347807E+00L, /* 3fff00721965c4f76c00000000000000 */
+  1.00177158694046569697988502412044909E+00L, /* 3fff00741a4bf8a87c00000000000000 */
+  1.00180215904962455208959681840497069E+00L, /* 3fff00761b362e29f800000000000000 */
+  1.00183273209178441698341543997230474E+00L, /* 3fff00781c246583e400000000000000 */
+  1.00186330606697365785962006157205906E+00L, /* 3fff007a1d169ebe3c00000000000000 */
+  1.00189388097522080744994354972732253E+00L, /* 3fff007c1e0cd9e10800000000000000 */
+  1.00192445681655439848611877096118405E+00L, /* 3fff007e1f0716f45000000000000000 */
+  1.00195503359100279716642489802325144E+00L, /* 3fff0080200556001000000000000000 */
+  1.00198561129859459173374602869444061E+00L, /* 3fff00822107970c5400000000000000 */
 };
-- 
2.14.1


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)
---
 ChangeLog                                 | 7 +++++++
 sysdeps/ieee754/ldbl-128/e_lgammal_r.c    | 6 +-----
 sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c | 6 +-----
 3 files changed, 9 insertions(+), 10 deletions(-)

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);
-- 
2.14.1


From 5ebb81e29243ff286bd46dea62fab46a40dfd6c3 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Tue, 10 Oct 2017 11:50:41 +0200
Subject: [PATCH 59/90] nss_files: Refactor gethostbyname3 multi case into
 separate function

This is in preparation of further cleanup work.

(cherry picked from commit 8ed70de2faceb4bd7b35bbdc2b7e8c83d9a297ba)
---
 ChangeLog                   |   6 +
 nss/nss_files/files-hosts.c | 395 ++++++++++++++++++++++----------------------
 2 files changed, 208 insertions(+), 193 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 846601bc21..54347f5485 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-10  Florian Weimer  <fweimer@redhat.com>
+
+	* nss/nss_files/files-hosts.c (gethostbyname3_multi): New
+	function.
+	(_nss_files_gethostbyname3_r): Call it.
+
 2017-09-21  Gabriel F. T. Gomes  <gabriel@inconstante.eti.br>
 
 	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r):
diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
index bccb6a5780..867c10c2ef 100644
--- a/nss/nss_files/files-hosts.c
+++ b/nss/nss_files/files-hosts.c
@@ -115,6 +115,206 @@ DB_LOOKUP (hostbyaddr, ,,,
 	   }, const void *addr, socklen_t len, int af)
 #undef EXTRA_ARGS_VALUE
 
+static enum nss_status
+gethostbyname3_multi (FILE * stream, const char *name, int af,
+		      struct hostent *result, char *buffer, size_t buflen,
+		      int *errnop, int *herrnop, int flags)
+{
+  /* We have to get all host entries from the file.  */
+  size_t tmp_buflen = MIN (buflen, 4096);
+  char tmp_buffer_stack[tmp_buflen]
+    __attribute__ ((__aligned__ (__alignof__ (struct hostent_data))));
+  char *tmp_buffer = tmp_buffer_stack;
+  struct hostent tmp_result_buf;
+  int naddrs = 1;
+  int naliases = 0;
+  char *bufferend;
+  bool tmp_buffer_malloced = false;
+  enum nss_status status;
+
+  while (result->h_aliases[naliases] != NULL)
+    ++naliases;
+
+  bufferend = (char *) &result->h_aliases[naliases + 1];
+
+ again:
+  while ((status = internal_getent (stream, &tmp_result_buf, tmp_buffer,
+				    tmp_buflen, errnop, herrnop, af,
+				    flags))
+	 == NSS_STATUS_SUCCESS)
+    {
+      int matches = 1;
+      struct hostent *old_result = result;
+      result = &tmp_result_buf;
+      /* The following piece is a bit clumsy but we want to use the
+	 `LOOKUP_NAME_CASE' value.  The optimizer should do its
+	 job.  */
+      do
+	{
+	  LOOKUP_NAME_CASE (h_name, h_aliases)
+	    result = old_result;
+	}
+      while ((matches = 0));
+
+      if (matches)
+	{
+	  /* We could be very clever and try to recycle a few bytes
+	     in the buffer instead of generating new arrays.  But
+	     we are not doing this here since it's more work than
+	     it's worth.  Simply let the user provide a bit bigger
+	     buffer.  */
+	  char **new_h_addr_list;
+	  char **new_h_aliases;
+	  int newaliases = 0;
+	  size_t newstrlen = 0;
+	  int cnt;
+
+	  /* Count the new aliases and the length of the strings.  */
+	  while (tmp_result_buf.h_aliases[newaliases] != NULL)
+	    {
+	      char *cp = tmp_result_buf.h_aliases[newaliases];
+	      ++newaliases;
+	      newstrlen += strlen (cp) + 1;
+	    }
+	  /* If the real name is different add it also to the
+	     aliases.  This means that there is a duplication
+	     in the alias list but this is really the user's
+	     problem.  */
+	  if (strcmp (old_result->h_name,
+		      tmp_result_buf.h_name) != 0)
+	    {
+	      ++newaliases;
+	      newstrlen += strlen (tmp_result_buf.h_name) + 1;
+	    }
+
+	  /* Make sure bufferend is aligned.  */
+	  assert ((bufferend - (char *) 0) % sizeof (char *) == 0);
+
+	  /* Now we can check whether the buffer is large enough.
+	     16 is the maximal size of the IP address.  */
+	  if (bufferend + 16 + (naddrs + 2) * sizeof (char *)
+	      + roundup (newstrlen, sizeof (char *))
+	      + (naliases + newaliases + 1) * sizeof (char *)
+	      >= buffer + buflen)
+	    {
+	      *errnop = ERANGE;
+	      *herrnop = NETDB_INTERNAL;
+	      status = NSS_STATUS_TRYAGAIN;
+	      goto out;
+	    }
+
+	  new_h_addr_list =
+	    (char **) (bufferend
+		       + roundup (newstrlen, sizeof (char *))
+		       + 16);
+	  new_h_aliases =
+	    (char **) ((char *) new_h_addr_list
+		       + (naddrs + 2) * sizeof (char *));
+
+	  /* Copy the old data in the new arrays.  */
+	  for (cnt = 0; cnt < naddrs; ++cnt)
+	    new_h_addr_list[cnt] = old_result->h_addr_list[cnt];
+
+	  for (cnt = 0; cnt < naliases; ++cnt)
+	    new_h_aliases[cnt] = old_result->h_aliases[cnt];
+
+	  /* Store the new strings.  */
+	  cnt = 0;
+	  while (tmp_result_buf.h_aliases[cnt] != NULL)
+	    {
+	      new_h_aliases[naliases++] = bufferend;
+	      bufferend = (__stpcpy (bufferend,
+				     tmp_result_buf.h_aliases[cnt])
+			   + 1);
+	      ++cnt;
+	    }
+
+	  if (cnt < newaliases)
+	    {
+	      new_h_aliases[naliases++] = bufferend;
+	      bufferend = __stpcpy (bufferend,
+				    tmp_result_buf.h_name) + 1;
+	    }
+
+	  /* Final NULL pointer.  */
+	  new_h_aliases[naliases] = NULL;
+
+	  /* Round up the buffer end address.  */
+	  bufferend += (sizeof (char *)
+			- ((bufferend - (char *) 0)
+			   % sizeof (char *))) % sizeof (char *);
+
+	  /* Now the new address.  */
+	  new_h_addr_list[naddrs++] =
+	    memcpy (bufferend, tmp_result_buf.h_addr,
+		    tmp_result_buf.h_length);
+
+	  /* Also here a final NULL pointer.  */
+	  new_h_addr_list[naddrs] = NULL;
+
+	  /* Store the new array pointers.  */
+	  old_result->h_aliases = new_h_aliases;
+	  old_result->h_addr_list = new_h_addr_list;
+
+	  /* Compute the new buffer end.  */
+	  bufferend = (char *) &new_h_aliases[naliases + 1];
+	  assert (bufferend <= buffer + buflen);
+
+	  result = old_result;
+	}
+    }
+
+  if (status == NSS_STATUS_TRYAGAIN)
+    {
+      size_t newsize = 2 * tmp_buflen;
+      if (tmp_buffer_malloced)
+	{
+	  char *newp = realloc (tmp_buffer, newsize);
+	  if (newp != NULL)
+	    {
+	      assert ((((uintptr_t) newp)
+		       & (__alignof__ (struct hostent_data) - 1))
+		      == 0);
+	      tmp_buffer = newp;
+	      tmp_buflen = newsize;
+	      goto again;
+	    }
+	}
+      else if (!__libc_use_alloca (buflen + newsize))
+	{
+	  tmp_buffer = malloc (newsize);
+	  if (tmp_buffer != NULL)
+	    {
+	      assert ((((uintptr_t) tmp_buffer)
+		       & (__alignof__ (struct hostent_data) - 1))
+		      == 0);
+	      tmp_buffer_malloced = true;
+	      tmp_buflen = newsize;
+	      goto again;
+	    }
+	}
+      else
+	{
+	  tmp_buffer
+	    = extend_alloca (tmp_buffer, tmp_buflen,
+			     newsize
+			     + __alignof__ (struct hostent_data));
+	  tmp_buffer = (char *) (((uintptr_t) tmp_buffer
+				  + __alignof__ (struct hostent_data)
+				  - 1)
+				 & ~(__alignof__ (struct hostent_data)
+				     - 1));
+	  goto again;
+	}
+    }
+  else
+    status = NSS_STATUS_SUCCESS;
+ out:
+  if (tmp_buffer_malloced)
+    free (tmp_buffer);
+  return status;
+}
+
 enum nss_status
 _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
 			     char *buffer, size_t buflen, int *errnop,
@@ -143,199 +343,8 @@ _nss_files_gethostbyname3_r (const char *name, int af, struct hostent *result,
 
       if (status == NSS_STATUS_SUCCESS
 	  && _res_hconf.flags & HCONF_FLAG_MULTI)
-	{
-	  /* We have to get all host entries from the file.  */
-	  size_t tmp_buflen = MIN (buflen, 4096);
-	  char tmp_buffer_stack[tmp_buflen]
-	    __attribute__ ((__aligned__ (__alignof__ (struct hostent_data))));
-	  char *tmp_buffer = tmp_buffer_stack;
-	  struct hostent tmp_result_buf;
-	  int naddrs = 1;
-	  int naliases = 0;
-	  char *bufferend;
-	  bool tmp_buffer_malloced = false;
-
-	  while (result->h_aliases[naliases] != NULL)
-	    ++naliases;
-
-	  bufferend = (char *) &result->h_aliases[naliases + 1];
-
-	again:
-	  while ((status = internal_getent (stream, &tmp_result_buf, tmp_buffer,
-					    tmp_buflen, errnop, herrnop, af,
-					    flags))
-		 == NSS_STATUS_SUCCESS)
-	    {
-	      int matches = 1;
-	      struct hostent *old_result = result;
-	      result = &tmp_result_buf;
-	      /* The following piece is a bit clumsy but we want to use the
-		 `LOOKUP_NAME_CASE' value.  The optimizer should do its
-		 job.  */
-	      do
-		{
-		  LOOKUP_NAME_CASE (h_name, h_aliases)
-		  result = old_result;
-		}
-	      while ((matches = 0));
-
-	      if (matches)
-		{
-		  /* We could be very clever and try to recycle a few bytes
-		     in the buffer instead of generating new arrays.  But
-		     we are not doing this here since it's more work than
-		     it's worth.  Simply let the user provide a bit bigger
-		     buffer.  */
-		  char **new_h_addr_list;
-		  char **new_h_aliases;
-		  int newaliases = 0;
-		  size_t newstrlen = 0;
-		  int cnt;
-
-		  /* Count the new aliases and the length of the strings.  */
-		  while (tmp_result_buf.h_aliases[newaliases] != NULL)
-		    {
-		      char *cp = tmp_result_buf.h_aliases[newaliases];
-		      ++newaliases;
-		      newstrlen += strlen (cp) + 1;
-		    }
-		  /* If the real name is different add it also to the
-		     aliases.  This means that there is a duplication
-		     in the alias list but this is really the user's
-		     problem.  */
-		  if (strcmp (old_result->h_name,
-			      tmp_result_buf.h_name) != 0)
-		    {
-		      ++newaliases;
-		      newstrlen += strlen (tmp_result_buf.h_name) + 1;
-		    }
-
-		  /* Make sure bufferend is aligned.  */
-		  assert ((bufferend - (char *) 0) % sizeof (char *) == 0);
-
-		  /* Now we can check whether the buffer is large enough.
-		     16 is the maximal size of the IP address.  */
-		  if (bufferend + 16 + (naddrs + 2) * sizeof (char *)
-		      + roundup (newstrlen, sizeof (char *))
-		      + (naliases + newaliases + 1) * sizeof (char *)
-		      >= buffer + buflen)
-		    {
-		      *errnop = ERANGE;
-		      *herrnop = NETDB_INTERNAL;
-		      status = NSS_STATUS_TRYAGAIN;
-		      goto out;
-		    }
-
-		  new_h_addr_list =
-		    (char **) (bufferend
-			       + roundup (newstrlen, sizeof (char *))
-			       + 16);
-		  new_h_aliases =
-		    (char **) ((char *) new_h_addr_list
-			       + (naddrs + 2) * sizeof (char *));
-
-		  /* Copy the old data in the new arrays.  */
-		  for (cnt = 0; cnt < naddrs; ++cnt)
-		    new_h_addr_list[cnt] = old_result->h_addr_list[cnt];
-
-		  for (cnt = 0; cnt < naliases; ++cnt)
-		    new_h_aliases[cnt] = old_result->h_aliases[cnt];
-
-		  /* Store the new strings.  */
-		  cnt = 0;
-		  while (tmp_result_buf.h_aliases[cnt] != NULL)
-		    {
-		      new_h_aliases[naliases++] = bufferend;
-		      bufferend = (__stpcpy (bufferend,
-					     tmp_result_buf.h_aliases[cnt])
-				   + 1);
-		      ++cnt;
-		    }
-
-		  if (cnt < newaliases)
-		    {
-		      new_h_aliases[naliases++] = bufferend;
-		      bufferend = __stpcpy (bufferend,
-					    tmp_result_buf.h_name) + 1;
-		    }
-
-		  /* Final NULL pointer.  */
-		  new_h_aliases[naliases] = NULL;
-
-		  /* Round up the buffer end address.  */
-		  bufferend += (sizeof (char *)
-				- ((bufferend - (char *) 0)
-				   % sizeof (char *))) % sizeof (char *);
-
-		  /* Now the new address.  */
-		  new_h_addr_list[naddrs++] =
-		    memcpy (bufferend, tmp_result_buf.h_addr,
-			    tmp_result_buf.h_length);
-
-		  /* Also here a final NULL pointer.  */
-		  new_h_addr_list[naddrs] = NULL;
-
-		  /* Store the new array pointers.  */
-		  old_result->h_aliases = new_h_aliases;
-		  old_result->h_addr_list = new_h_addr_list;
-
-		  /* Compute the new buffer end.  */
-		  bufferend = (char *) &new_h_aliases[naliases + 1];
-		  assert (bufferend <= buffer + buflen);
-
-		  result = old_result;
-		}
-	    }
-
-	  if (status == NSS_STATUS_TRYAGAIN)
-	    {
-	      size_t newsize = 2 * tmp_buflen;
-	      if (tmp_buffer_malloced)
-		{
-		  char *newp = realloc (tmp_buffer, newsize);
-		  if (newp != NULL)
-		    {
-		      assert ((((uintptr_t) newp)
-			       & (__alignof__ (struct hostent_data) - 1))
-			      == 0);
-		      tmp_buffer = newp;
-		      tmp_buflen = newsize;
-		      goto again;
-		    }
-		}
-	      else if (!__libc_use_alloca (buflen + newsize))
-		{
-		  tmp_buffer = malloc (newsize);
-		  if (tmp_buffer != NULL)
-		    {
-		      assert ((((uintptr_t) tmp_buffer)
-			       & (__alignof__ (struct hostent_data) - 1))
-			      == 0);
-		      tmp_buffer_malloced = true;
-		      tmp_buflen = newsize;
-		      goto again;
-		    }
-		}
-	      else
-		{
-		  tmp_buffer
-		    = extend_alloca (tmp_buffer, tmp_buflen,
-				     newsize
-				     + __alignof__ (struct hostent_data));
-		  tmp_buffer = (char *) (((uintptr_t) tmp_buffer
-					  + __alignof__ (struct hostent_data)
-					  - 1)
-					 & ~(__alignof__ (struct hostent_data)
-					     - 1));
-		  goto again;
-		}
-	    }
-	  else
-	    status = NSS_STATUS_SUCCESS;
-	out:
-	  if (tmp_buffer_malloced)
-	    free (tmp_buffer);
-	}
+	status = gethostbyname3_multi
+	  (stream, name, af, result, buffer, buflen, errnop, herrnop, flags);
 
       internal_endent (&stream);
     }
-- 
2.14.1


From 13728f56f0cdfff536fe6673eae6881a3483a6a2 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 11 Oct 2017 07:01:34 +0200
Subject: [PATCH 60/90] nss_files: Use struct scratch_buffer for gethostbyname
 [BZ #18023]

(cherry picked from commit 78e806fd8cd8c918d3bbe1bcdf9091ab365e4a69)
---
 ChangeLog                   |   6 +
 nss/nss_files/files-hosts.c | 294 +++++++++++++++++++++-----------------------
 2 files changed, 144 insertions(+), 156 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 54347f5485..40867db75a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-11  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #18023]
+	* nss/nss_files/files-hosts.c (gethostbyname3_multi): Use struct
+	scratch_buffer.  Eliminate gotos.
+
 2017-10-10  Florian Weimer  <fweimer@redhat.com>
 
 	* nss/nss_files/files-hosts.c (gethostbyname3_multi): New
diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
index 867c10c2ef..763fa39a47 100644
--- a/nss/nss_files/files-hosts.c
+++ b/nss/nss_files/files-hosts.c
@@ -22,6 +22,7 @@
 #include <arpa/nameser.h>
 #include <netdb.h>
 #include <resolv/resolv-internal.h>
+#include <scratch_buffer.h>
 
 
 /* Get implementation for some internal functions.  */
@@ -121,15 +122,12 @@ gethostbyname3_multi (FILE * stream, const char *name, int af,
 		      int *errnop, int *herrnop, int flags)
 {
   /* We have to get all host entries from the file.  */
-  size_t tmp_buflen = MIN (buflen, 4096);
-  char tmp_buffer_stack[tmp_buflen]
-    __attribute__ ((__aligned__ (__alignof__ (struct hostent_data))));
-  char *tmp_buffer = tmp_buffer_stack;
+  struct scratch_buffer tmp_buffer;
+  scratch_buffer_init (&tmp_buffer);
   struct hostent tmp_result_buf;
   int naddrs = 1;
   int naliases = 0;
   char *bufferend;
-  bool tmp_buffer_malloced = false;
   enum nss_status status;
 
   while (result->h_aliases[naliases] != NULL)
@@ -137,181 +135,165 @@ gethostbyname3_multi (FILE * stream, const char *name, int af,
 
   bufferend = (char *) &result->h_aliases[naliases + 1];
 
- again:
-  while ((status = internal_getent (stream, &tmp_result_buf, tmp_buffer,
-				    tmp_buflen, errnop, herrnop, af,
-				    flags))
-	 == NSS_STATUS_SUCCESS)
+  while (true)
     {
-      int matches = 1;
-      struct hostent *old_result = result;
-      result = &tmp_result_buf;
-      /* The following piece is a bit clumsy but we want to use the
-	 `LOOKUP_NAME_CASE' value.  The optimizer should do its
-	 job.  */
-      do
+      status = internal_getent (stream, &tmp_result_buf, tmp_buffer.data,
+				tmp_buffer.length, errnop, herrnop, af,
+				flags);
+      /* Enlarge the buffer if necessary.  */
+      if (status == NSS_STATUS_TRYAGAIN && *herrnop == NETDB_INTERNAL
+	  && *errnop == ERANGE)
 	{
-	  LOOKUP_NAME_CASE (h_name, h_aliases)
-	    result = old_result;
+	  if (!scratch_buffer_grow (&tmp_buffer))
+	    {
+	      *errnop = ENOMEM;
+	      /* *herrnop and status already have the right value.  */
+	      break;
+	    }
+	  /* Loop around and retry with a larger buffer.  */
 	}
-      while ((matches = 0));
-
-      if (matches)
+      else if (status == NSS_STATUS_SUCCESS)
 	{
-	  /* We could be very clever and try to recycle a few bytes
-	     in the buffer instead of generating new arrays.  But
-	     we are not doing this here since it's more work than
-	     it's worth.  Simply let the user provide a bit bigger
-	     buffer.  */
-	  char **new_h_addr_list;
-	  char **new_h_aliases;
-	  int newaliases = 0;
-	  size_t newstrlen = 0;
-	  int cnt;
-
-	  /* Count the new aliases and the length of the strings.  */
-	  while (tmp_result_buf.h_aliases[newaliases] != NULL)
+	  /* A line was read.  Check that it matches the search
+	     criteria.  */
+
+	  int matches = 1;
+	  struct hostent *old_result = result;
+	  result = &tmp_result_buf;
+	  /* The following piece is a bit clumsy but we want to use
+	     the `LOOKUP_NAME_CASE' value.  The optimizer should do
+	     its job.  */
+	  do
 	    {
-	      char *cp = tmp_result_buf.h_aliases[newaliases];
-	      ++newaliases;
-	      newstrlen += strlen (cp) + 1;
+	      LOOKUP_NAME_CASE (h_name, h_aliases)
+		result = old_result;
 	    }
-	  /* If the real name is different add it also to the
-	     aliases.  This means that there is a duplication
-	     in the alias list but this is really the user's
-	     problem.  */
-	  if (strcmp (old_result->h_name,
-		      tmp_result_buf.h_name) != 0)
+	  while ((matches = 0));
+
+	  if (matches)
 	    {
-	      ++newaliases;
-	      newstrlen += strlen (tmp_result_buf.h_name) + 1;
-	    }
+	      /* We could be very clever and try to recycle a few bytes
+		 in the buffer instead of generating new arrays.  But
+		 we are not doing this here since it's more work than
+		 it's worth.  Simply let the user provide a bit bigger
+		 buffer.  */
+	      char **new_h_addr_list;
+	      char **new_h_aliases;
+	      int newaliases = 0;
+	      size_t newstrlen = 0;
+	      int cnt;
+
+	      /* Count the new aliases and the length of the strings.  */
+	      while (tmp_result_buf.h_aliases[newaliases] != NULL)
+		{
+		  char *cp = tmp_result_buf.h_aliases[newaliases];
+		  ++newaliases;
+		  newstrlen += strlen (cp) + 1;
+		}
+	      /* If the real name is different add it also to the
+		 aliases.  This means that there is a duplication
+		 in the alias list but this is really the user's
+		 problem.  */
+	      if (strcmp (old_result->h_name,
+			  tmp_result_buf.h_name) != 0)
+		{
+		  ++newaliases;
+		  newstrlen += strlen (tmp_result_buf.h_name) + 1;
+		}
 
-	  /* Make sure bufferend is aligned.  */
-	  assert ((bufferend - (char *) 0) % sizeof (char *) == 0);
+	      /* Make sure bufferend is aligned.  */
+	      assert ((bufferend - (char *) 0) % sizeof (char *) == 0);
 
-	  /* Now we can check whether the buffer is large enough.
-	     16 is the maximal size of the IP address.  */
-	  if (bufferend + 16 + (naddrs + 2) * sizeof (char *)
-	      + roundup (newstrlen, sizeof (char *))
-	      + (naliases + newaliases + 1) * sizeof (char *)
-	      >= buffer + buflen)
-	    {
-	      *errnop = ERANGE;
-	      *herrnop = NETDB_INTERNAL;
-	      status = NSS_STATUS_TRYAGAIN;
-	      goto out;
-	    }
+	      /* Now we can check whether the buffer is large enough.
+		 16 is the maximal size of the IP address.  */
+	      if (bufferend + 16 + (naddrs + 2) * sizeof (char *)
+		  + roundup (newstrlen, sizeof (char *))
+		  + (naliases + newaliases + 1) * sizeof (char *)
+		  >= buffer + buflen)
+		{
+		  *errnop = ERANGE;
+		  *herrnop = NETDB_INTERNAL;
+		  status = NSS_STATUS_TRYAGAIN;
+		  break;
+		}
 
-	  new_h_addr_list =
-	    (char **) (bufferend
-		       + roundup (newstrlen, sizeof (char *))
-		       + 16);
-	  new_h_aliases =
-	    (char **) ((char *) new_h_addr_list
-		       + (naddrs + 2) * sizeof (char *));
+	      new_h_addr_list =
+		(char **) (bufferend
+			   + roundup (newstrlen, sizeof (char *))
+			   + 16);
+	      new_h_aliases =
+		(char **) ((char *) new_h_addr_list
+			   + (naddrs + 2) * sizeof (char *));
 
-	  /* Copy the old data in the new arrays.  */
-	  for (cnt = 0; cnt < naddrs; ++cnt)
-	    new_h_addr_list[cnt] = old_result->h_addr_list[cnt];
+	      /* Copy the old data in the new arrays.  */
+	      for (cnt = 0; cnt < naddrs; ++cnt)
+		new_h_addr_list[cnt] = old_result->h_addr_list[cnt];
 
-	  for (cnt = 0; cnt < naliases; ++cnt)
-	    new_h_aliases[cnt] = old_result->h_aliases[cnt];
+	      for (cnt = 0; cnt < naliases; ++cnt)
+		new_h_aliases[cnt] = old_result->h_aliases[cnt];
 
-	  /* Store the new strings.  */
-	  cnt = 0;
-	  while (tmp_result_buf.h_aliases[cnt] != NULL)
-	    {
-	      new_h_aliases[naliases++] = bufferend;
-	      bufferend = (__stpcpy (bufferend,
-				     tmp_result_buf.h_aliases[cnt])
-			   + 1);
-	      ++cnt;
-	    }
+	      /* Store the new strings.  */
+	      cnt = 0;
+	      while (tmp_result_buf.h_aliases[cnt] != NULL)
+		{
+		  new_h_aliases[naliases++] = bufferend;
+		  bufferend = (__stpcpy (bufferend,
+					 tmp_result_buf.h_aliases[cnt])
+			       + 1);
+		  ++cnt;
+		}
 
-	  if (cnt < newaliases)
-	    {
-	      new_h_aliases[naliases++] = bufferend;
-	      bufferend = __stpcpy (bufferend,
-				    tmp_result_buf.h_name) + 1;
-	    }
+	      if (cnt < newaliases)
+		{
+		  new_h_aliases[naliases++] = bufferend;
+		  bufferend = __stpcpy (bufferend,
+					tmp_result_buf.h_name) + 1;
+		}
 
-	  /* Final NULL pointer.  */
-	  new_h_aliases[naliases] = NULL;
+	      /* Final NULL pointer.  */
+	      new_h_aliases[naliases] = NULL;
 
-	  /* Round up the buffer end address.  */
-	  bufferend += (sizeof (char *)
-			- ((bufferend - (char *) 0)
-			   % sizeof (char *))) % sizeof (char *);
+	      /* Round up the buffer end address.  */
+	      bufferend += (sizeof (char *)
+			    - ((bufferend - (char *) 0)
+			       % sizeof (char *))) % sizeof (char *);
 
-	  /* Now the new address.  */
-	  new_h_addr_list[naddrs++] =
-	    memcpy (bufferend, tmp_result_buf.h_addr,
-		    tmp_result_buf.h_length);
+	      /* Now the new address.  */
+	      new_h_addr_list[naddrs++] =
+		memcpy (bufferend, tmp_result_buf.h_addr,
+			tmp_result_buf.h_length);
 
-	  /* Also here a final NULL pointer.  */
-	  new_h_addr_list[naddrs] = NULL;
+	      /* Also here a final NULL pointer.  */
+	      new_h_addr_list[naddrs] = NULL;
 
-	  /* Store the new array pointers.  */
-	  old_result->h_aliases = new_h_aliases;
-	  old_result->h_addr_list = new_h_addr_list;
+	      /* Store the new array pointers.  */
+	      old_result->h_aliases = new_h_aliases;
+	      old_result->h_addr_list = new_h_addr_list;
 
-	  /* Compute the new buffer end.  */
-	  bufferend = (char *) &new_h_aliases[naliases + 1];
-	  assert (bufferend <= buffer + buflen);
+	      /* Compute the new buffer end.  */
+	      bufferend = (char *) &new_h_aliases[naliases + 1];
+	      assert (bufferend <= buffer + buflen);
 
-	  result = old_result;
-	}
-    }
+	      result = old_result;
+	    } /* If match was found.  */
 
-  if (status == NSS_STATUS_TRYAGAIN)
-    {
-      size_t newsize = 2 * tmp_buflen;
-      if (tmp_buffer_malloced)
-	{
-	  char *newp = realloc (tmp_buffer, newsize);
-	  if (newp != NULL)
-	    {
-	      assert ((((uintptr_t) newp)
-		       & (__alignof__ (struct hostent_data) - 1))
-		      == 0);
-	      tmp_buffer = newp;
-	      tmp_buflen = newsize;
-	      goto again;
-	    }
-	}
-      else if (!__libc_use_alloca (buflen + newsize))
-	{
-	  tmp_buffer = malloc (newsize);
-	  if (tmp_buffer != NULL)
-	    {
-	      assert ((((uintptr_t) tmp_buffer)
-		       & (__alignof__ (struct hostent_data) - 1))
-		      == 0);
-	      tmp_buffer_malloced = true;
-	      tmp_buflen = newsize;
-	      goto again;
-	    }
-	}
+	  /* If no match is found, loop around and fetch another
+	     line.  */
+
+	} /* status == NSS_STATUS_SUCCESS.  */
       else
-	{
-	  tmp_buffer
-	    = extend_alloca (tmp_buffer, tmp_buflen,
-			     newsize
-			     + __alignof__ (struct hostent_data));
-	  tmp_buffer = (char *) (((uintptr_t) tmp_buffer
-				  + __alignof__ (struct hostent_data)
-				  - 1)
-				 & ~(__alignof__ (struct hostent_data)
-				     - 1));
-	  goto again;
-	}
-    }
-  else
+	/* internal_getent returned an error.  */
+	break;
+    } /* while (true) */
+
+  /* Propagate the NSS_STATUS_TRYAGAIN error to the caller.  It means
+     that we may not have loaded the complete result.
+     NSS_STATUS_NOTFOUND, however, means that we reached the end of
+     the file successfully.  */
+  if (status != NSS_STATUS_TRYAGAIN)
     status = NSS_STATUS_SUCCESS;
- out:
-  if (tmp_buffer_malloced)
-    free (tmp_buffer);
+
+  scratch_buffer_free (&tmp_buffer);
   return status;
 }
 
-- 
2.14.1


From 05155f0772a4befcc10da16ab64060ae7836ff7c Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 19 Oct 2017 10:44:31 +0200
Subject: [PATCH 61/90] nss_files: Avoid large buffers with many host addresses
 [BZ #22078]

The previous implementation had at least a quadratic space
requirement in the number of host addresses and aliases.

(cherry picked from commit d8425e116cdd954fea0c04c0f406179b5daebbb3)
---
 ChangeLog                       |  10 ++
 NEWS                            |   1 +
 nss/Makefile                    |   2 +
 nss/nss_files/files-hosts.c     | 225 +++++++++++++++------------
 nss/tst-nss-files-hosts-multi.c | 331 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 473 insertions(+), 96 deletions(-)
 create mode 100644 nss/tst-nss-files-hosts-multi.c

diff --git a/ChangeLog b/ChangeLog
index 40867db75a..ad3adc0bdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-10-11  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #22078]
+	Avoid large NSS buffers with many addresses, aliases.
+	* nss/nss_files/files-hosts.c (gethostbyname3_multi): Rewrite
+	using dynarrays and struct alloc_buffer.
+	* nss/Makefile (tests): Add tst-nss-files-hosts-multi.
+	(tst-nss-files-hosts-multi): Link with -ldl.
+	* nss/tst-nss-files-hosts-multi.c: New file.
+
 2017-10-11  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #18023]
diff --git a/NEWS b/NEWS
index d6d1f90008..9cb8f00529 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ The following bugs are resolved with this release:
   [21982] string: stratcliff.c: error: assuming signed overflow does not
     occur with -O3
   [22051] libc: zero terminator in the middle of glibc's .eh_frame
+  [22078] nss_files performance issue in hosts multi mode
   [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
   [22096] resolv: __resolv_conf_attach must not free passed conf object
   [22111] malloc: per thread cache is not returned when thread exits
diff --git a/nss/Makefile b/nss/Makefile
index 91b1c21567..8efb2a56fa 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -61,6 +61,7 @@ xtests			= bug-erange
 # Tests which need libdl
 ifeq (yes,$(build-shared))
 tests += tst-nss-files-hosts-erange
+tests += tst-nss-files-hosts-multi
 endif
 
 # If we have a thread library then we can test cancellation against
@@ -161,3 +162,4 @@ $(objpfx)tst-cancel-getpwuid_r: $(shared-thread-library)
 endif
 
 $(objpfx)tst-nss-files-hosts-erange: $(libdl)
+$(objpfx)tst-nss-files-hosts-multi: $(libdl)
diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
index 763fa39a47..6f7cc4d94b 100644
--- a/nss/nss_files/files-hosts.c
+++ b/nss/nss_files/files-hosts.c
@@ -23,6 +23,7 @@
 #include <netdb.h>
 #include <resolv/resolv-internal.h>
 #include <scratch_buffer.h>
+#include <alloc_buffer.h>
 
 
 /* Get implementation for some internal functions.  */
@@ -116,24 +117,45 @@ DB_LOOKUP (hostbyaddr, ,,,
 	   }, const void *addr, socklen_t len, int af)
 #undef EXTRA_ARGS_VALUE
 
+/* Type of the address and alias arrays.  */
+#define DYNARRAY_STRUCT array
+#define DYNARRAY_ELEMENT char *
+#define DYNARRAY_PREFIX array_
+#include <malloc/dynarray-skeleton.c>
+
 static enum nss_status
 gethostbyname3_multi (FILE * stream, const char *name, int af,
 		      struct hostent *result, char *buffer, size_t buflen,
 		      int *errnop, int *herrnop, int flags)
 {
+  assert (af == AF_INET || af == AF_INET6);
+
   /* We have to get all host entries from the file.  */
   struct scratch_buffer tmp_buffer;
   scratch_buffer_init (&tmp_buffer);
   struct hostent tmp_result_buf;
-  int naddrs = 1;
-  int naliases = 0;
-  char *bufferend;
+  struct array addresses;
+  array_init (&addresses);
+  struct array aliases;
+  array_init (&aliases);
   enum nss_status status;
 
-  while (result->h_aliases[naliases] != NULL)
-    ++naliases;
-
-  bufferend = (char *) &result->h_aliases[naliases + 1];
+  /* Preserve the addresses and aliases encountered so far.  */
+  for (size_t i = 0; result->h_addr_list[i] != NULL; ++i)
+    array_add (&addresses, result->h_addr_list[i]);
+  for (size_t i = 0; result->h_aliases[i] != NULL; ++i)
+    array_add (&aliases, result->h_aliases[i]);
+
+  /* The output buffer re-uses now-unused space at the end of the
+     buffer, starting with the aliases array.  It comes last in the
+     data produced by internal_getent.  (The alias names themselves
+     are still located in the line read in internal_getent, which is
+     stored at the beginning of the buffer.)  */
+  struct alloc_buffer outbuf;
+  {
+    char *bufferend = (char *) result->h_aliases;
+    outbuf = alloc_buffer_create (bufferend, buffer + buflen - bufferend);
+  }
 
   while (true)
     {
@@ -170,110 +192,81 @@ gethostbyname3_multi (FILE * stream, const char *name, int af,
 	    }
 	  while ((matches = 0));
 
+	  /* If the line matches, we need to copy the addresses and
+	     aliases, so that we can reuse tmp_buffer for the next
+	     line.  */
 	  if (matches)
 	    {
-	      /* We could be very clever and try to recycle a few bytes
-		 in the buffer instead of generating new arrays.  But
-		 we are not doing this here since it's more work than
-		 it's worth.  Simply let the user provide a bit bigger
-		 buffer.  */
-	      char **new_h_addr_list;
-	      char **new_h_aliases;
-	      int newaliases = 0;
-	      size_t newstrlen = 0;
-	      int cnt;
-
-	      /* Count the new aliases and the length of the strings.  */
-	      while (tmp_result_buf.h_aliases[newaliases] != NULL)
+	      /* Record the addresses.  */
+	      for (size_t i = 0; tmp_result_buf.h_addr_list[i] != NULL; ++i)
 		{
-		  char *cp = tmp_result_buf.h_aliases[newaliases];
-		  ++newaliases;
-		  newstrlen += strlen (cp) + 1;
+		  /* Allocate the target space in the output buffer,
+		     depending on the address family.  */
+		  void *target;
+		  if (af == AF_INET)
+		    {
+		      assert (tmp_result_buf.h_length == 4);
+		      target = alloc_buffer_alloc (&outbuf, struct in_addr);
+		    }
+		  else if (af == AF_INET6)
+		    {
+		      assert (tmp_result_buf.h_length == 16);
+		      target = alloc_buffer_alloc (&outbuf, struct in6_addr);
+		    }
+		  else
+		    __builtin_unreachable ();
+
+		  if (target == NULL)
+		    {
+		      /* Request a larger output buffer.  */
+		      *errnop = ERANGE;
+		      *herrnop = NETDB_INTERNAL;
+		      status = NSS_STATUS_TRYAGAIN;
+		      break;
+		    }
+		  memcpy (target, tmp_result_buf.h_addr_list[i],
+			  tmp_result_buf.h_length);
+		  array_add (&addresses, target);
 		}
-	      /* If the real name is different add it also to the
-		 aliases.  This means that there is a duplication
-		 in the alias list but this is really the user's
-		 problem.  */
-	      if (strcmp (old_result->h_name,
-			  tmp_result_buf.h_name) != 0)
+
+	      /* Record the aliases.  */
+	      for (size_t i = 0; tmp_result_buf.h_aliases[i] != NULL; ++i)
 		{
-		  ++newaliases;
-		  newstrlen += strlen (tmp_result_buf.h_name) + 1;
+		  char *alias = tmp_result_buf.h_aliases[i];
+		  array_add (&aliases,
+			     alloc_buffer_copy_string (&outbuf, alias));
 		}
 
-	      /* Make sure bufferend is aligned.  */
-	      assert ((bufferend - (char *) 0) % sizeof (char *) == 0);
-
-	      /* Now we can check whether the buffer is large enough.
-		 16 is the maximal size of the IP address.  */
-	      if (bufferend + 16 + (naddrs + 2) * sizeof (char *)
-		  + roundup (newstrlen, sizeof (char *))
-		  + (naliases + newaliases + 1) * sizeof (char *)
-		  >= buffer + buflen)
+	      /* If the real name is different add, it also to the
+		 aliases.  This means that there is a duplication in
+		 the alias list but this is really the user's
+		 problem.  */
+	      {
+		char *new_name = tmp_result_buf.h_name;
+		if (strcmp (old_result->h_name, new_name) != 0)
+		  array_add (&aliases,
+			     alloc_buffer_copy_string (&outbuf, new_name));
+	      }
+
+	      /* Report memory allocation failures during the
+		 expansion of the temporary arrays.  */
+	      if (array_has_failed (&addresses) || array_has_failed (&aliases))
 		{
-		  *errnop = ERANGE;
+		  *errnop = ENOMEM;
 		  *herrnop = NETDB_INTERNAL;
-		  status = NSS_STATUS_TRYAGAIN;
+		  status = NSS_STATUS_UNAVAIL;
 		  break;
 		}
 
-	      new_h_addr_list =
-		(char **) (bufferend
-			   + roundup (newstrlen, sizeof (char *))
-			   + 16);
-	      new_h_aliases =
-		(char **) ((char *) new_h_addr_list
-			   + (naddrs + 2) * sizeof (char *));
-
-	      /* Copy the old data in the new arrays.  */
-	      for (cnt = 0; cnt < naddrs; ++cnt)
-		new_h_addr_list[cnt] = old_result->h_addr_list[cnt];
-
-	      for (cnt = 0; cnt < naliases; ++cnt)
-		new_h_aliases[cnt] = old_result->h_aliases[cnt];
-
-	      /* Store the new strings.  */
-	      cnt = 0;
-	      while (tmp_result_buf.h_aliases[cnt] != NULL)
+	      /* Request a larger output buffer if we ran out of room.  */
+	      if (alloc_buffer_has_failed (&outbuf))
 		{
-		  new_h_aliases[naliases++] = bufferend;
-		  bufferend = (__stpcpy (bufferend,
-					 tmp_result_buf.h_aliases[cnt])
-			       + 1);
-		  ++cnt;
-		}
-
-	      if (cnt < newaliases)
-		{
-		  new_h_aliases[naliases++] = bufferend;
-		  bufferend = __stpcpy (bufferend,
-					tmp_result_buf.h_name) + 1;
+		  *errnop = ERANGE;
+		  *herrnop = NETDB_INTERNAL;
+		  status = NSS_STATUS_TRYAGAIN;
+		  break;
 		}
 
-	      /* Final NULL pointer.  */
-	      new_h_aliases[naliases] = NULL;
-
-	      /* Round up the buffer end address.  */
-	      bufferend += (sizeof (char *)
-			    - ((bufferend - (char *) 0)
-			       % sizeof (char *))) % sizeof (char *);
-
-	      /* Now the new address.  */
-	      new_h_addr_list[naddrs++] =
-		memcpy (bufferend, tmp_result_buf.h_addr,
-			tmp_result_buf.h_length);
-
-	      /* Also here a final NULL pointer.  */
-	      new_h_addr_list[naddrs] = NULL;
-
-	      /* Store the new array pointers.  */
-	      old_result->h_aliases = new_h_aliases;
-	      old_result->h_addr_list = new_h_addr_list;
-
-	      /* Compute the new buffer end.  */
-	      bufferend = (char *) &new_h_aliases[naliases + 1];
-	      assert (bufferend <= buffer + buflen);
-
 	      result = old_result;
 	    } /* If match was found.  */
 
@@ -293,7 +286,47 @@ gethostbyname3_multi (FILE * stream, const char *name, int af,
   if (status != NSS_STATUS_TRYAGAIN)
     status = NSS_STATUS_SUCCESS;
 
+  if (status == NSS_STATUS_SUCCESS)
+    {
+      /* Copy the address and alias arrays into the output buffer and
+	 add NULL terminators.  The pointed-to elements were directly
+	 written into the output buffer above and do not need to be
+	 copied again.  */
+      size_t addresses_count = array_size (&addresses);
+      size_t aliases_count = array_size (&aliases);
+      char **out_addresses = alloc_buffer_alloc_array
+	(&outbuf, char *, addresses_count + 1);
+      char **out_aliases = alloc_buffer_alloc_array
+	(&outbuf, char *, aliases_count + 1);
+      if (out_addresses == NULL || out_aliases == NULL)
+	{
+	  /* The output buffer is not large enough.  */
+	  *errnop = ERANGE;
+	  *herrnop = NETDB_INTERNAL;
+	  status = NSS_STATUS_TRYAGAIN;
+	  /* Fall through to function exit.  */
+	}
+      else
+	{
+	  /* Everything is allocated in place.  Make the copies and
+	     adjust the array pointers.  */
+	  memcpy (out_addresses, array_begin (&addresses),
+		  addresses_count * sizeof (char *));
+	  out_addresses[addresses_count] = NULL;
+	  memcpy (out_aliases, array_begin (&aliases),
+		  aliases_count * sizeof (char *));
+	  out_aliases[aliases_count] = NULL;
+
+	  result->h_addr_list = out_addresses;
+	  result->h_aliases = out_aliases;
+
+	  status = NSS_STATUS_SUCCESS;
+	}
+    }
+
   scratch_buffer_free (&tmp_buffer);
+  array_free (&addresses);
+  array_free (&aliases);
   return status;
 }
 
diff --git a/nss/tst-nss-files-hosts-multi.c b/nss/tst-nss-files-hosts-multi.c
new file mode 100644
index 0000000000..195a19be4f
--- /dev/null
+++ b/nss/tst-nss-files-hosts-multi.c
@@ -0,0 +1,331 @@
+/* Parse /etc/hosts in multi mode with many addresses/aliases.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <dlfcn.h>
+#include <errno.h>
+#include <gnu/lib-names.h>
+#include <netdb.h>
+#include <nss.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/check_nss.h>
+#include <support/namespace.h>
+#include <support/support.h>
+#include <support/test-driver.h>
+#include <support/test-driver.h>
+#include <support/xmemstream.h>
+#include <support/xstdio.h>
+#include <support/xunistd.h>
+#include <sys/resource.h>
+
+struct support_chroot *chroot_env;
+
+static void
+prepare (int argc, char **argv)
+{
+  chroot_env = support_chroot_create
+    ((struct support_chroot_configuration)
+     {
+       .resolv_conf = "",
+       .hosts = "",             /* See write_hosts below.  */
+       .host_conf = "multi on\n",
+     });
+}
+
+/* Create the /etc/hosts file from outside the chroot.  */
+static void
+write_hosts (int count)
+{
+  TEST_VERIFY (count > 0 && count <= 65535);
+  FILE *fp = xfopen (chroot_env->path_hosts, "w");
+  fputs ("127.0.0.1   localhost localhost.localdomain\n"
+         "::1         localhost localhost.localdomain\n",
+         fp);
+  for (int i = 0; i < count; ++i)
+    {
+      fprintf (fp, "10.4.%d.%d www4.example.com\n",
+               (i / 256) & 0xff, i & 0xff);
+      fprintf (fp, "10.46.%d.%d www.example.com\n",
+               (i / 256) & 0xff, i & 0xff);
+      fprintf (fp, "192.0.2.1 alias.example.com v4-%d.example.com\n", i);
+      fprintf (fp, "2001:db8::6:%x www6.example.com\n", i);
+      fprintf (fp, "2001:db8::46:%x www.example.com\n", i);
+      fprintf (fp, "2001:db8::1 alias.example.com v6-%d.example.com\n", i);
+    }
+  xfclose (fp);
+}
+
+/* Parameters of a single test.  */
+struct test_params
+{
+  const char *name;             /* Name to query.  */
+  const char *marker;           /* Address marker for the name.  */
+  int count;                    /* Number of addresses/aliases.  */
+  int family;                   /* AF_INET, AF_INET_6 or AF_UNSPEC.  */
+  bool canonname;               /* True if AI_CANONNAME should be enabled.  */
+};
+
+/* Expected result of gethostbyname/gethostbyname2.  */
+static char *
+expected_ghbn (const struct test_params *params)
+{
+  TEST_VERIFY (params->family == AF_INET || params->family == AF_INET6);
+
+  struct xmemstream expected;
+  xopen_memstream (&expected);
+  if (strcmp (params->name, "alias.example.com") == 0)
+    {
+      fprintf (expected.out, "name: %s\n", params->name);
+      char af;
+      if (params->family == AF_INET)
+        af = '4';
+      else
+        af = '6';
+      for (int i = 0; i < params->count; ++i)
+        fprintf (expected.out, "alias: v%c-%d.example.com\n", af, i);
+
+      for (int i = 0; i < params->count; ++i)
+        if (params->family == AF_INET)
+          fputs ("address: 192.0.2.1\n", expected.out);
+        else
+          fputs ("address: 2001:db8::1\n", expected.out);
+    }
+  else /* www/www4/www6 name.  */
+    {
+      bool do_ipv4 = params->family == AF_INET
+        && strncmp (params->name, "www6", 4) != 0;
+      bool do_ipv6 = params->family == AF_INET6
+        && strncmp (params->name, "www4", 4) != 0;
+      if (do_ipv4 || do_ipv6)
+        {
+          fprintf (expected.out, "name: %s\n", params->name);
+          if (do_ipv4)
+            for (int i = 0; i < params->count; ++i)
+              fprintf (expected.out, "address: 10.%s.%d.%d\n",
+                       params->marker, i / 256, i % 256);
+          if (do_ipv6)
+            for (int i = 0; i < params->count; ++i)
+              fprintf (expected.out, "address: 2001:db8::%s:%x\n",
+                       params->marker, i);
+        }
+      else
+        fputs ("error: HOST_NOT_FOUND\n", expected.out);
+    }
+  xfclose_memstream (&expected);
+  return expected.buffer;
+}
+
+/* Expected result of getaddrinfo.  */
+static char *
+expected_gai (const struct test_params *params)
+{
+  bool do_ipv4 = false;
+  bool do_ipv6 = false;
+  if (params->family == AF_UNSPEC)
+    do_ipv4 = do_ipv6 = true;
+  else if (params->family == AF_INET)
+    do_ipv4 = true;
+  else if (params->family == AF_INET6)
+    do_ipv6 = true;
+
+  struct xmemstream expected;
+  xopen_memstream (&expected);
+  if (strcmp (params->name, "alias.example.com") == 0)
+    {
+      if (params->canonname)
+        fprintf (expected.out,
+                 "flags: AI_CANONNAME\n"
+                 "canonname: %s\n",
+                 params->name);
+
+      if (do_ipv4)
+        for (int i = 0; i < params->count; ++i)
+          fputs ("address: STREAM/TCP 192.0.2.1 80\n", expected.out);
+      if (do_ipv6)
+        for (int i = 0; i < params->count; ++i)
+          fputs ("address: STREAM/TCP 2001:db8::1 80\n", expected.out);
+    }
+  else /* www/www4/www6 name.  */
+    {
+      if (strncmp (params->name, "www4", 4) == 0)
+        do_ipv6 = false;
+      else if (strncmp (params->name, "www6", 4) == 0)
+        do_ipv4 = false;
+      /* Otherwise, we have www as the name, so we do both.  */
+
+      if (do_ipv4 || do_ipv6)
+        {
+          if (params->canonname)
+            fprintf (expected.out,
+                     "flags: AI_CANONNAME\n"
+                     "canonname: %s\n",
+                     params->name);
+
+          if (do_ipv4)
+            for (int i = 0; i < params->count; ++i)
+              fprintf (expected.out, "address: STREAM/TCP 10.%s.%d.%d 80\n",
+                       params->marker, i / 256, i % 256);
+          if (do_ipv6)
+            for (int i = 0; i < params->count; ++i)
+              fprintf (expected.out,
+                       "address: STREAM/TCP 2001:db8::%s:%x 80\n",
+                       params->marker, i);
+        }
+      else
+        fputs ("error: Name or service not known\n", expected.out);
+    }
+  xfclose_memstream (&expected);
+  return expected.buffer;
+}
+
+static void
+run_gbhn_gai (struct test_params *params)
+{
+  char *ctx = xasprintf ("name=%s marker=%s count=%d family=%d",
+                         params->name, params->marker, params->count,
+                         params->family);
+  if (test_verbose > 0)
+    printf ("info: %s\n", ctx);
+
+  /* Check gethostbyname, gethostbyname2.  */
+  if (params->family == AF_INET)
+    {
+      char *expected = expected_ghbn (params);
+      check_hostent (ctx, gethostbyname (params->name), expected);
+      free (expected);
+    }
+  if (params->family != AF_UNSPEC)
+    {
+      char *expected = expected_ghbn (params);
+      check_hostent (ctx, gethostbyname2 (params->name, params->family),
+                     expected);
+      free (expected);
+    }
+
+  /* Check getaddrinfo.  */
+  for (int do_canonical = 0; do_canonical < 2; ++do_canonical)
+    {
+      params->canonname = do_canonical;
+      char *expected = expected_gai (params);
+      struct addrinfo hints =
+        {
+          .ai_family = params->family,
+          .ai_socktype = SOCK_STREAM,
+          .ai_protocol = IPPROTO_TCP,
+        };
+      if (do_canonical)
+        hints.ai_flags |= AI_CANONNAME;
+      struct addrinfo *ai;
+      int ret = getaddrinfo (params->name, "80", &hints, &ai);
+      check_addrinfo (ctx, ai, ret, expected);
+      if (ret == 0)
+        freeaddrinfo (ai);
+      free (expected);
+    }
+
+  free (ctx);
+}
+
+/* Callback for the subprocess which runs the test in a chroot.  */
+static void
+subprocess (void *closure)
+{
+  struct test_params *params = closure;
+
+  xchroot (chroot_env->path_chroot);
+
+  static const int families[] = { AF_INET, AF_INET6, AF_UNSPEC, -1 };
+  static const char *const names[] =
+    {
+      "www.example.com", "www4.example.com", "www6.example.com",
+      "alias.example.com",
+      NULL
+    };
+  static const char *const names_marker[] = { "46", "4", "6", "" };
+
+  for (int family_idx = 0; families[family_idx] >= 0; ++family_idx)
+    {
+      params->family = families[family_idx];
+      for (int names_idx = 0; names[names_idx] != NULL; ++names_idx)
+        {
+          params->name = names[names_idx];
+          params->marker = names_marker[names_idx];
+          run_gbhn_gai (params);
+        }
+    }
+}
+
+/* Run the test for a specific number of addresses/aliases.  */
+static void
+run_test (int count)
+{
+  write_hosts (count);
+
+  struct test_params params =
+    {
+      .count = count,
+    };
+
+  support_isolate_in_subprocess (subprocess, &params);
+}
+
+static int
+do_test (void)
+{
+  support_become_root ();
+  if (!support_can_chroot ())
+    return EXIT_UNSUPPORTED;
+
+  /* This test should not use gigabytes of memory.   */
+  {
+    struct rlimit limit;
+    if (getrlimit (RLIMIT_AS, &limit) != 0)
+      {
+        printf ("getrlimit (RLIMIT_AS) failed: %m\n");
+        return 1;
+      }
+    long target = 200 * 1024 * 1024;
+    if (limit.rlim_cur == RLIM_INFINITY || limit.rlim_cur > target)
+      {
+        limit.rlim_cur = target;
+        if (setrlimit (RLIMIT_AS, &limit) != 0)
+          {
+            printf ("setrlimit (RLIMIT_AS) failed: %m\n");
+            return 1;
+          }
+      }
+  }
+
+  __nss_configure_lookup ("hosts", "files");
+  if (dlopen (LIBNSS_FILES_SO, RTLD_LAZY) == NULL)
+    FAIL_EXIT1 ("could not load " LIBNSS_DNS_SO ": %s", dlerror ());
+
+  /* Run the tests with a few different address/alias counts.  */
+  for (int count = 1; count <= 111; ++count)
+    run_test (count);
+  run_test (1111);
+  run_test (22222);
+
+  support_chroot_free (chroot_env);
+  return 0;
+}
+
+#define PREPARE prepare
+#include <support/test-driver.c>
-- 
2.14.1


From 2e78ea7a207e49a47a3448fbbc387d606141ec9d Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Fri, 20 Oct 2017 04:10:15 +0200
Subject: [PATCH 62/90] sysconf: Fix missing definition of UIO_MAXIOV on Linux
 [BZ #22321]

After commit 37f802f86400684c8d13403958b2c598721d6360 (Remove
__need_IOV_MAX and __need_FOPEN_MAX), UIO_MAXIOV is no longer supplied
(indirectly) through <bits/stdio_lim.h>, so sysdeps/posix/sysconf.c no
longer sees the definition.

(cherry picked from commit 63b4baa44e8d22501c433c4093aa3310f91b6aa2)
---
 ChangeLog                                          | 10 ++++++
 NEWS                                               |  1 +
 sysdeps/posix/sysconf.c                            |  1 +
 sysdeps/unix/sysv/linux/Makefile                   |  8 +++--
 sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c | 27 +++++++++++++++
 sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c      | 40 ++++++++++++++++++++++
 6 files changed, 85 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c
 create mode 100644 sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c

diff --git a/ChangeLog b/ChangeLog
index ad3adc0bdc..a1fd1e8a3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-10-20  Florian Weimer  <fweimer@redhat.com>
+
+	[BZ #22321]
+	sysconf: Fix missing definition of UIO_MAXIOV on Linux.
+	* sysdeps/posix/sysconf.c: Include <sys/uio.h>.
+	* sysdeps/unix/sysv/linux/Makefile (tests): Add tst-sysconf-iov_max.
+	(tst-sysconf-iov_max): Link with tst-sysconf-iov_max-uapi.o.
+	* sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c: New file.
+	* sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c: Likewise.
+
 2017-10-11  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #22078]
diff --git a/NEWS b/NEWS
index 9cb8f00529..e5ac109a63 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,7 @@ The following bugs are resolved with this release:
   [22146] Let fpclassify use the builtin when optimizing for size in C++ mode
   [22225] math: nearbyint arithmetic moved before feholdexcept
   [22235] Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm
+  [22321] sysconf: Fix missing definition of UIO_MAXIOV on Linux
 
 Version 2.26
 
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index a95e1b3f05..254f87c437 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <sys/sysinfo.h>
 #include <sys/types.h>
+#include <sys/uio.h>
 #include <regex.h>
 
 #define NEED_SPEC_ARRAY 0
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 9d6a2de870..5dce300f7f 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -50,7 +50,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
 		  bits/siginfo-arch.h bits/siginfo-consts-arch.h
 
 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
-	 tst-quota tst-sync_file_range test-errno-linux
+	 tst-quota tst-sync_file_range test-errno-linux tst-sysconf-iov_max
 
 # Generate the list of SYS_* macros for the system calls (__NR_* macros).
 
@@ -120,7 +120,11 @@ ifndef no_deps
 -include $(objpfx)bits/syscall.d
 endif
 generated += bits/syscall.h bits/syscall.d
-endif
+
+# Separate object file for access to the constant from the UAPI header.
+$(objpfx)tst-sysconf-iov_max: $(objpfx)tst-sysconf-iov_max-uapi.o
+
+endif # $(subdir) == misc
 
 ifeq ($(subdir),time)
 sysdep_headers += sys/timex.h bits/timex.h
diff --git a/sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c
new file mode 100644
index 0000000000..1240b846e6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max-uapi.c
@@ -0,0 +1,27 @@
+/* Check IOV_MAX definition: Helper function to capture UAPI header value.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Use a separate function to avoid header compatibility issues.  */
+
+#include <linux/uio.h>
+
+long
+uio_maxiov_value (void)
+{
+  return UIO_MAXIOV;
+}
diff --git a/sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c
new file mode 100644
index 0000000000..dfdf3da484
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-sysconf-iov_max.c
@@ -0,0 +1,40 @@
+/* Check IOV_MAX definition for consistency (bug 22321).
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Defined in tst-sysconf-iov_max-uapi.c.  */
+long uio_maxiov_value (void);
+
+
+#include <limits.h>
+#include <support/check.h>
+#include <sys/uio.h>
+#include <unistd.h>
+
+static int
+do_test (void)
+{
+  TEST_VERIFY (_XOPEN_IOV_MAX == 16); /* Value required by POSIX.  */
+  TEST_VERIFY (uio_maxiov_value () >= _XOPEN_IOV_MAX);
+  TEST_VERIFY (IOV_MAX == uio_maxiov_value ());
+  TEST_VERIFY (UIO_MAXIOV == uio_maxiov_value ());
+  TEST_VERIFY (sysconf (_SC_UIO_MAXIOV) == uio_maxiov_value ());
+  TEST_VERIFY (sysconf (_SC_IOV_MAX) == uio_maxiov_value ());
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.14.1


From c96d7a646b52e8d50e7ca98e0a60af5f24e4b441 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 20 Aug 2017 10:46:47 -0700
Subject: [PATCH 63/90] i386: Hide __old_glob64 [BZ #18822]

Hide internal __old_glob64 function to allow direct access within
libc.so and libc.a without using GOT nor PLT.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/i386/glob64.c (__old_glob64): Add
	libc_hidden_proto and libc_hidden_def.

(cherry picked from commit 2585d7b839559e665d5723734862fbe62264b25d)
---
 ChangeLog                             | 6 ++++++
 sysdeps/unix/sysv/linux/i386/glob64.c | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index a1fd1e8a3e..1ed253214c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #18822]
+	* sysdeps/unix/sysv/linux/i386/glob64.c (__old_glob64): Add
+	libc_hidden_proto and libc_hidden_def.
+
 2017-10-20  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #22321]
diff --git a/sysdeps/unix/sysv/linux/i386/glob64.c b/sysdeps/unix/sysv/linux/i386/glob64.c
index f68195137e..956cb0474a 100644
--- a/sysdeps/unix/sysv/linux/i386/glob64.c
+++ b/sysdeps/unix/sysv/linux/i386/glob64.c
@@ -53,6 +53,7 @@ libc_hidden_ver (__glob64, glob64)
 int __old_glob64 (const char *__pattern, int __flags,
 		  int (*__errfunc) (const char *, int),
 		  glob64_t *__pglob);
+libc_hidden_proto (__old_glob64);
 
 #undef dirent
 #define dirent __old_dirent64
@@ -72,5 +73,7 @@ int __old_glob64 (const char *__pattern, int __flags,
 
 #include <posix/glob.c>
 
+libc_hidden_def (__old_glob64);
+
 compat_symbol (libc, __old_glob64, glob64, GLIBC_2_1);
 #endif
-- 
2.14.1


From 305f4f057dace256e99e4321e21a23267187d77f Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri, 20 Oct 2017 19:36:33 +0200
Subject: [PATCH 64/90] posix: Sync glob with gnulib [BZ #1062]

This patch syncs posix/glob.c implementation with gnulib version
b5ec983 (glob: simplify symlink detection).  The only difference
to gnulib code is

  * DT_UNKNOWN, DT_DIR, and DT_LNK definition in the case there
    were not already defined.  Gnulib code which uses
    HAVE_STRUCT_DIRENT_D_TYPE will redefine them wrongly because
    GLIBC does not define HAVE_STRUCT_DIRENT_D_TYPE.  Instead
    the patch check for each definition instead.

Also, the patch requires additional globfree and globfree64 files
for compatibility version on some architectures.  Also the code
simplification leads to not macro simplification (not need for
NO_GLOB_PATTERN_P anymore).

Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py
for all major architectures.

	[BZ #1062]
	* posix/Makefile (routines): Add globfree, globfree64, and
	glob_pattern_p.
	* posix/flexmember.h: New file.
	* posix/glob_internal.h: Likewise.
	* posix/glob_pattern_p.c: Likewise.
	* posix/globfree.c: Likewise.
	* posix/globfree64.c: Likewise.
	* sysdeps/gnu/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/oldglob.c: Likewise.
	* sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise.
	* sysdeps/wordsize-64/globfree.c: Likewise.
	* sysdeps/wordsize-64/globfree64.c: Likewise.
	* posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead.
	[NDEBUG): Remove comments.
	(GLOB_ONLY_P, _AMIGA, VMS): Remove define.
	(dirent_type): New type.  Use uint_fast8_t not
	uint8_t, as C99 does not require uint8_t.
	(DT_UNKNOWN, DT_DIR, DT_LNK): New macros.
	(struct readdir_result): Use dirent_type.  Do not define skip_entry
	unless it is needed; this saves a byte on platforms lacking d_ino.
	(readdir_result_type, readdir_result_skip_entry):
	New functions, replacing ...
	(readdir_result_might_be_symlink, readdir_result_might_be_dir):
	 these functions, which were removed.  This makes the callers
	easier to read.  All callers changed.
	(D_INO_TO_RESULT): Now empty if there is no d_ino.
	(size_add_wrapv, glob_use_alloca): New static functions.
	(glob, glob_in_dir): Check for size_t overflow in several places,
	and fix some size_t checks that were not quite right.
	Remove old code using SHELL since Bash no longer
	uses this.
	(glob, prefix_array): Separate MS code better.
	(glob_in_dir): Remove old Amiga and VMS code.
	(globfree, __glob_pattern_type, __glob_pattern_p): Move to
	separate files.
	(glob_in_dir): Do not rely on undefined behavior in accessing
	struct members beyond their bounds.  Use a flexible array member
	instead
	(link_stat): Rename from link_exists2_p and return -1/0 instead of
	0/1.  Caller changed.
	(glob): Fix memory leaks.
	* posix/glob64 (globfree64): Move to separate file.
	* sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define.
	(globfree64): Remove hidden alias.
	* sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add
	oldglob.
	* sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to
	separate file.
	* sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove
	define.
	Move compat code to separate file.
	* sysdeps/wordsize-64/glob.c (globfree): Move definitions to
	separate file.

(cherry picked from commit c66c908230169c1bab1f83b071eb585baa214b9f)
---
 ChangeLog                                          |  62 ++
 NEWS                                               |   1 +
 posix/Makefile                                     |   2 +-
 posix/flexmember.h                                 |  45 ++
 posix/glob.c                                       | 774 ++++++++++-----------
 posix/glob64.c                                     |   6 -
 posix/glob_internal.h                              |  57 ++
 posix/glob_pattern_p.c                             |  33 +
 posix/globfree.c                                   |  41 ++
 posix/globfree64.c                                 |  31 +
 sysdeps/gnu/glob64.c                               |   3 -
 sysdeps/gnu/globfree64.c                           |  10 +
 sysdeps/unix/sysv/linux/Makefile                   |   2 +-
 sysdeps/unix/sysv/linux/alpha/glob.c               |   4 -
 sysdeps/unix/sysv/linux/alpha/globfree.c           |  37 +
 sysdeps/unix/sysv/linux/i386/glob64.c              |  39 +-
 .../unix/sysv/linux/mips/mips64/n64/globfree64.c   |   1 +
 sysdeps/unix/sysv/linux/oldglob.c                  |  42 ++
 sysdeps/unix/sysv/linux/wordsize-64/globfree64.c   |   2 +
 sysdeps/unix/sysv/linux/x86_64/x32/globfree.c      |   1 +
 sysdeps/wordsize-64/glob.c                         |   2 -
 sysdeps/wordsize-64/globfree.c                     |   5 +
 sysdeps/wordsize-64/globfree64.c                   |   1 +
 23 files changed, 742 insertions(+), 459 deletions(-)
 create mode 100644 posix/flexmember.h
 create mode 100644 posix/glob_internal.h
 create mode 100644 posix/glob_pattern_p.c
 create mode 100644 posix/globfree.c
 create mode 100644 posix/globfree64.c
 create mode 100644 sysdeps/gnu/globfree64.c
 create mode 100644 sysdeps/unix/sysv/linux/alpha/globfree.c
 create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c
 create mode 100644 sysdeps/unix/sysv/linux/oldglob.c
 create mode 100644 sysdeps/unix/sysv/linux/wordsize-64/globfree64.c
 create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/globfree.c
 create mode 100644 sysdeps/wordsize-64/globfree.c
 create mode 100644 sysdeps/wordsize-64/globfree64.c

diff --git a/ChangeLog b/ChangeLog
index 1ed253214c..d54d5a895d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,65 @@
+2017-09-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	[BZ #1062]
+	[BZ #22325]
+	CVE-2017-15671
+	* posix/Makefile (routines): Add globfree, globfree64, and
+	glob_pattern_p.
+	* posix/flexmember.h: New file.
+	* posix/glob_internal.h: Likewise.
+	* posix/glob_pattern_p.c: Likewise.
+	* posix/globfree.c: Likewise.
+	* posix/globfree64.c: Likewise.
+	* sysdeps/gnu/globfree64.c: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise.
+	* sysdeps/unix/sysv/linux/oldglob.c: Likewise.
+	* sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise.
+	* sysdeps/wordsize-64/globfree.c: Likewise.
+	* sysdeps/wordsize-64/globfree64.c: Likewise.
+	* posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead.
+	[NDEBUG): Remove comments.
+	(GLOB_ONLY_P, _AMIGA, VMS): Remove define.
+	(dirent_type): New type.  Use uint_fast8_t not
+	uint8_t, as C99 does not require uint8_t.
+	(DT_UNKNOWN, DT_DIR, DT_LNK): New macros.
+	(struct readdir_result): Use dirent_type.  Do not define skip_entry
+	unless it is needed; this saves a byte on platforms lacking d_ino.
+	(readdir_result_type, readdir_result_skip_entry):
+	New functions, replacing ...
+	(readdir_result_might_be_symlink, readdir_result_might_be_dir):
+	 these functions, which were removed.  This makes the callers
+	easier to read.  All callers changed.
+	(D_INO_TO_RESULT): Now empty if there is no d_ino.
+	(size_add_wrapv, glob_use_alloca): New static functions.
+	(glob, glob_in_dir): Check for size_t overflow in several places,
+	and fix some size_t checks that were not quite right.
+	Remove old code using SHELL since Bash no longer
+	uses this.
+	(glob, prefix_array): Separate MS code better.
+	(glob_in_dir): Remove old Amiga and VMS code.
+	(globfree, __glob_pattern_type, __glob_pattern_p): Move to
+	separate files.
+	(glob_in_dir): Do not rely on undefined behavior in accessing
+	struct members beyond their bounds.  Use a flexible array member
+	instead
+	(link_stat): Rename from link_exists2_p and return -1/0 instead of
+	0/1.  Caller changed.
+	(glob): Fix memory leaks.
+	* posix/glob64 (globfree64): Move to separate file.
+	* sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define.
+	(globfree64): Remove hidden alias.
+	* sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add
+	oldglob.
+	* sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to
+	separate file.
+	* sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove
+	define.
+	Move compat code to separate file.
+	* sysdeps/wordsize-64/glob.c (globfree): Move definitions to
+	separate file.
+
 2017-08-20  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #18822]
diff --git a/NEWS b/NEWS
index e5ac109a63..ddc950c6cf 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,7 @@ The following bugs are resolved with this release:
   [22225] math: nearbyint arithmetic moved before feholdexcept
   [22235] Add C++ versions of iscanonical for ldbl-96 and ldbl-128ibm
   [22321] sysconf: Fix missing definition of UIO_MAXIOV on Linux
+  [22325] glibc: Memory leak in glob with GLOB_TILDE (CVE-2017-15671)
 
 Version 2.26
 
diff --git a/posix/Makefile b/posix/Makefile
index 33abcaed7a..51e7e5bcb8 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -45,7 +45,7 @@ routines :=								      \
 	getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid	      \
 	getresuid getresgid setresuid setresgid				      \
 	pathconf sysconf fpathconf					      \
-	glob glob64 fnmatch regex					      \
+	glob glob64 globfree globfree64 glob_pattern_p fnmatch regex	      \
 	confstr								      \
 	getopt getopt1 							      \
 	sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax  \
diff --git a/posix/flexmember.h b/posix/flexmember.h
new file mode 100644
index 0000000000..107c1f09e9
--- /dev/null
+++ b/posix/flexmember.h
@@ -0,0 +1,45 @@
+/* Sizes of structs with flexible array members.
+
+   Copyright 2016-2017 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.
+
+   Written by Paul Eggert.  */
+
+#include <stddef.h>
+
+/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below.
+   On older platforms without _Alignof, use a pessimistic bound that is
+   safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1.
+   On newer platforms, use _Alignof to get a tighter bound.  */
+
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1))
+#else
+# define FLEXALIGNOF(type) _Alignof (type)
+#endif
+
+/* Upper bound on the size of a struct of type TYPE with a flexible
+   array member named MEMBER that is followed by N bytes of other data.
+   This is not simply sizeof (TYPE) + N, since it may require
+   alignment on unusually picky C11 platforms, and
+   FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms.
+   Yield a value less than N if and only if arithmetic overflow occurs.  */
+
+#define FLEXSIZEOF(type, member, n) \
+   ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \
+    & ~ (FLEXALIGNOF (type) - 1))
diff --git a/posix/glob.c b/posix/glob.c
index c653809118..a7eccf9cb4 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -15,7 +15,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef	HAVE_CONFIG_H
+#ifndef _LIBC
 # include <config.h>
 #endif
 
@@ -27,29 +27,15 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
-
-/* Outcomment the following line for production quality code.  */
-/* #define NDEBUG 1 */
 #include <assert.h>
+#include <unistd.h>
 
-#include <stdio.h>		/* Needed on stupid SunOS for assert.  */
-
-#if !defined _LIBC || !defined GLOB_ONLY_P
-#if defined HAVE_UNISTD_H || defined _LIBC
-# include <unistd.h>
-# ifndef POSIX
-#  ifdef _POSIX_VERSION
-#   define POSIX
-#  endif
-# endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define WINDOWS32
 #endif
 
-#include <pwd.h>
-
-#if defined HAVE_STDINT_H || defined _LIBC
-# include <stdint.h>
-#elif !defined UINTPTR_MAX
-# define UINTPTR_MAX (~((size_t) 0))
+#ifndef WINDOWS32
+# include <pwd.h>
 #endif
 
 #include <errno.h>
@@ -57,24 +43,7 @@
 # define __set_errno(val) errno = (val)
 #endif
 
-#if defined HAVE_DIRENT_H || defined __GNU_LIBRARY__
-# include <dirent.h>
-#else
-# define dirent direct
-# ifdef HAVE_SYS_NDIR_H
-#  include <sys/ndir.h>
-# endif
-# ifdef HAVE_SYS_DIR_H
-#  include <sys/dir.h>
-# endif
-# ifdef HAVE_NDIR_H
-#  include <ndir.h>
-# endif
-# ifdef HAVE_VMSDIR_H
-#  include "vmsdir.h"
-# endif /* HAVE_VMSDIR_H */
-#endif
-
+#include <dirent.h>
 #include <stdlib.h>
 #include <string.h>
 #include <alloca.h>
@@ -87,27 +56,29 @@
 # define opendir(name) __opendir (name)
 # define readdir(str) __readdir64 (str)
 # define getpwnam_r(name, bufp, buf, len, res) \
-   __getpwnam_r (name, bufp, buf, len, res)
+    __getpwnam_r (name, bufp, buf, len, res)
 # ifndef __stat64
 #  define __stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf)
 # endif
 # define struct_stat64		struct stat64
+# define FLEXIBLE_ARRAY_MEMBER
 #else /* !_LIBC */
-# include "getlogin_r.h"
-# include "mempcpy.h"
-# include "stat-macros.h"
-# include "strdup.h"
-# define __stat64(fname, buf)	stat (fname, buf)
-# define struct_stat64		struct stat
-# define __stat(fname, buf)	stat (fname, buf)
-# define __alloca		alloca
-# define __readdir		readdir
-# define __readdir64		readdir64
-# define __glob_pattern_p	glob_pattern_p
+# define __getlogin_r(buf, len) getlogin_r (buf, len)
+# define __stat64(fname, buf)   stat (fname, buf)
+# define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag)
+# define struct_stat64          struct stat
+# ifndef __MVS__
+#  define __alloca              alloca
+# endif
+# define __readdir              readdir
+# define COMPILE_GLOB64
 #endif /* _LIBC */
 
 #include <fnmatch.h>
 
+#include <flexmember.h>
+#include <glob_internal.h>
+
 #ifdef _SC_GETPW_R_SIZE_MAX
 # define GETPW_R_SIZE_MAX()	sysconf (_SC_GETPW_R_SIZE_MAX)
 #else
@@ -121,61 +92,59 @@
 
 static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
 
+typedef uint_fast8_t dirent_type;
+
+#if !defined _LIBC && !defined HAVE_STRUCT_DIRENT_D_TYPE
+/* Any distinct values will do here.
+   Undef any existing macros out of the way.  */
+# undef DT_UNKNOWN
+# undef DT_DIR
+# undef DT_LNK
+# define DT_UNKNOWN 0
+# define DT_DIR 1
+# define DT_LNK 2
+#endif
+
 /* A representation of a directory entry which does not depend on the
    layout of struct dirent, or the size of ino_t.  */
 struct readdir_result
 {
   const char *name;
-# if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
-  uint8_t type;
-# endif
+#if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
+  dirent_type type;
+#endif
+#if defined _LIBC || defined D_INO_IN_DIRENT
   bool skip_entry;
+#endif
 };
 
-# if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
-/* Initializer based on the d_type member of struct dirent.  */
-#  define D_TYPE_TO_RESULT(source) (source)->d_type,
-
-/* True if the directory entry D might be a symbolic link.  */
-static bool
-readdir_result_might_be_symlink (struct readdir_result d)
-{
-  return d.type == DT_UNKNOWN || d.type == DT_LNK;
-}
-
-/* True if the directory entry D might be a directory.  */
-static bool
-readdir_result_might_be_dir (struct readdir_result d)
-{
-  return d.type == DT_DIR || readdir_result_might_be_symlink (d);
-}
-# else /* defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE */
-#  define D_TYPE_TO_RESULT(source)
-
-/* If we do not have type information, symbolic links and directories
-   are always a possibility.  */
-
-static bool
-readdir_result_might_be_symlink (struct readdir_result d)
+/* Initialize and return type member of struct readdir_result.  */
+static dirent_type
+readdir_result_type (struct readdir_result d)
 {
-  return true;
+#if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
+# define D_TYPE_TO_RESULT(source) (source)->d_type,
+  return d.type;
+#else
+# define D_TYPE_TO_RESULT(source)
+  return DT_UNKNOWN;
+#endif
 }
 
+/* Initialize and return skip_entry member of struct readdir_result.  */
 static bool
-readdir_result_might_be_dir (struct readdir_result d)
+readdir_result_skip_entry (struct readdir_result d)
 {
-  return true;
-}
-
-# endif /* defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE */
-
-# if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
 /* Initializer for skip_entry.  POSIX does not require that the d_ino
    field be present, and some systems do not provide it. */
-#  define D_INO_TO_RESULT(source) false,
-# else
-#  define D_INO_TO_RESULT(source) (source)->d_ino == 0,
-# endif
+#if defined _LIBC || defined D_INO_IN_DIRENT
+# define D_INO_TO_RESULT(source) (source)->d_ino == 0,
+  return d.skip_entry;
+#else
+# define D_INO_TO_RESULT(source)
+  return false;
+#endif
+}
 
 /* Construct an initializer for a struct readdir_result object from a
    struct dirent *.  No copy of the name is made.  */
@@ -186,8 +155,6 @@ readdir_result_might_be_dir (struct readdir_result d)
     D_INO_TO_RESULT (source)		   \
   }
 
-#endif /* !defined _LIBC || !defined GLOB_ONLY_P */
-
 /* Call gl_readdir on STREAM.  This macro can be overridden to reduce
    type safety if an old interface version needs to be supported.  */
 #ifndef GL_READDIR
@@ -225,18 +192,55 @@ convert_dirent64 (const struct dirent64 *source)
 }
 #endif
 
+#ifndef _LIBC
+/* The results of opendir() in this file are not used with dirfd and fchdir,
+   and we do not leak fds to any single-threaded code that could use stdio,
+   therefore save some unnecessary recursion in fchdir.c and opendir_safer.c.
+   FIXME - if the kernel ever adds support for multi-thread safety for
+   avoiding standard fds, then we should use opendir_safer.  */
+# ifdef GNULIB_defined_opendir
+#  undef opendir
+# endif
+# ifdef GNULIB_defined_closedir
+#  undef closedir
+# endif
 
-#ifndef attribute_hidden
-# define attribute_hidden
+/* Just use malloc.  */
+# define __libc_use_alloca(n) false
+# define alloca_account(len, avar) ((void) (len), (void) (avar), (void *) 0)
+# define extend_alloca_account(buf, len, newlen, avar) \
+    ((void) (buf), (void) (len), (void) (newlen), (void) (avar), (void *) 0)
 #endif
 
+/* Set *R = A + B.  Return true if the answer is mathematically
+   incorrect due to overflow; in this case, *R is the low order
+   bits of the correct answer.  */
+
+static bool
+size_add_wrapv (size_t a, size_t b, size_t *r)
+{
+#if 5 <= __GNUC__ && !defined __ICC
+  return __builtin_add_overflow (a, b, r);
+#else
+  *r = a + b;
+  return *r < a;
+#endif
+}
+
+static bool
+glob_use_alloca (size_t alloca_used, size_t len)
+{
+  size_t size;
+  return (!size_add_wrapv (alloca_used, len, &size)
+          && __libc_use_alloca (size));
+}
+
 static int glob_in_dir (const char *pattern, const char *directory,
 			int flags, int (*errfunc) (const char *, int),
 			glob_t *pglob, size_t alloca_used);
 extern int __glob_pattern_type (const char *pattern, int quote)
     attribute_hidden;
 
-#if !defined _LIBC || !defined GLOB_ONLY_P
 static int prefix_array (const char *prefix, char **array, size_t n) __THROWNL;
 static int collated_compare (const void *, const void *) __THROWNL;
 
@@ -265,16 +269,15 @@ next_brace_sub (const char *cp, int flags)
   return *cp != '\0' ? cp : NULL;
 }
 
-#endif /* !defined _LIBC || !defined GLOB_ONLY_P */
 
 /* Do glob searching for PATTERN, placing results in PGLOB.
    The bits defined above may be set in FLAGS.
    If a directory cannot be opened or read and ERRFUNC is not nil,
    it is called with the pathname that caused the error, and the
-   `errno' value from the failing call; if it returns non-zero
-   `glob' returns GLOB_ABORTED; if it returns zero, the error is ignored.
+   'errno' value from the failing call; if it returns non-zero
+   'glob' returns GLOB_ABORTED; if it returns zero, the error is ignored.
    If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
-   Otherwise, `glob' returns zero.  */
+   Otherwise, 'glob' returns zero.  */
 int
 #ifdef GLOB_ATTRIBUTE
 GLOB_ATTRIBUTE
@@ -292,9 +295,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
   int malloc_dirname = 0;
   glob_t dirs;
   int retval = 0;
-#ifdef _LIBC
   size_t alloca_used = 0;
-#endif
 
   if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
     {
@@ -308,7 +309,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
     flags |= GLOB_ONLYDIR;
 
   if (!(flags & GLOB_DOOFFS))
-    /* Have to do this so `globfree' knows where to start freeing.  It
+    /* Have to do this so 'globfree' knows where to start freeing.  It
        also makes all the code that uses gl_offs simpler. */
     pglob->gl_offs = 0;
 
@@ -372,14 +373,12 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  size_t rest_len;
 	  char *onealt;
 	  size_t pattern_len = strlen (pattern) - 1;
-#ifdef _LIBC
-	  int alloca_onealt = __libc_use_alloca (alloca_used + pattern_len);
+	  int alloca_onealt = glob_use_alloca (alloca_used, pattern_len);
 	  if (alloca_onealt)
 	    onealt = alloca_account (pattern_len, alloca_used);
 	  else
-#endif
 	    {
-	      onealt = (char *) malloc (pattern_len);
+	      onealt = malloc (pattern_len);
 	      if (onealt == NULL)
 		return GLOB_NOSPACE;
 	    }
@@ -392,11 +391,9 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  next = next_brace_sub (begin + 1, flags);
 	  if (next == NULL)
 	    {
-	      /* It is an illegal expression.  */
+	      /* It is an invalid expression.  */
 	    illegal_brace:
-#ifdef _LIBC
 	      if (__glibc_unlikely (!alloca_onealt))
-#endif
 		free (onealt);
 	      flags &= ~GLOB_BRACE;
 	      goto no_brace;
@@ -437,9 +434,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      /* If we got an error, return it.  */
 	      if (result && result != GLOB_NOMATCH)
 		{
-#ifdef _LIBC
 		  if (__glibc_unlikely (!alloca_onealt))
-#endif
 		    free (onealt);
 		  if (!(flags & GLOB_APPEND))
 		    {
@@ -458,9 +453,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      assert (next != NULL);
 	    }
 
-#ifdef _LIBC
 	  if (__glibc_unlikely (!alloca_onealt))
-#endif
 	    free (onealt);
 
 	  if (pglob->gl_pathc != firstc)
@@ -476,14 +469,16 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 
   /* Find the filename.  */
   filename = strrchr (pattern, '/');
+
 #if defined __MSDOS__ || defined WINDOWS32
-  /* The case of "d:pattern".  Since `:' is not allowed in
+  /* The case of "d:pattern".  Since ':' is not allowed in
      file names, we can safely assume that wherever it
      happens in pattern, it signals the filename part.  This
      is so we could some day support patterns like "[a-z]:foo".  */
   if (filename == NULL)
     filename = strchr (pattern, ':');
 #endif /* __MSDOS__ || WINDOWS32 */
+
   dirname_modified = 0;
   if (filename == NULL)
     {
@@ -508,11 +503,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	    }
 
 	  filename = pattern;
-#ifdef _AMIGA
-	  dirname = (char *) "";
-#else
 	  dirname = (char *) ".";
-#endif
 	  dirlen = 0;
 	}
     }
@@ -536,22 +527,21 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  char *drive_spec;
 
 	  ++dirlen;
-	  drive_spec = (char *) __alloca (dirlen + 1);
+	  drive_spec = __alloca (dirlen + 1);
 	  *((char *) mempcpy (drive_spec, pattern, dirlen)) = '\0';
 	  /* For now, disallow wildcards in the drive spec, to
 	     prevent infinite recursion in glob.  */
 	  if (__glob_pattern_p (drive_spec, !(flags & GLOB_NOESCAPE)))
 	    return GLOB_NOMATCH;
-	  /* If this is "d:pattern", we need to copy `:' to DIRNAME
+	  /* If this is "d:pattern", we need to copy ':' to DIRNAME
 	     as well.  If it's "d:/pattern", don't remove the slash
 	     from "d:/", since "d:" and "d:/" are not the same.*/
 	}
 #endif
-#ifdef _LIBC
-      if (__libc_use_alloca (alloca_used + dirlen + 1))
+
+      if (glob_use_alloca (alloca_used, dirlen + 1))
 	newp = alloca_account (dirlen + 1, alloca_used);
       else
-#endif
 	{
 	  newp = malloc (dirlen + 1);
 	  if (newp == NULL)
@@ -562,14 +552,17 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
       dirname = newp;
       ++filename;
 
-      if (filename[0] == '\0'
 #if defined __MSDOS__ || defined WINDOWS32
-	  && dirname[dirlen - 1] != ':'
-	  && (dirlen < 3 || dirname[dirlen - 2] != ':'
-	      || dirname[dirlen - 1] != '/')
+      bool drive_root = (dirlen > 1
+                         && (dirname[dirlen - 1] == ':'
+                             || (dirlen > 2 && dirname[dirlen - 2] == ':'
+                                 && dirname[dirlen - 1] == '/')));
+#else
+      bool drive_root = false;
 #endif
-	  && dirlen > 1)
-	/* "pattern/".  Expand "pattern", appending slashes.  */
+
+      if (filename[0] == '\0' && dirlen > 1 && !drive_root)
+        /* "pattern/".  Expand "pattern", appending slashes.  */
 	{
 	  int orig_flags = flags;
 	  if (!(flags & GLOB_NOESCAPE) && dirname[dirlen - 1] == '\\')
@@ -602,7 +595,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	}
     }
 
-#ifndef VMS
   if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
     {
       if (dirname[1] == '\0' || dirname[1] == '/'
@@ -612,100 +604,127 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  /* Look up home directory.  */
 	  char *home_dir = getenv ("HOME");
 	  int malloc_home_dir = 0;
-# ifdef _AMIGA
-	  if (home_dir == NULL || home_dir[0] == '\0')
-	    home_dir = "SYS:";
-# else
-#  ifdef WINDOWS32
-	  if (home_dir == NULL || home_dir[0] == '\0')
-	    home_dir = "c:/users/default"; /* poor default */
-#  else
 	  if (home_dir == NULL || home_dir[0] == '\0')
 	    {
+#ifdef WINDOWS32
+	      /* Windows NT defines HOMEDRIVE and HOMEPATH.  But give
+		 preference to HOME, because the user can change HOME.  */
+	      const char *home_drive = getenv ("HOMEDRIVE");
+	      const char *home_path = getenv ("HOMEPATH");
+
+	      if (home_drive != NULL && home_path != NULL)
+		{
+		  size_t home_drive_len = strlen (home_drive);
+		  size_t home_path_len = strlen (home_path);
+		  char *mem = alloca (home_drive_len + home_path_len + 1);
+
+		  memcpy (mem, home_drive, home_drive_len);
+		  memcpy (mem + home_drive_len, home_path, home_path_len + 1);
+		  home_dir = mem;
+		}
+	      else
+		home_dir = "c:/users/default"; /* poor default */
+#else
 	      int success;
 	      char *name;
+	      int malloc_name = 0;
 	      size_t buflen = GET_LOGIN_NAME_MAX () + 1;
 
 	      if (buflen == 0)
-		/* `sysconf' does not support _SC_LOGIN_NAME_MAX.  Try
+		/* 'sysconf' does not support _SC_LOGIN_NAME_MAX.  Try
 		   a moderate value.  */
 		buflen = 20;
-	      name = alloca_account (buflen, alloca_used);
+	      if (glob_use_alloca (alloca_used, buflen))
+		name = alloca_account (buflen, alloca_used);
+	      else
+		{
+		  name = malloc (buflen);
+		  if (name == NULL)
+		    {
+		      retval = GLOB_NOSPACE;
+		      goto out;
+		    }
+		  malloc_name = 1;
+		}
 
 	      success = __getlogin_r (name, buflen) == 0;
 	      if (success)
 		{
 		  struct passwd *p;
-#   if defined HAVE_GETPWNAM_R || defined _LIBC
-		  long int pwbuflen = GETPW_R_SIZE_MAX ();
+		  char *malloc_pwtmpbuf = NULL;
 		  char *pwtmpbuf;
+# if defined HAVE_GETPWNAM_R || defined _LIBC
+		  long int pwbuflenmax = GETPW_R_SIZE_MAX ();
+		  size_t pwbuflen = pwbuflenmax;
 		  struct passwd pwbuf;
-		  int malloc_pwtmpbuf = 0;
 		  int save = errno;
 
-#    ifndef _LIBC
-		  if (pwbuflen == -1)
-		    /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
+#  ifndef _LIBC
+		  if (! (0 < pwbuflenmax && pwbuflenmax <= SIZE_MAX))
+		    /* 'sysconf' does not support _SC_GETPW_R_SIZE_MAX.
 		       Try a moderate value.  */
 		    pwbuflen = 1024;
-#    endif
-		  if (__libc_use_alloca (alloca_used + pwbuflen))
+#  endif
+		  if (glob_use_alloca (alloca_used, pwbuflen))
 		    pwtmpbuf = alloca_account (pwbuflen, alloca_used);
 		  else
 		    {
 		      pwtmpbuf = malloc (pwbuflen);
 		      if (pwtmpbuf == NULL)
 			{
+			  if (__glibc_unlikely (malloc_name))
+			    free (name);
 			  retval = GLOB_NOSPACE;
 			  goto out;
 			}
-		      malloc_pwtmpbuf = 1;
+		      malloc_pwtmpbuf = pwtmpbuf;
 		    }
 
 		  while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
 			 != 0)
 		    {
+		      size_t newlen;
+		      bool v;
 		      if (errno != ERANGE)
 			{
 			  p = NULL;
 			  break;
 			}
-
-		      if (!malloc_pwtmpbuf
-			  && __libc_use_alloca (alloca_used
-						+ 2 * pwbuflen))
+		      v = size_add_wrapv (pwbuflen, pwbuflen, &newlen);
+		      if (!v && malloc_pwtmpbuf == NULL
+			  && glob_use_alloca (alloca_used, newlen))
 			pwtmpbuf = extend_alloca_account (pwtmpbuf, pwbuflen,
-							  2 * pwbuflen,
-							  alloca_used);
+							  newlen, alloca_used);
 		      else
 			{
-			  char *newp = realloc (malloc_pwtmpbuf
-						? pwtmpbuf : NULL,
-						2 * pwbuflen);
+			  char *newp = (v ? NULL
+					: realloc (malloc_pwtmpbuf, newlen));
 			  if (newp == NULL)
 			    {
-			      if (__glibc_unlikely (malloc_pwtmpbuf))
-				free (pwtmpbuf);
+			      free (malloc_pwtmpbuf);
+			      if (__glibc_unlikely (malloc_name))
+				free (name);
 			      retval = GLOB_NOSPACE;
 			      goto out;
 			    }
-			  pwtmpbuf = newp;
-			  pwbuflen = 2 * pwbuflen;
-			  malloc_pwtmpbuf = 1;
+			  malloc_pwtmpbuf = pwtmpbuf = newp;
 			}
+		      pwbuflen = newlen;
 		      __set_errno (save);
 		    }
-#   else
+# else
 		  p = getpwnam (name);
-#   endif
+# endif
+		  if (__glibc_unlikely (malloc_name))
+		    free (name);
 		  if (p != NULL)
 		    {
-		      if (!malloc_pwtmpbuf)
+		      if (malloc_pwtmpbuf == NULL)
 			home_dir = p->pw_dir;
 		      else
 			{
 			  size_t home_dir_len = strlen (p->pw_dir) + 1;
-			  if (__libc_use_alloca (alloca_used + home_dir_len))
+			  if (glob_use_alloca (alloca_used, home_dir_len))
 			    home_dir = alloca_account (home_dir_len,
 						       alloca_used);
 			  else
@@ -720,26 +739,32 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 			      malloc_home_dir = 1;
 			    }
 			  memcpy (home_dir, p->pw_dir, home_dir_len);
-
-			  free (pwtmpbuf);
 			}
 		    }
+		  free (malloc_pwtmpbuf);
 		}
+	      else
+		{
+		  if (__glibc_unlikely (malloc_name))
+		    free (name);
+		}
+#endif /* WINDOWS32 */
 	    }
 	  if (home_dir == NULL || home_dir[0] == '\0')
 	    {
+	      if (__glibc_unlikely (malloc_home_dir))
+		free (home_dir);
 	      if (flags & GLOB_TILDE_CHECK)
 		{
-		  if (__glibc_unlikely (malloc_home_dir))
-		    free (home_dir);
 		  retval = GLOB_NOMATCH;
 		  goto out;
 		}
 	      else
-		home_dir = (char *) "~"; /* No luck.  */
+		{
+		  home_dir = (char *) "~"; /* No luck.  */
+		  malloc_home_dir = 0;
+		}
 	    }
-#  endif /* WINDOWS32 */
-# endif
 	  /* Now construct the full directory.  */
 	  if (dirname[1] == '\0')
 	    {
@@ -754,8 +779,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	    {
 	      char *newp;
 	      size_t home_len = strlen (home_dir);
-	      int use_alloca = __libc_use_alloca (alloca_used
-						  + home_len + dirlen);
+	      int use_alloca = glob_use_alloca (alloca_used, home_len + dirlen);
 	      if (use_alloca)
 		newp = alloca_account (home_len + dirlen, alloca_used);
 	      else
@@ -779,12 +803,15 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      dirname = newp;
 	      dirlen += home_len - 1;
 	      malloc_dirname = !use_alloca;
+
+	      if (__glibc_unlikely (malloc_home_dir))
+		free (home_dir);
 	    }
 	  dirname_modified = 1;
 	}
-# if !defined _AMIGA && !defined WINDOWS32
       else
 	{
+#ifndef WINDOWS32
 	  char *end_name = strchr (dirname, '/');
 	  char *user_name;
 	  int malloc_user_name = 0;
@@ -806,7 +833,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  else
 	    {
 	      char *newp;
-	      if (__libc_use_alloca (alloca_used + (end_name - dirname)))
+	      if (glob_use_alloca (alloca_used, end_name - dirname))
 		newp = alloca_account (end_name - dirname, alloca_used);
 	      else
 		{
@@ -851,20 +878,21 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  /* Look up specific user's home directory.  */
 	  {
 	    struct passwd *p;
+	    char *malloc_pwtmpbuf = NULL;
 #  if defined HAVE_GETPWNAM_R || defined _LIBC
-	    long int buflen = GETPW_R_SIZE_MAX ();
+	    long int buflenmax = GETPW_R_SIZE_MAX ();
+	    size_t buflen = buflenmax;
 	    char *pwtmpbuf;
-	    int malloc_pwtmpbuf = 0;
 	    struct passwd pwbuf;
 	    int save = errno;
 
 #   ifndef _LIBC
-	    if (buflen == -1)
-	      /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.  Try a
+	    if (! (0 <= buflenmax && buflenmax <= SIZE_MAX))
+	      /* Perhaps 'sysconf' does not support _SC_GETPW_R_SIZE_MAX.  Try a
 		 moderate value.  */
 	      buflen = 1024;
 #   endif
-	    if (__libc_use_alloca (alloca_used + buflen))
+	    if (glob_use_alloca (alloca_used, buflen))
 	      pwtmpbuf = alloca_account (buflen, alloca_used);
 	    else
 	      {
@@ -877,32 +905,32 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 		    retval = GLOB_NOSPACE;
 		    goto out;
 		  }
-		malloc_pwtmpbuf = 1;
+		malloc_pwtmpbuf = pwtmpbuf;
 	      }
 
 	    while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) != 0)
 	      {
+		size_t newlen;
+		bool v;
 		if (errno != ERANGE)
 		  {
 		    p = NULL;
 		    break;
 		  }
-		if (!malloc_pwtmpbuf
-		    && __libc_use_alloca (alloca_used + 2 * buflen))
+		v = size_add_wrapv (buflen, buflen, &newlen);
+		if (!v && malloc_pwtmpbuf == NULL
+		    && glob_use_alloca (alloca_used, newlen))
 		  pwtmpbuf = extend_alloca_account (pwtmpbuf, buflen,
-						    2 * buflen, alloca_used);
+						    newlen, alloca_used);
 		else
 		  {
-		    char *newp = realloc (malloc_pwtmpbuf ? pwtmpbuf : NULL,
-					  2 * buflen);
+		    char *newp = v ? NULL : realloc (malloc_pwtmpbuf, newlen);
 		    if (newp == NULL)
 		      {
-			if (__glibc_unlikely (malloc_pwtmpbuf))
-			  free (pwtmpbuf);
+			free (malloc_pwtmpbuf);
 			goto nomem_getpw;
 		      }
-		    pwtmpbuf = newp;
-		    malloc_pwtmpbuf = 1;
+		    malloc_pwtmpbuf = pwtmpbuf = newp;
 		  }
 		__set_errno (save);
 	      }
@@ -923,7 +951,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 		  free (dirname);
 		malloc_dirname = 0;
 
-		if (__libc_use_alloca (alloca_used + home_len + rest_len + 1))
+		if (glob_use_alloca (alloca_used, home_len + rest_len + 1))
 		  dirname = alloca_account (home_len + rest_len + 1,
 					    alloca_used);
 		else
@@ -931,8 +959,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 		    dirname = malloc (home_len + rest_len + 1);
 		    if (dirname == NULL)
 		      {
-			if (__glibc_unlikely (malloc_pwtmpbuf))
-			  free (pwtmpbuf);
+			free (malloc_pwtmpbuf);
 			retval = GLOB_NOSPACE;
 			goto out;
 		      }
@@ -944,24 +971,24 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 		dirlen = home_len + rest_len;
 		dirname_modified = 1;
 
-		if (__glibc_unlikely (malloc_pwtmpbuf))
-		  free (pwtmpbuf);
+		free (malloc_pwtmpbuf);
 	      }
 	    else
 	      {
-		if (__glibc_unlikely (malloc_pwtmpbuf))
-		  free (pwtmpbuf);
+		free (malloc_pwtmpbuf);
 
 		if (flags & GLOB_TILDE_CHECK)
-		  /* We have to regard it as an error if we cannot find the
-		     home directory.  */
-		  return GLOB_NOMATCH;
+		  {
+		    /* We have to regard it as an error if we cannot find the
+		       home directory.  */
+		    retval = GLOB_NOMATCH;
+		    goto out;
+		  }
 	      }
 	  }
+#endif /* !WINDOWS32 */
 	}
-# endif	/* Not Amiga && not WINDOWS32.  */
     }
-#endif	/* Not VMS.  */
 
   /* Now test whether we looked for "~" or "~NAME".  In this case we
      can give the answer now.  */
@@ -980,19 +1007,18 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  size_t newcount = pglob->gl_pathc + pglob->gl_offs;
 	  char **new_gl_pathv;
 
-	  if (newcount > UINTPTR_MAX - (1 + 1)
-	      || newcount + 1 + 1 > ~((size_t) 0) / sizeof (char *))
+	  if (newcount > SIZE_MAX / sizeof (char *) - 2)
 	    {
 	    nospace:
 	      free (pglob->gl_pathv);
 	      pglob->gl_pathv = NULL;
 	      pglob->gl_pathc = 0;
-	      return GLOB_NOSPACE;
+	      retval = GLOB_NOSPACE;
+	      goto out;
 	    }
 
-	  new_gl_pathv
-	    = (char **) realloc (pglob->gl_pathv,
-				 (newcount + 1 + 1) * sizeof (char *));
+	  new_gl_pathv = realloc (pglob->gl_pathv,
+				  (newcount + 2) * sizeof (char *));
 	  if (new_gl_pathv == NULL)
 	    goto nospace;
 	  pglob->gl_pathv = new_gl_pathv;
@@ -1006,12 +1032,19 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      p = mempcpy (pglob->gl_pathv[newcount], dirname, dirlen);
 	      p[0] = '/';
 	      p[1] = '\0';
+	      if (__glibc_unlikely (malloc_dirname))
+		free (dirname);
 	    }
 	  else
 	    {
-	      pglob->gl_pathv[newcount] = strdup (dirname);
-	      if (pglob->gl_pathv[newcount] == NULL)
-		goto nospace;
+	      if (__glibc_unlikely (malloc_dirname))
+		pglob->gl_pathv[newcount] = dirname;
+	      else
+		{
+		  pglob->gl_pathv[newcount] = strdup (dirname);
+		  if (pglob->gl_pathv[newcount] == NULL)
+		    goto nospace;
+		}
 	    }
 	  pglob->gl_pathv[++newcount] = NULL;
 	  ++pglob->gl_pathc;
@@ -1021,7 +1054,8 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	}
 
       /* Not found.  */
-      return GLOB_NOMATCH;
+      retval = GLOB_NOMATCH;
+      goto out;
     }
 
   meta = __glob_pattern_type (dirname, !(flags & GLOB_NOESCAPE));
@@ -1067,7 +1101,10 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
       if (status != 0)
 	{
 	  if ((flags & GLOB_NOCHECK) == 0 || status != GLOB_NOMATCH)
-	    return status;
+	    {
+	      retval = status;
+	      goto out;
+	    }
 	  goto no_matches;
 	}
 
@@ -1078,19 +1115,6 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	{
 	  size_t old_pathc;
 
-#ifdef	SHELL
-	  {
-	    /* Make globbing interruptible in the bash shell. */
-	    extern int interrupt_state;
-
-	    if (interrupt_state)
-	      {
-		globfree (&dirs);
-		return GLOB_ABORTED;
-	      }
-	  }
-#endif /* SHELL.  */
-
 	  old_pathc = pglob->gl_pathc;
 	  status = glob_in_dir (filename, dirs.gl_pathv[i],
 				((flags | GLOB_APPEND)
@@ -1105,7 +1129,8 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      globfree (&dirs);
 	      globfree (pglob);
 	      pglob->gl_pathc = 0;
-	      return status;
+	      retval = status;
+	      goto out;
 	    }
 
 	  /* Stick the directory on the front of each name.  */
@@ -1116,13 +1141,14 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      globfree (&dirs);
 	      globfree (pglob);
 	      pglob->gl_pathc = 0;
-	      return GLOB_NOSPACE;
+	      retval = GLOB_NOSPACE;
+	      goto out;
 	    }
 	}
 
       flags |= GLOB_MAGCHAR;
 
-      /* We have ignored the GLOB_NOCHECK flag in the `glob_in_dir' calls.
+      /* We have ignored the GLOB_NOCHECK flag in the 'glob_in_dir' calls.
 	 But if we have not found any matching entry and the GLOB_NOCHECK
 	 flag was set we must return the input pattern itself.  */
       if (pglob->gl_pathc + pglob->gl_offs == oldcount)
@@ -1134,28 +1160,28 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      size_t newcount = pglob->gl_pathc + pglob->gl_offs;
 	      char **new_gl_pathv;
 
-	      if (newcount > UINTPTR_MAX - 2
-		  || newcount + 2 > ~((size_t) 0) / sizeof (char *))
+	      if (newcount > SIZE_MAX / sizeof (char *) - 2)
 		{
 		nospace2:
 		  globfree (&dirs);
-		  return GLOB_NOSPACE;
+		  retval = GLOB_NOSPACE;
+		  goto out;
 		}
 
-	      new_gl_pathv = (char **) realloc (pglob->gl_pathv,
-						(newcount + 2)
-						* sizeof (char *));
+	      new_gl_pathv = realloc (pglob->gl_pathv,
+				      (newcount + 2) * sizeof (char *));
 	      if (new_gl_pathv == NULL)
 		goto nospace2;
 	      pglob->gl_pathv = new_gl_pathv;
 
-	      pglob->gl_pathv[newcount] = __strdup (pattern);
+	      pglob->gl_pathv[newcount] = strdup (pattern);
 	      if (pglob->gl_pathv[newcount] == NULL)
 		{
 		  globfree (&dirs);
 		  globfree (pglob);
 		  pglob->gl_pathc = 0;
-		  return GLOB_NOSPACE;
+		  retval = GLOB_NOSPACE;
+		  goto out;
 		}
 
 	      ++pglob->gl_pathc;
@@ -1167,7 +1193,8 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	  else
 	    {
 	      globfree (&dirs);
-	      return GLOB_NOMATCH;
+	      retval = GLOB_NOMATCH;
+	      goto out;
 	    }
 	}
 
@@ -1213,7 +1240,8 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      flags = orig_flags;
 	      goto no_matches;
 	    }
-	  return status;
+	  retval = status;
+	  goto out;
 	}
 
       if (dirlen > 0)
@@ -1225,7 +1253,8 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	    {
 	      globfree (pglob);
 	      pglob->gl_pathc = 0;
-	      return GLOB_NOSPACE;
+	      retval = GLOB_NOSPACE;
+	      goto out;
 	    }
 	}
     }
@@ -1250,7 +1279,8 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 	      {
 		globfree (pglob);
 		pglob->gl_pathc = 0;
-		return GLOB_NOSPACE;
+		retval = GLOB_NOSPACE;
+		goto out;
 	      }
 	    strcpy (&new[len - 2], "/");
 	    pglob->gl_pathv[i] = new;
@@ -1276,32 +1306,12 @@ libc_hidden_def (glob)
 #endif
 
 
-#if !defined _LIBC || !defined GLOB_ONLY_P
-
-/* Free storage allocated in PGLOB by a previous `glob' call.  */
-void
-globfree (glob_t *pglob)
-{
-  if (pglob->gl_pathv != NULL)
-    {
-      size_t i;
-      for (i = 0; i < pglob->gl_pathc; ++i)
-	free (pglob->gl_pathv[pglob->gl_offs + i]);
-      free (pglob->gl_pathv);
-      pglob->gl_pathv = NULL;
-    }
-}
-#if defined _LIBC && !defined globfree
-libc_hidden_def (globfree)
-#endif
-
-
 /* Do a collated comparison of A and B.  */
 static int
 collated_compare (const void *a, const void *b)
 {
-  const char *const s1 = *(const char *const * const) a;
-  const char *const s2 = *(const char *const * const) b;
+  char *const *ps1 = a; char *s1 = *ps1;
+  char *const *ps2 = b; char *s2 = *ps2;
 
   if (s1 == s2)
     return 0;
@@ -1322,28 +1332,24 @@ prefix_array (const char *dirname, char **array, size_t n)
 {
   size_t i;
   size_t dirlen = strlen (dirname);
-#if defined __MSDOS__ || defined WINDOWS32
-  int sep_char = '/';
-# define DIRSEP_CHAR sep_char
-#else
-# define DIRSEP_CHAR '/'
-#endif
+  char dirsep_char = '/';
 
   if (dirlen == 1 && dirname[0] == '/')
     /* DIRNAME is just "/", so normal prepending would get us "//foo".
        We want "/foo" instead, so don't prepend any chars from DIRNAME.  */
     dirlen = 0;
+
 #if defined __MSDOS__ || defined WINDOWS32
-  else if (dirlen > 1)
+  if (dirlen > 1)
     {
       if (dirname[dirlen - 1] == '/' && dirname[dirlen - 2] == ':')
 	/* DIRNAME is "d:/".  Don't prepend the slash from DIRNAME.  */
 	--dirlen;
       else if (dirname[dirlen - 1] == ':')
 	{
-	  /* DIRNAME is "d:".  Use `:' instead of `/'.  */
+	  /* DIRNAME is "d:".  Use ':' instead of '/'.  */
 	  --dirlen;
-	  sep_char = ':';
+	  dirsep_char = ':';
 	}
     }
 #endif
@@ -1351,7 +1357,7 @@ prefix_array (const char *dirname, char **array, size_t n)
   for (i = 0; i < n; ++i)
     {
       size_t eltlen = strlen (array[i]) + 1;
-      char *new = (char *) malloc (dirlen + 1 + eltlen);
+      char *new = malloc (dirlen + 1 + eltlen);
       if (new == NULL)
 	{
 	  while (i > 0)
@@ -1361,7 +1367,7 @@ prefix_array (const char *dirname, char **array, size_t n)
 
       {
 	char *endp = mempcpy (new, dirname, dirlen);
-	*endp++ = DIRSEP_CHAR;
+	*endp++ = dirsep_char;
 	mempcpy (endp, array[i], eltlen);
       }
       free (array[i]);
@@ -1371,103 +1377,57 @@ prefix_array (const char *dirname, char **array, size_t n)
   return 0;
 }
 
-
-/* We must not compile this function twice.  */
-#if !defined _LIBC || !defined NO_GLOB_PATTERN_P
-int
-__glob_pattern_type (const char *pattern, int quote)
-{
-  const char *p;
-  int ret = 0;
-
-  for (p = pattern; *p != '\0'; ++p)
-    switch (*p)
-      {
-      case '?':
-      case '*':
-	return 1;
-
-      case '\\':
-	if (quote)
-	  {
-	    if (p[1] != '\0')
-	      ++p;
-	    ret |= 2;
-	  }
-	break;
-
-      case '[':
-	ret |= 4;
-	break;
-
-      case ']':
-	if (ret & 4)
-	  return 1;
-	break;
-      }
-
-  return ret;
-}
-
-/* Return nonzero if PATTERN contains any metacharacters.
-   Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
-int
-__glob_pattern_p (const char *pattern, int quote)
-{
-  return __glob_pattern_type (pattern, quote) == 1;
-}
-# ifdef _LIBC
-weak_alias (__glob_pattern_p, glob_pattern_p)
-# endif
-#endif
-
-#endif /* !GLOB_ONLY_P */
-
-
 /* We put this in a separate function mainly to allow the memory
    allocated with alloca to be recycled.  */
-#if !defined _LIBC || !defined GLOB_ONLY_P
 static int
 __attribute_noinline__
-link_exists2_p (const char *dir, size_t dirlen, const char *fname,
-	       glob_t *pglob
-# ifndef _LIBC
-		, int flags
+link_stat (const char *dir, size_t dirlen, const char *fname,
+	   glob_t *pglob
+# if !defined _LIBC && !HAVE_FSTATAT
+	   , int flags
 # endif
-		)
+	   )
 {
   size_t fnamelen = strlen (fname);
-  char *fullname = (char *) __alloca (dirlen + 1 + fnamelen + 1);
+  char *fullname = __alloca (dirlen + 1 + fnamelen + 1);
   struct stat st;
-# ifndef _LIBC
-  struct_stat64 st64;
-# endif
 
   mempcpy (mempcpy (mempcpy (fullname, dir, dirlen), "/", 1),
 	   fname, fnamelen + 1);
 
-# ifdef _LIBC
-  return (*pglob->gl_stat) (fullname, &st) == 0;
-# else
-  return ((__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
-	   ? (*pglob->gl_stat) (fullname, &st)
-	   : __stat64 (fullname, &st64)) == 0);
+# if !defined _LIBC && !HAVE_FSTATAT
+  if (__builtin_expect ((flags & GLOB_ALTDIRFUNC) == 0, 1))
+    {
+      struct_stat64 st64;
+      return __stat64 (fullname, &st64);
+    }
 # endif
+  return (*pglob->gl_stat) (fullname, &st);
 }
-# ifdef _LIBC
-#  define link_exists_p(dfd, dirname, dirnamelen, fname, pglob, flags) \
-  (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)			      \
-   ? link_exists2_p (dirname, dirnamelen, fname, pglob)			      \
-   : ({ struct stat64 st64;						      \
-       __fxstatat64 (_STAT_VER, dfd, fname, &st64, 0) == 0; }))
+
+/* Return true if DIR/FNAME exists.  */
+static int
+link_exists_p (int dfd, const char *dir, size_t dirlen, const char *fname,
+	       glob_t *pglob, int flags)
+{
+  int status;
+# if defined _LIBC || HAVE_FSTATAT
+  if (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0))
+    status = link_stat (dir, dirlen, fname, pglob);
+  else
+    {
+      /* dfd cannot be -1 here, because dirfd never returns -1 on
+	 glibc, or on hosts that have fstatat.  */
+      struct_stat64 st64;
+      status = __fxstatat64 (_STAT_VER, dfd, fname, &st64, 0);
+    }
 # else
-#  define link_exists_p(dfd, dirname, dirnamelen, fname, pglob, flags) \
-  link_exists2_p (dirname, dirnamelen, fname, pglob, flags)
+  status = link_stat (dir, dirlen, fname, pglob, flags);
 # endif
-#endif
-
+  return status == 0 || errno == EOVERFLOW;
+}
 
-/* Like `glob', but PATTERN is a final pathname component,
+/* Like 'glob', but PATTERN is a final pathname component,
    and matches are searched for in DIRECTORY.
    The GLOB_NOSORT bit in FLAGS is ignored.  No sorting is ever done.
    The GLOB_APPEND flag is assumed to be set (always appends).  */
@@ -1478,25 +1438,25 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 {
   size_t dirlen = strlen (directory);
   void *stream = NULL;
-  struct globnames
-    {
-      struct globnames *next;
-      size_t count;
-      char *name[64];
-    };
-#define INITIAL_COUNT sizeof (init_names.name) / sizeof (init_names.name[0])
-  struct globnames init_names;
-  struct globnames *names = &init_names;
-  struct globnames *names_alloca = &init_names;
+# define GLOBNAMES_MEMBERS(nnames) \
+    struct globnames *next; size_t count; char *name[nnames];
+  struct globnames { GLOBNAMES_MEMBERS (FLEXIBLE_ARRAY_MEMBER) };
+  struct { GLOBNAMES_MEMBERS (64) } init_names_buf;
+  struct globnames *init_names = (struct globnames *) &init_names_buf;
+  struct globnames *names = init_names;
+  struct globnames *names_alloca = init_names;
   size_t nfound = 0;
   size_t cur = 0;
   int meta;
   int save;
+  int result;
 
-  alloca_used += sizeof (init_names);
+  alloca_used += sizeof init_names_buf;
 
-  init_names.next = NULL;
-  init_names.count = INITIAL_COUNT;
+  init_names->next = NULL;
+  init_names->count = ((sizeof init_names_buf
+                        - offsetof (struct globnames, name))
+                       / sizeof init_names->name[0]);
 
   meta = __glob_pattern_type (pattern, !(flags & GLOB_NOESCAPE));
   if (meta == 0 && (flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
@@ -1516,14 +1476,16 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 	struct_stat64 st64;
       } ust;
       size_t patlen = strlen (pattern);
-      int alloca_fullname = __libc_use_alloca (alloca_used
-					       + dirlen + 1 + patlen + 1);
+      size_t fullsize;
+      bool alloca_fullname
+        = (! size_add_wrapv (dirlen + 1, patlen + 1, &fullsize)
+           && glob_use_alloca (alloca_used, fullsize));
       char *fullname;
       if (alloca_fullname)
-	fullname = alloca_account (dirlen + 1 + patlen + 1, alloca_used);
+        fullname = alloca_account (fullsize, alloca_used);
       else
 	{
-	  fullname = malloc (dirlen + 1 + patlen + 1);
+	  fullname = malloc (fullsize);
 	  if (fullname == NULL)
 	    return GLOB_NOSPACE;
 	}
@@ -1531,9 +1493,11 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
       mempcpy (mempcpy (mempcpy (fullname, directory, dirlen),
 			"/", 1),
 	       pattern, patlen + 1);
-      if ((__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
+      if (((__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
 	   ? (*pglob->gl_stat) (fullname, &ust.st)
-	   : __stat64 (fullname, &ust.st64)) == 0)
+	    : __stat64 (fullname, &ust.st64))
+	   == 0)
+	  || errno == EOVERFLOW)
 	/* We found this file to be existing.  Now tell the rest
 	   of the function to copy this name into the result.  */
 	flags |= GLOB_NOCHECK;
@@ -1555,16 +1519,10 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 	}
       else
 	{
-#ifdef _LIBC
 	  int dfd = (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
 		     ? -1 : dirfd ((DIR *) stream));
-#endif
 	  int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
-			   | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
-#if defined _AMIGA || defined VMS
-			   | FNM_CASEFOLD
-#endif
-			   );
+			   | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0));
 	  flags |= GLOB_MAGCHAR;
 
 	  while (1)
@@ -1584,19 +1542,24 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 	      }
 	      if (d.name == NULL)
 		break;
-	      if (d.skip_entry)
+	      if (readdir_result_skip_entry (d))
 		continue;
 
 	      /* If we shall match only directories use the information
 		 provided by the dirent call if possible.  */
-	      if ((flags & GLOB_ONLYDIR) && !readdir_result_might_be_dir (d))
-		continue;
+	      if (flags & GLOB_ONLYDIR)
+		switch (readdir_result_type (d))
+		  {
+		  case DT_DIR: case DT_LNK: case DT_UNKNOWN: break;
+		  default: continue;
+		  }
 
 	      if (fnmatch (pattern, d.name, fnm_flags) == 0)
 		{
 		  /* If the file we found is a symlink we have to
 		     make sure the target file exists.  */
-		  if (!readdir_result_might_be_symlink (d)
+		  dirent_type type = readdir_result_type (d);
+		  if (! (type == DT_LNK || type == DT_UNKNOWN)
 		      || link_exists_p (dfd, directory, dirlen, d.name,
 					pglob, flags))
 		    {
@@ -1604,10 +1567,13 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 			{
 			  struct globnames *newnames;
 			  size_t count = names->count * 2;
-			  size_t size = (sizeof (struct globnames)
-					 + ((count - INITIAL_COUNT)
-					    * sizeof (char *)));
-			  if (__libc_use_alloca (alloca_used + size))
+			  size_t nameoff = offsetof (struct globnames, name);
+			  size_t size = FLEXSIZEOF (struct globnames, name,
+						    count * sizeof (char *));
+			  if ((SIZE_MAX - nameoff) / 2 / sizeof (char *)
+			      < names->count)
+			    goto memory_error;
+			  if (glob_use_alloca (alloca_used, size))
 			    newnames = names_alloca
 			      = alloca_account (size, alloca_used);
 			  else if ((newnames = malloc (size))
@@ -1623,6 +1589,8 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 			goto memory_error;
 		      ++cur;
 		      ++nfound;
+		      if (SIZE_MAX - pglob->gl_offs <= nfound)
+			goto memory_error;
 		    }
 		}
 	    }
@@ -1633,29 +1601,27 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
     {
       size_t len = strlen (pattern);
       nfound = 1;
-      names->name[cur] = (char *) malloc (len + 1);
+      names->name[cur] = malloc (len + 1);
       if (names->name[cur] == NULL)
 	goto memory_error;
       *((char *) mempcpy (names->name[cur++], pattern, len)) = '\0';
     }
 
-  int result = GLOB_NOMATCH;
+  result = GLOB_NOMATCH;
   if (nfound != 0)
     {
+      char **new_gl_pathv;
       result = 0;
 
-      if (pglob->gl_pathc > UINTPTR_MAX - pglob->gl_offs
-	  || pglob->gl_pathc + pglob->gl_offs > UINTPTR_MAX - nfound
-	  || pglob->gl_pathc + pglob->gl_offs + nfound > UINTPTR_MAX - 1
-	  || (pglob->gl_pathc + pglob->gl_offs + nfound + 1
-	      > UINTPTR_MAX / sizeof (char *)))
+      if (SIZE_MAX / sizeof (char *) - pglob->gl_pathc
+	  < pglob->gl_offs + nfound + 1)
 	goto memory_error;
 
-      char **new_gl_pathv;
       new_gl_pathv
-	= (char **) realloc (pglob->gl_pathv,
-			     (pglob->gl_pathc + pglob->gl_offs + nfound + 1)
-			     * sizeof (char *));
+	= realloc (pglob->gl_pathv,
+		   (pglob->gl_pathc + pglob->gl_offs + nfound + 1)
+		    * sizeof (char *));
+
       if (new_gl_pathv == NULL)
 	{
 	memory_error:
@@ -1671,7 +1637,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 		 and this is the block assigned to OLD here.  */
 	      if (names == NULL)
 		{
-		  assert (old == &init_names);
+		  assert (old == init_names);
 		  break;
 		}
 	      cur = names->count;
@@ -1697,7 +1663,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
 		 and this is the block assigned to OLD here.  */
 	      if (names == NULL)
 		{
-		  assert (old == &init_names);
+		  assert (old == init_names);
 		  break;
 		}
 	      cur = names->count;
diff --git a/posix/glob64.c b/posix/glob64.c
index 6cb3d654a8..a515a1c12f 100644
--- a/posix/glob64.c
+++ b/posix/glob64.c
@@ -43,10 +43,4 @@ glob64 (const char *pattern, int flags,
 }
 libc_hidden_def (glob64)
 
-void
-globfree64 (glob64_t *pglob)
-{
-}
-libc_hidden_def (globfree64)
-
 stub_warning (glob64)
diff --git a/posix/glob_internal.h b/posix/glob_internal.h
new file mode 100644
index 0000000000..12c93660b7
--- /dev/null
+++ b/posix/glob_internal.h
@@ -0,0 +1,57 @@
+/* Shared definition for glob and glob_pattern_p.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef GLOB_INTERNAL_H
+# define GLOB_INTERNAL_H
+
+static inline int
+__glob_pattern_type (const char *pattern, int quote)
+{
+  const char *p;
+  int ret = 0;
+
+  for (p = pattern; *p != '\0'; ++p)
+    switch (*p)
+      {
+      case '?':
+      case '*':
+        return 1;
+
+      case '\\':
+        if (quote)
+          {
+            if (p[1] != '\0')
+              ++p;
+            ret |= 2;
+          }
+        break;
+
+      case '[':
+        ret |= 4;
+        break;
+
+      case ']':
+        if (ret & 4)
+          return 1;
+        break;
+      }
+
+  return ret;
+}
+
+#endif /* GLOB_INTERNAL_H  */
diff --git a/posix/glob_pattern_p.c b/posix/glob_pattern_p.c
new file mode 100644
index 0000000000..a17d337182
--- /dev/null
+++ b/posix/glob_pattern_p.c
@@ -0,0 +1,33 @@
+/* Return nonzero if PATTERN contains any metacharacters.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <glob.h>
+#include "glob_internal.h"
+
+/* Return nonzero if PATTERN contains any metacharacters.
+   Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
+int
+__glob_pattern_p (const char *pattern, int quote)
+{
+  return __glob_pattern_type (pattern, quote) == 1;
+}
+weak_alias (__glob_pattern_p, glob_pattern_p)
diff --git a/posix/globfree.c b/posix/globfree.c
new file mode 100644
index 0000000000..042e29d9b0
--- /dev/null
+++ b/posix/globfree.c
@@ -0,0 +1,41 @@
+/* Frees the dynamically allocated storage from an earlier call to glob.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <glob.h>
+#include <stdlib.h>
+
+/* Free storage allocated in PGLOB by a previous `glob' call.  */
+void
+globfree (glob_t *pglob)
+{
+  if (pglob->gl_pathv != NULL)
+    {
+      size_t i;
+      for (i = 0; i < pglob->gl_pathc; ++i)
+        free (pglob->gl_pathv[pglob->gl_offs + i]);
+      free (pglob->gl_pathv);
+      pglob->gl_pathv = NULL;
+    }
+}
+#ifndef globfree
+libc_hidden_def (globfree)
+#endif
diff --git a/posix/globfree64.c b/posix/globfree64.c
new file mode 100644
index 0000000000..c9f8908a4e
--- /dev/null
+++ b/posix/globfree64.c
@@ -0,0 +1,31 @@
+/* Frees the dynamically allocated storage from an earlier call to glob.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <glob.h>
+#include <stdlib.h>
+
+/* Free storage allocated in PGLOB by a previous `glob' call.  */
+void
+globfree64 (glob64_t *pglob)
+{
+}
+libc_hidden_def (globfree64)
diff --git a/sysdeps/gnu/glob64.c b/sysdeps/gnu/glob64.c
index d1e4e6f0d5..52e97e2f6a 100644
--- a/sysdeps/gnu/glob64.c
+++ b/sysdeps/gnu/glob64.c
@@ -15,11 +15,8 @@
 #undef __stat
 #define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
 
-#define NO_GLOB_PATTERN_P 1
-
 #define COMPILE_GLOB64	1
 
 #include <posix/glob.c>
 
 libc_hidden_def (glob64)
-libc_hidden_def (globfree64)
diff --git a/sysdeps/gnu/globfree64.c b/sysdeps/gnu/globfree64.c
new file mode 100644
index 0000000000..f092d0bf8b
--- /dev/null
+++ b/sysdeps/gnu/globfree64.c
@@ -0,0 +1,10 @@
+#include <dirent.h>
+#include <glob.h>
+#include <sys/stat.h>
+
+#define glob_t glob64_t
+#define globfree(pglob) globfree64 (pglob)
+
+#include <posix/globfree.c>
+
+libc_hidden_def (globfree64)
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 5dce300f7f..dbe6a36c57 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -166,7 +166,7 @@ endif
 ifeq ($(subdir),posix)
 sysdep_headers += bits/initspin.h
 
-sysdep_routines += sched_getcpu
+sysdep_routines += sched_getcpu oldglob
 
 tests += tst-affinity tst-affinity-pid
 
diff --git a/sysdeps/unix/sysv/linux/alpha/glob.c b/sysdeps/unix/sysv/linux/alpha/glob.c
index 2d7d287a25..1b813c1cfd 100644
--- a/sysdeps/unix/sysv/linux/alpha/glob.c
+++ b/sysdeps/unix/sysv/linux/alpha/glob.c
@@ -42,10 +42,6 @@ extern void __new_globfree (glob_t *__pglob);
 #undef globfree64
 
 versioned_symbol (libc, __new_glob, glob, GLIBC_2_1);
-versioned_symbol (libc, __new_globfree, globfree, GLIBC_2_1);
 libc_hidden_ver (__new_glob, glob)
-libc_hidden_ver (__new_globfree, globfree)
 
 weak_alias (__new_glob, glob64)
-weak_alias (__new_globfree, globfree64)
-libc_hidden_ver (__new_globfree, globfree64)
diff --git a/sysdeps/unix/sysv/linux/alpha/globfree.c b/sysdeps/unix/sysv/linux/alpha/globfree.c
new file mode 100644
index 0000000000..98cf1c200b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/globfree.c
@@ -0,0 +1,37 @@
+/* Compat globfree.  Linux/alpha version.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define globfree64 __no_globfree64_decl
+#include <sys/types.h>
+#include <glob.h>
+#include <shlib-compat.h>
+
+#define globfree(pglob) \
+  __new_globfree (pglob)
+
+extern void __new_globfree (glob_t *__pglob);
+
+#include <posix/globfree.c>
+
+#undef globfree64
+
+versioned_symbol (libc, __new_globfree, globfree, GLIBC_2_1);
+libc_hidden_ver (__new_globfree, globfree)
+
+weak_alias (__new_globfree, globfree64)
+libc_hidden_ver (__new_globfree, globfree64)
diff --git a/sysdeps/unix/sysv/linux/i386/glob64.c b/sysdeps/unix/sysv/linux/i386/glob64.c
index 956cb0474a..230f9fc037 100644
--- a/sysdeps/unix/sysv/linux/i386/glob64.c
+++ b/sysdeps/unix/sysv/linux/i386/glob64.c
@@ -19,6 +19,7 @@
 #include <dirent.h>
 #include <glob.h>
 #include <sys/stat.h>
+#include <shlib-compat.h>
 
 #define dirent dirent64
 #define __readdir(dirp) __readdir64 (dirp)
@@ -33,47 +34,9 @@
 #undef __stat
 #define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
 
-#define NO_GLOB_PATTERN_P 1
-
 #define COMPILE_GLOB64	1
 
 #include <posix/glob.c>
 
-#include "shlib-compat.h"
-
-libc_hidden_def (globfree64)
-
 versioned_symbol (libc, __glob64, glob64, GLIBC_2_2);
 libc_hidden_ver (__glob64, glob64)
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-
-#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
-
-int __old_glob64 (const char *__pattern, int __flags,
-		  int (*__errfunc) (const char *, int),
-		  glob64_t *__pglob);
-libc_hidden_proto (__old_glob64);
-
-#undef dirent
-#define dirent __old_dirent64
-#undef GL_READDIR
-# define GL_READDIR(pglob, stream) \
-  ((struct __old_dirent64 *) (pglob)->gl_readdir (stream))
-#undef __readdir
-#define __readdir(dirp) __old_readdir64 (dirp)
-#undef glob
-#define glob(pattern, flags, errfunc, pglob) \
-  __old_glob64 (pattern, flags, errfunc, pglob)
-#define convert_dirent __old_convert_dirent
-#define glob_in_dir __old_glob_in_dir
-#define GLOB_ATTRIBUTE attribute_compat_text_section
-
-#define GLOB_ONLY_P 1
-
-#include <posix/glob.c>
-
-libc_hidden_def (__old_glob64);
-
-compat_symbol (libc, __old_glob64, glob64, GLIBC_2_1);
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c b/sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c
new file mode 100644
index 0000000000..abc35fdd2b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c
@@ -0,0 +1 @@
+/* glob64 is in globfree64.c */
diff --git a/sysdeps/unix/sysv/linux/oldglob.c b/sysdeps/unix/sysv/linux/oldglob.c
new file mode 100644
index 0000000000..8233e57ce9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/oldglob.c
@@ -0,0 +1,42 @@
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+
+#include <dirent.h>
+#include <glob.h>
+#include <sys/stat.h>
+
+#include <sysdeps/unix/sysv/linux/i386/olddirent.h>
+
+int __old_glob64 (const char *__pattern, int __flags,
+		  int (*__errfunc) (const char *, int),
+		  glob64_t *__pglob);
+libc_hidden_proto (__old_glob64);
+
+#define dirent __old_dirent64
+#define GL_READDIR(pglob, stream) \
+  ((struct __old_dirent64 *) (pglob)->gl_readdir (stream))
+#undef __readdir
+#define __readdir(dirp) __old_readdir64 (dirp)
+
+#define glob_t glob64_t
+#define glob(pattern, flags, errfunc, pglob) \
+  __old_glob64 (pattern, flags, errfunc, pglob)
+#define globfree(pglob) globfree64(pglob)
+
+#define convert_dirent __old_convert_dirent
+#define glob_in_dir __old_glob_in_dir
+
+#undef stat
+#define stat stat64
+#undef __stat
+#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
+
+#define GLOB_ATTRIBUTE attribute_compat_text_section
+
+#include <posix/glob.c>
+
+libc_hidden_def (__old_glob64);
+
+compat_symbol (libc, __old_glob64, glob64, GLIBC_2_1);
+#endif
diff --git a/sysdeps/unix/sysv/linux/wordsize-64/globfree64.c b/sysdeps/unix/sysv/linux/wordsize-64/globfree64.c
new file mode 100644
index 0000000000..af035e1514
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/wordsize-64/globfree64.c
@@ -0,0 +1,2 @@
+/* This file is here so sysdeps/gnu/glob64.c doesn't take precedence.  */
+#include <sysdeps/wordsize-64/globfree64.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/globfree.c b/sysdeps/unix/sysv/linux/x86_64/x32/globfree.c
new file mode 100644
index 0000000000..b76a761c17
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/globfree.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/globfree.c>
diff --git a/sysdeps/wordsize-64/glob.c b/sysdeps/wordsize-64/glob.c
index 082faf1c70..954e8d37e2 100644
--- a/sysdeps/wordsize-64/glob.c
+++ b/sysdeps/wordsize-64/glob.c
@@ -4,5 +4,3 @@
 #undef glob64
 #undef globfree64
 weak_alias (glob, glob64)
-weak_alias (globfree, globfree64)
-libc_hidden_ver (globfree, globfree64)
diff --git a/sysdeps/wordsize-64/globfree.c b/sysdeps/wordsize-64/globfree.c
new file mode 100644
index 0000000000..ec8c35b489
--- /dev/null
+++ b/sysdeps/wordsize-64/globfree.c
@@ -0,0 +1,5 @@
+#define globfree64 __no_globfree64_decl
+#include <posix/globfree.c>
+#undef globfree64
+weak_alias (globfree, globfree64)
+libc_hidden_ver (globfree, globfree64)
diff --git a/sysdeps/wordsize-64/globfree64.c b/sysdeps/wordsize-64/globfree64.c
new file mode 100644
index 0000000000..a0f57ff4b3
--- /dev/null
+++ b/sysdeps/wordsize-64/globfree64.c
@@ -0,0 +1 @@
+/* globfree64 is in globfree.c */
-- 
2.14.1


From a76376df7c07e577a9515c3faa5dbd50bda5da07 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 20 Oct 2017 18:41:14 +0200
Subject: [PATCH 65/90] CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]

(cherry picked from commit c369d66e5426a30e4725b100d5cd28e372754f90)
---
 ChangeLog    | 6 ++++++
 NEWS         | 5 +++++
 posix/glob.c | 2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index d54d5a895d..e05c7fe433 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-20  Paul Eggert <eggert@cs.ucla.edu>
+
+	[BZ #22320]
+	CVE-2017-15670
+	* posix/glob.c (__glob): Fix one-byte overflow.
+
 2017-09-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	[BZ #1062]
diff --git a/NEWS b/NEWS
index ddc950c6cf..80248fec89 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,11 @@ Security related changes:
   vulnerability; only trusted binaries must be examined using the ldd
   script.)
 
+  CVE-2017-15670: The glob function, when invoked with GLOB_TILDE,
+  suffered from a one-byte overflow during ~ operator processing (either
+  on the stack or the heap, depending on the length of the user name).
+  Reported by Tim Rühsen.
+
 The following bugs are resolved with this release:
 
   [16750] ldd: Never run file directly.
diff --git a/posix/glob.c b/posix/glob.c
index a7eccf9cb4..c761c0861d 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -870,7 +870,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
 		  *p = '\0';
 		}
 	      else
-		*((char *) mempcpy (newp, dirname + 1, end_name - dirname))
+		*((char *) mempcpy (newp, dirname + 1, end_name - dirname - 1))
 		  = '\0';
 	      user_name = newp;
 	    }
-- 
2.14.1


From 6182b3708b7af316454c81467538a8c20c1b046d Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Sat, 21 Oct 2017 18:03:30 +0200
Subject: [PATCH 66/90] glob: Add new test tst-glob-tilde

The new test checks for memory leaks (see bug 22325) and attempts
to trigger the buffer overflow in bug 22320.

(cherry picked from commit e80fc1fc98bf614eb01cf8325503df3a1451a99c)
---
 ChangeLog              |   8 +++
 posix/Makefile         |  11 +++-
 posix/tst-glob-tilde.c | 136 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 153 insertions(+), 2 deletions(-)
 create mode 100644 posix/tst-glob-tilde.c

diff --git a/ChangeLog b/ChangeLog
index e05c7fe433..fccc246b20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-10-21  Florian Weimer  <fweimer@redhat.com>
+
+	* posix/Makefile (tests): Add tst-glob-tilde.
+	(tests-special): Add tst-glob-tilde-mem.out
+	(tst-glob-tilde-ENV): Set MALLOC_TRACE.
+	(tst-glob-tilde-mem.out): Add mtrace check.
+	* posix/tst-glob-tilde.c: New file.
+
 2017-10-20  Paul Eggert <eggert@cs.ucla.edu>
 
 	[BZ #22320]
diff --git a/posix/Makefile b/posix/Makefile
index 51e7e5bcb8..d35b7921b1 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -93,7 +93,7 @@ tests		:= test-errno tstgetopt testfnm runtests runptests \
 		   tst-fnmatch3 bug-regex36 tst-getaddrinfo5 \
 		   tst-posix_spawn-fd tst-posix_spawn-setsid \
 		   tst-posix_fadvise tst-posix_fadvise64 \
-		   tst-sysconf-empty-chroot
+		   tst-sysconf-empty-chroot tst-glob-tilde
 tests-internal	:= bug-regex5 bug-regex20 bug-regex33 \
 		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3
 xtests		:= bug-ga2
@@ -141,7 +141,8 @@ tests-special += $(objpfx)bug-regex2-mem.out $(objpfx)bug-regex14-mem.out \
 		 $(objpfx)tst-rxspencer-no-utf8-mem.out $(objpfx)tst-pcre-mem.out \
 		 $(objpfx)tst-boost-mem.out $(objpfx)tst-getconf.out \
 		 $(objpfx)bug-glob2-mem.out $(objpfx)tst-vfork3-mem.out \
-		 $(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out
+		 $(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out \
+		 $(objpfx)tst-glob-tilde-mem.out
 xtests-special += $(objpfx)bug-ga2-mem.out
 endif
 
@@ -350,6 +351,12 @@ $(objpfx)bug-glob2-mem.out: $(objpfx)bug-glob2.out
 	$(common-objpfx)malloc/mtrace $(objpfx)bug-glob2.mtrace > $@; \
 	$(evaluate-test)
 
+tst-glob-tilde-ENV = MALLOC_TRACE=$(objpfx)tst-glob-tilde.mtrace
+
+$(objpfx)tst-glob-tilde-mem.out: $(objpfx)tst-glob-tilde.out
+	$(common-objpfx)malloc/mtrace $(objpfx)tst-glob-tilde.mtrace > $@; \
+	$(evaluate-test)
+
 $(inst_libexecdir)/getconf: $(inst_bindir)/getconf \
 			    $(objpfx)getconf.speclist FORCE
 	$(addprefix $(..)./scripts/mkinstalldirs ,\
diff --git a/posix/tst-glob-tilde.c b/posix/tst-glob-tilde.c
new file mode 100644
index 0000000000..9518b4a6f8
--- /dev/null
+++ b/posix/tst-glob-tilde.c
@@ -0,0 +1,136 @@
+/* Check for GLOB_TIDLE heap allocation issues (bug 22320, bug 22325).
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <glob.h>
+#include <mcheck.h>
+#include <nss.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/support.h>
+
+/* Flag which indicates whether to pass the GLOB_ONLYDIR flag.  */
+static int do_onlydir;
+
+/* Flag which indicates whether to pass the GLOB_NOCHECK flag.  */
+static int do_nocheck;
+
+/* Flag which indicates whether to pass the GLOB_MARK flag.  */
+static int do_mark;
+
+static void
+one_test (const char *prefix, const char *middle, const char *suffix)
+{
+  char *pattern = xasprintf ("%s%s%s", prefix, middle, suffix);
+  int flags = GLOB_TILDE;
+  if (do_onlydir)
+    flags |= GLOB_ONLYDIR;
+  if (do_nocheck)
+    flags |= GLOB_NOCHECK;
+  if (do_mark)
+    flags |= GLOB_MARK;
+  glob_t gl;
+  /* This glob call might result in crashes or memory leaks.  */
+  if (glob (pattern, flags, NULL, &gl) == 0)
+    globfree (&gl);
+  free (pattern);
+}
+
+enum
+  {
+    /* The largest base being tested.  */
+    largest_base_size = 500000,
+
+    /* The actual size is the base size plus a variable whose absolute
+       value is not greater than this.  This helps malloc to trigger
+       overflows.  */
+    max_size_skew = 16,
+
+    /* The maximum string length supported by repeating_string
+       below.  */
+    repeat_size = largest_base_size + max_size_skew,
+  };
+
+/* Used to construct strings which repeat a single character 'x'.  */
+static char *repeat;
+
+/* Return a string of SIZE characters.  */
+const char *
+repeating_string (int size)
+{
+  TEST_VERIFY (size >= 0);
+  TEST_VERIFY (size <= repeat_size);
+  const char *repeated_shifted = repeat + repeat_size - size;
+  TEST_VERIFY (strlen (repeated_shifted) == size);
+  return repeated_shifted;
+}
+
+static int
+do_test (void)
+{
+  /* Avoid network-based NSS modules and initialize nss_files with a
+     dummy lookup.  This has to come before mtrace because NSS does
+     not free all memory.  */
+  __nss_configure_lookup ("passwd", "files");
+  (void) getpwnam ("root");
+
+  mtrace ();
+
+  repeat = xmalloc (repeat_size + 1);
+  memset (repeat, 'x', repeat_size);
+  repeat[repeat_size] = '\0';
+
+  /* These numbers control the size of the user name.  The values
+     cover the minimum (0), a typical size (8), a large
+     stack-allocated size (100000), and a somewhat large
+     heap-allocated size (largest_base_size).  */
+  static const int base_sizes[] = { 0, 8, 100, 100000, largest_base_size, -1 };
+
+  for (do_onlydir = 0; do_onlydir < 2; ++do_onlydir)
+    for (do_nocheck = 0; do_nocheck < 2; ++do_nocheck)
+      for (do_mark = 0; do_mark < 2; ++do_mark)
+        for (int base_idx = 0; base_sizes[base_idx] >= 0; ++base_idx)
+          {
+            for (int size_skew = -max_size_skew; size_skew <= max_size_skew;
+                 ++size_skew)
+              {
+                int size = base_sizes[base_idx] + size_skew;
+                if (size < 0)
+                  continue;
+
+                const char *user_name = repeating_string (size);
+                one_test ("~", user_name, "/a/b");
+              }
+
+            const char *user_name = repeating_string (base_sizes[base_idx]);
+            one_test ("~", user_name, "");
+            one_test ("~", user_name, "/");
+            one_test ("~", user_name, "/a");
+            one_test ("~", user_name, "/*/*");
+            one_test ("~", user_name, "\\/");
+            one_test ("/~", user_name, "");
+            one_test ("*/~", user_name, "/a/b");
+          }
+
+  free (repeat);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
-- 
2.14.1


From b2c78ae69eb5845c94db94e87a2addd695f978c0 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 22 Oct 2017 04:14:54 -0700
Subject: [PATCH 67/90] x86: Add x86_64 to x86-64 HWCAP [BZ #22093]

Before glibc 2.26, ld.so set dl_platform to "x86_64" and searched the
"x86_64" subdirectory when loading a shared library.  ld.so in glibc
2.26 was changed to set dl_platform to "haswell" or "xeon_phi", based
on supported ISAs.  This led to shared library loading failure for
shared libraries placed under the "x86_64" subdirectory.

This patch adds "x86_64" to x86-64 dl_hwcap so that ld.so will always
search the "x86_64" subdirectory when loading a shared library.

NB: We can't set x86-64 dl_platform to "x86-64" since ld.so will skip
the "haswell" and "xeon_phi" subdirectories on "haswell" and "xeon_phi"
machines.

Tested on i686 and x86-64.

	[BZ #22093]
	* sysdeps/x86/cpu-features.c (init_cpu_features): Initialize
	GLRO(dl_hwcap) to HWCAP_X86_64 for x86-64.
	* sysdeps/x86/dl-hwcap.h (HWCAP_COUNT): Updated.
	(HWCAP_IMPORTANT): Likewise.
	(HWCAP_X86_64): New enum.
	(HWCAP_X86_AVX512_1): Updated.
	* sysdeps/x86/dl-procinfo.c (_dl_x86_hwcap_flags): Add "x86_64".
	* sysdeps/x86_64/Makefile (tests): Add tst-x86_64-1.
	(modules-names): Add x86_64/tst-x86_64mod-1.
	(LDFLAGS-tst-x86_64mod-1.so): New.
	($(objpfx)tst-x86_64-1): Likewise.
	($(objpfx)x86_64/tst-x86_64mod-1.os): Likewise.
	(tst-x86_64-1-clean): Likewise.
	* sysdeps/x86_64/tst-x86_64-1.c: New file.
	* sysdeps/x86_64/tst-x86_64mod-1.c: Likewise.

(cherry picked from commit 45ff34638f034877b6a490c217d6a0632ce263f4)
---
 ChangeLog                        | 19 +++++++++++++++++++
 NEWS                             |  1 +
 sysdeps/x86/cpu-features.c       |  3 ++-
 sysdeps/x86/dl-hwcap.h           | 12 +++++++-----
 sysdeps/x86/dl-procinfo.c        |  4 ++--
 sysdeps/x86_64/Makefile          | 17 +++++++++++++++++
 sysdeps/x86_64/tst-x86_64-1.c    | 26 ++++++++++++++++++++++++++
 sysdeps/x86_64/tst-x86_64mod-1.c | 22 ++++++++++++++++++++++
 8 files changed, 96 insertions(+), 8 deletions(-)
 create mode 100644 sysdeps/x86_64/tst-x86_64-1.c
 create mode 100644 sysdeps/x86_64/tst-x86_64mod-1.c

diff --git a/ChangeLog b/ChangeLog
index fccc246b20..2c1ee0bac1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2017-10-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #22093]
+	* sysdeps/x86/cpu-features.c (init_cpu_features): Initialize
+	GLRO(dl_hwcap) to HWCAP_X86_64 for x86-64.
+	* sysdeps/x86/dl-hwcap.h (HWCAP_COUNT): Updated.
+	(HWCAP_IMPORTANT): Likewise.
+	(HWCAP_X86_64): New enum.
+	(HWCAP_X86_AVX512_1): Updated.
+	* sysdeps/x86/dl-procinfo.c (_dl_x86_hwcap_flags): Add "x86_64".
+	* sysdeps/x86_64/Makefile (tests): Add tst-x86_64-1.
+	(modules-names): Add x86_64/tst-x86_64mod-1.
+	(LDFLAGS-tst-x86_64mod-1.so): New.
+	($(objpfx)tst-x86_64-1): Likewise.
+	($(objpfx)x86_64/tst-x86_64mod-1.os): Likewise.
+	(tst-x86_64-1-clean): Likewise.
+	* sysdeps/x86_64/tst-x86_64-1.c: New file.
+	* sysdeps/x86_64/tst-x86_64mod-1.c: Likewise.
+
 2017-10-21  Florian Weimer  <fweimer@redhat.com>
 
 	* posix/Makefile (tests): Add tst-glob-tilde.
diff --git a/NEWS b/NEWS
index 80248fec89..bb625e699e 100644
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,7 @@ The following bugs are resolved with this release:
     occur with -O3
   [22051] libc: zero terminator in the middle of glibc's .eh_frame
   [22078] nss_files performance issue in hosts multi mode
+  [22093] x86: Add x86_64 to x86-64 HWCAP
   [22095] resolv: Fix memory leak with OOM during resolv.conf parsing
   [22096] resolv: __resolv_conf_attach must not free passed conf object
   [22111] malloc: per thread cache is not returned when thread exits
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 6f900840d4..c267f17b76 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -336,7 +336,6 @@ no_cpuid:
 
   /* Reuse dl_platform, dl_hwcap and dl_hwcap_mask for x86.  */
   GLRO(dl_platform) = NULL;
-  GLRO(dl_hwcap) = 0;
 #if !HAVE_TUNABLES && defined SHARED
   /* The glibc.tune.hwcap_mask tunable is initialized already, so no need to do
      this.  */
@@ -344,6 +343,7 @@ no_cpuid:
 #endif
 
 #ifdef __x86_64__
+  GLRO(dl_hwcap) = HWCAP_X86_64;
   if (cpu_features->kind == arch_kind_intel)
     {
       if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
@@ -374,6 +374,7 @@ no_cpuid:
 	GLRO(dl_platform) = "haswell";
     }
 #else
+  GLRO(dl_hwcap) = 0;
   if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
     GLRO(dl_hwcap) |= HWCAP_X86_SSE2;
 
diff --git a/sysdeps/x86/dl-hwcap.h b/sysdeps/x86/dl-hwcap.h
index c95668415a..38627e9eef 100644
--- a/sysdeps/x86/dl-hwcap.h
+++ b/sysdeps/x86/dl-hwcap.h
@@ -24,15 +24,16 @@
 # define HWCAP_PLATFORMS_START	0
 # define HWCAP_PLATFORMS_COUNT	4
 # define HWCAP_START		0
-# define HWCAP_COUNT		2
-# define HWCAP_IMPORTANT	(HWCAP_X86_SSE2 | HWCAP_X86_AVX512_1)
+# define HWCAP_COUNT		3
+# define HWCAP_IMPORTANT \
+  (HWCAP_X86_SSE2 | HWCAP_X86_64 | HWCAP_X86_AVX512_1)
 #elif defined __x86_64__
 /* For 64 bit, only cover x86-64 platforms and capabilities.  */
 # define HWCAP_PLATFORMS_START	2
 # define HWCAP_PLATFORMS_COUNT	4
 # define HWCAP_START		1
-# define HWCAP_COUNT		2
-# define HWCAP_IMPORTANT	(HWCAP_X86_AVX512_1)
+# define HWCAP_COUNT		3
+# define HWCAP_IMPORTANT	(HWCAP_X86_64 | HWCAP_X86_AVX512_1)
 #else
 /* For 32 bit, only cover i586, i686 and SSE2.  */
 # define HWCAP_PLATFORMS_START	0
@@ -45,7 +46,8 @@
 enum
 {
   HWCAP_X86_SSE2		= 1 << 0,
-  HWCAP_X86_AVX512_1		= 1 << 1
+  HWCAP_X86_64			= 1 << 1,
+  HWCAP_X86_AVX512_1		= 1 << 2
 };
 
 static inline const char *
diff --git a/sysdeps/x86/dl-procinfo.c b/sysdeps/x86/dl-procinfo.c
index 43ab8fe25b..0192feb850 100644
--- a/sysdeps/x86/dl-procinfo.c
+++ b/sysdeps/x86/dl-procinfo.c
@@ -58,11 +58,11 @@ PROCINFO_CLASS struct cpu_features _dl_x86_cpu_features
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_x86_hwcap_flags
 #else
-PROCINFO_CLASS const char _dl_x86_hwcap_flags[2][9]
+PROCINFO_CLASS const char _dl_x86_hwcap_flags[3][9]
 #endif
 #ifndef PROCINFO_DECL
 = {
-    "sse2", "avx512_1"
+    "sse2", "x86_64", "avx512_1"
   }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 132470d9cb..457cf5d129 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -52,6 +52,12 @@ $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
 CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
 CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
 
+tests += tst-x86_64-1
+modules-names += x86_64/tst-x86_64mod-1
+LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
+
+$(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
+
 tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
 	 tst-audit10 tst-sse tst-avx tst-avx512
 test-extras += tst-audit4-aux tst-audit10-aux \
@@ -122,3 +128,14 @@ endif
 ifeq ($(subdir),csu)
 gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
 endif
+
+$(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os
+	$(make-target-directory)
+	rm -f $@
+	ln $< $@
+
+do-tests-clean common-mostlyclean: tst-x86_64-1-clean
+
+.PHONY: tst-x86_64-1-clean
+tst-x86_64-1-clean:
+	-rm -rf $(objpfx)x86_64
diff --git a/sysdeps/x86_64/tst-x86_64-1.c b/sysdeps/x86_64/tst-x86_64-1.c
new file mode 100644
index 0000000000..ba1a55cdaf
--- /dev/null
+++ b/sysdeps/x86_64/tst-x86_64-1.c
@@ -0,0 +1,26 @@
+/* Test searching the "x86_64" directory for shared libraries.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+extern void foo (void);
+
+int
+main (void)
+{
+  foo ();
+  return 0;
+}
diff --git a/sysdeps/x86_64/tst-x86_64mod-1.c b/sysdeps/x86_64/tst-x86_64mod-1.c
new file mode 100644
index 0000000000..83dfafb5a8
--- /dev/null
+++ b/sysdeps/x86_64/tst-x86_64mod-1.c
@@ -0,0 +1,22 @@
+/* Test searching the "x86_64" directory for shared libraries.
+   Copyright (C) 2017 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+void
+foo (void)
+{
+}
-- 
2.14.1


From f82a6fc223cbd890b9de9007cfce63e6cae8f799 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Sun, 22 Oct 2017 07:40:39 -0700
Subject: [PATCH 68/90] x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve
 [BZ #21265]

In _dl_runtime_resolve, use fxsave/xsave/xsavec to preserve all vector,
mask and bound registers.  It simplifies _dl_runtime_resolve and supports
different calling conventions.  ld.so code size is reduced by more than
1 KB.  However, use fxsave/xsave/xsavec takes a little bit more cycles
than saving and restoring vector and bound registers individually.

Latency for _dl_runtime_resolve to lookup the function, foo, from one
shared library plus libc.so:

                             Before    After     Change

Westmere (SSE)/fxsave         345      866       151%
IvyBridge (AVX)/xsave         420      643       53%
Haswell (AVX)/xsave           713      1252      75%
Skylake (AVX+MPX)/xsavec      559      719       28%
Skylake (AVX512+MPX)/xsavec   145      272       87%
Ryzen (AVX)/xsavec            280      553       97%

This is the worst case where portion of time spent for saving and
restoring registers is bigger than majority of cases.  With smaller
_dl_runtime_resolve code size, overall performance impact is negligible.

On IvyBridge, differences in build and test time of binutils with lazy
binding GCC and binutils are noises.  On Westmere, differences in
bootstrap and "makc check" time of GCC 7 with lazy binding GCC and
binutils are also noises.

	[BZ #21265]
	* sysdeps/x86/cpu-features-offsets.sym (XSAVE_STATE_SIZE_OFFSET):
	New.
	* sysdeps/x86/cpu-features.c: Include <libc-pointer-arith.h>.
	(get_common_indeces): Set xsave_state_size, xsave_state_full_size
	and bit_arch_XSAVEC_Usable if needed.
	(init_cpu_features): Remove bit_arch_Use_dl_runtime_resolve_slow
	and bit_arch_Use_dl_runtime_resolve_opt.
	* sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
	Removed.
	(bit_arch_Use_dl_runtime_resolve_slow): Likewise.
	(bit_arch_Prefer_No_AVX512): Updated.
	(bit_arch_MathVec_Prefer_No_AVX512): Likewise.
	(bit_arch_XSAVEC_Usable): New.
	(STATE_SAVE_OFFSET): Likewise.
	(STATE_SAVE_MASK): Likewise.
	[__ASSEMBLER__]: Include <cpu-features-offsets.h>.
	(cpu_features): Add xsave_state_size and xsave_state_full_size.
	(index_arch_Use_dl_runtime_resolve_opt): Removed.
	(index_arch_Use_dl_runtime_resolve_slow): Likewise.
	(index_arch_XSAVEC_Usable): New.
	* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
	Support XSAVEC_Usable.  Remove Use_dl_runtime_resolve_slow.
	* sysdeps/x86_64/Makefile (tst-x86_64-1-ENV): New if tunables
	is enabled.
	* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
	Replace _dl_runtime_resolve_sse, _dl_runtime_resolve_avx,
	_dl_runtime_resolve_avx_slow, _dl_runtime_resolve_avx_opt,
	_dl_runtime_resolve_avx512 and _dl_runtime_resolve_avx512_opt
	with _dl_runtime_resolve_fxsave, _dl_runtime_resolve_xsave and
	_dl_runtime_resolve_xsavec.
	* sysdeps/x86_64/dl-trampoline.S (DL_RUNTIME_UNALIGNED_VEC_SIZE):
	Removed.
	(DL_RUNTIME_RESOLVE_REALIGN_STACK): Check STATE_SAVE_ALIGNMENT
	instead of VEC_SIZE.
	(REGISTER_SAVE_BND0): Removed.
	(REGISTER_SAVE_BND1): Likewise.
	(REGISTER_SAVE_BND3): Likewise.
	(REGISTER_SAVE_RAX): Always defined to 0.
	(VMOV): Removed.
	(_dl_runtime_resolve_avx): Likewise.
	(_dl_runtime_resolve_avx_slow): Likewise.
	(_dl_runtime_resolve_avx_opt): Likewise.
	(_dl_runtime_resolve_avx512): Likewise.
	(_dl_runtime_resolve_avx512_opt): Likewise.
	(_dl_runtime_resolve_sse): Likewise.
	(_dl_runtime_resolve_sse_vex): Likewise.
	(USE_FXSAVE): New.
	(_dl_runtime_resolve_fxsave): Likewise.
	(USE_XSAVE): Likewise.
	(_dl_runtime_resolve_xsave): Likewise.
	(USE_XSAVEC): Likewise.
	(_dl_runtime_resolve_xsavec): Likewise.
	* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx512):
	Removed.
	(_dl_runtime_resolve_avx512_opt): Likewise.
	(_dl_runtime_resolve_avx): Likewise.
	(_dl_runtime_resolve_avx_opt): Likewise.
	(_dl_runtime_resolve_sse): Likewise.
	(_dl_runtime_resolve_sse_vex): Likewise.
	(_dl_runtime_resolve_fxsave): New.
	(_dl_runtime_resolve_xsave): Likewise.
	(_dl_runtime_resolve_xsavec): Likewise.

(cherry picked from commit b52b0d793dcb226ecb0ecca1e672ca265973233c)
---
 ChangeLog                            |  66 +++++++++
 NEWS                                 |   1 +
 sysdeps/x86/cpu-features-offsets.sym |   1 +
 sysdeps/x86/cpu-features.c           |  88 +++++++++---
 sysdeps/x86/cpu-features.h           |  31 +++-
 sysdeps/x86/cpu-tunables.c           |  17 ++-
 sysdeps/x86_64/Makefile              |   4 +
 sysdeps/x86_64/dl-machine.h          |  38 ++---
 sysdeps/x86_64/dl-trampoline.S       |  87 ++++--------
 sysdeps/x86_64/dl-trampoline.h       | 267 ++++++++++-------------------------
 10 files changed, 294 insertions(+), 306 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2c1ee0bac1..cd598788f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,69 @@
+2017-10-22  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #21265]
+	* sysdeps/x86/cpu-features-offsets.sym (XSAVE_STATE_SIZE_OFFSET):
+	New.
+	* sysdeps/x86/cpu-features.c: Include <libc-pointer-arith.h>.
+	(get_common_indeces): Set xsave_state_size, xsave_state_full_size
+	and bit_arch_XSAVEC_Usable if needed.
+	(init_cpu_features): Remove bit_arch_Use_dl_runtime_resolve_slow
+	and bit_arch_Use_dl_runtime_resolve_opt.
+	* sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
+	Removed.
+	(bit_arch_Use_dl_runtime_resolve_slow): Likewise.
+	(bit_arch_Prefer_No_AVX512): Updated.
+	(bit_arch_MathVec_Prefer_No_AVX512): Likewise.
+	(bit_arch_XSAVEC_Usable): New.
+	(STATE_SAVE_OFFSET): Likewise.
+	(STATE_SAVE_MASK): Likewise.
+	[__ASSEMBLER__]: Include <cpu-features-offsets.h>.
+	(cpu_features): Add xsave_state_size and xsave_state_full_size.
+	(index_arch_Use_dl_runtime_resolve_opt): Removed.
+	(index_arch_Use_dl_runtime_resolve_slow): Likewise.
+	(index_arch_XSAVEC_Usable): New.
+	* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
+	Support XSAVEC_Usable.  Remove Use_dl_runtime_resolve_slow.
+	* sysdeps/x86_64/Makefile (tst-x86_64-1-ENV): New if tunables
+	is enabled.
+	* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
+	Replace _dl_runtime_resolve_sse, _dl_runtime_resolve_avx,
+	_dl_runtime_resolve_avx_slow, _dl_runtime_resolve_avx_opt,
+	_dl_runtime_resolve_avx512 and _dl_runtime_resolve_avx512_opt
+	with _dl_runtime_resolve_fxsave, _dl_runtime_resolve_xsave and
+	_dl_runtime_resolve_xsavec.
+	* sysdeps/x86_64/dl-trampoline.S (DL_RUNTIME_UNALIGNED_VEC_SIZE):
+	Removed.
+	(DL_RUNTIME_RESOLVE_REALIGN_STACK): Check STATE_SAVE_ALIGNMENT
+	instead of VEC_SIZE.
+	(REGISTER_SAVE_BND0): Removed.
+	(REGISTER_SAVE_BND1): Likewise.
+	(REGISTER_SAVE_BND3): Likewise.
+	(REGISTER_SAVE_RAX): Always defined to 0.
+	(VMOV): Removed.
+	(_dl_runtime_resolve_avx): Likewise.
+	(_dl_runtime_resolve_avx_slow): Likewise.
+	(_dl_runtime_resolve_avx_opt): Likewise.
+	(_dl_runtime_resolve_avx512): Likewise.
+	(_dl_runtime_resolve_avx512_opt): Likewise.
+	(_dl_runtime_resolve_sse): Likewise.
+	(_dl_runtime_resolve_sse_vex): Likewise.
+	(USE_FXSAVE): New.
+	(_dl_runtime_resolve_fxsave): Likewise.
+	(USE_XSAVE): Likewise.
+	(_dl_runtime_resolve_xsave): Likewise.
+	(USE_XSAVEC): Likewise.
+	(_dl_runtime_resolve_xsavec): Likewise.
+	* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx512):
+	Removed.
+	(_dl_runtime_resolve_avx512_opt): Likewise.
+	(_dl_runtime_resolve_avx): Likewise.
+	(_dl_runtime_resolve_avx_opt): Likewise.
+	(_dl_runtime_resolve_sse): Likewise.
+	(_dl_runtime_resolve_sse_vex): Likewise.
+	(_dl_runtime_resolve_fxsave): New.
+	(_dl_runtime_resolve_xsave): Likewise.
+	(_dl_runtime_resolve_xsavec): Likewise.
+
 2017-10-22  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #22093]
diff --git a/NEWS b/NEWS
index bb625e699e..87d48025e2 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ The following bugs are resolved with this release:
 
   [16750] ldd: Never run file directly.
   [21242] assert: Suppress pedantic warning caused by statement expression
+  [21265] x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve
   [21780] posix: Set p{read,write}v2 to return ENOTSUP
   [21871] x86-64: Use _dl_runtime_resolve_opt only with AVX512F
   [21885] getaddrinfo: Release resolver context on error in gethosts
diff --git a/sysdeps/x86/cpu-features-offsets.sym b/sysdeps/x86/cpu-features-offsets.sym
index f6739fae81..33dd094e37 100644
--- a/sysdeps/x86/cpu-features-offsets.sym
+++ b/sysdeps/x86/cpu-features-offsets.sym
@@ -15,6 +15,7 @@ CPUID_ECX_OFFSET	offsetof (struct cpuid_registers, ecx)
 CPUID_EDX_OFFSET	offsetof (struct cpuid_registers, edx)
 FAMILY_OFFSET		offsetof (struct cpu_features, family)
 MODEL_OFFSET		offsetof (struct cpu_features, model)
+XSAVE_STATE_SIZE_OFFSET	offsetof (struct cpu_features, xsave_state_size)
 FEATURE_OFFSET		offsetof (struct cpu_features, feature)
 FEATURE_SIZE		sizeof (unsigned int)
 
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index c267f17b76..3a5c3e8bfd 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -19,6 +19,7 @@
 #include <cpuid.h>
 #include <cpu-features.h>
 #include <dl-hwcap.h>
+#include <libc-pointer-arith.h>
 
 #if HAVE_TUNABLES
 # define TUNABLE_NAMESPACE tune
@@ -103,6 +104,76 @@ get_common_indeces (struct cpu_features *cpu_features,
 		}
 	    }
 	}
+
+      /* For _dl_runtime_resolve, set xsave_state_size to xsave area
+	 size + integer register save size and align it to 64 bytes.  */
+      if (cpu_features->max_cpuid >= 0xd)
+	{
+	  unsigned int eax, ebx, ecx, edx;
+
+	  __cpuid_count (0xd, 0, eax, ebx, ecx, edx);
+	  if (ebx != 0)
+	    {
+	      unsigned int xsave_state_full_size
+		= ALIGN_UP (ebx + STATE_SAVE_OFFSET, 64);
+
+	      cpu_features->xsave_state_size
+		= xsave_state_full_size;
+	      cpu_features->xsave_state_full_size
+		= xsave_state_full_size;
+
+	      __cpuid_count (0xd, 1, eax, ebx, ecx, edx);
+
+	      /* Check if XSAVEC is available.  */
+	      if ((eax & (1 << 1)) != 0)
+		{
+		  unsigned int xstate_comp_offsets[32];
+		  unsigned int xstate_comp_sizes[32];
+		  unsigned int i;
+
+		  xstate_comp_offsets[0] = 0;
+		  xstate_comp_offsets[1] = 160;
+		  xstate_comp_offsets[2] = 576;
+		  xstate_comp_sizes[0] = 160;
+		  xstate_comp_sizes[1] = 256;
+
+		  for (i = 2; i < 32; i++)
+		    {
+		      if ((STATE_SAVE_MASK & (1 << i)) != 0)
+			{
+			  __cpuid_count (0xd, i, eax, ebx, ecx, edx);
+			  xstate_comp_sizes[i] = eax;
+			}
+		      else
+			{
+			  ecx = 0;
+			  xstate_comp_sizes[i] = 0;
+			}
+
+		      if (i > 2)
+			{
+			  xstate_comp_offsets[i]
+			    = (xstate_comp_offsets[i - 1]
+			       + xstate_comp_sizes[i -1]);
+			  if ((ecx & (1 << 1)) != 0)
+			    xstate_comp_offsets[i]
+			      = ALIGN_UP (xstate_comp_offsets[i], 64);
+			}
+		    }
+
+		  /* Use XSAVEC.  */
+		  unsigned int size
+		    = xstate_comp_offsets[31] + xstate_comp_sizes[31];
+		  if (size)
+		    {
+		      cpu_features->xsave_state_size
+			= ALIGN_UP (size + STATE_SAVE_OFFSET, 64);
+		      cpu_features->feature[index_arch_XSAVEC_Usable]
+			|= bit_arch_XSAVEC_Usable;
+		    }
+		}
+	    }
+	}
     }
 }
 
@@ -242,23 +313,6 @@ init_cpu_features (struct cpu_features *cpu_features)
       else
 	cpu_features->feature[index_arch_Prefer_No_AVX512]
 	  |= bit_arch_Prefer_No_AVX512;
-
-      /* To avoid SSE transition penalty, use _dl_runtime_resolve_slow.
-         If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt.
-	 Use _dl_runtime_resolve_opt only with AVX512F since it is
-	 slower than _dl_runtime_resolve_slow with AVX.  */
-      cpu_features->feature[index_arch_Use_dl_runtime_resolve_slow]
-	|= bit_arch_Use_dl_runtime_resolve_slow;
-      if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
-	  && cpu_features->max_cpuid >= 0xd)
-	{
-	  unsigned int eax;
-
-	  __cpuid_count (0xd, 1, eax, ebx, ecx, edx);
-	  if ((eax & (1 << 2)) != 0)
-	    cpu_features->feature[index_arch_Use_dl_runtime_resolve_opt]
-	      |= bit_arch_Use_dl_runtime_resolve_opt;
-	}
     }
   /* This spells out "AuthenticAMD".  */
   else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index 3ed67f5800..1d88f7a68c 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -37,9 +37,8 @@
 #define bit_arch_Prefer_No_VZEROUPPER		(1 << 17)
 #define bit_arch_Fast_Unaligned_Copy		(1 << 18)
 #define bit_arch_Prefer_ERMS			(1 << 19)
-#define bit_arch_Use_dl_runtime_resolve_opt	(1 << 20)
-#define bit_arch_Use_dl_runtime_resolve_slow	(1 << 21)
-#define bit_arch_Prefer_No_AVX512		(1 << 22)
+#define bit_arch_Prefer_No_AVX512		(1 << 20)
+#define bit_arch_XSAVEC_Usable			(1 << 21)
 
 /* CPUID Feature flags.  */
 
@@ -88,6 +87,15 @@
 /* The current maximum size of the feature integer bit array.  */
 #define FEATURE_INDEX_MAX 1
 
+/* Offset for fxsave/xsave area used by _dl_runtime_resolve.  Also need
+   space to preserve RCX, RDX, RSI, RDI, R8, R9 and RAX.  It must be
+   aligned to 16 bytes for fxsave and 64 bytes for xsave.  */
+#define STATE_SAVE_OFFSET (8 * 7 + 8)
+
+/* Save SSE, AVX, AVX512, mask and bound registers.  */
+#define STATE_SAVE_MASK \
+  ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7))
+
 #ifdef	__ASSEMBLER__
 
 # include <cpu-features-offsets.h>
@@ -123,8 +131,6 @@
 # define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE
 # define index_arch_Fast_Unaligned_Copy	FEATURE_INDEX_1*FEATURE_SIZE
 # define index_arch_Prefer_ERMS		FEATURE_INDEX_1*FEATURE_SIZE
-# define index_arch_Use_dl_runtime_resolve_opt FEATURE_INDEX_1*FEATURE_SIZE
-# define index_arch_Use_dl_runtime_resolve_slow FEATURE_INDEX_1*FEATURE_SIZE
 # define index_arch_Prefer_No_AVX512	FEATURE_INDEX_1*FEATURE_SIZE
 
 
@@ -214,6 +220,18 @@ struct cpu_features
   } cpuid[COMMON_CPUID_INDEX_MAX];
   unsigned int family;
   unsigned int model;
+  /* The state size for XSAVEC or XSAVE.  The type must be unsigned long
+     int so that we use
+
+	sub xsave_state_size_offset(%rip) %RSP_LP
+
+     in _dl_runtime_resolve.  */
+  unsigned long int xsave_state_size;
+  /* The full state size for XSAVE when XSAVEC is disabled by
+
+     GLIBC_TUNABLES=glibc.tune.hwcaps=-XSAVEC_Usable
+   */
+  unsigned int xsave_state_full_size;
   unsigned int feature[FEATURE_INDEX_MAX];
   /* Data cache size for use in memory and string routines, typically
      L1 size.  */
@@ -326,9 +344,8 @@ extern const struct cpu_features *__get_cpu_features (void)
 # define index_arch_Prefer_No_VZEROUPPER FEATURE_INDEX_1
 # define index_arch_Fast_Unaligned_Copy	FEATURE_INDEX_1
 # define index_arch_Prefer_ERMS		FEATURE_INDEX_1
-# define index_arch_Use_dl_runtime_resolve_opt FEATURE_INDEX_1
-# define index_arch_Use_dl_runtime_resolve_slow FEATURE_INDEX_1
 # define index_arch_Prefer_No_AVX512	FEATURE_INDEX_1
+# define index_arch_XSAVEC_Usable	FEATURE_INDEX_1
 
 #endif	/* !__ASSEMBLER__ */
 
diff --git a/sysdeps/x86/cpu-tunables.c b/sysdeps/x86/cpu-tunables.c
index 872dd1267f..0488f03d32 100644
--- a/sysdeps/x86/cpu-tunables.c
+++ b/sysdeps/x86/cpu-tunables.c
@@ -240,6 +240,16 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
 						Slow_SSE4_2, SSE4_2,
 						disable, 11);
 	  break;
+	case 13:
+	  if (disable)
+	    {
+	      /* Update xsave_state_size to XSAVE state size.  */
+	      cpu_features->xsave_state_size
+		= cpu_features->xsave_state_full_size;
+	      CHECK_GLIBC_IFUNC_ARCH_OFF (n, cpu_features,
+					  XSAVEC_Usable, 13);
+	    }
+	  break;
 	case 14:
 	  if (disable)
 	    {
@@ -308,13 +318,6 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
 		 disable, 26);
 	    }
 	  break;
-	case 27:
-	    {
-	      CHECK_GLIBC_IFUNC_ARCH_BOTH (n, cpu_features,
-					   Use_dl_runtime_resolve_slow,
-					   disable, 27);
-	    }
-	  break;
 	}
       p += len + 1;
     }
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 457cf5d129..cb4e63897c 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -55,6 +55,10 @@ CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
 tests += tst-x86_64-1
 modules-names += x86_64/tst-x86_64mod-1
 LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
+ifneq (no,$(have-tunables))
+# Test the state size for XSAVE when XSAVEC is disabled.
+tst-x86_64-1-ENV = GLIBC_TUNABLES=glibc.tune.hwcaps=-XSAVEC_Usable
+endif
 
 $(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
 
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 6a04cbcdc9..905a37a5cc 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -66,12 +66,9 @@ static inline int __attribute__ ((unused, always_inline))
 elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 {
   Elf64_Addr *got;
-  extern void _dl_runtime_resolve_sse (ElfW(Word)) attribute_hidden;
-  extern void _dl_runtime_resolve_avx (ElfW(Word)) attribute_hidden;
-  extern void _dl_runtime_resolve_avx_slow (ElfW(Word)) attribute_hidden;
-  extern void _dl_runtime_resolve_avx_opt (ElfW(Word)) attribute_hidden;
-  extern void _dl_runtime_resolve_avx512 (ElfW(Word)) attribute_hidden;
-  extern void _dl_runtime_resolve_avx512_opt (ElfW(Word)) attribute_hidden;
+  extern void _dl_runtime_resolve_fxsave (ElfW(Word)) attribute_hidden;
+  extern void _dl_runtime_resolve_xsave (ElfW(Word)) attribute_hidden;
+  extern void _dl_runtime_resolve_xsavec (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_profile_sse (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_profile_avx (ElfW(Word)) attribute_hidden;
   extern void _dl_runtime_profile_avx512 (ElfW(Word)) attribute_hidden;
@@ -120,29 +117,14 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
 	  /* This function will get called to fix up the GOT entry
 	     indicated by the offset on the stack, and then jump to
 	     the resolved address.  */
-	  if (HAS_ARCH_FEATURE (AVX512F_Usable))
-	    {
-	      if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_opt))
-		*(ElfW(Addr) *) (got + 2)
-		  = (ElfW(Addr)) &_dl_runtime_resolve_avx512_opt;
-	      else
-		*(ElfW(Addr) *) (got + 2)
-		  = (ElfW(Addr)) &_dl_runtime_resolve_avx512;
-	    }
-	  else if (HAS_ARCH_FEATURE (AVX_Usable))
-	    {
-	      if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_opt))
-		*(ElfW(Addr) *) (got + 2)
-		  = (ElfW(Addr)) &_dl_runtime_resolve_avx_opt;
-	      else if (HAS_ARCH_FEATURE (Use_dl_runtime_resolve_slow))
-		*(ElfW(Addr) *) (got + 2)
-		  = (ElfW(Addr)) &_dl_runtime_resolve_avx_slow;
-	      else
-		*(ElfW(Addr) *) (got + 2)
-		  = (ElfW(Addr)) &_dl_runtime_resolve_avx;
-	    }
+	  if (GLRO(dl_x86_cpu_features).xsave_state_size != 0)
+	    *(ElfW(Addr) *) (got + 2)
+	      = (HAS_ARCH_FEATURE (XSAVEC_Usable)
+		 ? (ElfW(Addr)) &_dl_runtime_resolve_xsavec
+		 : (ElfW(Addr)) &_dl_runtime_resolve_xsave);
 	  else
-	    *(ElfW(Addr) *) (got + 2) = (ElfW(Addr)) &_dl_runtime_resolve_sse;
+	    *(ElfW(Addr) *) (got + 2)
+	      = (ElfW(Addr)) &_dl_runtime_resolve_fxsave;
 	}
     }
 
diff --git a/sysdeps/x86_64/dl-trampoline.S b/sysdeps/x86_64/dl-trampoline.S
index c14c61aa58..a645572e44 100644
--- a/sysdeps/x86_64/dl-trampoline.S
+++ b/sysdeps/x86_64/dl-trampoline.S
@@ -34,41 +34,24 @@
 # define DL_STACK_ALIGNMENT 8
 #endif
 
-#ifndef DL_RUNTIME_UNALIGNED_VEC_SIZE
-/* The maximum size in bytes of unaligned vector load and store in the
-   dynamic linker.  Since SSE optimized memory/string functions with
-   aligned SSE register load and store are used in the dynamic linker,
-   we must set this to 8 so that _dl_runtime_resolve_sse will align the
-   stack before calling _dl_fixup.  */
-# define DL_RUNTIME_UNALIGNED_VEC_SIZE 8
-#endif
-
-/* True if _dl_runtime_resolve should align stack to VEC_SIZE bytes.  */
+/* True if _dl_runtime_resolve should align stack for STATE_SAVE or align
+   stack to 16 bytes before calling _dl_fixup.  */
 #define DL_RUNTIME_RESOLVE_REALIGN_STACK \
-  (VEC_SIZE > DL_STACK_ALIGNMENT \
-   && VEC_SIZE > DL_RUNTIME_UNALIGNED_VEC_SIZE)
-
-/* Align vector register save area to 16 bytes.  */
-#define REGISTER_SAVE_VEC_OFF	0
+  (STATE_SAVE_ALIGNMENT > DL_STACK_ALIGNMENT \
+   || 16 > DL_STACK_ALIGNMENT)
 
 /* Area on stack to save and restore registers used for parameter
    passing when calling _dl_fixup.  */
 #ifdef __ILP32__
-# define REGISTER_SAVE_RAX	(REGISTER_SAVE_VEC_OFF + VEC_SIZE * 8)
 # define PRESERVE_BND_REGS_PREFIX
 #else
-/* Align bound register save area to 16 bytes.  */
-# define REGISTER_SAVE_BND0	(REGISTER_SAVE_VEC_OFF + VEC_SIZE * 8)
-# define REGISTER_SAVE_BND1	(REGISTER_SAVE_BND0 + 16)
-# define REGISTER_SAVE_BND2	(REGISTER_SAVE_BND1 + 16)
-# define REGISTER_SAVE_BND3	(REGISTER_SAVE_BND2 + 16)
-# define REGISTER_SAVE_RAX	(REGISTER_SAVE_BND3 + 16)
 # ifdef HAVE_MPX_SUPPORT
 #  define PRESERVE_BND_REGS_PREFIX bnd
 # else
 #  define PRESERVE_BND_REGS_PREFIX .byte 0xf2
 # endif
 #endif
+#define REGISTER_SAVE_RAX	0
 #define REGISTER_SAVE_RCX	(REGISTER_SAVE_RAX + 8)
 #define REGISTER_SAVE_RDX	(REGISTER_SAVE_RCX + 8)
 #define REGISTER_SAVE_RSI	(REGISTER_SAVE_RDX + 8)
@@ -80,68 +63,56 @@
 
 #define VEC_SIZE		64
 #define VMOVA			vmovdqa64
-#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV			vmovdqa64
-#else
-# define VMOV			vmovdqu64
-#endif
 #define VEC(i)			zmm##i
-#define _dl_runtime_resolve	_dl_runtime_resolve_avx512
 #define _dl_runtime_profile	_dl_runtime_profile_avx512
 #include "dl-trampoline.h"
-#undef _dl_runtime_resolve
 #undef _dl_runtime_profile
 #undef VEC
-#undef VMOV
 #undef VMOVA
 #undef VEC_SIZE
 
 #define VEC_SIZE		32
 #define VMOVA			vmovdqa
-#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV			vmovdqa
-#else
-# define VMOV			vmovdqu
-#endif
 #define VEC(i)			ymm##i
-#define _dl_runtime_resolve	_dl_runtime_resolve_avx
-#define _dl_runtime_resolve_opt	_dl_runtime_resolve_avx_opt
 #define _dl_runtime_profile	_dl_runtime_profile_avx
 #include "dl-trampoline.h"
-#undef _dl_runtime_resolve
-#undef _dl_runtime_resolve_opt
 #undef _dl_runtime_profile
 #undef VEC
-#undef VMOV
 #undef VMOVA
 #undef VEC_SIZE
 
 /* movaps/movups is 1-byte shorter.  */
 #define VEC_SIZE		16
 #define VMOVA			movaps
-#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV			movaps
-#else
-# define VMOV			movups
-#endif
 #define VEC(i)			xmm##i
-#define _dl_runtime_resolve	_dl_runtime_resolve_sse
 #define _dl_runtime_profile	_dl_runtime_profile_sse
 #undef RESTORE_AVX
 #include "dl-trampoline.h"
-#undef _dl_runtime_resolve
 #undef _dl_runtime_profile
-#undef VMOV
+#undef VEC
 #undef VMOVA
+#undef VEC_SIZE
 
-/* Used by _dl_runtime_resolve_avx_opt/_dl_runtime_resolve_avx512_opt
-   to preserve the full vector registers with zero upper bits.  */
-#define VMOVA			vmovdqa
-#if DL_RUNTIME_RESOLVE_REALIGN_STACK || VEC_SIZE <= DL_STACK_ALIGNMENT
-# define VMOV			vmovdqa
-#else
-# define VMOV			vmovdqu
-#endif
-#define _dl_runtime_resolve	_dl_runtime_resolve_sse_vex
-#define _dl_runtime_resolve_opt	_dl_runtime_resolve_avx512_opt
+#define USE_FXSAVE
+#define STATE_SAVE_ALIGNMENT	16
+#define _dl_runtime_resolve	_dl_runtime_resolve_fxsave
+#include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef USE_FXSAVE
+#undef STATE_SAVE_ALIGNMENT
+
+#define USE_XSAVE
+#define STATE_SAVE_ALIGNMENT	64
+#define _dl_runtime_resolve	_dl_runtime_resolve_xsave
+#include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef USE_XSAVE
+#undef STATE_SAVE_ALIGNMENT
+
+#define USE_XSAVEC
+#define STATE_SAVE_ALIGNMENT	64
+#define _dl_runtime_resolve	_dl_runtime_resolve_xsavec
 #include "dl-trampoline.h"
+#undef _dl_runtime_resolve
+#undef USE_XSAVEC
+#undef STATE_SAVE_ALIGNMENT
diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h
index 8db24c16ac..9ddaafee17 100644
--- a/sysdeps/x86_64/dl-trampoline.h
+++ b/sysdeps/x86_64/dl-trampoline.h
@@ -16,140 +16,47 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#undef REGISTER_SAVE_AREA_RAW
-#ifdef __ILP32__
-/* X32 saves RCX, RDX, RSI, RDI, R8 and R9 plus RAX as well as VEC0 to
-   VEC7.  */
-# define REGISTER_SAVE_AREA_RAW	(8 * 7 + VEC_SIZE * 8)
-#else
-/* X86-64 saves RCX, RDX, RSI, RDI, R8 and R9 plus RAX as well as
-   BND0, BND1, BND2, BND3 and VEC0 to VEC7. */
-# define REGISTER_SAVE_AREA_RAW	(8 * 7 + 16 * 4 + VEC_SIZE * 8)
-#endif
+	.text
+#ifdef _dl_runtime_resolve
 
-#undef REGISTER_SAVE_AREA
-#undef LOCAL_STORAGE_AREA
-#undef BASE
-#if DL_RUNTIME_RESOLVE_REALIGN_STACK
-# define REGISTER_SAVE_AREA	(REGISTER_SAVE_AREA_RAW + 8)
-/* Local stack area before jumping to function address: RBX.  */
-# define LOCAL_STORAGE_AREA	8
-# define BASE			rbx
-# if (REGISTER_SAVE_AREA % VEC_SIZE) != 0
-#  error REGISTER_SAVE_AREA must be multples of VEC_SIZE
-# endif
-#else
-# define REGISTER_SAVE_AREA	REGISTER_SAVE_AREA_RAW
-/* Local stack area before jumping to function address:  All saved
-   registers.  */
-# define LOCAL_STORAGE_AREA	REGISTER_SAVE_AREA
-# define BASE			rsp
-# if (REGISTER_SAVE_AREA % 16) != 8
-#  error REGISTER_SAVE_AREA must be odd multples of 8
+# undef REGISTER_SAVE_AREA
+# undef LOCAL_STORAGE_AREA
+# undef BASE
+
+# if (STATE_SAVE_ALIGNMENT % 16) != 0
+#  error STATE_SAVE_ALIGNMENT must be multples of 16
 # endif
-#endif
 
-	.text
-#ifdef _dl_runtime_resolve_opt
-/* Use the smallest vector registers to preserve the full YMM/ZMM
-   registers to avoid SSE transition penalty.  */
-
-# if VEC_SIZE == 32
-/* Check if the upper 128 bits in %ymm0 - %ymm7 registers are non-zero
-   and preserve %xmm0 - %xmm7 registers with the zero upper bits.  Since
-   there is no SSE transition penalty on AVX512 processors which don't
-   support XGETBV with ECX == 1, _dl_runtime_resolve_avx512_slow isn't
-   provided.   */
-	.globl _dl_runtime_resolve_avx_slow
-	.hidden _dl_runtime_resolve_avx_slow