blob: 45bd0fd27190552808fdc4dc08e301be0f96f3f5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* Public domain. */
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
typedef int DItype __attribute__ ((mode (DI)));
typedef float DFtype __attribute__ ((mode (DF)));
DFtype __floatdidf (DItype);
DFtype
__floatdidf (DItype u)
{
/* When the word size is small, we never get any rounding error. */
DFtype f = (SItype) (u >> (sizeof (SItype) * 8));
f *= 0x1p32f;
f += (USItype) u;
return f;
}
|