llvm.org GIT mirror llvm / d3d8ce3
Mark shortening NaN conversions as Inexact. PR 2856. Improve description of unsupported formats. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57185 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 11 years ago
1 changed file(s) with 9 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
17261726 APInt::tcShiftLeft(significandParts(), newPartCount, shift);
17271727 else if (shift < 0)
17281728 APInt::tcShiftRight(significandParts(), newPartCount, -shift);
1729 // If the new size is shorter, we lost information.
1730 fs = (shift < 0) ? opInexact : opOK;
17291731 // gcc forces the Quiet bit on, which means (float)(double)(float_sNan)
17301732 // does not give you back the same bits. This is dubious, and we
17311733 // don't currently do it. You're really supposed to get
17321734 // an invalid operation signal at runtime, but nobody does that.
1733 fs = opOK;
17341735 } else {
17351736 semantics = &toSemantics;
17361737 fs = opOK;
26322633 return api.bitsToDouble();
26332634 }
26342635
2635 /// Integer bit is explicit in this format. Current Intel book does not
2636 /// define meaning of:
2637 /// exponent = all 1's, integer bit not set.
2638 /// exponent = 0, integer bit set. (formerly "psuedodenormals")
2639 /// exponent!=0 nor all 1's, integer bit not set. (formerly "unnormals")
2636 /// Integer bit is explicit in this format. Intel hardware (387 and later)
2637 /// does not support these bit patterns:
2638 /// exponent = all 1's, integer bit 0, significand 0 ("pseudoinfinity")
2639 /// exponent = all 1's, integer bit 0, significand nonzero ("pseudoNaN")
2640 /// exponent = 0, integer bit 1 ("pseudodenormal")
2641 /// exponent!=0 nor all 1's, integer bit 0 ("unnormal")
2642 /// At the moment, the first two are treated as NaNs, the second two as Normal.
26402643 void
26412644 APFloat::initFromF80LongDoubleAPInt(const APInt &api)
26422645 {