Make the results for the rotate functions correct when rotateAmt == 0.

llvm-svn: 37026
This commit is contained in:
Reid Spencer 2007-05-14 00:15:28 +00:00
parent 4c50b52f63
commit 98ed7db7ab
1 changed files with 4 additions and 0 deletions

View File

@ -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);