Get rid of ASM_TYPE_DIRECTIVE{,_PREFIX}.
[platform/upstream/glibc.git] / sysdeps / i386 / fpu / e_ilogbf.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_ilogbf.S,v 1.4 1995/10/22 20:32:43 pk Exp $")
9
10 ENTRY(__ieee754_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.  */
21         cmpb    $0x40, %dh
22         je      2f              /* Is +-0, jump.  */
23
24         fxtract
25         pushl   %eax
26         cfi_adjust_cfa_offset (4)
27         fstp    %st
28
29         fistpl  (%esp)
30         fwait
31         popl    %eax
32         cfi_adjust_cfa_offset (-4)
33
34         ret
35
36 1:      fstp    %st
37         movl    $0x7fffffff, %eax
38         ret
39 2:      fstp    %st
40         movl    $0x80000000, %eax       /* FP_ILOGB0  */
41         ret
42 END (__ieee754_ilogbf)