about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/fpu/e_expl.S10
-rw-r--r--sysdeps/x86_64/fpu/e_expl.S10
2 files changed, 20 insertions, 0 deletions
diff --git a/sysdeps/i386/fpu/e_expl.S b/sysdeps/i386/fpu/e_expl.S
index eb4086b3f5..c7e43732dc 100644
--- a/sysdeps/i386/fpu/e_expl.S
+++ b/sysdeps/i386/fpu/e_expl.S
@@ -108,6 +108,16 @@ ENTRY(IEEE754_EXPL)
 	andb	%ah, %dh
 	cmpb	$0x40, %dh
 	je	2f
+
+	/* Test for arguments that are small but not subnormal.  */
+	movzwl	4+8(%esp), %eax
+	andl	$0x7fff, %eax
+	cmpl	$0x3fbf, %eax
+	jge	3f
+	/* Argument's exponent below -64; avoid spurious underflow if
+	   normal.  */
+	cmpl	$0x0001, %eax
+	jge	2f
 #else
 	movzwl	4+8(%esp), %eax
 	andl	$0x7fff, %eax
diff --git a/sysdeps/x86_64/fpu/e_expl.S b/sysdeps/x86_64/fpu/e_expl.S
index 338527b3de..0ebe3882a5 100644
--- a/sysdeps/x86_64/fpu/e_expl.S
+++ b/sysdeps/x86_64/fpu/e_expl.S
@@ -105,6 +105,16 @@ ENTRY(IEEE754_EXPL)
 	andb	%ah, %dh
 	cmpb	$0x40, %dh
 	je	2f
+
+	/* Test for arguments that are small but not subnormal.  */
+	movzwl	8+8(%rsp), %eax
+	andl	$0x7fff, %eax
+	cmpl	$0x3fbf, %eax
+	jge	3f
+	/* Argument's exponent below -64; avoid spurious underflow if
+	   normal.  */
+	cmpl	$0x0001, %eax
+	jge	2f
 #else
 	movzwl	8+8(%rsp), %eax
 	andl	$0x7fff, %eax