Skip to content

Commit

Permalink
[APInt] Implement AndAssignSlowCase using tcAnd. Do the same for Or a…
Browse files Browse the repository at this point in the history
…nd Xor. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299317 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Apr 1, 2017
1 parent 2ea3d99 commit e222bad
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/Support/APInt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e222bad

Please sign in to comment.