mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 08:46:37 +00:00
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
This commit is contained in:
parent
ef7d2bb8d3
commit
bfde7d6b9e
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user