about summary refs log tree commit diff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2016-06-22 15:40:30 +0000
committerJoseph Myers <joseph@codesourcery.com>2016-06-22 15:40:30 +0000
commit4e9bf327ad02ed83bded4011af68613e6b03ab33 (patch)
tree20dfec4dcf14d0772751092bcb340c02b535b9a9 /sysdeps/i386
parent11f4944d7f3d179408c7b8814eafdc383a1b3416 (diff)
downloadglibc-4e9bf327ad02ed83bded4011af68613e6b03ab33.tar.gz
glibc-4e9bf327ad02ed83bded4011af68613e6b03ab33.tar.xz
glibc-4e9bf327ad02ed83bded4011af68613e6b03ab33.zip
Simplify x86 nearbyint functions.
The i386 implementations of nearbyint functions, and x86_64
nearbyintl, contain code to mask the "inexact" exception.  However,
the fnstenv instruction has the effect of masking all exceptions, so
this masking code has been redundant since fnstenv was added to those
implementations (by commit 846d9a4a3acdb4939ca7bf6aed48f9f6f26911be;
commit 71d1b0166b4ace0d804af2993b3815758b852efc added the test
math/test-nearbyint-except-2.c that verifies these functions do work
when called with "inexact" traps enabled); this patch removes the
redundant code.

Tested for x86_64 and x86.

	* sysdeps/i386/fpu/s_nearbyint.S (__nearbyint): Do not mask
	"inexact" exceptions after fnstenv.
	* sysdeps/i386/fpu/s_nearbyintf.S (__nearbyintf): Likewise.
	* sysdeps/i386/fpu/s_nearbyintl.S (__nearbyintl): Likewise.
	* sysdeps/x86_64/fpu/s_nearbyintl.S (__nearbyintl): Likewise.
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/fpu/s_nearbyint.S4
-rw-r--r--sysdeps/i386/fpu/s_nearbyintf.S4
-rw-r--r--sysdeps/i386/fpu/s_nearbyintl.S4
3 files changed, 0 insertions, 12 deletions
diff --git a/sysdeps/i386/fpu/s_nearbyint.S b/sysdeps/i386/fpu/s_nearbyint.S
index 8da8ae9792..f7b79b6ff2 100644
--- a/sysdeps/i386/fpu/s_nearbyint.S
+++ b/sysdeps/i386/fpu/s_nearbyint.S
@@ -11,10 +11,6 @@ ENTRY(__nearbyint)
 	subl	$32, %esp
 	cfi_adjust_cfa_offset (32)
 	fnstenv	4(%esp)
-	movl	4(%esp), %eax
-	orl	$0x20, %eax
-	movl	%eax, (%esp)
-	fldcw	(%esp)
 	frndint
 	fldenv	4(%esp)
 	addl	$32, %esp
diff --git a/sysdeps/i386/fpu/s_nearbyintf.S b/sysdeps/i386/fpu/s_nearbyintf.S
index 0c51f72364..92df2f87b3 100644
--- a/sysdeps/i386/fpu/s_nearbyintf.S
+++ b/sysdeps/i386/fpu/s_nearbyintf.S
@@ -11,10 +11,6 @@ ENTRY(__nearbyintf)
 	subl	$32, %esp
 	cfi_adjust_cfa_offset (32)
 	fnstenv	4(%esp)
-	movl	4(%esp), %eax
-	orl	$0x20, %eax
-	movl	%eax, (%esp)
-	fldcw	(%esp)
 	frndint
 	fldenv	4(%esp)
 	addl	$32, %esp
diff --git a/sysdeps/i386/fpu/s_nearbyintl.S b/sysdeps/i386/fpu/s_nearbyintl.S
index b260ab5914..3b7d1e2436 100644
--- a/sysdeps/i386/fpu/s_nearbyintl.S
+++ b/sysdeps/i386/fpu/s_nearbyintl.S
@@ -11,10 +11,6 @@ ENTRY(__nearbyintl)
 	subl	$32, %esp
 	cfi_adjust_cfa_offset (32)
 	fnstenv	4(%esp)
-	movl	4(%esp), %eax
-	orl	$0x20, %eax
-	movl	%eax, (%esp)
-	fldcw	(%esp)
 	frndint
 	fnstsw
 	andl	$0x1, %eax