Add r149110 back with a fix for when the vector and the int have the same

width.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149151 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2012-01-27 23:33:07 +00:00
parent 0c6e177881
commit 04594aeffa
6 changed files with 78 additions and 9 deletions

View File

@ -1123,6 +1123,18 @@ APInt APInt::sextOrTrunc(unsigned width) const {
return *this;
}
APInt APInt::zextOrSelf(unsigned width) const {
if (BitWidth < width)
return zext(width);
return *this;
}
APInt APInt::sextOrSelf(unsigned width) const {
if (BitWidth < width)
return sext(width);
return *this;
}
/// Arithmetic right-shift this APInt by shiftAmt.
/// @brief Arithmetic right-shift function.
APInt APInt::ashr(const APInt &shiftAmt) const {