From 8ff395406932b10f96bfee08db80268afde16907 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 21 Apr 2012 21:38:57 +1000 Subject: [PATCH] Added the memcheck for stXx. --- .../Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index 9a246008c6..c583ae349a 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -151,7 +151,7 @@ void Jit64::lXXx(UGeckoInstruction inst) // ! we must continue executing of the loop after exception handling, maybe there is still 0 in r0 //MOV(32, M(&PowerPC::ppcState.pc), Imm32(js.compilerPC)); - JMP(asm_routines.testExceptions, true); + JMP(asm_routines.testExceptions, true); SetJumpTarget(noIdle); @@ -405,10 +405,13 @@ void Jit64::stXx(UGeckoInstruction inst) gpr.Lock(a, b, s); gpr.FlushLockX(ECX, EDX); - if (inst.SUBOP10 & 32) { + if (inst.SUBOP10 & 32) + { + MEMCHECK_START gpr.BindToRegister(a, true, true); ADD(32, gpr.R(a), gpr.R(b)); MOV(32, R(EDX), gpr.R(a)); + MEMCHECK_END } else { MOV(32, R(EDX), gpr.R(a)); ADD(32, R(EDX), gpr.R(b)); @@ -425,12 +428,6 @@ void Jit64::stXx(UGeckoInstruction inst) MOV(32, R(ECX), gpr.R(s)); SafeWriteRegToReg(ECX, EDX, accessSize, 0); - //MEMCHECK_START - - // TODO: Insert rA update code here - - //MEMCHECK_END - gpr.UnlockAll(); gpr.UnlockAllX(); } @@ -438,6 +435,9 @@ void Jit64::stXx(UGeckoInstruction inst) // A few games use these heavily in video codecs. void Jit64::lmw(UGeckoInstruction inst) { + INSTRUCTION_START + JITDISABLE(LoadStore) + #ifdef _M_X64 gpr.FlushLockX(ECX); MOV(32, R(EAX), Imm32((u32)(s32)inst.SIMM_16)); @@ -458,6 +458,9 @@ void Jit64::lmw(UGeckoInstruction inst) void Jit64::stmw(UGeckoInstruction inst) { + INSTRUCTION_START + JITDISABLE(LoadStore) + #ifdef _M_X64 gpr.FlushLockX(ECX); MOV(32, R(EAX), Imm32((u32)(s32)inst.SIMM_16));