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