Merge branch 'vendor/LESS'
[dragonfly.git] / lib / libm / arch / i386 / s_finite.S
1 /*
2  * Written by J.T. Conklin <jtc@NetBSD.org>.
3  * Public domain.
4  *
5  * $NetBSD: s_finite.S,v 1.7 2003/07/26 19:25:01 salo Exp $
6  * $DragonFly: src/lib/libm/arch/i386/s_finite.S,v 1.1 2005/07/26 21:15:19 joerg Exp $
7  */
8
9 #include <machine/asm.h>
10
11 ENTRY(finite)
12 #ifdef __i386__
13         movl    8(%esp),%eax
14         andl    $0x7ff00000, %eax
15         cmpl    $0x7ff00000, %eax
16         setne   %al
17         andl    $0x000000ff, %eax
18 #else
19         xorl    %eax,%eax
20         movq    $0x7ff0000000000000,%rsi
21         movq    %rsi,%rdi
22         movsd   %xmm0,-8(%rsp)
23         andq    -8(%rsp),%rsi
24         cmpq    %rdi,%rsi
25         setne   %al
26 #endif
27         ret