diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index d2294ba313..4329fc0a13 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -1480,9 +1480,9 @@ void Jit64::divwx(UGeckoInstruction inst) if (inst.OE) GenerateConstantOverflow(false); } - else if (MathUtil::IsPow2(divisor) || MathUtil::IsPow2(-divisor)) + else if (MathUtil::IsPow2(divisor) || MathUtil::IsPow2(-static_cast(divisor))) { - u32 abs_val = std::abs(divisor); + const u32 abs_val = static_cast(std::abs(static_cast(divisor))); X64Reg tmp = RSCRATCH; if (Ra.IsSimpleReg() && Ra.GetSimpleReg() != Rd) diff --git a/Source/Core/Core/PowerPC/JitCommon/DivUtils.h b/Source/Core/Core/PowerPC/JitCommon/DivUtils.h index b243e2654b..65ebb29832 100644 --- a/Source/Core/Core/PowerPC/JitCommon/DivUtils.h +++ b/Source/Core/Core/PowerPC/JitCommon/DivUtils.h @@ -16,7 +16,7 @@ struct Magic // Calculate the constants required to optimize a signed 32-bit integer division. // Taken from The PowerPC Compiler Writer's Guide and LLVM. -// Divisor must not be -1, 0, and 1. +// Divisor must not be -1, 0, 1 or INT_MIN. Magic SignedDivisionConstants(s32 divisor); } // namespace JitCommon