floatunsitf.c revision 169689
1169689Skan/* Public domain.  */
2169689Skantypedef int SItype __attribute__ ((mode (SI)));
3169689Skantypedef unsigned int USItype __attribute__ ((mode (SI)));
4169689Skantypedef float TFtype __attribute__ ((mode (TF)));
5169689Skan
6169689SkanTFtype
7169689Skan__floatunsitf (USItype u)
8169689Skan{
9169689Skan  SItype s = (SItype) u;
10169689Skan  TFtype r = (TFtype) s;
11169689Skan  if (s < 0)
12169689Skan    r += (TFtype)2.0 * (TFtype) ((USItype) 1
13169689Skan				 << (sizeof (USItype) * __CHAR_BIT__ - 1));
14169689Skan  return r;
15169689Skan}
16