X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSupport%2FAPFloat.cpp;h=a83801ed06853b540f44129f204832c1cc758354;hb=3fa4c1dc95098105e73aa7055c27bebbf9112966;hp=2e785570113313887dba84484891a0eb5bec1c04;hpb=38e59891ee4417a9be2f8146ce0ba3269e38ac21;p=oota-llvm.git diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 2e785570113..a83801ed068 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -153,6 +153,7 @@ readExponent(StringRef::iterator begin, StringRef::iterator end) value += absExponent * 10; if (absExponent >= overlargeExponent) { absExponent = overlargeExponent; + p = end; /* outwit assert below */ break; } absExponent = value; @@ -3257,14 +3258,12 @@ APFloat::APFloat(const APInt& api, bool isIEEE) APFloat::APFloat(float f) { - APInt api = APInt(32, 0); - initFromAPInt(api.floatToBits(f)); + initFromAPInt(APInt::floatToBits(f)); } APFloat::APFloat(double d) { - APInt api = APInt(64, 0); - initFromAPInt(api.doubleToBits(d)); + initFromAPInt(APInt::doubleToBits(d)); } namespace { @@ -3311,7 +3310,7 @@ namespace { // Truncate the significand down to its active bit count, but // don't try to drop below 32. unsigned newPrecision = std::max(32U, significand.getActiveBits()); - significand.trunc(newPrecision); + significand = significand.trunc(newPrecision); } @@ -3416,7 +3415,7 @@ void APFloat::toString(SmallVectorImpl &Str, // Nothing to do. } else if (exp > 0) { // Just shift left. - significand.zext(semantics->precision + exp); + significand = significand.zext(semantics->precision + exp); significand <<= exp; exp = 0; } else { /* exp < 0 */ @@ -3435,7 +3434,7 @@ void APFloat::toString(SmallVectorImpl &Str, // Multiply significand by 5^e. // N * 5^0101 == N * 5^(1*1) * 5^(0*2) * 5^(1*4) * 5^(0*8) - significand.zext(precision); + significand = significand.zext(precision); APInt five_to_the_i(precision, 5); while (true) { if (texp & 1) significand *= five_to_the_i;