Add attempted idiotproofing comment per review.
authorDale Johannesen <dalej@apple.com>
Wed, 12 Aug 2009 18:04:11 +0000 (18:04 +0000)
committerDale Johannesen <dalej@apple.com>
Wed, 12 Aug 2009 18:04:11 +0000 (18:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78825 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index 6638fccfef581ca0d549542ae1c838cb8d1025a1..daf2244149a87527c9a6ae4853e91a4df6614ab4 100644 (file)
@@ -885,7 +885,7 @@ APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) {
   return isNeg ? -Tmp : Tmp;
 }
 
-/// RoundToDouble - This function convert this APInt to a double.
+/// RoundToDouble - This function converts this APInt to a double.
 /// The layout for double is as following (IEEE Standard 754):
 ///  --------------------------------------
 /// |  Sign    Exponent    Fraction    Bias |
@@ -895,6 +895,7 @@ APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) {
 double APInt::roundToDouble(bool isSigned) const {
 
   // Handle the simple case where the value is contained in one uint64_t.
+  // It is wrong to optimize getWord(0) to VAL; there might be more than one word.
   if (isSingleWord() || getActiveBits() <= APINT_BITS_PER_WORD) {
     if (isSigned) {
       int64_t sext = (int64_t(getWord(0)) << (64-BitWidth)) >> (64-BitWidth);