1 /* ===-- fixunsdfdi.c - Implement __fixunsdfdi -----------------------------===
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 * ===----------------------------------------------------------------------===
11 #define DOUBLE_PRECISION
14 ARM_EABI_FNALIAS(d2ulz, fixunsdfdi)
17 /* Support for systems that have hardware floating-point; can set the invalid
18 * flag as a side-effect of computation.
21 COMPILER_RT_ABI du_int
22 __fixunsdfdi(double a)
24 if (a <= 0.0) return 0;
25 su_int high = a / 4294967296.f; /* a / 0x1p32f; */
26 su_int low = a - (double)high * 4294967296.f; /* high * 0x1p32f; */
27 return ((du_int)high << 32) | low;
31 /* Support for systems that don't have hardware floating-point; there are no
32 * flags to set, and we don't want to code-gen to an unknown soft-float
36 typedef du_int fixuint_t;
37 #include "fp_fixuint_impl.inc"
39 COMPILER_RT_ABI du_int
40 __fixunsdfdi(fp_t a) {