aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-05-14 00:15:28 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-05-14 00:15:28 +0000
commit69944e85aa63d5a067692f6e680b6939fe7d4131 (patch)
tree2967d9db3ad2c766744d8c37bc94866614bb80f3 /lib/Support/APInt.cpp
parent19dc32a2d422ac0aafd047514e3e5e727796696e (diff)
Make the results for the rotate functions correct when rotateAmt == 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 3501774967..c8c3c24627 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -1249,6 +1249,8 @@ APInt APInt::shl(uint32_t shiftAmt) const {
}
APInt APInt::rotl(uint32_t rotateAmt) const {
+ if (rotateAmt == 0)
+ return *this;
// Don't get too fancy, just use existing shift/or facilities
APInt hi(*this);
APInt lo(*this);
@@ -1258,6 +1260,8 @@ APInt APInt::rotl(uint32_t rotateAmt) const {
}
APInt APInt::rotr(uint32_t rotateAmt) const {
+ if (rotateAmt == 0)
+ return *this;
// Don't get too fancy, just use existing shift/or facilities
APInt hi(*this);
APInt lo(*this);