diff options
| author | nakeee <nakeee@gmail.com> | 2010-04-07 15:04:45 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2010-04-07 15:04:45 +0000 |
| commit | 499936561a0683d6798c6edfa0b86b1ffcba8ec0 (patch) | |
| tree | 753037fea47837c2ae6bc6eb88e01f81f378a58f /Source/Core/DSPCore/Src/DSPCore.cpp | |
| parent | 1b96bef8e1ee40fdaff7636b9b17b3e71c683dc7 (diff) | |
DSP LLE Jit, joined work with XK and skidu.
VERY EXPERIMENTAL DON'T EXPECT HIGH PERFORMANCE!.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5288 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPCore.cpp')
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPCore.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp index 06fe875911..44ea934b5e 100644 --- a/Source/Core/DSPCore/Src/DSPCore.cpp +++ b/Source/Core/DSPCore/Src/DSPCore.cpp @@ -26,6 +26,7 @@ #include "Common.h" #include "Thread.h" #include "DSPCore.h" +#include "DSPEmitter.h" #include "DSPHost.h" #include "DSPAnalyzer.h" #include "MemoryUtil.h" @@ -36,6 +37,7 @@ SDSP g_dsp; DSPBreakpoints dsp_breakpoints; DSPCoreState core_state = DSPCORE_RUNNING; +DSPEmitter *jit = NULL; Common::Event step_event; static bool LoadRom(const char *fname, int size_in_words, u16 *rom) @@ -65,10 +67,12 @@ static bool LoadRom(const char *fname, int size_in_words, u16 *rom) return false; } -bool DSPCore_Init(const char *irom_filename, const char *coef_filename) +bool DSPCore_Init(const char *irom_filename, const char *coef_filename, + bool bUsingJIT) { g_dsp.step_counter = 0; - + jit = NULL; + g_dsp.irom = (u16*)AllocateMemoryPages(DSP_IROM_BYTE_SIZE); g_dsp.iram = (u16*)AllocateMemoryPages(DSP_IRAM_BYTE_SIZE); g_dsp.dram = (u16*)AllocateMemoryPages(DSP_DRAM_BYTE_SIZE); @@ -124,7 +128,13 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename) // Mostly keep IRAM write protected. We unprotect only when DMA-ing // in new ucodes. WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false); + + // Initialize JIT, if necessary + if(bUsingJIT) + jit = new DSPEmitter(); + DSPAnalyzer::Analyze(); + step_event.Init(); return true; @@ -132,6 +142,10 @@ bool DSPCore_Init(const char *irom_filename, const char *coef_filename) void DSPCore_Shutdown() { + if(jit) { + delete jit; + jit = NULL; + } step_event.Shutdown(); FreeMemoryPages(g_dsp.irom, DSP_IROM_BYTE_SIZE); FreeMemoryPages(g_dsp.iram, DSP_IRAM_BYTE_SIZE); @@ -214,10 +228,14 @@ void DSPCore_CheckExceptions() } } -// Delegate to JIT (when it is written) or interpreter as appropriate. +// Delegate to JIT or interpreter as appropriate. // Handle state changes and stepping. int DSPCore_RunCycles(int cycles) { + if(jit) { + jit->RunBlock(cycles); + return 0; + } while (cycles > 0) { reswitch: switch (core_state) @@ -266,3 +284,8 @@ void DSPCore_Step() if (core_state == DSPCORE_STEPPING) step_event.Set(); } + +void CompileCurrent() { + jit->Compile(g_dsp.pc); +} + |
