OSDN Git Service

Streamline the build system infrastructure.
[mingw/mingw-org-wsl.git] / mingwrt / mingwex / math / floorl.S
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  *
5  * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
6  *
7  */
8         .file   "floorl.S"
9         .text
10         .align 4
11 .globl _floorl
12         .def    _floorl;        .scl    2;      .type   32;     .endef
13 _floorl:
14         fldt    4(%esp)
15         subl    $8,%esp
16
17         fstcw   4(%esp)                 /* store fpu control word */
18
19         /* We use here %edx although only the low 1 bits are defined.
20            But none of the operations should care and they are faster
21            than the 16 bit operations.  */
22         movl    $0x400,%edx             /* round towards -oo */
23         orl     4(%esp),%edx
24         andl    $0xf7ff,%edx
25         movl    %edx,(%esp)
26         fldcw   (%esp)                  /* load modified control word */
27
28         frndint                         /* round */
29
30         fldcw   4(%esp)                 /* restore original control word */
31
32         addl    $8,%esp
33         ret