aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2007-10-07 11:45:55 +0000
committerNeil Booth <neil@daikokuya.co.uk>2007-10-07 11:45:55 +0000
commit4bdd45a1cdc1f329ce090b3dfd288b99db6c7fc6 (patch)
tree8323d17a395d8dbbb4d9c91239fc92e1ebb439fa /lib/Support
parent8caf8257a3b599d746e7a0690e9a10c357b3da65 (diff)
downloadexternal_llvm-4bdd45a1cdc1f329ce090b3dfd288b99db6c7fc6.zip
external_llvm-4bdd45a1cdc1f329ce090b3dfd288b99db6c7fc6.tar.gz
external_llvm-4bdd45a1cdc1f329ce090b3dfd288b99db6c7fc6.tar.bz2
convertFromInteger, as originally written, expected sign-extended
input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/APFloat.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 2037210..5e3504b1 100644
--- a/lib/Support/APFloat.cpp
+++ b/lib/Support/APFloat.cpp
@@ -1247,8 +1247,8 @@ APFloat::mod(const APFloat &rhs, roundingMode rounding_mode)
if (fs==opInvalidOp)
return fs;
- fs = V.convertFromInteger(x, parts * integerPartWidth, true,
- rmNearestTiesToEven);
+ fs = V.convertFromZeroExtendedInteger(x, parts * integerPartWidth, true,
+ rmNearestTiesToEven);
assert(fs==opOK); // should always work
fs = V.multiply(rhs, rounding_mode);
@@ -1576,9 +1576,11 @@ APFloat::convertFromUnsignedInteger(integerPart *parts,
return normalize(rounding_mode, lost_fraction);
}
+/* FIXME: should this just take a const APInt reference? */
APFloat::opStatus
-APFloat::convertFromInteger(const integerPart *parts, unsigned int width,
- bool isSigned, roundingMode rounding_mode)
+APFloat::convertFromZeroExtendedInteger(const integerPart *parts,
+ unsigned int width, bool isSigned,
+ roundingMode rounding_mode)
{
unsigned int partCount = partCountForBits(width);
opStatus status;