mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
APFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller type.
Fixes PR15054. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1913,6 +1913,12 @@ APFloat::convert(const fltSemantics &toSemantics,
|
||||
*losesInfo = (fs != opOK);
|
||||
} else if (category == fcNaN) {
|
||||
*losesInfo = lostFraction != lfExactlyZero || X86SpecialNan;
|
||||
|
||||
// For x87 extended precision, we want to make a NaN, not a special NaN if
|
||||
// the input wasn't special either.
|
||||
if (!X86SpecialNan && semantics == &APFloat::x87DoubleExtended)
|
||||
APInt::tcSetBit(significandParts(), semantics->precision - 1);
|
||||
|
||||
// gcc forces the Quiet bit on, which means (float)(double)(float_sNan)
|
||||
// does not give you back the same bits. This is dubious, and we
|
||||
// don't currently do it. You're really supposed to get
|
||||
|
||||
Reference in New Issue
Block a user