This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.23-390-g98c9c9d


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  98c9c9d9ca6c1eb8e30fe449b1e1121b8c498715 (commit)
      from  d73e7bdb3a9284eb437b6cd84923658e25f922f2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=98c9c9d9ca6c1eb8e30fe449b1e1121b8c498715

commit 98c9c9d9ca6c1eb8e30fe449b1e1121b8c498715
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu May 26 22:58:36 2016 +0000

    Fix ldbl-128ibm sqrtl (sNaN) (bug 20153).
    
    The ldbl-128ibm implementation of sqrtl wrongly returns an sNaN for
    signaling NaN arguments.  This patch fixes it to quiet its argument,
    using the same x * x + x return for infinities and NaNs as the dbl-64
    implementation uses to ensure that +Inf maps to +Inf while -Inf and
    NaN map to NaN.
    
    Tested for powerpc.
    
    	[BZ #20153]
    	* sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (__ieee754_sqrtl): Return
    	x * x + x for infinities and NaNs.

diff --git a/ChangeLog b/ChangeLog
index b597ce9..2516304 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2016-05-26  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #20153]
+	* sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c (__ieee754_sqrtl): Return
+	x * x + x for infinities and NaNs.
+
 	[BZ #20151]
 	* sysdeps/ieee754/ldbl-128/e_j0l.c (__ieee754_j0l): Add NaN
 	argument to itself before returning result.
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
index 96845fe..51365d6 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c
@@ -91,11 +91,9 @@ long double __ieee754_sqrtl(long double x)
     return c.x * i;
   }
   else {
-    if (k>=INT64_C(0x7ff0000000000000)) {
-      if (a.i[0] == INT64_C(0xfff0000000000000))
-	return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN.  */
-      return x; /* sqrt (NaN) = NaN, sqrt (+Inf) = +Inf.  */
-    }
+    if (k>=INT64_C(0x7ff0000000000000))
+      /* sqrt (-Inf) = NaN, sqrt (NaN) = NaN, sqrt (+Inf) = +Inf.  */
+      return x * x + x;
     if (x == 0) return x;
     if (x < 0) return (big1-big1)/(big-big);
     return tm256*__ieee754_sqrtl(x*t512);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                             |    4 ++++
 sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c |    8 +++-----
 2 files changed, 7 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]