aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-02-29 01:40:47 +0000
committerDan Gohman <gohman@apple.com>2008-02-29 01:40:47 +0000
commit625ff8ddaeec92052c410ceb1cb30252e42eae6c (patch)
tree23d18a74d0cd16af8b3b94980f7c675f0077dd27 /include
parenta31d51a0ed1cc98dd6b5244e614e8f781d853d89 (diff)
downloadexternal_llvm-625ff8ddaeec92052c410ceb1cb30252e42eae6c.zip
external_llvm-625ff8ddaeec92052c410ceb1cb30252e42eae6c.tar.gz
external_llvm-625ff8ddaeec92052c410ceb1cb30252e42eae6c.tar.bz2
Add support to APInt for shift and rotate operations with APInt
instead of uint32_t for the shift/rotate count operand type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/APInt.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index bf3f80c..737c5e6 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -584,6 +584,10 @@ public:
return shl(Bits);
}
+ APInt operator<<(const APInt &Bits) const {
+ return shl(Bits);
+ }
+
/// Arithmetic right-shift this APInt by shiftAmt.
/// @brief Arithmetic right-shift function.
APInt ashr(uint32_t shiftAmt) const;
@@ -602,6 +606,24 @@ public:
/// @brief Rotate right by rotateAmt.
APInt rotr(uint32_t rotateAmt) const;
+ /// Arithmetic right-shift this APInt by shiftAmt.
+ /// @brief Arithmetic right-shift function.
+ APInt ashr(const APInt &shiftAmt) const;
+
+ /// Logical right-shift this APInt by shiftAmt.
+ /// @brief Logical right-shift function.
+ APInt lshr(const APInt &shiftAmt) const;
+
+ /// Left-shift this APInt by shiftAmt.
+ /// @brief Left-shift function.
+ APInt shl(const APInt &shiftAmt) const;
+
+ /// @brief Rotate left by rotateAmt.
+ APInt rotl(const APInt &rotateAmt) const;
+
+ /// @brief Rotate right by rotateAmt.
+ APInt rotr(const APInt &rotateAmt) const;
+
/// Perform an unsigned divide operation on this APInt by RHS. Both this and
/// RHS are treated as unsigned quantities for purposes of this division.
/// @returns a new APInt value containing the division result