about summary refs log tree commit diff
path: root/src/math/i386/acos.s
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-03-19 04:56:07 -0400
committerRich Felker <dalias@aerifal.cx>2012-03-19 04:56:07 -0400
commitbc33e617040166e971ec1e6822ac1cc417eb6c9c (patch)
tree984dfc67487f0759fa5cceca0e9e53e28ad05b99 /src/math/i386/acos.s
parent495a52ae7bb581aac2942d7cb095cca2ff53ca3c (diff)
downloadmusl-bc33e617040166e971ec1e6822ac1cc417eb6c9c.tar.gz
musl-bc33e617040166e971ec1e6822ac1cc417eb6c9c.tar.xz
musl-bc33e617040166e971ec1e6822ac1cc417eb6c9c.zip
asm for inverse trig functions
unlike trig functions, these are easy to do in asm because they do not
involve (arbitrary-precision) argument reduction. fpatan automatically
takes care of domain issues, and in asin and acos, fsqrt takes care of
them for us.
Diffstat (limited to 'src/math/i386/acos.s')
-rw-r--r--src/math/i386/acos.s24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/math/i386/acos.s b/src/math/i386/acos.s
new file mode 100644
index 00000000..6f9ef7f0
--- /dev/null
+++ b/src/math/i386/acos.s
@@ -0,0 +1,24 @@
+.global acosf
+.type acosf,@function
+acosf:
+	flds 4(%esp)
+	jmp 1f
+
+.global acosl
+.type acosl,@function
+acosl:
+	fldt 4(%esp)
+	jmp 1f
+
+.global acos
+.type acos,@function
+acos:
+	fldl 4(%esp)
+1:	fld %st(0)
+	fmul %st(0)
+	fld1
+	fsubp %st(1)
+	fsqrt
+	fxch %st(1)
+	fpatan
+	ret