Skip to content

Commit

Permalink
Fix MSVC "32-bit shift implicitly converted to 64 bits" warning. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
RKSimon committed Sep 25, 2023
1 parent 791b279 commit 98e8f04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2936,7 +2936,7 @@ bool AArch64InstrInfo::canFoldIntoAddrMode(const MachineInstr &MemI,
if (avoidSlowSTRQ(MemI))
return false;
}
return canFoldAddRegIntoAddrMode(1 << Shift);
return canFoldAddRegIntoAddrMode(1ULL << Shift);
}

case AArch64::ADDXrr:
Expand Down Expand Up @@ -2968,10 +2968,10 @@ bool AArch64InstrInfo::canFoldIntoAddrMode(const MachineInstr &MemI,
if (Extend != AArch64_AM::UXTW && Extend != AArch64_AM::SXTW)
return false;

return canFoldAddRegIntoAddrMode(1 << AArch64_AM::getArithShiftValue(Imm),
(Extend == AArch64_AM::SXTW)
? ExtAddrMode::Formula::SExtScaledReg
: ExtAddrMode::Formula::ZExtScaledReg);
return canFoldAddRegIntoAddrMode(
1ULL << AArch64_AM::getArithShiftValue(Imm),
(Extend == AArch64_AM::SXTW) ? ExtAddrMode::Formula::SExtScaledReg
: ExtAddrMode::Formula::ZExtScaledReg);
}
}

Expand Down

0 comments on commit 98e8f04

Please sign in to comment.