xref: /relibc/openlibm/i387/s_cos.S (revision 0affa5be194d0784e373b0243804e04040e106e9)
1/*
2 * Written by:
3 *	J.T. Conklin (jtc@netbsd.org)
4 *	Public domain.
5 */
6
7#include <i387/bsd_asm.h>
8//__FBSDID("$FreeBSD: src/lib/msun/i387/s_cos.S,v 1.9 2011/01/07 16:13:12 kib Exp $")
9
10ENTRY(cos)
11	fldl	4(%esp)
12	fcos
13	fnstsw	%ax
14	andw	$0x400,%ax
15	jnz	1f
16	ret
171:	fldpi
18	fadd	%st(0)
19	fxch	%st(1)
202:	fprem1
21	fnstsw	%ax
22	andw	$0x400,%ax
23	jnz	2b
24	fstp	%st(1)
25	fcos
26	ret
27END(cos)
28
29
30/* Enable stack protection */
31#if defined(__linux__) && defined(__ELF__)
32.section .note.GNU-stack,"",%progbits
33#endif
34