From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/math/i386/acos.s | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/math/i386/acos.s (limited to 'src/math/i386/acos.s') diff --git a/src/math/i386/acos.s b/src/math/i386/acos.s new file mode 100644 index 0000000..af423a2 --- /dev/null +++ b/src/math/i386/acos.s @@ -0,0 +1,18 @@ +# use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x) + +.global acos +.type acos,@function +acos: + fldl 4(%esp) + fld %st(0) + fld1 + fsub %st(0),%st(1) + fadd %st(2) + fmulp + fsqrt + fabs # fix sign of zero (matters in downward rounding mode) + fxch %st(1) + fpatan + fstpl 4(%esp) + fldl 4(%esp) + ret -- cgit v1.2.3