about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/x86_64/fpu')
-rw-r--r--sysdeps/x86_64/fpu/e_expl.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/e_expl.S b/sysdeps/x86_64/fpu/e_expl.S
index 866bad2c6e..14dd29dcad 100644
--- a/sysdeps/x86_64/fpu/e_expl.S
+++ b/sysdeps/x86_64/fpu/e_expl.S
@@ -119,6 +119,12 @@ ENTRY(IEEE754_EXPL)
 	   normal.  */
 	cmpl	$0x0001, %eax
 	jge	2f
+	/* Force underflow and return the argument, to avoid wrong signs
+	   of zero results from the code below in some rounding modes.  */
+	fld	%st
+	fmul	%st
+	fstp	%st
+	jmp	2f
 #else
 	movzwl	8+8(%rsp), %eax
 	andl	$0x7fff, %eax