1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 #include "../assembly.h"
7 // xf_float __floatundixf(du_int a);16
15 .quad 0x4330000000000000
18 twop84_plus_twop52_neg:
19 .quad 0xc530000000100000
23 .quad 0x4530000000000000
25 #define REL_ADDR(_a) (_a)-0b(%eax)
29 DEFINE_COMPILERRT_FUNCTION(__floatundixf)
32 movss 8(%esp), %xmm0 // hi 32 bits of input
33 movss 4(%esp), %xmm1 // lo 32 bits of input
34 orpd REL_ADDR(twop84), %xmm0 // 2^84 + hi (as a double)
35 orpd REL_ADDR(twop52), %xmm1 // 2^52 + lo (as a double)
36 addsd REL_ADDR(twop84_plus_twop52_neg), %xmm0 // hi - 2^52 (no rounding occurs)
42 END_COMPILERRT_FUNCTION(__floatundixf)
46 NO_EXEC_STACK_DIRECTIVE