forked from OSchip/llvm-project
[APInt] Inline the single word case of lshrInPlace similar to what we do for <<=.
llvm-svn: 300577
This commit is contained in:
parent
9398649fea
commit
ae8bd67d96
|
@ -191,6 +191,9 @@ private:
|
|||
/// out-of-line slow case for shl
|
||||
void shlSlowCase(unsigned ShiftAmt);
|
||||
|
||||
/// out-of-line slow case for lshr.
|
||||
void lshrSlowCase(unsigned ShiftAmt);
|
||||
|
||||
/// out-of-line slow case for operator=
|
||||
APInt &AssignSlowCase(const APInt &RHS);
|
||||
|
||||
|
@ -889,7 +892,16 @@ public:
|
|||
}
|
||||
|
||||
/// Logical right-shift this APInt by ShiftAmt in place.
|
||||
void lshrInPlace(unsigned ShiftAmt);
|
||||
void lshrInPlace(unsigned ShiftAmt) {
|
||||
if (isSingleWord()) {
|
||||
if (ShiftAmt >= BitWidth)
|
||||
VAL = 0;
|
||||
else
|
||||
VAL >>= ShiftAmt;
|
||||
return;
|
||||
}
|
||||
lshrSlowCase(ShiftAmt);
|
||||
}
|
||||
|
||||
/// \brief Left-shift function.
|
||||
///
|
||||
|
|
|
@ -1140,15 +1140,7 @@ void APInt::lshrInPlace(const APInt &shiftAmt) {
|
|||
|
||||
/// Logical right-shift this APInt by shiftAmt.
|
||||
/// @brief Logical right-shift function.
|
||||
void APInt::lshrInPlace(unsigned ShiftAmt) {
|
||||
if (isSingleWord()) {
|
||||
if (ShiftAmt >= BitWidth)
|
||||
VAL = 0;
|
||||
else
|
||||
VAL >>= ShiftAmt;
|
||||
return;
|
||||
}
|
||||
|
||||
void APInt::lshrSlowCase(unsigned ShiftAmt) {
|
||||
tcShiftRight(pVal, getNumWords(), ShiftAmt);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue