diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp index 41de8489ed82..a63e3826f071 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -1766,7 +1766,7 @@ int HexagonInstrInfo::getMinValue(const MachineInstr *MI) const { & HexagonII::ExtentBitsMask; if (isSigned) // if value is signed - return -1 << (bits - 1); + return -1U << (bits - 1); else return 0; } @@ -1780,9 +1780,9 @@ int HexagonInstrInfo::getMaxValue(const MachineInstr *MI) const { & HexagonII::ExtentBitsMask; if (isSigned) // if value is signed - return ~(-1 << (bits - 1)); + return ~(-1U << (bits - 1)); else - return ~(-1 << bits); + return ~(-1U << bits); } // Returns true if an instruction can be converted into a non-extended diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp index 98b8db076382..c842b9b7cf3d 100644 --- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp +++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp @@ -155,7 +155,7 @@ int HexagonMCInst::getMinValue(void) const { & HexagonII::ExtentBitsMask; if (isSigned) // if value is signed - return -1 << (bits - 1); + return -1U << (bits - 1); else return 0; } @@ -170,7 +170,7 @@ int HexagonMCInst::getMaxValue(void) const { & HexagonII::ExtentBitsMask; if (isSigned) // if value is signed - return ~(-1 << (bits - 1)); + return ~(-1U << (bits - 1)); else - return ~(-1 << bits); + return ~(-1U << bits); }