Jit64: Use LoadAndSwap/SwapAndStore where it makes sense.

This commit is contained in:
Pierre Bourdon 2014-03-16 04:08:51 +01:00
parent 6cb42859d4
commit 745fe14269
2 changed files with 6 additions and 10 deletions

View File

@ -314,8 +314,7 @@ void Jit64::stX(UGeckoInstruction inst)
else if (Memory::IsRAMAddress(addr)) else if (Memory::IsRAMAddress(addr))
{ {
MOV(32, R(EAX), gpr.R(s)); MOV(32, R(EAX), gpr.R(s));
BSWAP(accessSize, EAX); WriteToConstRamAddress(accessSize, EAX, addr, true);
WriteToConstRamAddress(accessSize, R(EAX), addr);
if (update) if (update)
gpr.SetImmediate32(a, addr); gpr.SetImmediate32(a, addr);
return; return;
@ -344,10 +343,10 @@ void Jit64::stX(UGeckoInstruction inst)
gpr.FlushLockX(ABI_PARAM1); gpr.FlushLockX(ABI_PARAM1);
MOV(32, R(ABI_PARAM1), gpr.R(a)); MOV(32, R(ABI_PARAM1), gpr.R(a));
MOV(32, R(EAX), gpr.R(s)); MOV(32, R(EAX), gpr.R(s));
BSWAP(32, EAX);
#if _M_X86_64 #if _M_X86_64
MOV(accessSize, MComplex(RBX, ABI_PARAM1, SCALE_1, (u32)offset), R(EAX)); SwapAndStore(accessSize, MComplex(RBX, ABI_PARAM1, SCALE_1, (u32)offset), EAX);
#else #else
BSWAP(32, EAX);
AND(32, R(ABI_PARAM1), Imm32(Memory::MEMVIEW32_MASK)); AND(32, R(ABI_PARAM1), Imm32(Memory::MEMVIEW32_MASK));
MOV(accessSize, MDisp(ABI_PARAM1, (u32)Memory::base + (u32)offset), R(EAX)); MOV(accessSize, MDisp(ABI_PARAM1, (u32)Memory::base + (u32)offset), R(EAX));
#endif #endif
@ -456,8 +455,7 @@ void Jit64::lmw(UGeckoInstruction inst)
ADD(32, R(EAX), gpr.R(inst.RA)); ADD(32, R(EAX), gpr.R(inst.RA));
for (int i = inst.RD; i < 32; i++) for (int i = inst.RD; i < 32; i++)
{ {
MOV(32, R(ECX), MComplex(EBX, EAX, SCALE_1, (i - inst.RD) * 4)); LoadAndSwap(32, ECX, MComplex(EBX, EAX, SCALE_1, (i - inst.RD) * 4));
BSWAP(32, ECX);
gpr.BindToRegister(i, false, true); gpr.BindToRegister(i, false, true);
MOV(32, gpr.R(i), R(ECX)); MOV(32, gpr.R(i), R(ECX));
} }
@ -481,8 +479,7 @@ void Jit64::stmw(UGeckoInstruction inst)
for (int i = inst.RD; i < 32; i++) for (int i = inst.RD; i < 32; i++)
{ {
MOV(32, R(ECX), gpr.R(i)); MOV(32, R(ECX), gpr.R(i));
BSWAP(32, ECX); SwapAndStore(32, MComplex(EBX, EAX, SCALE_1, (i - inst.RD) * 4), ECX);
MOV(32, MComplex(EBX, EAX, SCALE_1, (i - inst.RD) * 4), R(ECX));
} }
gpr.UnlockAllX(); gpr.UnlockAllX();
#else #else

View File

@ -96,8 +96,7 @@ void Jit64::lfd(UGeckoInstruction inst)
MOVSD(xd, R(XMM0)); MOVSD(xd, R(XMM0));
} else { } else {
#if _M_X86_64 #if _M_X86_64
MOV(64, R(EAX), MComplex(RBX, ABI_PARAM1, SCALE_1, offset)); LoadAndSwap(64, EAX, MComplex(RBX, ABI_PARAM1, SCALE_1, offset));
BSWAP(64, EAX);
MOV(64, M(&temp64), R(EAX)); MOV(64, M(&temp64), R(EAX));
MEMCHECK_START MEMCHECK_START