From dc0a67b53a824825ebf56bc9d9d7fe721552e87d Mon Sep 17 00:00:00 2001 From: skidau Date: Wed, 4 Aug 2010 11:07:40 +0000 Subject: [PATCH] Brings back any speed lost from r6040 while maintaining all speed gains. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6045 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/Src/PowerPC/JitCommon/Jit_Util.cpp | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp index a18088e66e..b01cc4c517 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/Jit_Util.cpp @@ -83,7 +83,14 @@ void EmuCodeBlock::SafeLoadRegToEAX(X64Reg reg_addr, int accessSize, s32 offset, if (offset) ADD(32, R(reg_addr), Imm32((u32)offset)); - TEST(32, R(reg_addr), Imm32(Memory::ADDR_MASK_HW_ACCESS | Memory::ADDR_MASK_MEM1)); + u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; + + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + { + mem_mask |= Memory::ADDR_MASK_MEM1; + } + + TEST(32, R(reg_addr), Imm32(mem_mask)); FixupBranch fast = J_CC(CC_Z); switch (accessSize) @@ -125,7 +132,14 @@ void EmuCodeBlock::SafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acce if (offset) ADD(32, R(reg_addr), Imm32((u32)offset)); - TEST(32, R(reg_addr), Imm32(Memory::ADDR_MASK_HW_ACCESS | Memory::ADDR_MASK_MEM1)); + u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; + + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + { + mem_mask |= Memory::ADDR_MASK_MEM1; + } + + TEST(32, R(reg_addr), Imm32(mem_mask)); FixupBranch fast = J_CC(CC_Z); switch (accessSize) @@ -142,7 +156,14 @@ void EmuCodeBlock::SafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acce void EmuCodeBlock::SafeWriteFloatToReg(X64Reg xmm_value, X64Reg reg_addr) { - TEST(32, R(reg_addr), Imm32(Memory::ADDR_MASK_HW_ACCESS | Memory::ADDR_MASK_MEM1)); + u32 mem_mask = Memory::ADDR_MASK_HW_ACCESS; + + if (Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.iTLBHack) + { + mem_mask |= Memory::ADDR_MASK_MEM1; + } + + TEST(32, R(reg_addr), Imm32(mem_mask)); if (false && cpu_info.bSSSE3) { // This path should be faster but for some reason it causes errors so I've disabled it. FixupBranch argh = J_CC(CC_Z);