Lines Matching defs:precision
9 // This file implements a class to represent arbitrary precision floating
114 unsigned int precision;
288 A.precision <= B.precision;
316 return semantics.precision;
367 return Dst.precision >= Src.precision;
943 fill_storage = APInt::getZero(semantics->precision - 1);
945 fill_storage = APInt::getAllOnes(semantics->precision - 1);
958 unsigned bitsToPreserve = semantics->precision - 1;
967 (semantics->precision >= 2) ? (semantics->precision - 2) : 0;
986 // For x87 extended precision, we want to make a NaN, not a
1021 semantics->precision - 1) == 0);
1038 const unsigned int PartCount = partCountForBits(semantics->precision);
1042 // When precision is just 1, it represents the 'Pth'
1044 const unsigned int NumHighBits = (semantics->precision > 1)
1045 ? (Bits - semantics->precision + 1)
1046 : (Bits - semantics->precision);
1054 const unsigned PartCount = partCountForBits(semantics->precision);
1065 if ((semantics->precision <= 1) || (~(Parts[PartCount - 1] | HighBitFill)))
1079 const unsigned PartCount = partCountForBits(semantics->precision);
1101 const unsigned PartCount = partCountForBits(semantics->precision);
1113 if ((semantics->precision > 1) && (Parts[PartCount - 1] & HighBitMask))
1121 const unsigned PartCount = partCountForBits(semantics->precision);
1131 return ((semantics->precision <= 1) || (Parts[PartCount - 1] == MSBMask));
1181 exponent = ourSemantics.precision - 1;
1214 return partCountForBits(semantics->precision + 1);
1271 on to the full-precision result of the multiplication. Returns the
1277 unsigned int partsCount, newPartsCount, precision;
1286 precision = semantics->precision;
1290 newPartsCount = partCountForBits(precision * 2 + 1);
1307 // Assume the operands involved in the multiplication are single-precision
1320 // The intermediate result of the multiplication has "2 * precision"
1330 extendedPrecision = 2 * precision + 1;
1340 extendedSemantics.precision = extendedPrecision;
1362 "Lost precision while shifting addend for fused-multiply-add.");
1375 // Convert the result having "2 * precision" significant-bits back to the one
1376 // having "precision" significant-bits. First, move the radix point from
1377 // poision "2*precision - 1" to "precision - 1". The exponent need to be
1378 // adjusted by "2*precision - 1" - "precision - 1" = "precision".
1379 exponent -= precision + 1;
1385 // Note that the result is not normalized when "omsb < precision". So, the
1388 if (omsb > precision) {
1392 bits = omsb - precision;
1446 unsigned int precision = semantics->precision;
1449 bit = precision - APInt::tcMSB(divisor, partsCount) - 1;
1456 bit = precision - APInt::tcMSB(dividend, partsCount) - 1;
1472 for (bit = precision; bit; bit -= 1) {
1519 assert(bits < semantics->precision ||
1520 (semantics->precision == 1 && bits <= 1));
1593 semantics->precision);
1659 exponentChange = omsb - semantics->precision;
1671 /* Shifting left is easy as we don't lose precision. */
1730 if (omsb == (unsigned) semantics->precision + 1) {
1756 if (omsb == semantics->precision)
1760 assert(omsb < semantics->precision);
2237 extendedSemantics.precision += 2;
2330 extended-precision calculation. */
2358 precision. */
2422 // precision of our format, and then subtract it back off again. The choice
2542 newPartCount = partCountForBits(toSemantics.precision + 1);
2544 shift = toSemantics.precision - fromSemantics.precision;
2565 int exponentChange = omsb - fromSemantics.precision;
2632 // For x87 extended precision, we want to make a NaN, not a special NaN if
2635 APInt::tcSetBit(significandParts(), semantics->precision - 1);
2711 truncatedBits = semantics->precision -1U - exponent;
2721 if (bits < semantics->precision) {
2722 /* We truncate (semantics->precision - bits) bits. */
2723 truncatedBits = semantics->precision - bits;
2727 APInt::tcExtract(parts.data(), dstPartsCount, src, semantics->precision,
2730 bits - semantics->precision);
2827 unsigned int omsb, precision, dstCount;
2835 precision = semantics->precision;
2839 if (precision <= omsb) {
2842 omsb - precision);
2843 APInt::tcExtract(dst, dstCount, src, precision, omsb - precision);
2845 exponent = precision - 1;
2993 expAdjustment += semantics->precision;
3018 parts = partCountForBits(semantics->precision + 11);
3027 calcSemantics.precision = parts * integerPartWidth - 1;
3028 excessPrecision = calcSemantics.precision - semantics->precision;
3047 /* multiplySignificand leaves the precision-th bit set to 1. */
3052 /* Denormal numbers have less precision. */
3056 if (excessPrecision > calcSemantics.precision)
3057 excessPrecision = calcSemantics.precision;
3066 (decSig.significandParts(), calcSemantics.precision - 1) == 1);
3076 calcSemantics.precision - excessPrecision,
3081 exponent = (decSig.exponent + semantics->precision
3082 - (calcSemantics.precision - excessPrecision));
3110 (exp + 1) * L <= minExponent - precision
3144 8651 * (semantics->minExponent - (int) semantics->precision)) {
3328 necessary. If HEXDIGITS is 0, the minimal precision to display the
3411 valueBits = semantics->precision + 3;
3419 precision. Otherwise, see if we are truncating. If we are,
3498 Arg.semantics->precision);
3502 Arg.semantics->precision, Arg.exponent,
3601 constexpr unsigned int trailing_significand_bits = S.precision - 1;
3913 // This format does not have any significand but the 'Pth' precision bit is
3933 << ((S.precision - 1) % integerPartWidth);
3935 constexpr unsigned int trailing_significand_bits = S.precision - 1;
4143 PartCount*integerPartWidth - semantics->precision;
4149 (semantics->precision > 1))
4182 APInt::tcSetBit(significandParts(), semantics->precision - 1);
4203 /// precise than is required for the desired precision.
4268 // If we carried through, we have exactly one digit of precision.
4289 // truncate trailing zeros, as those are part of the precision.
4294 // FIXME: Using a formula based purely on the precision is conservative;
4323 // <= semantics->precision + e * 137 / 59
4326 unsigned precision = semanticsPrecision + (137 * texp + 136) / 59;
4330 significand = significand.zext(precision);
4331 APInt five_to_the_i(precision, 5);
4348 unsigned precision = significand.getBitWidth();
4349 if (precision < 4) {
4350 // We need enough precision to store the value 10.
4351 precision = 4;
4352 significand = significand.zext(precision);
4354 APInt ten(precision, 10);
4355 APInt digit(precision, 0);
4507 int exp = exponent - ((int) semantics->precision - 1);
4509 semantics->precision,
4510 ArrayRef(significandParts(), partCountForBits(semantics->precision)));
4524 if (significandLSB() != semantics->precision - 1)
4538 reciprocal.significandLSB() == reciprocal.semantics->precision - 1);
4551 const int PartCount = partCountForBits(semantics->precision);
4567 return exponent - semantics->precision + CountrParts +
4584 return !APInt::tcExtractBit(significandParts(), semantics->precision - 2);
4685 APInt::tcSetBit(Parts, semantics->precision - 1);
4705 APInt::tcSetBit(Parts, semantics->precision - 1);
4768 APInt::tcSetBit(significandParts(), semantics->precision - 2);
4782 int SignificandBits = Arg.getSemantics().precision - 1;
4799 int SignificandBits = X.getSemantics().precision - 1;
5511 precision of the conversion.