diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-27 23:33:07 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-27 23:33:07 +0000 |
commit | bb893fea6b142c52d7d73fb3fd4332e31d11644d (patch) | |
tree | 174dbbd93c9e9fc4fed2a00cdb3b14ba95d8b459 /llvm/lib/Support | |
parent | 400dd1c3d03733a57a3cc8f9870b5fcab388d62a (diff) | |
download | bcm5719-llvm-bb893fea6b142c52d7d73fb3fd4332e31d11644d.tar.gz bcm5719-llvm-bb893fea6b142c52d7d73fb3fd4332e31d11644d.zip |
Add r149110 back with a fix for when the vector and the int have the same
width.
llvm-svn: 149151
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index b5411bec9d4..c580dd3ba3e 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -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 { |