1570af302Sopenharmony_ci# use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x) 2570af302Sopenharmony_ci 3570af302Sopenharmony_ci.global acos 4570af302Sopenharmony_ci.type acos,@function 5570af302Sopenharmony_ciacos: 6570af302Sopenharmony_ci fldl 4(%esp) 7570af302Sopenharmony_ci fld %st(0) 8570af302Sopenharmony_ci fld1 9570af302Sopenharmony_ci fsub %st(0),%st(1) 10570af302Sopenharmony_ci fadd %st(2) 11570af302Sopenharmony_ci fmulp 12570af302Sopenharmony_ci fsqrt 13570af302Sopenharmony_ci fabs # fix sign of zero (matters in downward rounding mode) 14570af302Sopenharmony_ci fxch %st(1) 15570af302Sopenharmony_ci fpatan 16570af302Sopenharmony_ci fstpl 4(%esp) 17570af302Sopenharmony_ci fldl 4(%esp) 18570af302Sopenharmony_ci ret 19