Home | History | Annotate | Line # | Download | only in i387
e_acos.S revision 1.6
      1 /*
      2  * Written by J.T. Conklin <jtc (at) netbsd.org>.
      3  * Public domain.
      4  */
      5 
      6 #include <machine/asm.h>
      7 
      8 RCSID("$NetBSD: e_acos.S,v 1.6 2000/09/26 07:28:23 kleink Exp $")
      9 
     10 /* acos = atan (sqrt(1 - x^2) / x) */
     11 ENTRY(__ieee754_acos)
     12 	fldl	4(%esp)			/* x */
     13 	fld	%st(0)
     14 	fmul	%st(0)			/* x^2 */
     15 	fld1
     16 	fsubp				/* 1 - x^2 */
     17 	fsqrt				/* sqrt (1 - x^2) */
     18 	fxch	%st(1)
     19 	fpatan
     20 	ret
     21