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 | * Adapted for `long double' by Ulrich Drepper |
||
6 | * |
||
7 | * Removed header file dependency for use in libmingwex.a by |
||
8 | * Danny Smith |
||
9 | */ |
||
10 | .file "logl.S" |
||
11 | .text |
||
12 | .align 4 |
||
13 | one: .double 1.0 |
||
14 | /* It is not important that this constant is precise. It is only |
||
15 | a value which is known to be on the safe side for using the |
||
16 | fyl2xp1 instruction. */ |
||
17 | limit: .double 0.29 |
||
18 | |||
19 | .text |
||
20 | .align 4 |
||
21 | .globl _logl |
||
22 | .def _logl; .scl 2; .type 32; .endef |
||
23 | _logl: |
||
24 | fldln2 /* log(2) */ |
||
25 | fldt 4(%esp) /* x : log(2) */ |
||
26 | fld %st /* x : x : log(2) */ |
||
27 | fsubl one /* x-1 : x : log(2) */ |
||
28 | fld %st /* x-1 : x-1 : x : log(2) */ |
||
29 | fabs /* |x-1| : x-1 : x : log(2) */ |
||
30 | fcompl limit /* x-1 : x : log(2) */ |
||
31 | fnstsw /* x-1 : x : log(2) */ |
||
32 | andb $0x45, %ah |
||
33 | jz 2f |
||
34 | fstp %st(1) /* x-1 : log(2) */ |
||
35 | fyl2xp1 /* log(x) */ |
||
36 | ret |
||
37 | |||
38 | 2: fstp %st(0) /* x : log(2) */ |
||
39 | fyl2x /* log(x) */ |
||
40 | ret |