Lines Matching refs:precision
10 // This file implements a class to represent arbitrary precision floating
55 unsigned int precision;
634 unsigned bitsToPreserve = semantics->precision - 1;
642 unsigned QNaNBit = semantics->precision - 2;
658 // For x87 extended precision, we want to make a NaN, not a
704 semantics->precision - 1) == 0);
727 PartCount*integerPartWidth - semantics->precision + 1;
749 PartCount*integerPartWidth - semantics->precision + 1;
797 exponent = ourSemantics.precision - 1;
840 return partCountForBits(semantics->precision + 1);
846 return semantics.precision;
914 on to the full-precision result of the multiplication. Returns the
920 unsigned int partsCount, newPartsCount, precision;
929 precision = semantics->precision;
930 newPartsCount = partCountForBits(precision * 2);
947 // Assume the operands involved in the multiplication are single-precision
959 // The intermediate result of the multiplication has "2 * precision"
969 extendedPrecision = 2 * precision;
979 extendedSemantics.precision = extendedPrecision;
1002 // Convert the result having "2 * precision" significant-bits back to the one
1003 // having "precision" significant-bits. First, move the radix point from
1004 // poision "2*precision - 1" to "precision - 1". The exponent need to be
1005 // adjusted by "2*precision - 1" - "precision - 1" = "precision".
1006 exponent -= precision;
1012 // Note that the result is not normalized when "omsb < precision". So, the
1014 if (omsb > precision) {
1018 bits = omsb - precision;
1065 unsigned int precision = semantics->precision;
1068 bit = precision - APInt::tcMSB(divisor, partsCount) - 1;
1075 bit = precision - APInt::tcMSB(dividend, partsCount) - 1;
1091 for (bit = precision; bit; bit -= 1) {
1146 assert(bits < semantics->precision);
1201 semantics->precision);
1263 bit numbered PRECISION if possible, with a compensating change in
1265 exponentChange = omsb - semantics->precision;
1277 /* Shifting left is easy as we don't lose precision. */
1324 if (omsb == (unsigned) semantics->precision + 1) {
1342 if (omsb == semantics->precision)
1346 assert(omsb < semantics->precision);
1801 extended-precision calculation. */
1826 precision. */
1845 // precision of our format, and then subtract it back off again. The choice
1968 newPartCount = partCountForBits(toSemantics.precision + 1);
1970 shift = toSemantics.precision - fromSemantics.precision;
1988 int exponentChange = significandMSB() + 1 - fromSemantics.precision;
2036 // For x87 extended precision, we want to make a NaN, not a special NaN if
2039 APInt::tcSetBit(significandParts(), semantics->precision - 1);
2098 truncatedBits = semantics->precision -1U - exponent;
2108 if (bits < semantics->precision) {
2109 /* We truncate (semantics->precision - bits) bits. */
2110 truncatedBits = semantics->precision - bits;
2114 APInt::tcExtract(parts, dstPartsCount, src, semantics->precision, 0);
2115 APInt::tcShiftLeft(parts, dstPartsCount, bits - semantics->precision);
2208 precision of the conversion.
2231 unsigned int omsb, precision, dstCount;
2239 precision = semantics->precision;
2241 /* We want the most significant PRECISION bits of SRC. There may not
2243 if (precision <= omsb) {
2246 precision);
2247 APInt::tcExtract(dst, dstCount, src, precision, omsb - precision);
2249 exponent = precision - 1;
2392 expAdjustment += semantics->precision;
2415 parts = partCountForBits(semantics->precision + 11);
2424 calcSemantics.precision = parts * integerPartWidth - 1;
2425 excessPrecision = calcSemantics.precision - semantics->precision;
2443 /* multiplySignificand leaves the precision-th bit set to 1. */
2448 /* Denormal numbers have less precision. */
2452 if (excessPrecision > calcSemantics.precision)
2453 excessPrecision = calcSemantics.precision;
2462 (decSig.significandParts(), calcSemantics.precision - 1) == 1);
2472 calcSemantics.precision - excessPrecision,
2477 exponent = (decSig.exponent + semantics->precision
2478 - (calcSemantics.precision - excessPrecision));
2506 (exp + 1) * L <= minExponent - precision
2536 8651 * (semantics->minExponent - (int) semantics->precision)) {
2666 necessary. If HEXDIGITS is 0, the minimal precision to display the
2752 valueBits = semantics->precision + 3;
2760 precision. Otherwise, see if we are truncating. If we are,
2839 Arg.semantics->precision);
2843 Arg.semantics->precision, Arg.exponent,
3379 PartCount*integerPartWidth - semantics->precision;
3429 Val.significandParts()[partCountForBits(Sem.precision)-1] |=
3430 (((integerPart) 1) << ((Sem.precision - 1) % integerPartWidth));
3453 /// precise than is required for the desired precision.
3518 // If we carried through, we have exactly one digit of precision.
3561 int exp = exponent - ((int) semantics->precision - 1);
3562 APInt significand(semantics->precision,
3564 partCountForBits(semantics->precision)));
3567 // truncate trailing zeros, as those are part of the precision.
3572 // FIXME: Using a formula based purely on the precision is conservative;
3576 FormatPrecision = 2 + semantics->precision * 59 / 196;
3589 significand = significand.zext(semantics->precision + exp);
3601 // <= semantics->precision + e * 137 / 59
3604 unsigned precision = semantics->precision + (137 * texp + 136) / 59;
3608 significand = significand.zext(precision);
3609 APInt five_to_the_i(precision, 5);
3624 unsigned precision = significand.getBitWidth();
3625 APInt ten(precision, 10);
3626 APInt digit(precision, 0);
3741 if (significandLSB() != semantics->precision - 1)
3755 reciprocal.significandLSB() == reciprocal.semantics->precision - 1);
3769 return !APInt::tcExtractBit(significandParts(), semantics->precision - 2);
3856 APInt::tcSetBit(Parts, semantics->precision - 1);
3873 APInt::tcSetBit(Parts, semantics->precision - 1);