(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / sysdeps / i386 / fpu / s_ilogb.S
blob68d9c1a680457e00564e76072df814635b4d616d
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  */
6 #include <machine/asm.h>
8 RCSID("$NetBSD: s_ilogb.S,v 1.5 1995/10/12 15:53:09 jtc Exp $")
10 ENTRY(__ilogb)
11         fldl    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 (__ilogb)
36 weak_alias (__ilogb, ilogb)