]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - lib/msun/i387/s_floorl.S
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / lib / msun / i387 / s_floorl.S
1 /*
2  * Based on code written by J.T. Conklin <jtc@NetBSD.org>.
3  * Public domain.
4  */
5
6 #include <machine/asm.h>
7 __FBSDID("$FreeBSD$")
8
9 ENTRY(floorl)
10         pushl   %ebp
11         movl    %esp,%ebp
12         subl    $8,%esp
13
14         fstcw   -4(%ebp)                /* store fpu control word */
15         movw    -4(%ebp),%dx
16         orw     $0x0400,%dx             /* round towards -oo */
17         andw    $0xf7ff,%dx
18         movw    %dx,-8(%ebp)
19         fldcw   -8(%ebp)                /* load modfied control word */
20
21         fldt    8(%ebp)                 /* round */
22         frndint
23
24         fldcw   -4(%ebp)                /* restore original control word */
25
26         leave
27         ret
28 END(floorl)
29
30         .section .note.GNU-stack,"",%progbits