]> sourceware.org Git - newlib-cygwin.git/blob - winsup/cygwin/math/nearbyintf.S
Add missing long double functions to Cygwin
[newlib-cygwin.git] / winsup / cygwin / math / nearbyintf.S
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(_ARM_) || defined(__arm__)
37 vmrs r1, fpscr
38 vcvt.s32.f32 s0, s0
39 vcvt.f32.s32 s0, s0
40 vmsr fpscr, r1
41 bx lr
42 #elif defined(_X86_) || defined(__i386__)
43 flds 4(%esp)
44 pushl %eax
45 pushl %ecx
46 fnstcw (%esp)
47 movl (%esp), %eax
48 orl $0x20, %eax
49 movl %eax, 4(%esp)
50 fldcw 4(%esp)
51 frndint
52 fclex
53 fldcw (%esp)
54 popl %ecx
55 popl %eax
56 ret
57 #endif
This page took 0.036744 seconds and 5 git commands to generate.