diff --git a/Core/MIPS/ARM/ArmCompBranch.cpp b/Core/MIPS/ARM/ArmCompBranch.cpp index 1780547b3f..25151c1729 100644 --- a/Core/MIPS/ARM/ArmCompBranch.cpp +++ b/Core/MIPS/ARM/ArmCompBranch.cpp @@ -49,7 +49,7 @@ #define _SIZE ((op>>11) & 0x1F) #define _IMM16 (signed short)(op & 0xFFFF) #define _IMM26 (op & 0x03FFFFFF) -#define TARGET16 ((int)((uint32_t)_IMM16 << 2)) +#define TARGET16 ((int)((uint32_t)(int)_IMM16 << 2)) #define TARGET26 (_IMM26 << 2) #define LOOPOPTIMIZATION 0 diff --git a/Core/MIPS/ARM64/Arm64CompBranch.cpp b/Core/MIPS/ARM64/Arm64CompBranch.cpp index 9212d0fc9b..e3914ee1a6 100644 --- a/Core/MIPS/ARM64/Arm64CompBranch.cpp +++ b/Core/MIPS/ARM64/Arm64CompBranch.cpp @@ -49,7 +49,7 @@ #define _SIZE ((op>>11) & 0x1F) #define _IMM16 (signed short)(op & 0xFFFF) #define _IMM26 (op & 0x03FFFFFF) -#define TARGET16 ((int)((uint32_t)_IMM16 << 2)) +#define TARGET16 ((int)((uint32_t)(int)_IMM16 << 2)) #define TARGET26 (_IMM26 << 2) #define LOOPOPTIMIZATION 0 diff --git a/Core/MIPS/IR/IRCompBranch.cpp b/Core/MIPS/IR/IRCompBranch.cpp index 959b7403ce..16a158b9fe 100644 --- a/Core/MIPS/IR/IRCompBranch.cpp +++ b/Core/MIPS/IR/IRCompBranch.cpp @@ -42,7 +42,7 @@ #define _SIZE ((op>>11) & 0x1F) #define _IMM16 (signed short)(op & 0xFFFF) #define _IMM26 (op & 0x03FFFFFF) -#define TARGET16 ((int)((uint32_t)_IMM16 << 2)) +#define TARGET16 ((int)((uint32_t)(int)_IMM16 << 2)) #define TARGET26 (_IMM26 << 2) #define LOOPOPTIMIZATION 0 diff --git a/Core/MIPS/MIPSCodeUtils.cpp b/Core/MIPS/MIPSCodeUtils.cpp index 97aa88309b..5f1253ee0a 100644 --- a/Core/MIPS/MIPSCodeUtils.cpp +++ b/Core/MIPS/MIPSCodeUtils.cpp @@ -30,7 +30,7 @@ namespace MIPSCodeUtils #define _RT ((op>>16) & 0x1F) #define _IMM16 (signed short)(op & 0xFFFF) #define _IMM26 (op & 0x03FFFFFF) -#define TARGET16 ((int)((uint32_t)_IMM16 << 2)) +#define TARGET16 ((int)((uint32_t)(int)_IMM16 << 2)) #define TARGET26 (_IMM26 << 2) u32 GetJumpTarget(u32 addr) { diff --git a/Core/MIPS/x86/CompBranch.cpp b/Core/MIPS/x86/CompBranch.cpp index 09b0cc09a1..4910e29655 100644 --- a/Core/MIPS/x86/CompBranch.cpp +++ b/Core/MIPS/x86/CompBranch.cpp @@ -48,7 +48,7 @@ #define _SIZE ((op>>11) & 0x1F) #define _IMM16 (signed short)(op & 0xFFFF) #define _IMM26 (op & 0x03FFFFFF) -#define TARGET16 ((int)((uint32_t)_IMM16 << 2)) +#define TARGET16 ((int)((uint32_t)(int)_IMM16 << 2)) #define TARGET26 (_IMM26 << 2) #define LOOPOPTIMIZATION 0