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.19-135-g54b46a4


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  54b46a4b3efd179ccbbf8e342e64391e2b590f1b (commit)
      from  e9996ef750d845b46bc7d743c730c73f044720af (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=54b46a4b3efd179ccbbf8e342e64391e2b590f1b

commit 54b46a4b3efd179ccbbf8e342e64391e2b590f1b
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Sat Mar 8 11:24:32 2014 -0600

    PowerPC: Fix modf/modff optimization return sign
    
    This patch fix the optimized powerpc-fpu modf/modff implementation
    when using in non-default rounding mode where the zero sign is not
    as expected. It fixes the libm testsuite tests
    
      modf_downward (0)  == 0.00000000000000000000e+00
      modf_downward (20) == 0.00000000000000000000e+00
      modf_downward (21) == 0.00000000000000000000e+00
    
    Where the sign returned was negative.

diff --git a/ChangeLog b/ChangeLog
index 4071f08..5266177 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-03-03  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/power5+/fpu/s_modf.c (__modf): Fix to return correct
+	sign in non default rounding modes.
+	* sysdeps/powerpc/power5+/fpu/s_modff.c (__modff): Likewise.
+
 2014-03-08  Joseph Myers  <joseph@codesourcery.com>
 
 	* math/libm-test.inc (ALL_RM_TEST): New macro.
diff --git a/sysdeps/powerpc/power5+/fpu/s_modf.c b/sysdeps/powerpc/power5+/fpu/s_modf.c
index eb469f7..06da3ac 100644
--- a/sysdeps/powerpc/power5+/fpu/s_modf.c
+++ b/sysdeps/powerpc/power5+/fpu/s_modf.c
@@ -36,12 +36,12 @@ __modf (double x, double *iptr)
   if (x >= 0.0)
     {
       *iptr = __floor (x);
-      return (x - *iptr);
+      return __copysign (x - *iptr, x);
     }
   else
     {
       *iptr = __ceil (x);
-      return (x - *iptr);
+      return __copysign (x - *iptr, x);
     }
 }
 weak_alias (__modf, modf)
diff --git a/sysdeps/powerpc/power5+/fpu/s_modff.c b/sysdeps/powerpc/power5+/fpu/s_modff.c
index e4fe857..af17bec 100644
--- a/sysdeps/powerpc/power5+/fpu/s_modff.c
+++ b/sysdeps/powerpc/power5+/fpu/s_modff.c
@@ -35,12 +35,12 @@ __modff (float x, float *iptr)
   if (x >= 0.0)
     {
       *iptr = __floorf (x);
-      return (x - *iptr);
+      return __copysignf (x - *iptr, x);
     }
   else
     {
       *iptr = __ceilf (x);
-      return (x - *iptr);
+      return __copysignf (x - *iptr, x);
     }
 }
 weak_alias (__modff, modff)

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

Summary of changes:
 ChangeLog                             |    6 ++++++
 sysdeps/powerpc/power5+/fpu/s_modf.c  |    4 ++--
 sysdeps/powerpc/power5+/fpu/s_modff.c |    4 ++--
 3 files changed, 10 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]