about summary refs log tree commit diff
path: root/src/math/i386/expm1.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-03-18 21:43:43 -0400
committerRich Felker <dalias@aerifal.cx>2012-03-18 21:43:43 -0400
commit6f26cf3dacf9d426bbd18cecb4d486da56c17351 (patch)
tree662a6bb927776d10fbc1ab5bec86ebbd285b442b /src/math/i386/expm1.s
parentb935147761d1770bb115f09f8c28ddb4d36e1236 (diff)
downloadmusl-6f26cf3dacf9d426bbd18cecb4d486da56c17351.tar.gz
musl-6f26cf3dacf9d426bbd18cecb4d486da56c17351.tar.xz
musl-6f26cf3dacf9d426bbd18cecb4d486da56c17351.zip
asm exponential functions for i386
Diffstat (limited to 'src/math/i386/expm1.s')
-rw-r--r--src/math/i386/expm1.s36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/math/i386/expm1.s b/src/math/i386/expm1.s
new file mode 100644
index 00000000..d6d511ef
--- /dev/null
+++ b/src/math/i386/expm1.s
@@ -0,0 +1,36 @@
+.global expm1f
+.type expm1f,@function
+expm1f:
+	flds 4(%esp)
+	jmp 1f
+
+.global expm1l
+.type expm1l,@function
+expm1l:
+	fldt 4(%esp)
+	jmp 1f
+
+.global expm1
+.type expm1,@function
+expm1:
+	fldl 4(%esp)
+1:	fldl2e
+	fmulp
+	fld %st(0)
+	frndint
+	fldz
+	fcompi
+	jnz 1f
+	fstp %st(0)
+	f2xm1
+	ret
+1:	fxch %st(1)
+	fsub %st(1)
+	f2xm1
+	fld1
+	faddp
+	fscale
+	fld1
+	fsubrp
+	fstp %st(1)
+	ret