Mon Dec 2 15:32:15 1996 Ulrich Drepper <drepper@cygnus.com>
[glibc.git] / sysdeps / libm-i387 / s_floorl.S
blobae4ba2ea4da703dc5f62357e0f8d499d5358845e
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(__floorl)
12         pushl   %ebp
13         movl    %esp,%ebp
14         subl    $8,%esp
16         fstcw   -4(%ebp)                /* store fpu control word */
17         movw    -4(%ebp),%dx
18         orw     $0x0400,%dx             /* round towards -oo */
19         andw    $0xf7ff,%dx
20         movw    %dx,-8(%ebp)
21         fldcw   -8(%ebp)                /* load modfied control word */
23         fldt    8(%ebp)                 /* round */
24         frndint
26         fldcw   -4(%ebp)                /* restore original control word */
28         leave
29         ret
30 PSEUDO_END (__floorl)
31 weak_alias (__floorl, floorl)