Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1906 | serge | 1 | /* |
2 | * Written by J.T. Conklin |
||
3 | * Public domain. |
||
4 | * |
||
5 | * Removed glibc header dependancy by Danny Smith |
||
6 | * |
||
7 | */ |
||
8 | .file "cos.s" |
||
9 | .text |
||
10 | .align 4 |
||
11 | .globl _cos |
||
12 | .def _cos; .scl 2; .type 32; .endef |
||
13 | _cos: |
||
14 | fldl 4(%esp) |
||
15 | fcos |
||
16 | fnstsw %ax |
||
17 | testl $0x400,%eax |
||
18 | jnz 1f |
||
19 | ret |
||
20 | 1: fldpi |
||
21 | fadd %st(0) |
||
22 | fxch %st(1) |
||
23 | 2: fprem1 |
||
24 | fnstsw %ax |
||
25 | testl $0x400,%eax |
||
26 | jnz 2b |
||
27 | fstp %st(1) |
||
28 | fcos |
||
29 | ret |