floatunsitf.c revision 259065
1193323Sed/* Public domain. */ 2193323Sedtypedef int SItype __attribute__ ((mode (SI))); 3193323Sedtypedef unsigned int USItype __attribute__ ((mode (SI))); 4193323Sedtypedef float TFtype __attribute__ ((mode (TF))); 5193323Sed 6193323SedTFtype 7193323Sed__floatunsitf (USItype u) 8193323Sed{ 9193323Sed SItype s = (SItype) u; 10193323Sed TFtype r = (TFtype) s; 11193323Sed if (s < 0) 12193323Sed r += (TFtype)2.0 * (TFtype) ((USItype) 1 13193323Sed << (sizeof (USItype) * __CHAR_BIT__ - 1)); 14193323Sed return r; 15193323Sed} 16193323Sed