diff options
| author | pierre <pierre@pirsoft.de> | 2010-10-14 13:17:38 +0000 |
|---|---|---|
| committer | pierre <pierre@pirsoft.de> | 2010-10-14 13:17:38 +0000 |
| commit | 6d2c35a332e06c31bdbfdb2eabe147e8e947d9b2 (patch) | |
| tree | 518dc7833d486eecfe12c7ca89a7b7c38b090eb3 /Source/Core/DSPCore/Src/DSPEmitter.cpp | |
| parent | 47eb5c3416780007318247757a688528df5141ea (diff) | |
Core/DSPCore: Jit: only end emitting the current block when hitting an
unconditional branch(or idle skip), emit check g_dsp.pc and return when
hitting a conditional branch.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6281 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPEmitter.cpp')
| -rw-r--r-- | Source/Core/DSPCore/Src/DSPEmitter.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/Source/Core/DSPCore/Src/DSPEmitter.cpp b/Source/Core/DSPCore/Src/DSPEmitter.cpp index 8347852c48..7b0a27c362 100644 --- a/Source/Core/DSPCore/Src/DSPEmitter.cpp +++ b/Source/Core/DSPCore/Src/DSPEmitter.cpp @@ -225,10 +225,31 @@ const u8 *DSPEmitter::Compile(int start_addr) { SetJumpTarget(rLoopCounterExit); } - // End the block if we're at a loop end. - if (opcode->branch || - (DSPAnalyzer::code_flags[addr-1] & DSPAnalyzer::CODE_LOOP_END) || - (DSPAnalyzer::code_flags[addr] & DSPAnalyzer::CODE_IDLE_SKIP)) { + if (opcode->branch) { + if (opcode->uncond_branch) { + break; + } else { + //look at g_dsp.pc if we actually branched +#ifdef _M_IX86 // All32 + MOV(16, R(AX), M(&(g_dsp.pc))); +#else + MOV(64, R(RAX), ImmPtr(&(g_dsp.pc))); + MOV(16, R(AX), MDisp(RAX,0)); +#endif + CMP(16, R(AX), Imm16(addr)); + FixupBranch rNoBranch = J_CC(CC_Z); + + // ABI_RestoreStack(0); + ABI_PopAllCalleeSavedRegsAndAdjustStack(); + MOV(32,R(EAX),Imm32(blockSize[start_addr])); + RET(); + + SetJumpTarget(rNoBranch); + } + } + + // End the block if we're before an idle skip address + if (DSPAnalyzer::code_flags[addr] & DSPAnalyzer::CODE_IDLE_SKIP) { break; } } |
