]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/msun/i387/s_floorl.S
zfs: merge openzfs/zfs@a94860a6d
[FreeBSD/FreeBSD.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 ENTRY(floorl)
8         pushl   %ebp
9         movl    %esp,%ebp
10         subl    $8,%esp
11
12         fstcw   -4(%ebp)                /* store fpu control word */
13         movw    -4(%ebp),%dx
14         orw     $0x0400,%dx             /* round towards -oo */
15         andw    $0xf7ff,%dx
16         movw    %dx,-8(%ebp)
17         fldcw   -8(%ebp)                /* load modified control word */
18
19         fldt    8(%ebp)                 /* round */
20         frndint
21
22         fldcw   -4(%ebp)                /* restore original control word */
23
24         leave
25         ret
26 END(floorl)
27
28         .section .note.GNU-stack,"",%progbits