Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}.
[platform/upstream/glibc.git] / sysdeps / i386 / fpu / s_log1pf.S
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  */
5
6 #include <machine/asm.h>
7
8 RCSID("$NetBSD: s_log1pf.S,v 1.4 1995/05/09 00:13:05 jtc Exp $")
9
10         .section .rodata
11
12         .align ALIGNARG(4)
13         /* The fyl2xp1 can only be used for values in
14                 -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
15            0.29 is a safe value.
16         */
17 limit:  .float 0.29
18 one:    .float 1.0
19
20 /*
21  * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
22  * otherwise fyl2x with the needed extra computation.
23  */
24         .text
25 ENTRY(__log1pf)
26         fldln2
27
28         flds    4(%esp)
29
30 #ifdef  PIC
31         LOAD_PIC_REG (dx)
32 #endif
33
34         fxam
35         fnstsw
36         fld     %st
37         sahf
38         jc      3f              // in case x is NaN or ±Inf
39 4:      fabs
40 #ifdef PIC
41         fcomps  limit@GOTOFF(%edx)
42 #else
43         fcomps  limit
44 #endif
45         fnstsw
46         sahf
47         jc      2f
48
49 #ifdef PIC
50         fadds   one@GOTOFF(%edx)
51 #else
52         fadds   one
53 #endif
54         fyl2x
55         ret
56
57 2:      fyl2xp1
58         ret
59
60 3:      jp      4b              // in case x is ±Inf
61         fstp    %st(1)
62         fstp    %st(1)
63         ret
64
65 END (__log1pf)
66 weak_alias (__log1pf, log1pf)