summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-03-28 04:00:47 +0000
committerCraig Topper <craig.topper@gmail.com>2017-03-28 04:00:47 +0000
commitf496f9a27304f72e11f2514b99f41a99991bc66b (patch)
tree9ab9c550b12931c5aec8579c180916a0fdf21551 /llvm/lib/Support
parentc4a1908681dfbac19239b956f811b0f666de0ecc (diff)
downloadbcm5719-llvm-f496f9a27304f72e11f2514b99f41a99991bc66b.tar.gz
bcm5719-llvm-f496f9a27304f72e11f2514b99f41a99991bc66b.zip
[APInt] Move the single word cases of the bitwise operators inline.
llvm-svn: 298894
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/APInt.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index f2c3a2db30c..d5543cafff6 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -406,36 +406,21 @@ APInt& APInt::operator*=(const APInt& RHS) {
return *this;
}
-APInt& APInt::operator&=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- VAL &= RHS.VAL;
- return *this;
- }
+APInt& APInt::AndAssignSlowCase(const APInt& RHS) {
unsigned numWords = getNumWords();
for (unsigned i = 0; i < numWords; ++i)
pVal[i] &= RHS.pVal[i];
return *this;
}
-APInt& APInt::operator|=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- VAL |= RHS.VAL;
- return *this;
- }
+APInt& APInt::OrAssignSlowCase(const APInt& RHS) {
unsigned numWords = getNumWords();
for (unsigned i = 0; i < numWords; ++i)
pVal[i] |= RHS.pVal[i];
return *this;
}
-APInt& APInt::operator^=(const APInt& RHS) {
- assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");
- if (isSingleWord()) {
- VAL ^= RHS.VAL;
- return *this;
- }
+APInt& APInt::XorAssignSlowCase(const APInt& RHS) {
unsigned numWords = getNumWords();
for (unsigned i = 0; i < numWords; ++i)
pVal[i] ^= RHS.pVal[i];
OpenPOWER on IntegriCloud