X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=gcc%2Fconfig%2Ffloatunsidf.c;fp=gcc%2Fconfig%2Ffloatunsidf.c;h=ff28112502b7e95cb4a66dc99a2c91e6aec7e595;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/config/floatunsidf.c b/gcc/config/floatunsidf.c new file mode 100644 index 00000000..ff281125 --- /dev/null +++ b/gcc/config/floatunsidf.c @@ -0,0 +1,15 @@ +/* Public domain. */ +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef float DFtype __attribute__ ((mode (DF))); + +DFtype +__floatunsidf (USItype u) +{ + SItype s = (SItype) u; + DFtype r = (DFtype) s; + if (s < 0) + r += (DFtype)2.0 * (DFtype) ((USItype) 1 + << (sizeof (USItype) * __CHAR_BIT__ - 1)); + return r; +}