2.9
[glibc/nacl-glibc.git] / sysdeps / x86_64 / fpu / s_tanl.S
blob674e908accda63ea919c0ceab6ecaec857657f75
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  */
9 #include <machine/asm.h>
11 RCSID("$NetBSD: $")
13 ENTRY(__tanl)
14         fldt    8(%rsp)
15         fptan
16         fnstsw  %ax
17         testl   $0x400,%eax
18         jnz     1f
19         fstp    %st(0)
20         ret
21 1:      fldpi
22         fadd    %st(0)
23         fxch    %st(1)
24 2:      fprem1
25         fstsw   %ax
26         testl   $0x400,%eax
27         jnz     2b
28         fstp    %st(1)
29         fptan
30         fstp    %st(0)
31         ret
32 END (__tanl)
33 weak_alias (__tanl, tanl)