[llvm-commits] [llvm] r42729 - in /llvm/trunk: include/llvm/ADT/APFloat.h lib/Support/APFloat.cpp

Neil Booth neil at daikokuya.co.uk
Sun Oct 7 01:51:21 PDT 2007


Author: neil
Date: Sun Oct  7 03:51:21 2007
New Revision: 42729

URL: http://llvm.org/viewvc/llvm-project?rev=42729&view=rev
Log:
combineLostFractions does not need to be a member function

Modified:
    llvm/trunk/include/llvm/ADT/APFloat.h
    llvm/trunk/lib/Support/APFloat.cpp

Modified: llvm/trunk/include/llvm/ADT/APFloat.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APFloat.h?rev=42729&r1=42728&r2=42729&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/APFloat.h (original)
+++ llvm/trunk/include/llvm/ADT/APFloat.h Sun Oct  7 03:51:21 2007
@@ -268,7 +268,6 @@
     bool roundAwayFromZero(roundingMode, lostFraction, unsigned int) const;
     opStatus convertFromUnsignedInteger(integerPart *, unsigned int,
                                         roundingMode);
-    lostFraction combineLostFractions(lostFraction, lostFraction);
     opStatus convertFromHexadecimalString(const char *, roundingMode);
     char *convertNormalToHexString(char *, unsigned int, bool,
                                    roundingMode) const;

Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=42729&r1=42728&r2=42729&view=diff

==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Sun Oct  7 03:51:21 2007
@@ -222,6 +222,20 @@
     return lost_fraction;
   }
 
+  /* Combine the effect of two lost fractions.  */
+  lostFraction
+  combineLostFractions(lostFraction moreSignificant,
+                       lostFraction lessSignificant)
+  {
+    if(lessSignificant != lfExactlyZero) {
+      if(moreSignificant == lfExactlyZero)
+        moreSignificant = lfLessThanHalf;
+      else if(moreSignificant == lfExactlyHalf)
+        moreSignificant = lfMoreThanHalf;
+    }
+
+    return moreSignificant;
+  }
 
   /* Zero at the end to avoid modular arithmetic when adding one; used
      when rounding up during hexadecimal output.  */
@@ -429,21 +443,6 @@
     return &significand.part;
 }
 
-/* Combine the effect of two lost fractions.  */
-lostFraction
-APFloat::combineLostFractions(lostFraction moreSignificant,
-                              lostFraction lessSignificant)
-{
-  if(lessSignificant != lfExactlyZero) {
-    if(moreSignificant == lfExactlyZero)
-      moreSignificant = lfLessThanHalf;
-    else if(moreSignificant == lfExactlyHalf)
-      moreSignificant = lfMoreThanHalf;
-  }
-
-  return moreSignificant;
-}
-
 void
 APFloat::zeroSignificand()
 {
@@ -1614,7 +1613,7 @@
   partsCount = partCount();
   bitPos = partsCount * integerPartWidth;
 
-  /* Skip leading zeroes and any(hexa)decimal point.  */
+  /* Skip leading zeroes and any (hexa)decimal point.  */
   p = skipLeadingZeroesAndAnyDot(p, &dot);
   firstSignificantDigit = p;
 





More information about the llvm-commits mailing list