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