| 1 |
/** |
| 2 |
* This file has no copyright assigned and is placed in the Public Domain. |
| 3 |
* This file is part of the mingw-w64 runtime package. |
| 4 |
* No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 |
*/ |
| 6 |
#include <_mingw_mac.h> |
| 7 |
|
| 8 |
.file "floorf.S" |
| 9 |
.text |
| 10 |
.p2align 4,,15 |
| 11 |
.globl __MINGW_USYMBOL(floorf) |
| 12 |
.def __MINGW_USYMBOL(floorf); .scl 2; .type 32; .endef |
| 13 |
#ifdef __x86_64__ |
| 14 |
.seh_proc __MINGW_USYMBOL(floorf) |
| 15 |
#endif |
| 16 |
__MINGW_USYMBOL(floorf): |
| 17 |
#if defined(_AMD64_) || defined(__x86_64__) |
| 18 |
subq $40, %rsp |
| 19 |
.seh_stackalloc 40 |
| 20 |
.seh_endprologue |
| 21 |
unpcklps %xmm0, %xmm0 |
| 22 |
cvtps2pd %xmm0, %xmm0 |
| 23 |
call floor |
| 24 |
unpcklpd %xmm0, %xmm0 |
| 25 |
cvtpd2ps %xmm0, %xmm0 |
| 26 |
addq $40, %rsp |
| 27 |
ret |
| 28 |
.seh_endproc |
| 29 |
.def __MINGW_USYMBOL(floor); .scl 2; .type 32; .endef |
| 30 |
#elif defined(_X86_) || defined(__i386__) |
| 31 |
flds 4(%esp) |
| 32 |
subl $8,%esp |
| 33 |
|
| 34 |
fstcw 4(%esp) /* store fpu control word */ |
| 35 |
|
| 36 |
/* We use here %edx although only the low 1 bits are defined. |
| 37 |
But none of the operations should care and they are faster |
| 38 |
than the 16 bit operations. */ |
| 39 |
movl $0x400,%edx /* round towards -oo */ |
| 40 |
orl 4(%esp),%edx |
| 41 |
andl $0xf7ff,%edx |
| 42 |
movl %edx,(%esp) |
| 43 |
fldcw (%esp) /* load modified control word */ |
| 44 |
|
| 45 |
frndint /* round */ |
| 46 |
|
| 47 |
fldcw 4(%esp) /* restore original control word */ |
| 48 |
|
| 49 |
addl $8,%esp |
| 50 |
ret |
| 51 |
#endif |