aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-06-27 21:58:19 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-06-27 21:58:19 +0000
commit4dfc257a1ad58be07753bfb96377869cb5dcf8e7 (patch)
tree33ff45d8c5e2491619f04d57594c87dbde38993a /lib/Support
parentd6bd98d01c3db23f9a66b1f1b2d3e65eef65382e (diff)
downloadexternal_llvm-4dfc257a1ad58be07753bfb96377869cb5dcf8e7.zip
external_llvm-4dfc257a1ad58be07753bfb96377869cb5dcf8e7.tar.gz
external_llvm-4dfc257a1ad58be07753bfb96377869cb5dcf8e7.tar.bz2
Revert "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 r185099. Looks like both the ppc-64 and mips bots are still failing after I reverted this change. Since: 1. The mips bot always performs a clean build, 2. The ppc64-bot failed again after a clean build (I asked the ppc-64 maintainers to clean the bot which they did... Thanks Will!), I think it is safe to assume that this change was not the cause of the failures that said builders were seeing. Thus I am recomitting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/APFloat.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 2eaf2b5..a7ff9f6 100644
--- a/lib/Support/APFloat.cpp
+++ b/lib/Support/APFloat.cpp
@@ -795,17 +795,6 @@ APFloat::APFloat(const fltSemantics &ourSemantics, uninitializedTag tag) {
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) {
initialize(&ourSemantics);
convertFromString(text, rmNearestTiesToEven);
@@ -2406,8 +2395,8 @@ APFloat::roundSignificandWithExponent(const integerPart *decSigParts,
excessPrecision = calcSemantics.precision - semantics->precision;
truncatedBits = excessPrecision;
- APFloat decSig(calcSemantics, fcZero, sign);
- APFloat pow5(calcSemantics, fcZero, false);
+ APFloat decSig = APFloat::getZero(calcSemantics, sign);
+ APFloat pow5(calcSemantics);
sigStatus = decSig.convertFromUnsignedParts(decSigParts, sigPartCount,
rmNearestTiesToEven);
@@ -3388,15 +3377,16 @@ APFloat APFloat::getSmallest(const fltSemantics &Sem, bool Negative) {
}
APFloat APFloat::getSmallestNormalized(const fltSemantics &Sem, bool Negative) {
- APFloat Val(Sem, fcNormal, Negative);
+ APFloat Val(Sem, uninitialized);
// We want (in interchange format):
// sign = {Negative}
// exponent = 0..0
// significand = 10..0
- Val.exponent = Sem.minExponent;
Val.zeroSignificand();
+ Val.sign = Negative;
+ Val.exponent = Sem.minExponent;
Val.significandParts()[partCountForBits(Sem.precision)-1] |=
(((integerPart) 1) << ((Sem.precision - 1) % integerPartWidth));