diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2007-10-07 08:51:21 +0000 |
---|---|---|
committer | Neil Booth <neil@daikokuya.co.uk> | 2007-10-07 08:51:21 +0000 |
commit | d3985924f490c47fdc3e0f6fbc9c61ae9a83f30e (patch) | |
tree | fa9aa2f5efb14e6e45dd17dbbc466c3d5fc3b811 /llvm/lib/Support/APFloat.cpp | |
parent | 4894f485c7e66aa8028e6195464f2427f6544d68 (diff) | |
download | bcm5719-llvm-d3985924f490c47fdc3e0f6fbc9c61ae9a83f30e.tar.gz bcm5719-llvm-d3985924f490c47fdc3e0f6fbc9c61ae9a83f30e.zip |
combineLostFractions does not need to be a member function
llvm-svn: 42729
Diffstat (limited to 'llvm/lib/Support/APFloat.cpp')
-rw-r--r-- | llvm/lib/Support/APFloat.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index ac2e5f2c276..2037210e05b 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -222,6 +222,20 @@ namespace { 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 @@ APFloat::significandParts() 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 @@ APFloat::convertFromHexadecimalString(const char *p, 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; |