summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit1247c077429d60fcbc2845c300a7d372bdb3bec4 (patch)
treefbdad87a6d757940d72fa2517289af1463676ef3 /llvm/lib/Support
parent0702adc65ebc3a96084132809bce44c89bc01db1 (diff)
downloadbcm5719-llvm-1247c077429d60fcbc2845c300a7d372bdb3bec4.tar.gz
bcm5719-llvm-1247c077429d60fcbc2845c300a7d372bdb3bec4.zip
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 llvm-svn: 51999
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index ef35e1c554c..e13011faeac 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud