From 6a6fb9cce94d3c4474553eb078297439e6ea1586 Mon Sep 17 00:00:00 2001 From: skidau Date: Sun, 28 Nov 2010 05:28:21 +0000 Subject: LLE JIT: Added an ASM dispatcher. Should help pave the way for future optimisation. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6486 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DSPCore/Src/DSPCore.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'Source/Core/DSPCore/Src/DSPCore.cpp') diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp index 49726732c5..0609fb578b 100644 --- a/Source/Core/DSPCore/Src/DSPCore.cpp +++ b/Source/Core/DSPCore/Src/DSPCore.cpp @@ -37,6 +37,7 @@ SDSP g_dsp; DSPBreakpoints dsp_breakpoints; DSPCoreState core_state = DSPCORE_STOP; +int cyclesLeft = 0; DSPEmitter *jit = NULL; Common::Event step_event; @@ -71,6 +72,7 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename, bool bUsingJIT) { g_dsp.step_counter = 0; + cyclesLeft = 0; jit = NULL; g_dsp.irom = (u16*)AllocateMemoryPages(DSP_IROM_BYTE_SIZE); @@ -224,13 +226,18 @@ void DSPCore_CheckExceptions() // Handle state changes and stepping. int DSPCore_RunCycles(int cycles) { - static int spare_cycles = 0; if (jit) { // DSPCore_CheckExceptions(); // DSPCore_CheckExternalInterrupt(); - spare_cycles = jit->RunForCycles(cycles + spare_cycles); - return 0; + cyclesLeft = cycles; + + CompiledCode pExecAddr = (CompiledCode)jit->enterDispatcher; + pExecAddr(); + + // To use the C++ dispatcher, uncomment the line below and comment out the two lines above + //jit->RunForCycles(cyclesLeft); + return cyclesLeft; } while (cycles > 0) { @@ -284,7 +291,8 @@ void DSPCore_Step() step_event.Set(); } -void CompileCurrent() { +void CompileCurrent() +{ jit->Compile(g_dsp.pc); } -- cgit v1.2.3