mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-30 19:55:11 +00:00
Revert "[APFloat] Removed APFloat constructor which initialized to either zero/NaN but allowed you to arbitrarily set the category of the float."
This reverts commit r185095. This is causing a FileCheck failure on the 3dnow intrinsics on at least the mips/ppc bots but not on the x86 bots. Reverting while I figure out what is going on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185099 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0bbbf7cbb0
commit
d6bd98d01c
@ -191,6 +191,7 @@ public:
|
|||||||
APFloat(const fltSemantics &); // Default construct to 0.0
|
APFloat(const fltSemantics &); // Default construct to 0.0
|
||||||
APFloat(const fltSemantics &, StringRef);
|
APFloat(const fltSemantics &, StringRef);
|
||||||
APFloat(const fltSemantics &, integerPart);
|
APFloat(const fltSemantics &, integerPart);
|
||||||
|
APFloat(const fltSemantics &, fltCategory, bool negative);
|
||||||
APFloat(const fltSemantics &, uninitializedTag);
|
APFloat(const fltSemantics &, uninitializedTag);
|
||||||
APFloat(const fltSemantics &, const APInt &);
|
APFloat(const fltSemantics &, const APInt &);
|
||||||
explicit APFloat(double d);
|
explicit APFloat(double d);
|
||||||
|
@ -795,6 +795,17 @@ APFloat::APFloat(const fltSemantics &ourSemantics, uninitializedTag tag) {
|
|||||||
initialize(&ourSemantics);
|
initialize(&ourSemantics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
APFloat::APFloat(const fltSemantics &ourSemantics,
|
||||||
|
fltCategory ourCategory, bool negative) {
|
||||||
|
initialize(&ourSemantics);
|
||||||
|
category = ourCategory;
|
||||||
|
sign = negative;
|
||||||
|
if (isFiniteNonZero())
|
||||||
|
category = fcZero;
|
||||||
|
else if (ourCategory == fcNaN)
|
||||||
|
makeNaN();
|
||||||
|
}
|
||||||
|
|
||||||
APFloat::APFloat(const fltSemantics &ourSemantics, StringRef text) {
|
APFloat::APFloat(const fltSemantics &ourSemantics, StringRef text) {
|
||||||
initialize(&ourSemantics);
|
initialize(&ourSemantics);
|
||||||
convertFromString(text, rmNearestTiesToEven);
|
convertFromString(text, rmNearestTiesToEven);
|
||||||
@ -2395,8 +2406,8 @@ APFloat::roundSignificandWithExponent(const integerPart *decSigParts,
|
|||||||
excessPrecision = calcSemantics.precision - semantics->precision;
|
excessPrecision = calcSemantics.precision - semantics->precision;
|
||||||
truncatedBits = excessPrecision;
|
truncatedBits = excessPrecision;
|
||||||
|
|
||||||
APFloat decSig = APFloat::getZero(calcSemantics, sign);
|
APFloat decSig(calcSemantics, fcZero, sign);
|
||||||
APFloat pow5(calcSemantics);
|
APFloat pow5(calcSemantics, fcZero, false);
|
||||||
|
|
||||||
sigStatus = decSig.convertFromUnsignedParts(decSigParts, sigPartCount,
|
sigStatus = decSig.convertFromUnsignedParts(decSigParts, sigPartCount,
|
||||||
rmNearestTiesToEven);
|
rmNearestTiesToEven);
|
||||||
@ -3377,16 +3388,15 @@ APFloat APFloat::getSmallest(const fltSemantics &Sem, bool Negative) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
APFloat APFloat::getSmallestNormalized(const fltSemantics &Sem, bool Negative) {
|
APFloat APFloat::getSmallestNormalized(const fltSemantics &Sem, bool Negative) {
|
||||||
APFloat Val(Sem, uninitialized);
|
APFloat Val(Sem, fcNormal, Negative);
|
||||||
|
|
||||||
// We want (in interchange format):
|
// We want (in interchange format):
|
||||||
// sign = {Negative}
|
// sign = {Negative}
|
||||||
// exponent = 0..0
|
// exponent = 0..0
|
||||||
// significand = 10..0
|
// significand = 10..0
|
||||||
|
|
||||||
Val.zeroSignificand();
|
|
||||||
Val.sign = Negative;
|
|
||||||
Val.exponent = Sem.minExponent;
|
Val.exponent = Sem.minExponent;
|
||||||
|
Val.zeroSignificand();
|
||||||
Val.significandParts()[partCountForBits(Sem.precision)-1] |=
|
Val.significandParts()[partCountForBits(Sem.precision)-1] |=
|
||||||
(((integerPart) 1) << ((Sem.precision - 1) % integerPartWidth));
|
(((integerPart) 1) << ((Sem.precision - 1) % integerPartWidth));
|
||||||
|
|
||||||
|
@ -2888,7 +2888,7 @@ Instruction *InstCombiner::FoldFCmp_IntToFP_Cst(FCmpInst &I,
|
|||||||
if (!LHSUnsigned) {
|
if (!LHSUnsigned) {
|
||||||
// If the RHS value is > SignedMax, fold the comparison. This handles +INF
|
// If the RHS value is > SignedMax, fold the comparison. This handles +INF
|
||||||
// and large values.
|
// and large values.
|
||||||
APFloat SMax(RHS.getSemantics());
|
APFloat SMax(RHS.getSemantics(), APFloat::fcZero, false);
|
||||||
SMax.convertFromAPInt(APInt::getSignedMaxValue(IntWidth), true,
|
SMax.convertFromAPInt(APInt::getSignedMaxValue(IntWidth), true,
|
||||||
APFloat::rmNearestTiesToEven);
|
APFloat::rmNearestTiesToEven);
|
||||||
if (SMax.compare(RHS) == APFloat::cmpLessThan) { // smax < 13123.0
|
if (SMax.compare(RHS) == APFloat::cmpLessThan) { // smax < 13123.0
|
||||||
@ -2900,7 +2900,7 @@ Instruction *InstCombiner::FoldFCmp_IntToFP_Cst(FCmpInst &I,
|
|||||||
} else {
|
} else {
|
||||||
// If the RHS value is > UnsignedMax, fold the comparison. This handles
|
// If the RHS value is > UnsignedMax, fold the comparison. This handles
|
||||||
// +INF and large values.
|
// +INF and large values.
|
||||||
APFloat UMax(RHS.getSemantics());
|
APFloat UMax(RHS.getSemantics(), APFloat::fcZero, false);
|
||||||
UMax.convertFromAPInt(APInt::getMaxValue(IntWidth), false,
|
UMax.convertFromAPInt(APInt::getMaxValue(IntWidth), false,
|
||||||
APFloat::rmNearestTiesToEven);
|
APFloat::rmNearestTiesToEven);
|
||||||
if (UMax.compare(RHS) == APFloat::cmpLessThan) { // umax < 13123.0
|
if (UMax.compare(RHS) == APFloat::cmpLessThan) { // umax < 13123.0
|
||||||
@ -2913,7 +2913,7 @@ Instruction *InstCombiner::FoldFCmp_IntToFP_Cst(FCmpInst &I,
|
|||||||
|
|
||||||
if (!LHSUnsigned) {
|
if (!LHSUnsigned) {
|
||||||
// See if the RHS value is < SignedMin.
|
// See if the RHS value is < SignedMin.
|
||||||
APFloat SMin(RHS.getSemantics());
|
APFloat SMin(RHS.getSemantics(), APFloat::fcZero, false);
|
||||||
SMin.convertFromAPInt(APInt::getSignedMinValue(IntWidth), true,
|
SMin.convertFromAPInt(APInt::getSignedMinValue(IntWidth), true,
|
||||||
APFloat::rmNearestTiesToEven);
|
APFloat::rmNearestTiesToEven);
|
||||||
if (SMin.compare(RHS) == APFloat::cmpGreaterThan) { // smin > 12312.0
|
if (SMin.compare(RHS) == APFloat::cmpGreaterThan) { // smin > 12312.0
|
||||||
@ -2924,7 +2924,7 @@ Instruction *InstCombiner::FoldFCmp_IntToFP_Cst(FCmpInst &I,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// See if the RHS value is < UnsignedMin.
|
// See if the RHS value is < UnsignedMin.
|
||||||
APFloat SMin(RHS.getSemantics());
|
APFloat SMin(RHS.getSemantics(), APFloat::fcZero, false);
|
||||||
SMin.convertFromAPInt(APInt::getMinValue(IntWidth), true,
|
SMin.convertFromAPInt(APInt::getMinValue(IntWidth), true,
|
||||||
APFloat::rmNearestTiesToEven);
|
APFloat::rmNearestTiesToEven);
|
||||||
if (SMin.compare(RHS) == APFloat::cmpGreaterThan) { // umin > 12312.0
|
if (SMin.compare(RHS) == APFloat::cmpGreaterThan) { // umin > 12312.0
|
||||||
|
Loading…
Reference in New Issue
Block a user