about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/s_nearbyintl.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/fpu/s_nearbyintl.S')
-rw-r--r--sysdeps/x86_64/fpu/s_nearbyintl.S14
1 files changed, 8 insertions, 6 deletions
diff --git a/sysdeps/x86_64/fpu/s_nearbyintl.S b/sysdeps/x86_64/fpu/s_nearbyintl.S
index dab2750a23..76d41bdd52 100644
--- a/sysdeps/x86_64/fpu/s_nearbyintl.S
+++ b/sysdeps/x86_64/fpu/s_nearbyintl.S
@@ -8,14 +8,16 @@
 
 ENTRY(__nearbyintl)
 	fldt	8(%rsp)
-	fnstcw	-4(%rsp)
-	movl	-4(%rsp), %eax
+	fnstenv	-28(%rsp)
+	movl	-28(%rsp), %eax
 	orl	$0x20, %eax
-	movl	%eax, -8(%rsp)
-	fldcw	-8(%rsp)
+	movl	%eax, -32(%rsp)
+	fldcw	-32(%rsp)
 	frndint
-	fclex
-	fldcw	-4(%rsp)
+	fnstsw
+	andl	$0x1, %eax
+	orl	%eax, -24(%rsp)
+	fldenv	-28(%rsp)
 	ret
 END (__nearbyintl)
 weak_alias (__nearbyintl, nearbyintl)