Home | History | Annotate | Line # | Download | only in libgcc
floatunsidf.c revision 1.1
      1  1.1  mrg /* Public domain.  */
      2  1.1  mrg typedef int SItype __attribute__ ((mode (SI)));
      3  1.1  mrg typedef unsigned int USItype __attribute__ ((mode (SI)));
      4  1.1  mrg typedef float DFtype __attribute__ ((mode (DF)));
      5  1.1  mrg 
      6  1.1  mrg DFtype
      7  1.1  mrg __floatunsidf (USItype u)
      8  1.1  mrg {
      9  1.1  mrg   SItype s = (SItype) u;
     10  1.1  mrg   DFtype r = (DFtype) s;
     11  1.1  mrg   if (s < 0)
     12  1.1  mrg     r += (DFtype)2.0 * (DFtype) ((USItype) 1
     13  1.1  mrg 				 << (sizeof (USItype) * __CHAR_BIT__ - 1));
     14  1.1  mrg   return r;
     15  1.1  mrg }
     16