Lines Matching defs: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
690 semantics->precision - 1) == 0);
713 PartCount*integerPartWidth - semantics->precision + 1;
735 PartCount*integerPartWidth - semantics->precision + 1;
783 exponent = ourSemantics.precision - 1;
822 return partCountForBits(semantics->precision + 1);
828 return semantics.precision;
896 on to the full-precision result of the multiplication. Returns the
902 unsigned int partsCount, newPartsCount, precision;
911 precision = semantics->precision;
912 newPartsCount = partCountForBits(precision * 2);
929 // Assume the operands involved in the multiplication are single-precision
941 // The intermediate result of the multiplication has "2 * precision"
951 extendedPrecision = 2 * precision;
961 extendedSemantics.precision = extendedPrecision;
984 // Convert the result having "2 * precision" significant-bits back to the one
985 // having "precision" significant-bits. First, move the radix point from
986 // poision "2*precision - 1" to "precision - 1". The exponent need to be
987 // adjusted by "2*precision - 1" - "precision - 1" = "precision".
988 exponent -= precision;
994 // Note that the result is not normalized when "omsb < precision". So, the
996 if (omsb > precision) {
1000 bits = omsb - precision;
1047 unsigned int precision = semantics->precision;
1050 bit = precision - APInt::tcMSB(divisor, partsCount) - 1;
1057 bit = precision - APInt::tcMSB(dividend, partsCount) - 1;
1073 for (bit = precision; bit; bit -= 1) {
1128 assert(bits < semantics->precision);
1183 semantics->precision);
1247 exponentChange = omsb - semantics->precision;
1259 /* Shifting left is easy as we don't lose precision. */
1306 if (omsb == (unsigned) semantics->precision + 1) {
1324 if (omsb == semantics->precision)
1328 assert(omsb < semantics->precision);
1781 extended-precision calculation. */
1806 precision. */
1825 // precision of our format, and then subtract it back off again. The choice
1948 newPartCount = partCountForBits(toSemantics.precision + 1);
1950 shift = toSemantics.precision - fromSemantics.precision;
1968 int exponentChange = significandMSB() + 1 - fromSemantics.precision;
2016 // For x87 extended precision, we want to make a NaN, not a special NaN if
2019 APInt::tcSetBit(significandParts(), semantics->precision - 1);
2078 truncatedBits = semantics->precision -1U - exponent;
2088 if (bits < semantics->precision) {
2089 /* We truncate (semantics->precision - bits) bits. */
2090 truncatedBits = semantics->precision - bits;
2094 APInt::tcExtract(parts, dstPartsCount, src, semantics->precision, 0);
2095 APInt::tcShiftLeft(parts, dstPartsCount, bits - semantics->precision);
2188 precision of the conversion.
2211 unsigned int omsb, precision, dstCount;
2219 precision = semantics->precision;
2223 if (precision <= omsb) {
2226 omsb - precision);
2227 APInt::tcExtract(dst, dstCount, src, precision, omsb - precision);
2229 exponent = precision - 1;
2372 expAdjustment += semantics->precision;
2395 parts = partCountForBits(semantics->precision + 11);
2404 calcSemantics.precision = parts * integerPartWidth - 1;
2405 excessPrecision = calcSemantics.precision - semantics->precision;
2423 /* multiplySignificand leaves the precision-th bit set to 1. */
2428 /* Denormal numbers have less precision. */
2432 if (excessPrecision > calcSemantics.precision)
2433 excessPrecision = calcSemantics.precision;
2442 (decSig.significandParts(), calcSemantics.precision - 1) == 1);
2452 calcSemantics.precision - excessPrecision,
2457 exponent = (decSig.exponent + semantics->precision
2458 - (calcSemantics.precision - excessPrecision));
2486 (exp + 1) * L <= minExponent - precision
2516 8651 * (semantics->minExponent - (int) semantics->precision)) {
2646 necessary. If HEXDIGITS is 0, the minimal precision to display the
2732 valueBits = semantics->precision + 3;
2740 precision. Otherwise, see if we are truncating. If we are,
2819 Arg.semantics->precision);
2823 Arg.semantics->precision, Arg.exponent,
3359 PartCount*integerPartWidth - semantics->precision;
3409 Val.significandParts()[partCountForBits(Sem.precision)-1] |=
3410 (((integerPart) 1) << ((Sem.precision - 1) % integerPartWidth));
3433 /// precise than is required for the desired precision.
3498 // If we carried through, we have exactly one digit of precision.
3541 int exp = exponent - ((int) semantics->precision - 1);
3542 APInt significand(semantics->precision,
3544 partCountForBits(semantics->precision)));
3547 // truncate trailing zeros, as those are part of the precision.
3552 // FIXME: Using a formula based purely on the precision is conservative;
3556 FormatPrecision = 2 + semantics->precision * 59 / 196;
3569 significand = significand.zext(semantics->precision + exp);
3581 // <= semantics->precision + e * 137 / 59
3584 unsigned precision = semantics->precision + (137 * texp + 136) / 59;
3588 significand = significand.zext(precision);
3589 APInt five_to_the_i(precision, 5);
3604 unsigned precision = significand.getBitWidth();
3605 APInt ten(precision, 10);
3606 APInt digit(precision, 0);
3721 if (significandLSB() != semantics->precision - 1)
3735 reciprocal.significandLSB() == reciprocal.semantics->precision - 1);
3749 return !APInt::tcExtractBit(significandParts(), semantics->precision - 2);
3836 APInt::tcSetBit(Parts, semantics->precision - 1);
3853 APInt::tcSetBit(Parts, semantics->precision - 1);