mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 11:33:24 +02:00
[APInt] Don't shift into the sign bit
This fixes PR28294. llvm-svn: 273722
This commit is contained in:
parent
c9778ed077
commit
60b0be69b7
@ -555,8 +555,8 @@ bool APInt::ult(const APInt& RHS) const {
|
||||
bool APInt::slt(const APInt& RHS) const {
|
||||
assert(BitWidth == RHS.BitWidth && "Bit widths must be same for comparison");
|
||||
if (isSingleWord()) {
|
||||
int64_t lhsSext = (int64_t(VAL) << (64-BitWidth)) >> (64-BitWidth);
|
||||
int64_t rhsSext = (int64_t(RHS.VAL) << (64-BitWidth)) >> (64-BitWidth);
|
||||
int64_t lhsSext = SignExtend64(VAL, BitWidth);
|
||||
int64_t rhsSext = SignExtend64(RHS.VAL, BitWidth);
|
||||
return lhsSext < rhsSext;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user