1208737Sjmallett/* Public domain. */ 2208737Sjmalletttypedef int SItype __attribute__ ((mode (SI))); 3208737Sjmalletttypedef unsigned int USItype __attribute__ ((mode (SI))); 4208737Sjmalletttypedef int DItype __attribute__ ((mode (DI))); 5208737Sjmalletttypedef float DFtype __attribute__ ((mode (DF))); 6208737Sjmallett 7208737SjmallettDFtype __floatdidf (DItype); 8208737Sjmallett 9208737SjmallettDFtype 10208737Sjmallett__floatdidf (DItype u) 11208737Sjmallett{ 12208737Sjmallett /* When the word size is small, we never get any rounding error. */ 13208737Sjmallett DFtype f = (SItype) (u >> (sizeof (SItype) * 8)); 14208737Sjmallett f *= 0x1p32f; 15208737Sjmallett f += (USItype) u; 16208737Sjmallett return f; 17208737Sjmallett} 18