[llvm-commits] [llvm] r122963 - /llvm/trunk/lib/Support/APFloat.cpp
Abramo Bagnara
abramo.bagnara at gmail.com
Thu Jan 6 08:55:14 PST 2011
Author: abramo
Date: Thu Jan 6 10:55:14 2011
New Revision: 122963
URL: http://llvm.org/viewvc/llvm-project?rev=122963&view=rev
Log:
Fixed parsing of hex floats.
Modified:
llvm/trunk/lib/Support/APFloat.cpp
Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=122963&r1=122962&r2=122963&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Thu Jan 6 10:55:14 2011
@@ -194,11 +194,11 @@
assert(value < 10U && "Invalid character in exponent");
unsignedExponent = unsignedExponent * 10 + value;
- if (unsignedExponent > 65535)
+ if (unsignedExponent > 32767)
overflow = true;
}
- if (exponentAdjustment > 65535 || exponentAdjustment < -65536)
+ if (exponentAdjustment > 32767 || exponentAdjustment < -32768)
overflow = true;
if (!overflow) {
@@ -206,12 +206,12 @@
if (negative)
exponent = -exponent;
exponent += exponentAdjustment;
- if (exponent > 65535 || exponent < -65536)
+ if (exponent > 32767 || exponent < -32768)
overflow = true;
}
if (overflow)
- exponent = negative ? -65536: 65535;
+ exponent = negative ? -32768: 32767;
return exponent;
}
More information about the llvm-commits
mailing list