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-25-ge266b71


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  e266b71770050a4d0cb276f4afea1c5b05215184 (commit)
       via  b23fc92895aff0ce3d3134a91adaa253bffd187a (commit)
       via  acd56f757b4e5ab8737b9564bd7a4ad1009acd8d (commit)
       via  fd5100c480beef3d36c4bf74b6a23529695d036c (commit)
      from  a51aafa398ed7dd2a0a846c1b2ed8a37909609eb (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=e266b71770050a4d0cb276f4afea1c5b05215184

commit e266b71770050a4d0cb276f4afea1c5b05215184
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Apr 2 13:46:19 2014 +1030

    Correct IBM long double nextafterl.
    
    Fix for values near a power of two, and some tidies.
    
    	[BZ #16739]
    	* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct
    	output when value is near a power of two.  Use int64_t for lx and
    	remove casts.  Use decimal rather than hex exponent constants.
    	Don't use long double multiplication when double will suffice.
    	* math/libm-test.inc (nextafter_test_data): Add tests.
    	* NEWS: Add 16739 and 16786 to bug list.
    
    Backport of b0abbc21034f0e5edc49023d8fda0616173faf17.

diff --git a/ChangeLog b/ChangeLog
index fe00e0c..5bf3e26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2014-04-02  Alan Modra  <amodra@gmail.com>
 
+	[BZ #16739]
+	* sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct
+	output when value is near a power of two.  Use int64_t for lx and
+	remove casts.  Use decimal rather than hex exponent constants.
+	Don't use long double multiplication when double will suffice.
+	* math/libm-test.inc (nextafter_test_data): Add tests.
+	* NEWS: Add 16739 and 16786 to bug list.
+
+2014-04-02  Alan Modra  <amodra@gmail.com>
+
 	* sysdeps/powerpc/powerpc64/power7/memrchr.S: Correct stream hint.
 
 2014-04-02  Alan Modra  <amodra@gmail.com>
diff --git a/NEWS b/NEWS
index a647e5d..71f6fb6 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.
+  16545, 16683, 16689, 16701, 16706, 16707, 16739.
 
 Version 2.19
 
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 1c9b97a..cf07069 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -10547,6 +10547,14 @@ static const struct test_ff_f_data nextafter_test_data[] =
     // XXX Enable once gcc is fixed.
     //TEST_ff_f (nextafter, 0x0.00000040000000000000p-16385L, -0.1L, 0x0.0000003ffffffff00000p-16385L),
 #endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 106
+    TEST_ff_f (nextafter, 1.0L, -10.0L, 1.0L-0x1p-106L, NO_EXCEPTION),
+    TEST_ff_f (nextafter, 1.0L, 10.0L, 1.0L+0x1p-105L, NO_EXCEPTION),
+    TEST_ff_f (nextafter, 1.0L-0x1p-106L, 10.0L, 1.0L, NO_EXCEPTION),
+    TEST_ff_f (nextafter, -1.0L, -10.0L, -1.0L-0x1p-105L, NO_EXCEPTION),
+    TEST_ff_f (nextafter, -1.0L, 10.0L, -1.0L+0x1p-106L, NO_EXCEPTION),
+    TEST_ff_f (nextafter, -1.0L+0x1p-106L, -10.0L, -1.0L, NO_EXCEPTION),
+#endif
 
     /* XXX We need the hexadecimal FP number representation here for further
        tests.  */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
index c050944..7b09927 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
@@ -30,8 +30,7 @@ static char rcsid[] = "$NetBSD: $";
 
 long double __nextafterl(long double x, long double y)
 {
-	int64_t hx,hy,ihx,ihy;
-	uint64_t lx;
+	int64_t hx, hy, ihx, ihy, lx;
 	double xhi, xlo, yhi;
 
 	ldbl_unpack (x, &xhi, &xlo);
@@ -76,19 +75,28 @@ long double __nextafterl(long double x, long double y)
 	      u = math_opt_barrier (x);
 	      x -= __LDBL_DENORM_MIN__;
 	      if (ihx < 0x0360000000000000LL
-		  || (hx > 0 && (int64_t) lx <= 0)
-		  || (hx < 0 && (int64_t) lx > 1)) {
+		  || (hx > 0 && lx <= 0)
+		  || (hx < 0 && lx > 1)) {
 		u = u * u;
 		math_force_eval (u);		/* raise underflow flag */
 	      }
 	      return x;
 	    }
-	    if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */
-	      INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52));
-	      u = yhi;
-	      u *= 0x1.0000000000000p-105L;
+	    /* If the high double is an exact power of two and the low
+	       double is the opposite sign, then 1ulp is one less than
+	       what we might determine from the high double.  Similarly
+	       if X is an exact power of two, and positive, because
+	       making it a little smaller will result in the exponent
+	       decreasing by one and normalisation of the mantissa.   */
+	    if ((hx & 0x000fffffffffffffLL) == 0
+		&& ((lx != 0 && (hx ^ lx) < 0)
+		    || (lx == 0 && hx >= 0)))
+	      ihx -= 1LL << 52;
+	    if (ihx < (106LL << 52)) { /* ulp will denormal */
+	      INSERT_WORDS64 (yhi, ihx & (0x7ffLL<<52));
+	      u = yhi * 0x1p-105;
 	    } else {
-	      INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52));
+	      INSERT_WORDS64 (yhi, (ihx & (0x7ffLL<<52))-(105LL<<52));
 	      u = yhi;
 	    }
 	    return x - u;
@@ -103,8 +111,8 @@ long double __nextafterl(long double x, long double y)
 	      u = math_opt_barrier (x);
 	      x += __LDBL_DENORM_MIN__;
 	      if (ihx < 0x0360000000000000LL
-		  || (hx > 0 && (int64_t) lx < 0 && lx != 0x8000000000000001LL)
-		  || (hx < 0 && (int64_t) lx >= 0)) {
+		  || (hx > 0 && lx < 0 && lx != 0x8000000000000001LL)
+		  || (hx < 0 && lx >= 0)) {
 		u = u * u;
 		math_force_eval (u);		/* raise underflow flag */
 	      }
@@ -112,12 +120,21 @@ long double __nextafterl(long double x, long double y)
 		x = -0.0L;
 	      return x;
 	    }
-	    if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */
-	      INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52));
-	      u = yhi;
-	      u *= 0x1.0000000000000p-105L;
+	    /* If the high double is an exact power of two and the low
+	       double is the opposite sign, then 1ulp is one less than
+	       what we might determine from the high double.  Similarly
+	       if X is an exact power of two, and negative, because
+	       making it a little larger will result in the exponent
+	       decreasing by one and normalisation of the mantissa.   */
+	    if ((hx & 0x000fffffffffffffLL) == 0
+		&& ((lx != 0 && (hx ^ lx) < 0)
+		    || (lx == 0 && hx < 0)))
+	      ihx -= 1LL << 52;
+	    if (ihx < (106LL << 52)) { /* ulp will denormal */
+	      INSERT_WORDS64 (yhi, ihx & (0x7ffLL<<52));
+	      u = yhi * 0x1p-105;
 	    } else {
-	      INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52));
+	      INSERT_WORDS64 (yhi, (ihx & (0x7ffLL<<52))-(105LL<<52));
 	      u = yhi;
 	    }
 	    return x + u;

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b23fc92895aff0ce3d3134a91adaa253bffd187a

commit b23fc92895aff0ce3d3134a91adaa253bffd187a
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Apr 2 13:42:27 2014 +1030

    Correct prefetch hint in power7 memrchr.
    
    Typo fix.
    
    	* sysdeps/powerpc/powerpc64/power7/memrchr.S: Correct stream hint.
    
    Backport of af6b17973cbc07ac06cfb40eeab5cc2391fb489a.

diff --git a/ChangeLog b/ChangeLog
index 1768334..fe00e0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-04-02  Alan Modra  <amodra@gmail.com>
 
+	* sysdeps/powerpc/powerpc64/power7/memrchr.S: Correct stream hint.
+
+2014-04-02  Alan Modra  <amodra@gmail.com>
+
 	* sysdeps/powerpc/powerpc64/start.S: Add @toc to toc symbol reference.
 
 2014-04-01  Alan Modra  <amodra@gmail.com>
diff --git a/sysdeps/powerpc/powerpc64/power7/memrchr.S b/sysdeps/powerpc/powerpc64/power7/memrchr.S
index 40e436f..0c01ca2 100644
--- a/sysdeps/powerpc/powerpc64/power7/memrchr.S
+++ b/sysdeps/powerpc/powerpc64/power7/memrchr.S
@@ -29,7 +29,7 @@ ENTRY (__memrchr)
 	mr	r10,r3
 	clrrdi	r6,r7,7
 	li	r9,3<<5
-	dcbt	r9,r6,16      /* Stream hint, decreasing addresses.  */
+	dcbt	r9,r6,8       /* Stream hint, decreasing addresses.  */
 
 	/* Replicate BYTE to doubleword.  */
 	insrdi	r4,r4,8,48

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=acd56f757b4e5ab8737b9564bd7a4ad1009acd8d

commit acd56f757b4e5ab8737b9564bd7a4ad1009acd8d
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Apr 2 13:40:21 2014 +1030

    Fix reference to toc symbol.
    
    https://sourceware.org/ml/binutils/2014-03/msg00033.html removes the
    "magic" treatment of symbols defined in a .toc section.
    
    	* sysdeps/powerpc/powerpc64/start.S: Add @toc to toc symbol reference.
    
    Backport of 483818d768ed99a5edf4114298a75ebedaee8d5c.

diff --git a/ChangeLog b/ChangeLog
index a54240d..1768334 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-04-02  Alan Modra  <amodra@gmail.com>
+
+	* sysdeps/powerpc/powerpc64/start.S: Add @toc to toc symbol reference.
+
 2014-04-01  Alan Modra  <amodra@gmail.com>
 
 	[BZ #16786]
diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
index 15e29d9..934c558 100644
--- a/sysdeps/powerpc/powerpc64/start.S
+++ b/sysdeps/powerpc/powerpc64/start.S
@@ -74,7 +74,7 @@ ENTRY(_start)
 
  /* put the address of start_addresses in r8...  **
 ** PPC64 ABI uses R13 for thread local, so we leave it alone */
-	ld	r8,.L01(r2)
+	ld	r8,.L01@toc(r2)
 
  /* and continue in libc-start, in glibc.  */
 	b	JUMPTARGET(__libc_start_main)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fd5100c480beef3d36c4bf74b6a23529695d036c

commit fd5100c480beef3d36c4bf74b6a23529695d036c
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Apr 1 14:07:42 2014 +1030

    Fix s_copysign stack temp for PowerPC64 ELFv2
    
    	[BZ #16786]
    	* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Don't trash stack.
    
    Backport of c859b32e9d76afe8a3f20bb9528961a573c06937.

diff --git a/ChangeLog b/ChangeLog
index 5c508a9..a54240d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-01  Alan Modra  <amodra@gmail.com>
+
+	[BZ #16786]
+	* sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Don't trash stack.
+
 2014-03-31  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/powerpc64/power8/fpu/s_finite.S (MFVSRD_R3_V1):
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
index 51681aa..49c793d 100644
--- a/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
+++ b/sysdeps/powerpc/powerpc64/fpu/s_copysign.S
@@ -27,11 +27,11 @@ ENTRY(__copysign)
 /* double [f1] copysign (double [f1] x, double [f2] y);
    copysign(x,y) returns a value with the magnitude of x and
    with the sign bit of y.  */
-	stfd	fp2,56(r1)
+	stfd	fp2,-8(r1)
 	nop
 	nop
 	nop
-	ld	r3,56(r1)
+	ld	r3,-8(r1)
 	cmpdi   r3,0
 	blt     L(0)
 	fabs    fp1,fp1

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

Summary of changes:
 ChangeLog                                  |   23 +++++++++++++
 NEWS                                       |    2 +-
 math/libm-test.inc                         |    8 ++++
 sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c |   49 +++++++++++++++++++---------
 sysdeps/powerpc/powerpc64/fpu/s_copysign.S |    4 +-
 sysdeps/powerpc/powerpc64/power7/memrchr.S |    2 +-
 sysdeps/powerpc/powerpc64/start.S          |    2 +-
 7 files changed, 69 insertions(+), 21 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]