Skip to content

Instantly share code, notes, and snippets.

@FioraAeterna
Created October 3, 2014 20:38
Show Gist options
  • Select an option

  • Save FioraAeterna/36d1cbb60e8d1c542f02 to your computer and use it in GitHub Desktop.

Select an option

Save FioraAeterna/36d1cbb60e8d1c542f02 to your computer and use it in GitHub Desktop.
Dolphin: Profile code size, weighted by code use
diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp
index c99f707..4f82cda 100644
--- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp
+++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp
@@ -212,9 +212,9 @@ void Jit64::Init()
code_block.m_stats = &js.st;
code_block.m_gpa = &js.gpa;
code_block.m_fpa = &js.fpa;
- analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE);
+ //analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CONDITIONAL_CONTINUE);
analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_BRANCH_MERGE);
- analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CARRY_MERGE);
+ //analyzer.SetOption(PPCAnalyst::PPCAnalyzer::OPTION_CARRY_MERGE);
}
void Jit64::ClearCache()
@@ -747,6 +747,15 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc
fpr.BindToRegister(reg, true, false);
}
+ if (i == code_block.m_num_instructions - 1)
+ {
+ static u64 codeSize = 0;
+ static u64 origSize = 0;
+ ADD(64, M(&codeSize), Imm32((u32)(GetCodePtr() - normalEntry)));
+ ADD(64, M(&origSize), Imm32(code_block.m_num_instructions * 4));
+ ERROR_LOG(COMMON, "%f\n", (double)codeSize / origSize);
+ }
+
Jit64Tables::CompileInstruction(ops[i]);
// If we have a register that will never be used again, flush it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment