Mercurial > mxe-octave
comparison src/build-msvctools/math/log1p.S @ 3061:f8299bb6c872
Initial support for native MSVC compilation.
* add MSVC support files: compiler wrappers and support libraries
* adapt libiconv to work with MSVC
* adapt gettext to work with MSVC
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Mon, 17 Jun 2013 22:43:11 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3060:cbdf4575016d | 3061:f8299bb6c872 |
---|---|
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 "log1p.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: .double 0.29 | |
16 one: .double 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 _log1p; | |
22 .def _log1p; .scl 2; .type 32; .endef | |
23 _log1p: | |
24 fldln2 | |
25 fldl 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 fcompl limit | |
34 fnstsw | |
35 sahf | |
36 jc 2f | |
37 faddl 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 |