1/*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
4 *
5 * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>.
6 * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>.
7 * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
8 */
9
10#include <machine/asm.h>
11
12ENTRY(__sinl)
13	fldt	8(%rsp)
14	fxam
15	fstsw	%ax
16	movb	$0x45, %dh
17	andb	%ah, %dh
18	cmpb	$0x05, %dh
19	je	3f
204:	fsin
21	fnstsw	%ax
22	testl	$0x400,%eax
23	jnz	1f
24	ret
25	.align ALIGNARG(4)
261:	fldpi
27	fadd	%st(0)
28	fxch	%st(1)
292:	fprem1
30	fnstsw	%ax
31	testl	$0x400,%eax
32	jnz	2b
33	fstp	%st(1)
34	fsin
35	ret
363:	//call	__errno_location@PLT
37	//movl	$EDOM, (%rax)
38	jmp	4b
39END (__sinl)
40weak_alias (__sinl, sinl)
41