From 0b46610d49a6d112be8ca196dbb6c6e78d1bd53c Mon Sep 17 00:00:00 2001 From: "james.jdunne" Date: Wed, 5 Jan 2011 03:29:56 +0000 Subject: [PATCH] Changed order of operations in Profiler.cpp to calculate non-zero values for 'cost'. Integer division was too early. Credit to my brother, Joe, for figuring this one out. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6746 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/Profiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/PowerPC/Profiler.cpp b/Source/Core/Core/Src/PowerPC/Profiler.cpp index b52d4e91b9..ba3d334739 100644 --- a/Source/Core/Core/Src/PowerPC/Profiler.cpp +++ b/Source/Core/Core/Src/PowerPC/Profiler.cpp @@ -55,7 +55,7 @@ void WriteProfileResults(const char *filename) { for (int i = 0; i < jit->GetBlockCache()->GetNumBlocks(); i++) { const JitBlock *block = jit->GetBlockCache()->GetBlock(i); - u64 cost = (block->originalSize / 4) * block->runCount; // rough heuristic. mem instructions should cost more. + u64 cost = block->originalSize * (block->runCount / 4); // rough heuristic. mem instructions should cost more. #ifdef _WIN32 u64 timecost = block->ticCounter; // Indeed ;) #endif