(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / sysdeps / i386 / fpu / s_ilogbl.S
blobed547bdc8b79f2b7b0bb4df4d645ff619935a22c
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
4  * Public domain.
5  */
7 #include <machine/asm.h>
9 RCSID("$NetBSD: $")
11 ENTRY(__ilogbl)
12         fldt    4(%esp)
13 /* I added the following ugly construct because ilogb(+-Inf) is
14    required to return INT_MAX in ISO C99.
15    -- jakub@redhat.com.  */
16         fxam                    /* Is NaN or +-Inf?  */
17         fstsw   %ax
18         movb    $0x45, %dh
19         andb    %ah, %dh
20         cmpb    $0x05, %dh
21         je      1f              /* Is +-Inf, jump.  */
23         fxtract
24         pushl   %eax
25         fstp    %st
27         fistpl  (%esp)
28         fwait
29         popl    %eax
31         ret
33 1:      fstp    %st
34         movl    $0x7fffffff, %eax
35         ret
36 END (__ilogbl)
37 weak_alias (__ilogbl, ilogbl)