1/* Public domain.  */
2typedef unsigned int USItype __attribute__ ((mode (SI)));
3typedef int DItype __attribute__ ((mode (DI)));
4typedef unsigned int UDItype __attribute__ ((mode (DI)));
5typedef float DFtype __attribute__ ((mode (DF)));
6
7DItype __fixdfdi (DFtype);
8
9/* This version is needed to prevent recursion; fixunsdfdi in libgcc
10   calls fixdfdi, which in turn calls calls fixunsdfdi.  */
11
12static DItype
13local_fixunsdfdi (DFtype a)
14{
15  USItype hi, lo;
16
17  hi = a / (((UDItype) 1) << (sizeof (USItype) * 8));
18  lo = a - ((DFtype) hi) * (((UDItype) 1) << (sizeof (USItype) * 8));
19  return ((UDItype) hi << (sizeof (USItype) * 8)) | lo;
20}
21
22DItype
23__fixdfdi (DFtype a)
24{
25  if (a < 0)
26    return - local_fixunsdfdi (-a);
27  return local_fixunsdfdi (a);
28}
29