* sysdeps/mach/hurd/dl-sysdep.c (_dl_important_hwcaps): Use INTUSE for
[glibc.git] / sysdeps / i386 / fpu / s_log1pl.S
blob26c407b606aa3d0986b7d9f68d277e8b8d22885a
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  */
8 #include <machine/asm.h>
10 RCSID("$NetBSD: s_log1p.S,v 1.7 1995/05/09 00:10:58 jtc Exp $")
12 #ifdef __ELF__
13         .section .rodata
14 #else
15         .text
16 #endif
17         .align ALIGNARG(4)
18         /* The fyl2xp1 can only be used for values in
19                 -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
20            0.29 is a safe value.
21         */
22 limit:  .tfloat 0.29
23         /* Please note:  we use a double value here.  Since 1.0 has
24            an exact representation this does not effect the accuracy
25            but it helps to optimize the code.  */
26 one:    .double 1.0
29  * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
30  * otherwise fyl2x with the needed extra computation.
31  */
32         .text
33 ENTRY(__log1pl)
34         fldln2
36         fldt    4(%esp)
38 #ifdef PIC
39         call    1f
40 1:      popl    %edx
41         addl    $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx
42 #endif
44         fxam
45         fnstsw
46         fld     %st
47         sahf
48         jc      3f              // in case x is NaN or ±Inf
50         fabs
51 #ifdef PIC
52         fldt    limit@GOTOFF(%edx)
53 #else
54         fldt    limit
55 #endif
56         fcompp
57         fnstsw
58         sahf
59         jnc     2f
61 #ifdef PIC
62         faddl   one@GOTOFF(%edx)
63 #else
64         faddl   one
65 #endif
66         fyl2x
67         ret
69 2:      fyl2xp1
70         ret
72 3:      jp      4b              // in case x is ±Inf
73         fstp    %st(1)
74         fstp    %st(1)
75         ret
77 END (__log1pl)
78 weak_alias (__log1pl, log1pl)