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.23-11-g9120a57


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  9120a57f4819965fa976d5de3b1d27b284319ed1 (commit)
      from  0fed79a8279bb4d4483895a742457946faf89594 (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=9120a57f4819965fa976d5de3b1d27b284319ed1

commit 9120a57f4819965fa976d5de3b1d27b284319ed1
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Feb 19 00:55:46 2016 +0000

    Fix ldbl-128ibm remainderl, remquol equality tests (bug 19603).
    
    The ldbl-128ibm implementations of remainderl and remquol have logic
    resulting in incorrect tests for equality of the absolute values of
    the arguments.  Equality is tested based on the integer
    representations of the high and low parts, with the sign bit masked
    off the high part - but when this changes the sign of the high part,
    the sign of the low part needs to be changed as well, and failure to
    do this means arguments are wrongly treated as equal when they are
    not.
    
    This patch fixes the logic to adjust signs of low parts as needed.
    Tested for powerpc.
    
    	[BZ #19603]
    	* sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
    	(__ieee754_remainderl): Adjust sign of integer version of low part
    	when taking absolute value of high part.
    	* sysdeps/ieee754/ldbl-128ibm/s_remquol.c (__remquol): Likewise.
    	* math/libm-test.inc (remainder_test_data): Add another test.
    	(remquo_test_data): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 3e480ed..32fae2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-02-19  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #19603]
+	* sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
+	(__ieee754_remainderl): Adjust sign of integer version of low part
+	when taking absolute value of high part.
+	* sysdeps/ieee754/ldbl-128ibm/s_remquol.c (__remquol): Likewise.
+	* math/libm-test.inc (remainder_test_data): Add another test.
+	(remquo_test_data): Likewise.
+
 2016-02-18  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #19602]
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 3f0610d..c9925fd 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -10392,6 +10392,7 @@ static const struct test_ff_f_data remainder_test_data[] =
     TEST_ff_f (remainder, 3.0, 2.0, -1.0, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 56
     TEST_ff_f (remainder, -0x1.80000000000002p1L, 2.0, 0x1.fffffffffffff8p-1L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ff_f (remainder, 0x0.ffffffffffffffp0L, -0x1.00000000000001p0L, -0x1p-55L, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
 #endif
 
     TEST_ff_f (remainder, 3419, 360, 179, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
@@ -10530,6 +10531,7 @@ static const struct test_ffI_f1_data remquo_test_data[] =
     TEST_ffI_f1 (remquo, 3, 2, -1, 2, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
 #if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 56
     TEST_ffI_f1 (remquo, -0x1.80000000000002p1L, 2.0, 0x1.fffffffffffff8p-1L, -2, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+    TEST_ffI_f1 (remquo, 0x0.ffffffffffffffp0L, -0x1.00000000000001p0L, -0x1p-55L, -1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
 #endif
 
     TEST_ffI_f1 (remquo, 3419, 360, 179, 1, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
index 800416f..1dc59a4 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
@@ -42,7 +42,9 @@ __ieee754_remainderl(long double x, long double p)
 	EXTRACT_WORDS64 (hp, phi);
 	EXTRACT_WORDS64 (lp, plo);
 	sx = hx&0x8000000000000000ULL;
+	lp ^= hp & 0x8000000000000000ULL;
 	hp &= 0x7fffffffffffffffLL;
+	lx ^= sx;
 	hx &= 0x7fffffffffffffffLL;
 
     /* purge off exception values */
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
index 20e17cc..14b27ca 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
@@ -43,7 +43,9 @@ __remquol (long double x, long double y, int *quo)
   EXTRACT_WORDS64 (ly, ylo);
   sx = hx & 0x8000000000000000ULL;
   qs = sx ^ (hy & 0x8000000000000000ULL);
+  ly ^= hy & 0x8000000000000000ULL;
   hy &= 0x7fffffffffffffffLL;
+  lx ^= sx;
   hx &= 0x7fffffffffffffffLL;
 
   /* Purge off exception values.  */

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

Summary of changes:
 ChangeLog                                  |   10 ++++++++++
 math/libm-test.inc                         |    2 ++
 sysdeps/ieee754/ldbl-128ibm/e_remainderl.c |    2 ++
 sysdeps/ieee754/ldbl-128ibm/s_remquol.c    |    2 ++
 4 files changed, 16 insertions(+), 0 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]