#include <stdint.h>
uint64_t
__fixunssfdi (float x)
{
union { float f; uint32_t u; } u = {x};
uint32_t hi, lo;
if (__builtin_expect (u.u < 0x4f800000U, 1))
return (uint64_t) ((uint32_t) x);
if (__builtin_expect (u.u < 0x5f800000U, 1))
{
uint32_t bits = (u.u & 0x007fffffU) | 0x00800000U;
uint32_t shift = (u.u >> 23) - (127 + 23);
if (shift < 32)
{
hi = bits >> (32 - shift);
lo = bits << shift;
}
else
{
hi = bits << (shift - 32);
lo = 0;
}
return ((uint64_t) hi << 32) | lo;
}
hi = x;
lo = (hi << 1) | (hi & 1);
return ((uint64_t) hi << 32) | lo;
}