mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Revert "Support/APFloat: unique_ptr-ify temp arrays"
This reverts commit rr216359. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216429 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
27dc1b8446
commit
ae65d0e330
@ -1722,8 +1722,7 @@ APFloat::remainder(const APFloat &rhs)
|
|||||||
return fs;
|
return fs;
|
||||||
|
|
||||||
int parts = partCount();
|
int parts = partCount();
|
||||||
auto XOwner = make_unique<integerPart[]>(parts);
|
integerPart *x = new integerPart[parts];
|
||||||
auto x = XOwner.get();
|
|
||||||
bool ignored;
|
bool ignored;
|
||||||
fs = V.convertToInteger(x, parts * integerPartWidth, true,
|
fs = V.convertToInteger(x, parts * integerPartWidth, true,
|
||||||
rmNearestTiesToEven, &ignored);
|
rmNearestTiesToEven, &ignored);
|
||||||
@ -1742,6 +1741,7 @@ APFloat::remainder(const APFloat &rhs)
|
|||||||
|
|
||||||
if (isZero())
|
if (isZero())
|
||||||
sign = origSign; // IEEE754 requires this
|
sign = origSign; // IEEE754 requires this
|
||||||
|
delete[] x;
|
||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1762,8 +1762,7 @@ APFloat::mod(const APFloat &rhs, roundingMode rounding_mode)
|
|||||||
return fs;
|
return fs;
|
||||||
|
|
||||||
int parts = partCount();
|
int parts = partCount();
|
||||||
auto XOwner = make_unique<integerPart[]>(parts);
|
integerPart *x = new integerPart[parts];
|
||||||
auto x = XOwner.get();
|
|
||||||
bool ignored;
|
bool ignored;
|
||||||
fs = V.convertToInteger(x, parts * integerPartWidth, true,
|
fs = V.convertToInteger(x, parts * integerPartWidth, true,
|
||||||
rmTowardZero, &ignored);
|
rmTowardZero, &ignored);
|
||||||
@ -1782,6 +1781,7 @@ APFloat::mod(const APFloat &rhs, roundingMode rounding_mode)
|
|||||||
|
|
||||||
if (isZero())
|
if (isZero())
|
||||||
sign = origSign; // IEEE754 requires this
|
sign = origSign; // IEEE754 requires this
|
||||||
|
delete[] x;
|
||||||
}
|
}
|
||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
@ -2284,14 +2284,15 @@ APFloat::convertFromSignExtendedInteger(const integerPart *src,
|
|||||||
|
|
||||||
if (isSigned &&
|
if (isSigned &&
|
||||||
APInt::tcExtractBit(src, srcCount * integerPartWidth - 1)) {
|
APInt::tcExtractBit(src, srcCount * integerPartWidth - 1)) {
|
||||||
auto C = make_unique<integerPart[]>(srcCount);
|
integerPart *copy;
|
||||||
auto copy = C.get();
|
|
||||||
|
|
||||||
/* If we're signed and negative negate a copy. */
|
/* If we're signed and negative negate a copy. */
|
||||||
sign = true;
|
sign = true;
|
||||||
|
copy = new integerPart[srcCount];
|
||||||
APInt::tcAssign(copy, src, srcCount);
|
APInt::tcAssign(copy, src, srcCount);
|
||||||
APInt::tcNegate(copy, srcCount);
|
APInt::tcNegate(copy, srcCount);
|
||||||
status = convertFromUnsignedParts(copy, srcCount, rounding_mode);
|
status = convertFromUnsignedParts(copy, srcCount, rounding_mode);
|
||||||
|
delete [] copy;
|
||||||
} else {
|
} else {
|
||||||
sign = false;
|
sign = false;
|
||||||
status = convertFromUnsignedParts(src, srcCount, rounding_mode);
|
status = convertFromUnsignedParts(src, srcCount, rounding_mode);
|
||||||
@ -2544,6 +2545,7 @@ APFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode)
|
|||||||
/* Overflow and round. */
|
/* Overflow and round. */
|
||||||
fs = handleOverflow(rounding_mode);
|
fs = handleOverflow(rounding_mode);
|
||||||
} else {
|
} else {
|
||||||
|
integerPart *decSignificand;
|
||||||
unsigned int partCount;
|
unsigned int partCount;
|
||||||
|
|
||||||
/* A tight upper bound on number of bits required to hold an
|
/* A tight upper bound on number of bits required to hold an
|
||||||
@ -2552,8 +2554,7 @@ APFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode)
|
|||||||
tcMultiplyPart. */
|
tcMultiplyPart. */
|
||||||
partCount = static_cast<unsigned int>(D.lastSigDigit - D.firstSigDigit) + 1;
|
partCount = static_cast<unsigned int>(D.lastSigDigit - D.firstSigDigit) + 1;
|
||||||
partCount = partCountForBits(1 + 196 * partCount / 59);
|
partCount = partCountForBits(1 + 196 * partCount / 59);
|
||||||
auto DecSignificandOwner = make_unique<integerPart[]>(partCount + 1);
|
decSignificand = new integerPart[partCount + 1];
|
||||||
auto decSignificand = DecSignificandOwner.get();
|
|
||||||
partCount = 0;
|
partCount = 0;
|
||||||
|
|
||||||
/* Convert to binary efficiently - we do almost all multiplication
|
/* Convert to binary efficiently - we do almost all multiplication
|
||||||
@ -2594,6 +2595,8 @@ APFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode)
|
|||||||
category = fcNormal;
|
category = fcNormal;
|
||||||
fs = roundSignificandWithExponent(decSignificand, partCount,
|
fs = roundSignificandWithExponent(decSignificand, partCount,
|
||||||
D.exponent, rounding_mode);
|
D.exponent, rounding_mode);
|
||||||
|
|
||||||
|
delete [] decSignificand;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fs;
|
return fs;
|
||||||
|
Loading…
Reference in New Issue
Block a user