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