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.22-508-g01189b0


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  01189b083b8ce54fc568fd2ab0dd433d869ede0e (commit)
      from  939fdd1c36dde8884543bc9c3b8506e76c9ff0e4 (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=01189b083b8ce54fc568fd2ab0dd433d869ede0e

commit 01189b083b8ce54fc568fd2ab0dd433d869ede0e
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Nov 5 21:56:31 2015 +0000

    Fix i386/x86_64 log* (1) zero sign for -ffinite-math-only (bug 19213).
    
    For the -ffinite-math-only versions of various x86_64 and x86 log*
    functions, a zero result from log* (1) is returned with incorrect sign
    in round-downward mode.  This patch fixes this in a similar way to the
    previous fixes for the non-*_finite versions of the functions.
    
    Tested for x86_64 and x86 (including an i586 build), together with a
    patch that will be applied separately to enable the main libm-test.inc
    tests for the finite-math-only functions.
    
    	[BZ #19213]
    	* sysdeps/i386/fpu/e_log.S (__log_finite): Ensure +0 is always
    	returned for argument 1.
    	* sysdeps/i386/fpu/e_logf.S (__logf_finite): Likewise.
    	* sysdeps/i386/fpu/e_logl.S (__logl_finite): Likewise.
    	* sysdeps/i386/i686/fpu/e_logl.S (__logl_finite): Likewise.
    	* sysdeps/x86_64/fpu/e_log10l.S (__log10l_finite): Likewise.
    	* sysdeps/x86_64/fpu/e_log2l.S (__log2l_finite): Likewise.
    	* sysdeps/x86_64/fpu/e_logl.S (__logl_finite): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 9c78a11..95dae4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2015-11-05  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #19213]
+	* sysdeps/i386/fpu/e_log.S (__log_finite): Ensure +0 is always
+	returned for argument 1.
+	* sysdeps/i386/fpu/e_logf.S (__logf_finite): Likewise.
+	* sysdeps/i386/fpu/e_logl.S (__logl_finite): Likewise.
+	* sysdeps/i386/i686/fpu/e_logl.S (__logl_finite): Likewise.
+	* sysdeps/x86_64/fpu/e_log10l.S (__log10l_finite): Likewise.
+	* sysdeps/x86_64/fpu/e_log2l.S (__log2l_finite): Likewise.
+	* sysdeps/x86_64/fpu/e_logl.S (__logl_finite): Likewise.
+
 	[BZ #19211]
 	* math/bits/math-finite.h (lgamma): Set signgam if [__USE_MISC ||
 	__USE_XOPEN], not if [!__USE_ISOC99].
diff --git a/NEWS b/NEWS
index b462e85..4e41998 100644
--- a/NEWS
+++ b/NEWS
@@ -22,7 +22,7 @@ Version 2.23
   19003, 19007, 19012, 19016, 19018, 19032, 19046, 19048, 19049, 19050,
   19059, 19071, 19074, 19076, 19077, 19078, 19079, 19085, 19086, 19088,
   19094, 19095, 19124, 19125, 19129, 19134, 19137, 19156, 19174, 19181,
-  19189, 19201, 19205, 19209, 19211, 19212.
+  19189, 19201, 19205, 19209, 19211, 19212, 19213.
 
 * A defect in the malloc implementation, present since glibc 2.15 (2012) or
   glibc 2.10 via --enable-experimental-malloc (2009), could result in the
diff --git a/sysdeps/i386/fpu/e_log.S b/sysdeps/i386/fpu/e_log.S
index 3fa32aa..335df22 100644
--- a/sysdeps/i386/fpu/e_log.S
+++ b/sysdeps/i386/fpu/e_log.S
@@ -80,7 +80,13 @@ ENTRY(__log_finite)
 	fnstsw			// x-1 : x : log(2)
 	andb	$0x45, %ah
 	jz	2b
-	fstp	%st(1)		// x-1 : log(2)
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	6f
+	fabs			// log(1) is +0 in all rounding modes.
+6:	fstp	%st(1)		// x-1 : log(2)
 	fyl2xp1			// log(x)
 	ret
 END(__log_finite)
diff --git a/sysdeps/i386/fpu/e_logf.S b/sysdeps/i386/fpu/e_logf.S
index ca83d39..de967a3 100644
--- a/sysdeps/i386/fpu/e_logf.S
+++ b/sysdeps/i386/fpu/e_logf.S
@@ -81,7 +81,13 @@ ENTRY(__logf_finite)
 	fnstsw			// x-1 : x : log(2)
 	andb	$0x45, %ah
 	jz	2b
-	fstp	%st(1)		// x-1 : log(2)
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	6f
+	fabs			// log(1) is +0 in all rounding modes.
+6:	fstp	%st(1)		// x-1 : log(2)
 	fyl2xp1			// log(x)
 	ret
 END(__logf_finite)
diff --git a/sysdeps/i386/fpu/e_logl.S b/sysdeps/i386/fpu/e_logl.S
index 828e98a..7a6d370 100644
--- a/sysdeps/i386/fpu/e_logl.S
+++ b/sysdeps/i386/fpu/e_logl.S
@@ -84,7 +84,13 @@ ENTRY(__logl_finite)
 	fnstsw			// x-1 : x : log(2)
 	andb	$0x45, %ah
 	jz	2b
-	fstp	%st(1)		// x-1 : log(2)
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	7f
+	fabs			// log(1) is +0 in all rounding modes.
+7:	fstp	%st(1)		// x-1 : log(2)
 	fyl2xp1			// log(x)
 	ret
 END(__logl_finite)
diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
index 0ccc8fc..e9ecbcd 100644
--- a/sysdeps/i386/i686/fpu/e_logl.S
+++ b/sysdeps/i386/i686/fpu/e_logl.S
@@ -81,7 +81,13 @@ ENTRY(__logl_finite)
 	fcomip	%st(1)		// |x-1| : x-1 : x : log(2)
 	fstp	%st(0)		// x-1 : x : log(2)
 	jc	2b
-	fstp	%st(1)		// x-1 : log(2)
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	6f
+	fabs			// log(1) is +0 in all rounding modes.
+6:	fstp	%st(1)		// x-1 : log(2)
 	fyl2xp1			// log(x)
 	ret
 END(__logl_finite)
diff --git a/sysdeps/x86_64/fpu/e_log10l.S b/sysdeps/x86_64/fpu/e_log10l.S
index 2607ad1..8fa6164 100644
--- a/sysdeps/x86_64/fpu/e_log10l.S
+++ b/sysdeps/x86_64/fpu/e_log10l.S
@@ -79,7 +79,13 @@ ENTRY(__log10l_finite)
 	fnstsw			// x-1 : x : log10(2)
 	andb	$0x45, %ah
 	jz	2b
-	fstp	%st(1)		// x-1 : log10(2)
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	6f
+	fabs			// log10(1) is +0 in all rounding modes.
+6:	fstp	%st(1)		// x-1 : log10(2)
 	fyl2xp1			// log10(x)
 	ret
 END(__log10l_finite)
diff --git a/sysdeps/x86_64/fpu/e_log2l.S b/sysdeps/x86_64/fpu/e_log2l.S
index c12906d..a063255 100644
--- a/sysdeps/x86_64/fpu/e_log2l.S
+++ b/sysdeps/x86_64/fpu/e_log2l.S
@@ -78,7 +78,13 @@ ENTRY(__log2l_finite)
 	fnstsw			// x-1 : x : 1
 	andb	$0x45, %ah
 	jz	2b
-	fstp	%st(1)		// x-1 : 1
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	6f
+	fabs			// log2(1) is +0 in all rounding modes.
+6:	fstp	%st(1)		// x-1 : 1
 	fyl2xp1			// log(x)
 	ret
 END (__log2l_finite)
diff --git a/sysdeps/x86_64/fpu/e_logl.S b/sysdeps/x86_64/fpu/e_logl.S
index 047b8db..dbe6fd5 100644
--- a/sysdeps/x86_64/fpu/e_logl.S
+++ b/sysdeps/x86_64/fpu/e_logl.S
@@ -81,7 +81,13 @@ ENTRY(__logl_finite)
 	fnstsw			// x-1 : x : log(2)
 	andb	$0x45, %ah
 	jz	2b
-	fstp	%st(1)		// x-1 : log(2)
+	fxam
+	fnstsw
+	andb	$0x45, %ah
+	cmpb	$0x40, %ah
+	jne	7f
+	fabs			// log(1) is +0 in all rounding modes.
+7:	fstp	%st(1)		// x-1 : log(2)
 	fyl2xp1			// log(x)
 	ret
 END (__logl_finite)

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

Summary of changes:
 ChangeLog                      |   10 ++++++++++
 NEWS                           |    2 +-
 sysdeps/i386/fpu/e_log.S       |    8 +++++++-
 sysdeps/i386/fpu/e_logf.S      |    8 +++++++-
 sysdeps/i386/fpu/e_logl.S      |    8 +++++++-
 sysdeps/i386/i686/fpu/e_logl.S |    8 +++++++-
 sysdeps/x86_64/fpu/e_log10l.S  |    8 +++++++-
 sysdeps/x86_64/fpu/e_log2l.S   |    8 +++++++-
 sysdeps/x86_64/fpu/e_logl.S    |    8 +++++++-
 9 files changed, 60 insertions(+), 8 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]