OSDN Git Service

2007-11-26 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
[pf3gnuchains/pf3gnuchains3x.git] / winsup / mingw / mingwex / math / log1pf.S
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  * Removed header file dependency for use in libmingwex.a by
5  *   Danny Smith <dannysmith@users.sourceforge.net>
6  */
7
8         .file   "log1pf.S"
9         .text
10         .align 4
11         /* The fyl2xp1 can only be used for values in
12            -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
13            0.29 is a safe value.
14          */
15 limit:  .float 0.29
16 one:    .float 1.0
17 /*
18  * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
19  * otherwise fyl2x with the needed extra computation.
20  */
21 .globl _log1pf; 
22         .def    _log1pf;        .scl    2;      .type   32;     .endef
23 _log1pf:
24         fldln2
25         flds    4(%esp)
26         fxam
27         fnstsw
28         fld     %st
29         sahf
30         jc      3f              /* in case x is NaN or ±Inf */
31
32 4:      fabs
33         fcomps  limit
34         fnstsw
35         sahf
36         jc      2f
37         fadds   one
38         fyl2x
39         ret
40
41 2:      fyl2xp1
42         ret
43
44 3:      jp      4b              /* in case x is ±Inf */
45         fstp    %st(1)
46         fstp    %st(1)
47         ret