combineLostFractions does not need to be a member function

llvm-svn: 42729
This commit is contained in:
Neil Booth 2007-10-07 08:51:21 +00:00
parent 4894f485c7
commit d3985924f4
2 changed files with 15 additions and 17 deletions

View File

@ -268,7 +268,6 @@ namespace llvm {
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;

View File

@ -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;