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: s_sin.S,v 1.6 2001/06/19 00:26:31 fvdl Exp $")
11
12ENTRY(sin)
13	XMM_ONE_ARG_DOUBLE_PROLOGUE
14	fldl	ARG_DOUBLE_ONE
15	fsin
16	fnstsw	%ax
17	andw	$0x400,%ax
18	jnz	1f
19	XMM_DOUBLE_EPILOGUE
20	ret
211:	fldpi
22	fadd	%st(0)
23	fxch	%st(1)
242:	fprem1
25	fnstsw	%ax
26	andw	$0x400,%ax
27	jnz	2b
28	fstp	%st(1)
29	fsin
30	XMM_DOUBLE_EPILOGUE
31	ret
32