1 // This file is dual licensed under the MIT and the University of Illinois Open
2 // Source Licenses. See LICENSE.TXT for details.
4 #include "../assembly.h"
6 // long double __floatundixf(du_int a);16
10 #if defined(__APPLE__)
12 #elif defined(__ELF__)
20 .quad 0x4330000000000000
23 twop84_plus_twop52_neg:
24 .quad 0xc530000000100000
28 .quad 0x4530000000000000
30 #define REL_ADDR(_a) (_a)-0b(%eax)
34 DEFINE_COMPILERRT_FUNCTION(__floatundixf)
37 movss 8(%esp), %xmm0 // hi 32 bits of input
38 movss 4(%esp), %xmm1 // lo 32 bits of input
39 orpd REL_ADDR(twop84), %xmm0 // 2^84 + hi (as a double)
40 orpd REL_ADDR(twop52), %xmm1 // 2^52 + lo (as a double)
41 addsd REL_ADDR(twop84_plus_twop52_neg), %xmm0 // hi - 2^52 (no rounding occurs)
47 END_COMPILERRT_FUNCTION(__floatundixf)