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.15-1125-g73a68f9


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  73a68f94d650ac485db6b95242e1cb6591b193d3 (commit)
      from  ebc64a18c07742ebb85d7ddeca376995c0e67593 (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=73a68f94d650ac485db6b95242e1cb6591b193d3

commit 73a68f94d650ac485db6b95242e1cb6591b193d3
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Fri Jun 1 10:10:18 2012 -0300

    PowerPC: Fix for POWER7 sinf/cosf
    
    This patch fixes some sinf/cosf calculations that generated unexpected
    underflows exceptions.

diff --git a/ChangeLog b/ChangeLog
index 6cb9f2d..009e75e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-01  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/fpu/k_cosf.c: Fix underflow generation.
+	* sysdeps/powerpc/fpu/k_sinf.c: Likewise.
+
 2012-05-31  H.J. Lu  <hongjiu.lu@intel.com>
 
 	[BZ #14117]
diff --git a/sysdeps/powerpc/fpu/k_cosf.c b/sysdeps/powerpc/fpu/k_cosf.c
index e2571d6..d5668e3 100644
--- a/sysdeps/powerpc/fpu/k_cosf.c
+++ b/sysdeps/powerpc/fpu/k_cosf.c
@@ -18,6 +18,7 @@
    not, see <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <fenv.h>
 #include <math_private.h>
 
 static const float twom27   = 7.4505806e-09;
@@ -40,8 +41,8 @@ __kernel_cosf (float x, float y)
   ix = __builtin_fabsf (x);
   if (ix < twom27)
     {				/* |x| < 2**-27 */
-      if (x == 0.0)
-	return one;
+      __feraiseexcept (FE_INEXACT);
+      return one;
     }
   z = x * x;
   r = z * (C1 + z * (C2 + z * (C3 + z * (C4 + z * (C5 + z * C6)))));
diff --git a/sysdeps/powerpc/fpu/k_sinf.c b/sysdeps/powerpc/fpu/k_sinf.c
index ab4561e..c8fb8ef 100644
--- a/sysdeps/powerpc/fpu/k_sinf.c
+++ b/sysdeps/powerpc/fpu/k_sinf.c
@@ -18,6 +18,7 @@
    not, see <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <fenv.h>
 #include <math_private.h>
 
 
@@ -39,8 +40,8 @@ __kernel_sinf (float x, float y, int iy)
   ix = __builtin_fabsf (x);
   if (ix < twom27)
     {				/* |x| < 2**-27 */
-      if (x == 0.0)
-	return x;
+      __feraiseexcept (FE_INEXACT);
+      return x;
     }
   z = x * x;
   v = z * x;

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

Summary of changes:
 ChangeLog                    |    5 +++++
 sysdeps/powerpc/fpu/k_cosf.c |    5 +++--
 sysdeps/powerpc/fpu/k_sinf.c |    5 +++--
 3 files changed, 11 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]