aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/APFloat.cpp
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2007-10-06 00:24:48 +0000
committerNeil Booth <neil@daikokuya.co.uk>2007-10-06 00:24:48 +0000
commit978661d05301a9bcd1222c048affef679da5ac43 (patch)
tree4a83b82f779dfebaa904148fec9cd9373df1dc11 /lib/Support/APFloat.cpp
parent88cc699942f7f972ef9bc3afa1df0a44d059e1d8 (diff)
Generalize tcFullMultiply so that the operands can be of differing
part widths. Also, return the number of parts actually required to hold the result's value. Remove an over-cautious condition from rounding of float->hex conversion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APFloat.cpp')
-rw-r--r--lib/Support/APFloat.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 3746ae8cfe..34784a0468 100644
--- a/lib/Support/APFloat.cpp
+++ b/lib/Support/APFloat.cpp
@@ -519,7 +519,7 @@ APFloat::multiplySignificand(const APFloat &rhs, const APFloat *addend)
partsCount = partCount();
APInt::tcFullMultiply(fullSignificand, lhsSignificand,
- rhs.significandParts(), partsCount);
+ rhs.significandParts(), partsCount, partsCount);
lost_fraction = lfExactlyZero;
omsb = APInt::tcMSB(fullSignificand, newPartsCount) + 1;
@@ -1795,7 +1795,7 @@ APFloat::convertNormalToHexString(char *dst, unsigned int hexDigits,
/* hexDigits of zero means use the required number for the
precision. Otherwise, see if we are truncating. If we are,
- found out if we need to round away from zero. */
+ find out if we need to round away from zero. */
if (hexDigits) {
if (hexDigits < outputDigits) {
/* We are dropping non-zero bits, so need to check how to round.
@@ -1845,7 +1845,8 @@ APFloat::convertNormalToHexString(char *dst, unsigned int hexDigits,
do {
q--;
*q = hexDigitChars[hexDigitValue (*q) + 1];
- } while (*q == '0' && q > p);
+ } while (*q == '0');
+ assert (q >= p);
} else {
/* Add trailing zeroes. */
memset (dst, '0', outputDigits);