[APInt] Implement AndAssignSlowCase using tcAnd. Do the same for Or and Xor. NFCI

llvm-svn: 299317
This commit is contained in:
Craig Topper 2017-04-01 21:50:03 +00:00
parent d143a0c2de
commit b2aaa5da42

View File

@ -407,23 +407,17 @@ APInt& APInt::operator*=(const APInt& RHS) {
}
APInt& APInt::AndAssignSlowCase(const APInt& RHS) {
unsigned numWords = getNumWords();
for (unsigned i = 0; i < numWords; ++i)
pVal[i] &= RHS.pVal[i];
tcAnd(pVal, RHS.pVal, getNumWords());
return *this;
}
APInt& APInt::OrAssignSlowCase(const APInt& RHS) {
unsigned numWords = getNumWords();
for (unsigned i = 0; i < numWords; ++i)
pVal[i] |= RHS.pVal[i];
tcOr(pVal, RHS.pVal, getNumWords());
return *this;
}
APInt& APInt::XorAssignSlowCase(const APInt& RHS) {
unsigned numWords = getNumWords();
for (unsigned i = 0; i < numWords; ++i)
pVal[i] ^= RHS.pVal[i];
tcXor(pVal, RHS.pVal, getNumWords());
return *this;
}