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
This commit is contained in:
skidau 2010-08-04 11:07:40 +00:00
parent f5d48a46ee
commit dc0a67b53a
1 changed files with 24 additions and 3 deletions

View File

@ -83,7 +83,14 @@ void EmuCodeBlock::SafeLoadRegToEAX(X64Reg reg_addr, int accessSize, s32 offset,
if (offset) if (offset)
ADD(32, R(reg_addr), Imm32((u32)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); FixupBranch fast = J_CC(CC_Z);
switch (accessSize) switch (accessSize)
@ -125,7 +132,14 @@ void EmuCodeBlock::SafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acce
if (offset) if (offset)
ADD(32, R(reg_addr), Imm32((u32)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); FixupBranch fast = J_CC(CC_Z);
switch (accessSize) 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) 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) { if (false && cpu_info.bSSSE3) {
// This path should be faster but for some reason it causes errors so I've disabled it. // This path should be faster but for some reason it causes errors so I've disabled it.
FixupBranch argh = J_CC(CC_Z); FixupBranch argh = J_CC(CC_Z);