1 1.1 jtc /* 2 1.8 salo * Written by J.T. Conklin <jtc (at) NetBSD.org>. 3 1.3 jtc * Public domain. 4 1.1 jtc */ 5 1.1 jtc 6 1.1 jtc #include <machine/asm.h> 7 1.1 jtc 8 1.7 fvdl #include "abi.h" 9 1.7 fvdl 10 1.9 dsl RCSID("$NetBSD: e_acos.S,v 1.9 2014/03/03 08:00:50 dsl Exp $") 11 1.2 jtc 12 1.1 jtc /* acos = atan (sqrt(1 - x^2) / x) */ 13 1.1 jtc ENTRY(__ieee754_acos) 14 1.7 fvdl XMM_ONE_ARG_DOUBLE_PROLOGUE 15 1.7 fvdl fldl ARG_DOUBLE_ONE /* x */ 16 1.6 kleink fld %st(0) 17 1.1 jtc fmul %st(0) /* x^2 */ 18 1.5 simonb fld1 19 1.1 jtc fsubp /* 1 - x^2 */ 20 1.1 jtc fsqrt /* sqrt (1 - x^2) */ 21 1.9 dsl fabs /* Change -0.0 to +0.0 */ 22 1.1 jtc fxch %st(1) 23 1.1 jtc fpatan 24 1.7 fvdl XMM_DOUBLE_EPILOGUE 25 1.1 jtc ret 26