From d08abfc14e857c236043ff8414ea48499c4904cf Mon Sep 17 00:00:00 2001 From: Yuriy O'Donnell Date: Fri, 23 May 2014 20:40:29 +0200 Subject: [PATCH] JIT: JitBaseBlockCache::InvalidateICache no longer memsets iCache memory to INVALID_BYTE. This is redundant, since we reset the valid_block bits any way. However, this was a source of a significant performance issues in some games. In particular, Metal Gear Solid: Twin Snakes. --- .../Core/Core/PowerPC/JitCommon/JitCache.cpp | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp index 30856fb48f..c4cb493a78 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp @@ -376,30 +376,6 @@ using namespace Gen; block_map.erase(it1, it2); } } - - // invalidate iCache. - // icbi can be called with any address, so we should check - if ((address & ~JIT_ICACHE_MASK) != 0x80000000 && (address & ~JIT_ICACHE_MASK) != 0x00000000 && - (address & ~JIT_ICACHE_MASK) != 0x7e000000 && // TLB area - (address & ~JIT_ICACHEEX_MASK) != 0x90000000 && (address & ~JIT_ICACHEEX_MASK) != 0x10000000) - { - return; - } - if (address & JIT_ICACHE_VMEM_BIT) - { - u32 cacheaddr = address & JIT_ICACHE_MASK; - memset(iCacheVMEM + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); - } - else if (address & JIT_ICACHE_EXRAM_BIT) - { - u32 cacheaddr = address & JIT_ICACHEEX_MASK; - memset(iCacheEx + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); - } - else - { - u32 cacheaddr = address & JIT_ICACHE_MASK; - memset(iCache + cacheaddr, JIT_ICACHE_INVALID_BYTE, length); - } } void JitBlockCache::WriteLinkBlock(u8* location, const u8* address) {