Home | History | Annotate | Download | only in Support

Lines Matching refs:remainder

1380   // remainder, which is the gcd(*this,modulo) as calculated by the Euclidean
1609 // D5. [Test remainder.] Set q[j] = qp. If the result of step D4 was
1640 // remainder may be obtained by dividing u[...] by d. If r is non-null we
1641 // compute the remainder (urem uses this).
1648 DEBUG(dbgs() << "KnuthDiv: remainder:");
1669 APInt *Quotient, APInt *Remainder)
1691 if ((Remainder?4:3)*n+2*m+1 <= 128) {
1695 if (Remainder)
1701 if (Remainder)
1722 // initialize the quotient and remainder
1724 if (Remainder)
1747 unsigned remainder = 0;
1749 uint64_t partial_dividend = uint64_t(remainder) << 32 | U[i];
1752 remainder = 0;
1755 remainder = (unsigned)partial_dividend;
1758 remainder = 0;
1761 remainder = (unsigned)(partial_dividend - (Q[i] * divisor));
1765 R[0] = remainder;
1803 // If the caller wants the remainder
1804 if (Remainder) {
1805 // Set up the Remainder value's memory.
1806 if (Remainder->BitWidth != RHS.BitWidth) {
1807 if (Remainder->isSingleWord())
1808 Remainder->VAL = 0;
1810 delete [] Remainder->pVal;
1811 Remainder->BitWidth = RHS.BitWidth;
1812 if (!Remainder->isSingleWord())
1813 Remainder->pVal = getClearedMemory(Remainder->getNumWords());
1815 Remainder->clearAllBits();
1817 // The remainder is in R. Reconstitute the remainder into Remainder's low
1822 if (Remainder->isSingleWord())
1823 Remainder->VAL = tmp;
1825 Remainder->pVal[0] = tmp;
1827 assert(!Remainder->isSingleWord() && "Remainder APInt not large enough");
1829 Remainder->pVal[i] =
1894 assert(RHS.VAL != 0 && "Remainder by zero?");
1905 assert(rhsWords && "Performing remainder operation by zero ???");
1918 // All high words are zero, just use native remainder
1923 APInt Remainder(1,0);
1924 divide(*this, lhsWords, RHS, rhsWords, nullptr, &Remainder);
1925 return Remainder;
1940 APInt &Quotient, APInt &Remainder) {
1950 Remainder = 0; // 0 % Y ===> 0
1955 Remainder = LHS; // X % Y ===> X, iff X < Y
1962 Remainder = 0; // X % X ===> 0;
1971 Remainder = APInt(LHS.getBitWidth(), lhsValue % rhsValue);
1976 divide(LHS, lhsWords, RHS, rhsWords, &Quotient, &Remainder);
1980 APInt &Quotient, APInt &Remainder) {
1983 APInt::udivrem(-LHS, -RHS, Quotient, Remainder);
1985 APInt::udivrem(-LHS, RHS, Quotient, Remainder);
1988 Remainder = -Remainder;
1990 APInt::udivrem(LHS, -RHS, Quotient, Remainder);
1993 APInt::udivrem(LHS, RHS, Quotient, Remainder);
2664 /* If RHS is zero LHS and REMAINDER are left unchanged, return one.
2666 set REMAINDER to the remainder, return zero. i.e.
2668 OLD_LHS = RHS * LHS + REMAINDER
2672 destroyed. LHS, REMAINDER and SCRATCH must be distinct.
2676 integerPart *remainder, integerPart *srhs,
2682 assert(lhs != remainder && lhs != srhs && remainder != srhs);
2694 tcAssign(remainder, lhs, parts);
2697 /* Loop, subtracting SRHS if REMAINDER is greater and adding that to
2702 compare = tcCompare(remainder, srhs, parts);
2704 tcSubtract(remainder, srhs, 0, parts);