diff options
author | Dale Johannesen <dalej@apple.com> | 2008-01-31 18:34:01 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-01-31 18:34:01 +0000 |
commit | 8ef8f24c4050482ff5cf715f8000e5a64091250e (patch) | |
tree | dcdde7c6b2a4fd3e0761416d78944744870748c0 /llvm/lib/Support | |
parent | e97c4ab30cdbadcde0aae314caf0a6e2c134a44b (diff) | |
download | bcm5719-llvm-8ef8f24c4050482ff5cf715f8000e5a64091250e.tar.gz bcm5719-llvm-8ef8f24c4050482ff5cf715f8000e5a64091250e.zip |
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
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/APFloat.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index 04e99149bb8..3de709c86ed 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -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; |