about summary refs log tree commit diff
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012-03-20 03:13:26 +0100
committernsz <nsz@port70.net>2012-03-20 03:13:26 +0100
commit0b0735af457e599a26a5f82f9e4615c60deac161 (patch)
tree88e9ce153895ad949576fa7ce1eeee4b02286479
parent634c3a63027aa4a693b64fae0e2f6e1635558e93 (diff)
parent97721a5508415a2f10eb068e022093811c9ff8be (diff)
downloadmusl-0b0735af457e599a26a5f82f9e4615c60deac161.tar.gz
musl-0b0735af457e599a26a5f82f9e4615c60deac161.tar.xz
musl-0b0735af457e599a26a5f82f9e4615c60deac161.zip
Merge branch 'master' of git://git.etalabs.net/musl
-rw-r--r--src/math/i386/exp.s45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/math/i386/exp.s b/src/math/i386/exp.s
index 76ab4d64..ca0de1d4 100644
--- a/src/math/i386/exp.s
+++ b/src/math/i386/exp.s
@@ -68,21 +68,19 @@ exp:
 .type exp2,@function
 exp2:
 	fldl 4(%esp)
-1:	mov $0x47000000,%eax
-	push %eax
+1:	pushl $0x467ff000
 	flds (%esp)
-	shl $7,%eax
-	push %eax
-	add %eax,%eax
+	xorl %eax,%eax
+	pushl $0x80000000
 	push %eax
 	fld %st(1)
 	fabs
 	fucom %st(1)
 	fnstsw
-	sahf
-	ja 2f
 	fstp %st(0)
 	fstp %st(0)
+	sahf
+	ja 2f
 	fld %st(0)
 	fistpl 8(%esp)
 	fildl 8(%esp)
@@ -99,22 +97,23 @@ exp2:
 	add $12,%esp
 	ret
 
-2:	fstp %st(0)
-	fstp %st(0)
-	fsts 8(%esp)
-	mov 8(%esp),%eax
-	lea (%eax,%eax),%ecx
-	cmp $0xff000000,%ecx
-	ja 2f
+2:	fld %st(0)
+	fstpt (%esp)
+	mov 9(%esp),%ah
+	and $0x7f,%ah
+	cmp $0x7f,%ah
+	jne 1f
+	decb 9(%esp)
 	fstp %st(0)
-	xor %ecx,%ecx
-	inc %ecx
-	add %eax,%eax
-	jc 1f
-	mov $0x7ffe,%ecx
-1:	mov %ecx,8(%esp)
 	fldt (%esp)
-	fld %st(0)
-	fmulp
-2:	add $12,%esp
+1:	fld %st(0)
+	frndint
+	fxch %st(1)
+	fsub %st(1)
+	f2xm1
+	fld1
+	faddp
+	fscale
+	fstp %st(1)
+	add $12,%esp
 	ret