xref: /netbsd/lib/libm/arch/i387/e_asin.S (revision bf9ec67e)
1/*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
4 */
5
6#include <machine/asm.h>
7
8#include "abi.h"
9
10RCSID("$NetBSD: e_asin.S,v 1.6 2001/06/19 00:26:29 fvdl Exp $")
11
12/* asin = atan (x / sqrt(1 - x^2)) */
13ENTRY(__ieee754_asin)
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	fpatan
22	XMM_DOUBLE_EPILOGUE
23	ret
24