1 //===-- floatundidf.S - Implement __floatundidf for i386 ------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements __floatundidf for the compiler_rt library.
12 //===----------------------------------------------------------------------===//
14 #include "../assembly.h"
16 // double __floatundidf(du_int a);
20 #if defined(__APPLE__)
22 #elif defined(__ELF__)
30 .quad 0x4330000000000000
34 .quad 0x4530000000100000
38 .quad 0x4530000000000000
40 #define REL_ADDR(_a) (_a)-0b(%eax)
44 DEFINE_COMPILERRT_FUNCTION(__floatundidf)
45 movss 8(%esp), %xmm1 // high 32 bits of a
46 movss 4(%esp), %xmm0 // low 32 bits of a
49 orpd REL_ADDR(twop84), %xmm1 // 0x1p84 + a_hi (no rounding occurs)
50 subsd REL_ADDR(twop84_plus_twop52), %xmm1 // a_hi - 0x1p52 (no rounding occurs)
51 orpd REL_ADDR(twop52), %xmm0 // 0x1p52 + a_lo (no rounding occurs)
52 addsd %xmm1, %xmm0 // a_hi + a_lo (round happens here)
56 END_COMPILERRT_FUNCTION(__floatundidf)