diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp index c3e3e2fdfc..840dd672c5 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp @@ -324,9 +324,20 @@ using namespace Gen; { XEmitter emit(location); if (*location == 0xE8) + { emit.CALL(address); + } else - emit.JMP(address, true); + { + // If we're going to link with the next block, there is no need + // to emit JMP. So just NOP out the gap to the next block. + // Support up to 3 additional bytes because of alignment. + s64 offset = address - emit.GetCodePtr(); + if (offset > 0 && offset <= 5 + 3) + emit.NOP(offset); + else + emit.JMP(address, true); + } } void JitBlockCache::WriteDestroyBlock(const u8* location, u32 address)