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.
12 files changed:
--- /dev/null
+.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
--- /dev/null
+# see acos.s
--- /dev/null
+# see acos.s
--- /dev/null
+.global asinf
+.type asinf,@function
+asinf:
+ flds 4(%esp)
+ jmp 1f
+
+.global asinl
+.type asinl,@function
+asinl:
+ fldt 4(%esp)
+ jmp 1f
+
+.global asin
+.type asin,@function
+asin:
+ fldl 4(%esp)
+1: fld %st(0)
+ fmul %st(0)
+ fld1
+ fsubp %st(1)
+ fsqrt
+ fpatan
+ ret
--- /dev/null
+# see asin.s
--- /dev/null
+# see asin.s
--- /dev/null
+.global atan
+.type atan,@function
+atan:
+ fldl 4(%esp)
+ fld1
+ fpatan
+ ret
--- /dev/null
+.global atan2
+.type atan2,@function
+atan2:
+ fldl 4(%esp)
+ fldl 12(%esp)
+ fpatan
+ ret
--- /dev/null
+.global atan2f
+.type atan2f,@function
+atan2f:
+ flds 4(%esp)
+ flds 8(%esp)
+ fpatan
+ ret
--- /dev/null
+.global atan2l
+.type atan2l,@function
+atan2l:
+ fldt 4(%esp)
+ fldt 16(%esp)
+ fpatan
+ ret
--- /dev/null
+.global atanf
+.type atanf,@function
+atanf:
+ flds 4(%esp)
+ fld1
+ fpatan
+ ret
--- /dev/null
+.global atanl
+.type atanl,@function
+atanl:
+ fldt 4(%esp)
+ fld1
+ fpatan
+ ret