}
// Get some facts about the LHS and RHS number of bits and words
- unsigned rhsBits = RHS.getActiveBits();
- unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1);
+ unsigned rhsWords = getNumWords(RHS.getActiveBits());
assert(rhsWords && "Divided by zero???");
- unsigned lhsBits = this->getActiveBits();
- unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1);
+ unsigned lhsWords = getNumWords(getActiveBits());
// Deal with some degenerate cases
if (!lhsWords)
}
// Get some facts about the LHS
- unsigned lhsBits = getActiveBits();
- unsigned lhsWords = !lhsBits ? 0 : (whichWord(lhsBits - 1) + 1);
+ unsigned lhsWords = getNumWords(getActiveBits());
// Get some facts about the RHS
- unsigned rhsBits = RHS.getActiveBits();
- unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1);
+ unsigned rhsWords = getNumWords(RHS.getActiveBits());
assert(rhsWords && "Performing remainder operation by zero ???");
// Check the degenerate cases
}
// Get some size facts about the dividend and divisor
- unsigned lhsBits = LHS.getActiveBits();
- unsigned lhsWords = !lhsBits ? 0 : (APInt::whichWord(lhsBits - 1) + 1);
- unsigned rhsBits = RHS.getActiveBits();
- unsigned rhsWords = !rhsBits ? 0 : (APInt::whichWord(rhsBits - 1) + 1);
+ unsigned lhsWords = getNumWords(LHS.getActiveBits());
+ unsigned rhsWords = getNumWords(RHS.getActiveBits());
// Check the degenerate cases
if (lhsWords == 0) {