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