(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / sysdeps / i386 / fpu / s_ilogbf.S
blob521afe2b60cba5e727fdd3f7a0b031e4e0cda610
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  */
6 #include <machine/asm.h>
8 RCSID("$NetBSD: s_ilogbf.S,v 1.4 1995/10/22 20:32:43 pk Exp $")
10 ENTRY(__ilogbf)
11         flds    4(%esp)
12 /* I added the following ugly construct because ilogb(+-Inf) is
13    required to return INT_MAX in ISO C99.
14    -- jakub@redhat.com.  */
15         fxam                    /* Is NaN or +-Inf?  */
16         fstsw   %ax
17         movb    $0x45, %dh
18         andb    %ah, %dh
19         cmpb    $0x05, %dh
20         je      1f              /* Is +-Inf, jump.  */
22         fxtract
23         pushl   %eax
24         fstp    %st
26         fistpl  (%esp)
27         fwait
28         popl    %eax
30         ret
32 1:      fstp    %st
33         movl    $0x7fffffff, %eax
34         ret
35 END (__ilogbf)
36 weak_alias (__ilogbf, ilogbf)