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 ibm/2.19/master updated. glibc-2.19-26-g154d4d9


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, ibm/2.19/master has been updated
       via  154d4d95f48061d5ab890c85b6015221c1accc6e (commit)
      from  e266b71770050a4d0cb276f4afea1c5b05215184 (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=154d4d95f48061d5ab890c85b6015221c1accc6e

commit 154d4d95f48061d5ab890c85b6015221c1accc6e
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Sun Apr 6 14:50:11 2014 -0500

    PowerPC: Fix nearbyint/nearbyintf result for FE_DOWNWARD
    
    This patch fixes the powerpc32 optimized nearbyint/nearbyintf bogus
    results for FE_DOWNWARD rounding mode.  This is due wrong instructions
    sequence used in the rounding calculation (two subtractions instead of
    adition and a subtraction).
    
    Fixes BZ#16815.
    
    Backport of 8bd70862e11023e7f827f240a5a214f847ae982d.

diff --git a/ChangeLog b/ChangeLog
index 5bf3e26..c28708f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-04-06  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	[BZ #16815]
+	* sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S (__nearbyint): Fix
+	result for FE_DOWNWARD rounding mode.
+	* sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S (__nearbyintf):
+	Likewise.
+	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
+
 2014-04-02  Alan Modra  <amodra@gmail.com>
 
 	[BZ #16739]
diff --git a/NEWS b/NEWS
index 71f6fb6..a496294 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.19.1
 
 * The following bugs are resolved with this release:
 
-  16545, 16683, 16689, 16701, 16706, 16707, 16739.
+  16545, 16683, 16689, 16701, 16706, 16707, 16739, 16815.
 
 Version 2.19
 
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
index 2734738..05ab40e 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S
@@ -53,17 +53,17 @@ ENTRY (__nearbyint)
 	fcmpu	cr7,fp1,fp12	/* if (x > 0.0 */
 	ble	cr7,L(lessthanzero)
 	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
-	fadd	fp0,fp1,fp13	/* x += TWO52 */
-	fsub	fp1,fp0,fp13	/* x -= TWO52 */
+	fadd	fp1,fp1,fp13	/* x += TWO52 */
+	fsub	fp1,fp1,fp13	/* x -= TWO52 */
 	fabs	fp1,fp1		/* if (x == 0.0 */
 	mtfsb0	4*cr1+eq	/* Clear any FE_INEXACT exception */
 	blr
 L(lessthanzero):
 	bgelr	cr7
 	mtfsb0	4*cr7+lt	/* Disable FE_INEXACT exception */
-	fsub	fp0,fp13,fp1	/* x -= TWO52 */
-	fsub	fp0,fp0,fp13	/* x += TWO52 */
-	fneg	fp1,fp0		/* if (x == 0.0) */
+	fsub	fp1,fp1,fp13	/* x -= TWO52 */
+	fadd	fp1,fp1,fp13	/* x += TWO52 */
+	fnabs	fp1,fp1		/* if (x == 0.0) */
 	mtfsb0	4*cr1+eq	/* Clear any FE_INEXACT exception */
 	blr
 END (__nearbyint)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
index 11bdc77..7449a5f 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S
@@ -52,16 +52,17 @@ ENTRY (__nearbyintf)
 	fcmpu	cr7,fp1,fp12		/* if (x > 0.0 */
 	ble	cr7,L(lessthanzero)
 	mtfsb0	4*cr7+lt		/* Disable FE_INEXACT exception */
-	fadds	fp0,fp1,fp13		/* x += TWO23 */
-	fsubs	fp1,fp0,fp13		/* x -= TWO23 */
+	fadds	fp1,fp1,fp13		/* x += TWO23 */
+	fsubs	fp1,fp1,fp13		/* x -= TWO23 */
+	fabs	fp1,fp1			/* if (x == 0.0) */
 	mtfsb0	4*cr1+eq		/* Clear any FE_INEXACT exception */
 	blr
 L(lessthanzero):
 	bgelr	cr7
 	mtfsb0	4*cr7+lt		/* Disable FE_INEXACT exception */
-	fsubs	fp0,fp13,fp1		/* x -= TWO23 */
-	fsubs	fp0,fp0,fp13		/* x += TWO23 */
-	fneg	fp1,fp0			/* if (x == 0.0) */
+	fsubs	fp1,fp1,fp13		/* x -= TWO23 */
+	fadds	fp1,fp1,fp13		/* x += TWO23 */
+	fnabs	fp1,fp1			/* if (x == 0.0) */
 	mtfsb0	4*cr1+eq		/* Clear any FE_INEXACT exception */
 	blr
 END (__nearbyintf)

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

Summary of changes:
 ChangeLog                                    |    9 +++++++++
 NEWS                                         |    2 +-
 sysdeps/powerpc/powerpc32/fpu/s_nearbyint.S  |   10 +++++-----
 sysdeps/powerpc/powerpc32/fpu/s_nearbyintf.S |   11 ++++++-----
 4 files changed, 21 insertions(+), 11 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]