| 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 "nearbyintf.S" |
| 9 |
.text |
| 10 |
#ifdef __x86_64__ |
| 11 |
.align 8 |
| 12 |
#else |
| 13 |
.align 4 |
| 14 |
#endif |
| 15 |
.globl __MINGW_USYMBOL(nearbyintf) |
| 16 |
.def __MINGW_USYMBOL(nearbyintf); .scl 2; .type 32; .endef |
| 17 |
__MINGW_USYMBOL(nearbyintf): |
| 18 |
#if defined(_AMD64_) || defined(__x86_64__) |
| 19 |
movss %xmm0,-12(%rsp) |
| 20 |
flds -12(%rsp) |
| 21 |
pushq %rax |
| 22 |
pushq %rcx |
| 23 |
fnstcw (%rsp) |
| 24 |
movq (%rsp), %rax |
| 25 |
orq $0x20, %rax |
| 26 |
movq %rax, 8(%rsp) |
| 27 |
fldcw 8(%rsp) |
| 28 |
frndint |
| 29 |
fclex |
| 30 |
fldcw (%rsp) |
| 31 |
popq %rcx |
| 32 |
popq %rax |
| 33 |
fstps -12(%rsp) |
| 34 |
movss -12(%rsp),%xmm0 |
| 35 |
ret |
| 36 |
#elif defined(_X86_) || defined(__i386__) |
| 37 |
flds 4(%esp) |
| 38 |
pushl %eax |
| 39 |
pushl %ecx |
| 40 |
fnstcw (%esp) |
| 41 |
movl (%esp), %eax |
| 42 |
orl $0x20, %eax |
| 43 |
movl %eax, 4(%esp) |
| 44 |
fldcw 4(%esp) |
| 45 |
frndint |
| 46 |
fclex |
| 47 |
fldcw (%esp) |
| 48 |
popl %ecx |
| 49 |
popl %eax |
| 50 |
ret |
| 51 |
#endif |