Updated to fedora-glibc-20090427T1419
[glibc.git] / sysdeps / i386 / fpu / s_sinl.S
blob68c4f99668a6652ae2f443b933b83570fd8f762d
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  * Fixed errno handling by Ulrich Drepper <drepper@redhat.com>.
7  */
9 #define __need_Emath
10 #include <bits/errno.h>
11 #include <machine/asm.h>
13 ENTRY(__sinl)
14         fldt    4(%esp)
15         fxam
16         fstsw   %ax
17         movb    $0x45, %dh
18         andb    %ah, %dh
19         cmpb    $0x05, %dh
20         je      3f
21 4:      fsin
22         fnstsw  %ax
23         testl   $0x400,%eax
24         jnz     1f
25         ret
26         .align ALIGNARG(4)
27 1:      fldpi
28         fadd    %st(0)
29         fxch    %st(1)
30 2:      fprem1
31         fnstsw  %ax
32         testl   $0x400,%eax
33         jnz     2b
34         fstp    %st(1)
35         fsin
36         ret
38 #ifdef PIC
39         pushl   %ebx
40         cfi_adjust_cfa_offset (4)
41         cfi_rel_offset (ebx, 0)
42         LOAD_PIC_REG (bx)
43         call    __errno_location@PLT
44         movl    $EDOM, (%eax)
45         popl    %ebx
46         cfi_adjust_cfa_offset (-4)
47         cfi_restore (ebx)
48 #else
49         call    __errno_location@PLT
50         movl    $EDOM, (%eax)
51 #endif
52         jmp     4b
53 END (__sinl)
54 weak_alias (__sinl, sinl)