summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-12-23 16:32:03 +0100
committerJosJuice <josjuice@gmail.com>2020-12-23 17:34:32 +0100
commit2dcd0b248fd78ebdc7a6b1f228454b154f2d7732 (patch)
treeef0dd3b8754043f9d459f61fe89d5fdb7f8d810c /Source/Core
parentf8f3548ca99b8e35a6d6c10533f8fb0c3df2ef8f (diff)
CachedInterpreter: Call UpdatePerformanceMonitor
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp b/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp
index eea5b63988..17b91a6627 100644
--- a/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp
+++ b/Source/Core/Core/PowerPC/CachedInterpreter/CachedInterpreter.cpp
@@ -134,6 +134,17 @@ static void EndBlock(UGeckoInstruction data)
{
PC = NPC;
PowerPC::ppcState.downcount -= data.hex;
+ PowerPC::UpdatePerformanceMonitor(data.hex, 0, 0);
+}
+
+static void UpdateNumLoadStoreInstructions(UGeckoInstruction data)
+{
+ PowerPC::UpdatePerformanceMonitor(0, data.hex, 0);
+}
+
+static void UpdateNumFloatingPointInstructions(UGeckoInstruction data)
+{
+ PowerPC::UpdatePerformanceMonitor(0, 0, data.hex);
}
static void WritePC(UGeckoInstruction data)
@@ -230,6 +241,8 @@ void CachedInterpreter::Jit(u32 address)
js.firstFPInstructionFound = false;
js.fifoBytesSinceCheck = 0;
js.downcountAmount = 0;
+ js.numLoadStoreInst = 0;
+ js.numFloatingPointInst = 0;
js.curBlock = b;
b->checkedEntry = GetCodePtr();
@@ -240,6 +253,10 @@ void CachedInterpreter::Jit(u32 address)
PPCAnalyst::CodeOp& op = m_code_buffer[i];
js.downcountAmount += op.opinfo->numCycles;
+ if (op.opinfo->flags & FL_LOADSTORE)
+ ++js.numLoadStoreInst;
+ if (op.opinfo->flags & FL_USE_FPU)
+ ++js.numFloatingPointInst;
if (HandleFunctionHooking(op.address))
break;
@@ -274,13 +291,19 @@ void CachedInterpreter::Jit(u32 address)
if (idle_loop)
m_code.emplace_back(CheckIdle, js.blockStart);
if (endblock)
+ {
m_code.emplace_back(EndBlock, js.downcountAmount);
+ m_code.emplace_back(UpdateNumLoadStoreInstructions, js.numLoadStoreInst);
+ m_code.emplace_back(UpdateNumFloatingPointInstructions, js.numFloatingPointInst);
+ }
}
}
if (code_block.m_broken)
{
m_code.emplace_back(WriteBrokenBlockNPC, nextPC);
m_code.emplace_back(EndBlock, js.downcountAmount);
+ m_code.emplace_back(UpdateNumLoadStoreInstructions, js.numLoadStoreInst);
+ m_code.emplace_back(UpdateNumFloatingPointInstructions, js.numFloatingPointInst);
}
m_code.emplace_back();