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