1/*	$OpenBSD: s_sin.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */
2/*
3 * Written by J.T. Conklin <jtc@NetBSD.org>.
4 * Public domain.
5 */
6
7#include <machine/asm.h>
8
9#include "abi.h"
10
11ENTRY(sin)
12	XMM_ONE_ARG_DOUBLE_PROLOGUE
13	fldl	ARG_DOUBLE_ONE
14	fsin
15	fnstsw	%ax
16	andw	$0x400,%ax
17	jnz	1f
18	XMM_DOUBLE_EPILOGUE
19	ret
201:	fldpi
21	fadd	%st(0)
22	fxch	%st(1)
232:	fprem1
24	fnstsw	%ax
25	andw	$0x400,%ax
26	jnz	2b
27	fstp	%st(1)
28	fsin
29	XMM_DOUBLE_EPILOGUE
30	ret
31END(sin)
32
33	.section .note.GNU-stack,"",%progbits
34