summaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2008-06-05 13:27:38 +0000
committerZhou Sheng <zhousheng00@gmail.com>2008-06-05 13:27:38 +0000
commitbfde7d6b9ea58a59edf61a5f93b2a86e5a9dae37 (patch)
tree1344f9a6597100e992eb617bd28bffc880832f79 /lib/Support
parentef7d2bb8d3b8f486d178440e9569e4f75f9c11a4 (diff)
downloadllvm-bfde7d6b9ea58a59edf61a5f93b2a86e5a9dae37.tar.gz
llvm-bfde7d6b9ea58a59edf61a5f93b2a86e5a9dae37.tar.bz2
llvm-bfde7d6b9ea58a59edf61a5f93b2a86e5a9dae37.tar.xz
As comments said, for negative value, the arithmetic
over-shift-right should return -1. So here it should be signed-extended, when bitwidth larger than 64. test case: llvm/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index ef35e1c554..e13011faea 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -1113,7 +1113,7 @@ APInt APInt::ashr(uint32_t shiftAmt) const {
// issues in the algorithm below.
if (shiftAmt == BitWidth) {
if (isNegative())
- return APInt(BitWidth, -1ULL);
+ return APInt(BitWidth, -1ULL, true);
else
return APInt(BitWidth, 0);
}