Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
- index a8277d8..0df0318 100644
- --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
- +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
- @@ -99,6 +99,7 @@ void Trace( UGeckoInstruction &instCode )
- int Interpreter::SingleStepInner(void)
- {
- static UGeckoInstruction instCode;
- + GekkoOPInfo *opinfo = GetOpInfo(instCode);
- NPC = PC + sizeof(UGeckoInstruction);
- instCode.hex = Memory::Read_Opcode(PC);
- @@ -144,6 +145,13 @@ int Interpreter::SingleStepInner(void)
- PowerPC::CheckExceptions();
- m_EndBlock = true;
- }
- + if (opinfo->flags & FL_LOADSTORE)
- + ++PowerPC::ppcState.numLoadStoreInst;
- + if (opinfo->flags & FL_USE_FPU)
- + ++PowerPC::ppcState.numFloatingPointInst;
- + if (MMCR0.Hex || MMCR1.Hex)
- + PowerPC::UpdatePerformanceMonitor(opinfo->numCyclesMinusOne + 1, PowerPC::ppcState.numLoadStoreInst,
- + PowerPC::ppcState.numFloatingPointInst);
- }
- }
- else
- @@ -164,7 +172,6 @@ int Interpreter::SingleStepInner(void)
- #endif
- patches();
- - GekkoOPInfo *opinfo = GetOpInfo(instCode);
- return opinfo->numCyclesMinusOne + 1;
- }
- diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp
- index 8d27619..72f859e 100644
- --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp
- +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp
- @@ -297,7 +297,7 @@ void Jit64::Cleanup()
- // SPEED HACK: MMCR0/MMCR1 should be checked at run-time, not at compile time.
- if (MMCR0.Hex || MMCR1.Hex)
- - ABI_CallFunctionCCC((void *)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, jit->js.numLoadStoreInst, jit->js.numFloatingPointInst);
- + ABI_CallFunctionCCC((void *)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, PowerPC::ppcState.numLoadStoreInst, PowerPC::ppcState.numFloatingPointInst);
- }
- void Jit64::WriteExit(u32 destination, int exit_num)
- @@ -460,8 +460,6 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
- js.curBlock = b;
- js.block_flags = 0;
- js.cancel = false;
- - jit->js.numLoadStoreInst = 0;
- - jit->js.numFloatingPointInst = 0;
- // Analyze the block, collect all instructions it is made of (including inlining,
- // if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
- @@ -645,10 +643,9 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
- }
- if (opinfo->flags & FL_LOADSTORE)
- - ++jit->js.numLoadStoreInst;
- -
- + ++PowerPC::ppcState.numLoadStoreInst;
- if (opinfo->flags & FL_USE_FPU)
- - ++jit->js.numFloatingPointInst;
- + ++PowerPC::ppcState.numFloatingPointInst;
- }
- #if defined(_DEBUG) || defined(DEBUGFAST)
- diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp
- index 1187956..215b470 100644
- --- a/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp
- +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/JitIL.cpp
- @@ -393,7 +393,7 @@ void JitIL::Cleanup()
- // SPEED HACK: MMCR0/MMCR1 should be checked at run-time, not at compile time.
- if (MMCR0.Hex || MMCR1.Hex)
- - ABI_CallFunctionCCC((void *)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, jit->js.numLoadStoreInst, jit->js.numFloatingPointInst);
- + ABI_CallFunctionCCC((void *)&PowerPC::UpdatePerformanceMonitor, js.downcountAmount, PowerPC::ppcState.numLoadStoreInst, PowerPC::ppcState.numFloatingPointInst);
- }
- void JitIL::WriteExit(u32 destination, int exit_num)
- @@ -551,8 +551,6 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
- js.fifoBytesThisBlock = 0;
- js.curBlock = b;
- js.cancel = false;
- - jit->js.numLoadStoreInst = 0;
- - jit->js.numFloatingPointInst = 0;
- // Analyze the block, collect all instructions it is made of (including inlining,
- // if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
- @@ -674,10 +672,10 @@ const u8* JitIL::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
- }
- if (opinfo->flags & FL_LOADSTORE)
- - ++jit->js.numLoadStoreInst;
- + ++PowerPC::ppcState.numLoadStoreInst;
- if (opinfo->flags & FL_USE_FPU)
- - ++jit->js.numFloatingPointInst;
- + ++PowerPC::ppcState.numFloatingPointInst;
- }
- }
- diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h
- index 5352c06..b643753 100644
- --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h
- +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitBase.h
- @@ -57,9 +57,7 @@ protected:
- int blockSize;
- int instructionNumber;
- int downcountAmount;
- - u32 numLoadStoreInst;
- - u32 numFloatingPointInst;
- -
- +
- bool firstFPInstructionFound;
- bool isLastInstruction;
- bool forceUnsafeLoad;
- diff --git a/Source/Core/Core/Src/PowerPC/PowerPC.cpp b/Source/Core/Core/Src/PowerPC/PowerPC.cpp
- index d444733..724d65d 100644
- --- a/Source/Core/Core/Src/PowerPC/PowerPC.cpp
- +++ b/Source/Core/Core/Src/PowerPC/PowerPC.cpp
- @@ -278,7 +278,7 @@ void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst)
- PowerPC::ppcState.spr[SPR_PMC2] += cycles;
- break;
- case 11: // Number of loads and stores completed
- - PowerPC::ppcState.spr[SPR_PMC2] += num_load_stores;
- + PowerPC::ppcState.spr[SPR_PMC2] = num_load_stores;
- break;
- default:
- break;
- @@ -292,7 +292,7 @@ void UpdatePerformanceMonitor(u32 cycles, u32 num_load_stores, u32 num_fp_inst)
- PowerPC::ppcState.spr[SPR_PMC3] += cycles;
- break;
- case 11: // Number of FPU instructions completed
- - PowerPC::ppcState.spr[SPR_PMC3] += num_fp_inst;
- + PowerPC::ppcState.spr[SPR_PMC3] = num_fp_inst;
- break;
- default:
- break;
- diff --git a/Source/Core/Core/Src/PowerPC/PowerPC.h b/Source/Core/Core/Src/PowerPC/PowerPC.h
- index e0b4bfa..4e236ac 100644
- --- a/Source/Core/Core/Src/PowerPC/PowerPC.h
- +++ b/Source/Core/Core/Src/PowerPC/PowerPC.h
- @@ -77,6 +77,9 @@ struct GC_ALIGNED64(PowerPCState)
- u32 itlb_va[128];
- u32 itlb_pa[128];
- + u32 numLoadStoreInst;
- + u32 numFloatingPointInst;
- +
- InstructionCache iCache;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement