about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/e_scalbf.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-02-18 19:52:52 +0000
committerUlrich Drepper <drepper@redhat.com>2001-02-18 19:52:52 +0000
commite208f556cad11f729533385e46e4191fcc49aa0a (patch)
tree7313b0ca2c1bc399228dc93c04a3b23fd072ee65 /sysdeps/i386/fpu/e_scalbf.S
parent3667c08816a6e43e2d41f6bcc58f17ad4f86b911 (diff)
downloadglibc-e208f556cad11f729533385e46e4191fcc49aa0a.tar.gz
glibc-e208f556cad11f729533385e46e4191fcc49aa0a.tar.xz
glibc-e208f556cad11f729533385e46e4191fcc49aa0a.zip
Update.
2001-02-18  Ulrich Drepper  <drepper@redhat.com>

	* math/libm-test.inc (scalb_test): Require invalid exception being
	raised for invalid parameters.
	* sysdeps/i386/fpu/e_scalb.S: Raise invalid exception if necessary.
	* sysdeps/i386/fpu/e_scalbf.S: Likewise.
	* sysdeps/i386/fpu/e_scalbl.S: Likewise.
Diffstat (limited to 'sysdeps/i386/fpu/e_scalbf.S')
-rw-r--r--sysdeps/i386/fpu/e_scalbf.S10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/i386/fpu/e_scalbf.S b/sysdeps/i386/fpu/e_scalbf.S
index 4b5b0d07b3..d41c29327d 100644
--- a/sysdeps/i386/fpu/e_scalbf.S
+++ b/sysdeps/i386/fpu/e_scalbf.S
@@ -58,7 +58,7 @@ ENTRY(__ieee754_scalbf)
 	fcomp	%st(2)
 	fnstsw
 	sahf
-	jne	2f
+	jne	4f
 	fscale
 	fstp	%st(1)
 	ret
@@ -77,6 +77,7 @@ ENTRY(__ieee754_scalbf)
 	fstp	%st
 	andl	$0x80000000, %edx
 	andl	$8, %eax
+	jnz	4f
 	shrl	$27, %edx
 	addl	%edx, %eax
 	fldl	MOX(zero_nan, %eax, 1)
@@ -97,4 +98,11 @@ ENTRY(__ieee754_scalbf)
 	/* 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_scalbf)