Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / lib / libm / arch / i387 / s_ilogb.S
blob7691d62666ef1c5e0d90951ebb8a194984d4fba4
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.6 2001/06/19 00:26:30 fvdl Exp $")
10 ENTRY(ilogb)
11 #ifdef __i386__
12         pushl   %ebp
13         movl    %esp,%ebp
14         subl    $4,%esp
16         fldl    8(%ebp)
17         fxtract
18         fstp    %st
20         fistpl  -4(%ebp)
21         movl    -4(%ebp),%eax
23         leave
24 #else
25         movsd   %xmm0,-8(%rsp)
26         fldl    -8(%rsp)
27         fxtract
28         fstp    %st
29         fistpl  -8(%rsp)
30         movl    -8(%rsp),%eax
31 #endif
32         ret