From 352ab2ba4394180739d7315c0c505aab83ffe211 Mon Sep 17 00:00:00 2001 From: marcosvitali Date: Tue, 13 Mar 2012 01:44:10 -0300 Subject: [PATCH] Improved the CheckException for the GatherPipe writes in JIT, now only the External Exceptions are processed. We Didn't Check 0x0008000 in PowerPC::ppcState.msr this was killing the performance, this also fix a hang when this check is performed. SMG for example. Deleted the HiWatermark condition from GPFifo. Please test games affected in this Revision 9e649ce79850, and games affected in this Revision b0f75f17ae19. I do not want to excite the game players of 'The Las Story', but Could test again the random hangs with this rev? Thanks --- Source/Core/Core/Src/HW/GPFifo.cpp | 2 +- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp index 9bae7bb621..77fdbf5933 100644 --- a/Source/Core/Core/Src/HW/GPFifo.cpp +++ b/Source/Core/Core/Src/HW/GPFifo.cpp @@ -99,7 +99,7 @@ void STACKALIGN CheckGatherPipe() // Profile where the FIFO writes are occurring. - if (g_video_backend->Video_IsHiWatermarkActive() && jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) + if (jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end())) { jit->js.fifoWriteAddresses.insert(PC); diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 417d1159da..b23964b071 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -576,14 +576,21 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc gpr.Flush(FLUSH_ALL); fpr.Flush(FLUSH_ALL); + + TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_ISI | EXCEPTION_PROGRAM | EXCEPTION_SYSCALL | EXCEPTION_FPU_UNAVAILABLE | EXCEPTION_DSI | EXCEPTION_ALIGNMENT | EXCEPTION_DECREMENTER)); + FixupBranch clearInt = J_CC(CC_NZ); TEST(32, M((void *)&PowerPC::ppcState.Exceptions), Imm32(EXCEPTION_EXTERNAL_INT)); FixupBranch noExtException = J_CC(CC_Z); - TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + TEST(32, M((void *)&PowerPC::ppcState.msr), Imm32(0x0008000)); FixupBranch noCPInt = J_CC(CC_Z); - + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); + FixupBranch noCPInt2 = J_CC(CC_Z); + MOV(32, M(&PC), Imm32(ops[i].address)); WriteExceptionExit(); + SetJumpTarget(clearInt); + SetJumpTarget(noCPInt2); SetJumpTarget(noCPInt); SetJumpTarget(noExtException); }