about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/e_scalbl.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/e_scalbl.S')
-rw-r--r--sysdeps/i386/fpu/e_scalbl.S10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_scalbl.S b/sysdeps/i386/fpu/e_scalbl.S
index e8166fa9d5..65644f8f0e 100644
--- a/sysdeps/i386/fpu/e_scalbl.S
+++ b/sysdeps/i386/fpu/e_scalbl.S
@@ -58,7 +58,7 @@ ENTRY(__ieee754_scalbl)
 	fcomp	%st(2)
 	fnstsw
 	sahf
-	jne	2f
+	jne	4f
 	fscale
 	fstp	%st(1)
 	ret
@@ -77,6 +77,7 @@ ENTRY(__ieee754_scalbl)
 	fstp	%st
 	andl	$0x8000, %edx
 	andl	$8, %eax
+	jnz	4f
 	shrl	$11, %edx
 	addl	%edx, %eax
 	fldl	MOX(zero_nan, %eax, 1)
@@ -97,4 +98,11 @@ ENTRY(__ieee754_scalbl)
 	/* The first parameter is a NaN.  Return it.  */
 3:	fstp	%st(1)
 	ret
+
+	/* Return NaN and raise the invalid exception.  */
+4:	fstp	%st
+	fstp	%st
+	fldz
+	fdiv	%st
+	ret
 END(__ieee754_scalbl)