[llvm-commits] [llvm] r78825 - /llvm/trunk/lib/Support/APInt.cpp

Dale Johannesen dalej at apple.com
Wed Aug 12 11:04:11 PDT 2009


Author: johannes
Date: Wed Aug 12 13:04:11 2009
New Revision: 78825

URL: http://llvm.org/viewvc/llvm-project?rev=78825&view=rev
Log:
Add attempted idiotproofing comment per review.


Modified:
    llvm/trunk/lib/Support/APInt.cpp

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=78825&r1=78824&r2=78825&view=diff

==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Wed Aug 12 13:04:11 2009
@@ -885,7 +885,7 @@
   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 @@
 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);





More information about the llvm-commits mailing list