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.21-553-ga04bb33


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  a04bb3306a9f9f17e5c588c903a438f1182ecd1a (commit)
      from  ed225df3ad9cbac3c22ec3f0fbbed1f9c61d1c54 (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=a04bb3306a9f9f17e5c588c903a438f1182ecd1a

commit a04bb3306a9f9f17e5c588c903a438f1182ecd1a
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jul 1 22:27:49 2015 +0000

    Fix ldbl-128 expm1l (-min_subnorm) result sign (bug 18619).
    
    In the ldbl-128 implementation of expm1l, when expm1l's result should
    underflow to 0 (argument minus the least subnormal, in some rounding
    modes), it can be a zero of the wrong sign.  This patch fixes this in
    the same way previously used for the x86 / x86_64 versions.
    
    Tested for mips64.
    
    	[BZ #18619]
    	* sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Force underflow
    	and return argument in case of subnormal argument.

diff --git a/ChangeLog b/ChangeLog
index a2fd213..7d501d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-07-01  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #18619]
+	* sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Force underflow
+	and return argument in case of subnormal argument.
+
 2015-07-01  Martin Sebor  <msebor@redhat.com>
 
 	[BZ #18435]
diff --git a/NEWS b/NEWS
index 91320dd..eecc9a1 100644
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@ Version 2.22
   18496, 18497, 18498, 18502, 18507, 18512, 18513, 18519, 18520, 18522,
   18527, 18528, 18529, 18530, 18532, 18533, 18534, 18536, 18539, 18540,
   18542, 18544, 18545, 18546, 18547, 18549, 18553, 18558, 18569, 18583,
-  18585, 18586, 18593, 18594, 18602, 18612, 18613.
+  18585, 18586, 18593, 18594, 18602, 18612, 18613, 18619.
 
 * Cache information can be queried via sysconf() function on s390 e.g. with
   _SC_LEVEL1_ICACHE_SIZE as argument.
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index f708af5..573d00b 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -137,9 +137,18 @@ __expm1l (long double x)
   if (x < minarg)
     return (4.0/big - 1.0L);
 
-  /* Avoid internal underflow when result does not underflow.  */
-  if (fabsl (x) < 0x1p-113L && fabsl (x) >= LDBL_MIN)
-    return x;
+  /* Avoid internal underflow when result does not underflow, while
+     ensuring underflow (without returning a zero of the wrong sign)
+     when the result does underflow.  */
+  if (fabsl (x) < 0x1p-113L)
+    {
+      if (fabsl (x) < LDBL_MIN)
+	{
+	  long double force_underflow = x * x;
+	  math_force_eval (force_underflow);
+	}
+      return x;
+    }
 
   /* Express x = ln 2 (k + remainder), remainder not exceeding 1/2. */
   xx = C1 + C2;			/* ln 2. */

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

Summary of changes:
 ChangeLog                           |    6 ++++++
 NEWS                                |    2 +-
 sysdeps/ieee754/ldbl-128/s_expm1l.c |   15 ++++++++++++---
 3 files changed, 19 insertions(+), 4 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]