about summary refs log tree commit diff
path: root/sysdeps/libm-i387/e_exp.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-i387/e_exp.S')
-rw-r--r--sysdeps/libm-i387/e_exp.S21
1 files changed, 10 insertions, 11 deletions
diff --git a/sysdeps/libm-i387/e_exp.S b/sysdeps/libm-i387/e_exp.S
index 4505ebd309..3c9d45b746 100644
--- a/sysdeps/libm-i387/e_exp.S
+++ b/sysdeps/libm-i387/e_exp.S
@@ -5,7 +5,7 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: e_exp.S,v 1.4 1995/05/08 23:47:04 jtc Exp $")
+RCSID("$NetBSD: e_exp.S,v 1.7 1996/07/03 17:31:28 jtc Exp $")
 
 /* e^x = 2^(x * log2(e)) */
 ENTRY(__ieee754_exp)
@@ -16,16 +16,16 @@ ENTRY(__ieee754_exp)
    -- drepper@cygnus.com.  */
 	fxam				/* Is NaN or +-Inf?  */
 	fstsw	%ax
-	sahf
-	jnc	.LnoInfNaN		/* No, jump.   */
-	jp	.LisInf			/* Is +-Inf, jump.  */
-.LnoInfNaN:
+	movb	$0x45, %dh
+	andb	%ah, %dh
+	cmpb	$0x05, %dh
+	je	1f			/* Is +-Inf, jump.  */
 	fldl2e
 	fmulp				/* x * log2(e) */
 	fstl	%st(1)
 	frndint				/* int(x * log2(e)) */
-	fstl	%st(2)
-	fsubrp				/* fract(x * log2(e)) */
+	fsub	%st,%st(1)		/* fract(x * log2(e)) */
+	fxch
 	f2xm1				/* 2^(fract(x * log2(e))) - 1 */
 	fld1
 	faddp				/* 2^(fract(x * log2(e))) */
@@ -33,9 +33,8 @@ ENTRY(__ieee754_exp)
 	fstp	%st(1)
 	ret
 
-.LisInf:
-	andb	$2, %ah			/* Test sign.  */
-	jz	.LpInf			/* If positive, jump.  */
+1:	testl	$0x200, %eax		/* Test sign.  */
+	jz	2f			/* If positive, jump.  */
 	fldz				/* Set result to 0.  */
-.LpInf:	ret
+2:	ret
 END (__ieee754_exp)