1*e4b17023SJohn Marino /* Public domain. */ 2*e4b17023SJohn Marino typedef int SItype __attribute__ ((mode (SI))); 3*e4b17023SJohn Marino typedef unsigned int USItype __attribute__ ((mode (SI))); 4*e4b17023SJohn Marino typedef float TFtype __attribute__ ((mode (TF))); 5*e4b17023SJohn Marino 6*e4b17023SJohn Marino TFtype __floatunsitf(USItype u)7*e4b17023SJohn Marino__floatunsitf (USItype u) 8*e4b17023SJohn Marino { 9*e4b17023SJohn Marino SItype s = (SItype) u; 10*e4b17023SJohn Marino TFtype r = (TFtype) s; 11*e4b17023SJohn Marino if (s < 0) 12*e4b17023SJohn Marino r += (TFtype)2.0 * (TFtype) ((USItype) 1 13*e4b17023SJohn Marino << (sizeof (USItype) * __CHAR_BIT__ - 1)); 14*e4b17023SJohn Marino return r; 15*e4b17023SJohn Marino } 16