Lines Matching defs:precision

10 // This file implements a class to represent arbitrary precision floating
54 unsigned int precision;
636 unsigned bitsToPreserve = semantics->precision - 1;
644 unsigned QNaNBit = semantics->precision - 2;
660 // For x87 extended precision, we want to make a NaN, not a
706 semantics->precision - 1) == 0);
729 PartCount*integerPartWidth - semantics->precision + 1;
751 PartCount*integerPartWidth - semantics->precision + 1;
802 exponent = ourSemantics.precision - 1;
845 return partCountForBits(semantics->precision + 1);
851 return semantics.precision;
934 on to the full-precision result of the multiplication. Returns the
940 unsigned int partsCount, newPartsCount, precision;
949 precision = semantics->precision;
953 newPartsCount = partCountForBits(precision * 2 + 1);
970 // Assume the operands involved in the multiplication are single-precision
983 // The intermediate result of the multiplication has "2 * precision"
993 extendedPrecision = 2 * precision + 1;
1003 extendedSemantics.precision = extendedPrecision;
1021 "Lost precision while shifting addend for fused-multiply-add.");
1034 // Convert the result having "2 * precision" significant-bits back to the one
1035 // having "precision" significant-bits. First, move the radix point from
1036 // poision "2*precision - 1" to "precision - 1". The exponent need to be
1037 // adjusted by "2*precision - 1" - "precision - 1" = "precision".
1038 exponent -= precision + 1;
1044 // Note that the result is not normalized when "omsb < precision". So, the
1046 if (omsb > precision) {
1050 bits = omsb - precision;
1097 unsigned int precision = semantics->precision;
1100 bit = precision - APInt::tcMSB(divisor, partsCount) - 1;
1107 bit = precision - APInt::tcMSB(dividend, partsCount) - 1;
1123 for (bit = precision; bit; bit -= 1) {
1178 assert(bits < semantics->precision);
1233 semantics->precision);
1297 exponentChange = omsb - semantics->precision;
1309 /* Shifting left is easy as we don't lose precision. */
1356 if (omsb == (unsigned) semantics->precision + 1) {
1374 if (omsb == semantics->precision)
1378 assert(omsb < semantics->precision);
1833 extended-precision calculation. */
1858 precision. */
1877 // precision of our format, and then subtract it back off again. The choice
2000 newPartCount = partCountForBits(toSemantics.precision + 1);
2002 shift = toSemantics.precision - fromSemantics.precision;
2020 int exponentChange = significandMSB() + 1 - fromSemantics.precision;
2068 // For x87 extended precision, we want to make a NaN, not a special NaN if
2071 APInt::tcSetBit(significandParts(), semantics->precision - 1);
2130 truncatedBits = semantics->precision -1U - exponent;
2140 if (bits < semantics->precision) {
2141 /* We truncate (semantics->precision - bits) bits. */
2142 truncatedBits = semantics->precision - bits;
2146 APInt::tcExtract(parts, dstPartsCount, src, semantics->precision, 0);
2147 APInt::tcShiftLeft(parts, dstPartsCount, bits - semantics->precision);
2240 precision of the conversion.
2263 unsigned int omsb, precision, dstCount;
2271 precision = semantics->precision;
2275 if (precision <= omsb) {
2278 omsb - precision);
2279 APInt::tcExtract(dst, dstCount, src, precision, omsb - precision);
2281 exponent = precision - 1;
2424 expAdjustment += semantics->precision;
2447 parts = partCountForBits(semantics->precision + 11);
2456 calcSemantics.precision = parts * integerPartWidth - 1;
2457 excessPrecision = calcSemantics.precision - semantics->precision;
2475 /* multiplySignificand leaves the precision-th bit set to 1. */
2480 /* Denormal numbers have less precision. */
2484 if (excessPrecision > calcSemantics.precision)
2485 excessPrecision = calcSemantics.precision;
2494 (decSig.significandParts(), calcSemantics.precision - 1) == 1);
2504 calcSemantics.precision - excessPrecision,
2509 exponent = (decSig.exponent + semantics->precision
2510 - (calcSemantics.precision - excessPrecision));
2538 (exp + 1) * L <= minExponent - precision
2568 8651 * (semantics->minExponent - (int) semantics->precision)) {
2698 necessary. If HEXDIGITS is 0, the minimal precision to display the
2784 valueBits = semantics->precision + 3;
2792 precision. Otherwise, see if we are truncating. If we are,
2871 Arg.semantics->precision);
2875 Arg.semantics->precision, Arg.exponent,
3415 PartCount*integerPartWidth - semantics->precision;
3467 Val.significandParts()[partCountForBits(Sem.precision)-1] |=
3468 (((integerPart) 1) << ((Sem.precision - 1) % integerPartWidth));
3491 /// precise than is required for the desired precision.
3556 // If we carried through, we have exactly one digit of precision.
3599 int exp = exponent - ((int) semantics->precision - 1);
3600 APInt significand(semantics->precision,
3602 partCountForBits(semantics->precision)));
3605 // truncate trailing zeros, as those are part of the precision.
3610 // FIXME: Using a formula based purely on the precision is conservative;
3614 FormatPrecision = 2 + semantics->precision * 59 / 196;
3627 significand = significand.zext(semantics->precision + exp);
3639 // <= semantics->precision + e * 137 / 59
3642 unsigned precision = semantics->precision + (137 * texp + 136) / 59;
3646 significand = significand.zext(precision);
3647 APInt five_to_the_i(precision, 5);
3662 unsigned precision = significand.getBitWidth();
3663 APInt ten(precision, 10);
3664 APInt digit(precision, 0);
3779 if (significandLSB() != semantics->precision - 1)
3793 reciprocal.significandLSB() == reciprocal.semantics->precision - 1);
3807 return !APInt::tcExtractBit(significandParts(), semantics->precision - 2);
3894 APInt::tcSetBit(Parts, semantics->precision - 1);
3911 APInt::tcSetBit(Parts, semantics->precision - 1);