Chris' change to print an approximation to long doubles

exposed a bug in APFloat's long double->double conversion of
NaNs.  Broke several things in the ieee part of gcc testsuite.

llvm-svn: 46617
This commit is contained in:
Dale Johannesen 2008-01-31 18:34:01 +00:00
parent e97c4ab30c
commit 8ef8f24c40
1 changed files with 2 additions and 1 deletions

View File

@ -1712,6 +1712,8 @@ APFloat::convert(const fltSemantics &toSemantics,
fs = normalize(rounding_mode, lostFraction);
} else if (category == fcNaN) {
int shift = toSemantics.precision - semantics->precision;
// Do this now so significandParts gets the right answer
semantics = &toSemantics;
// No normalization here, just truncate
if (shift>0)
APInt::tcShiftLeft(significandParts(), newPartCount, shift);
@ -1721,7 +1723,6 @@ APFloat::convert(const fltSemantics &toSemantics,
// does not give you back the same bits. This is dubious, and we
// don't currently do it. You're really supposed to get
// an invalid operation signal at runtime, but nobody does that.
semantics = &toSemantics;
fs = opOK;
} else {
semantics = &toSemantics;