mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
[APInt] Add support for multiplying by a uint64_t.
This makes multiply similar to add, sub, xor, and, and or. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302402 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -256,6 +256,16 @@ APInt& APInt::operator*=(const APInt& RHS) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
APInt& APInt::operator*=(uint64_t RHS) {
|
||||
if (isSingleWord()) {
|
||||
U.VAL *= RHS;
|
||||
} else {
|
||||
unsigned NumWords = getNumWords();
|
||||
tcMultiplyPart(U.pVal, U.pVal, RHS, 0, NumWords, NumWords, false);
|
||||
}
|
||||
return clearUnusedBits();
|
||||
}
|
||||
|
||||
bool APInt::EqualSlowCase(const APInt& RHS) const {
|
||||
return std::equal(U.pVal, U.pVal + getNumWords(), RHS.U.pVal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user