summaryrefslogtreecommitdiff
path: root/Source/Core/DSPCore/Src/DSPEmitter.cpp
diff options
context:
space:
mode:
authorpierre <pierre@pirsoft.de>2010-10-31 23:26:18 +0000
committerpierre <pierre@pirsoft.de>2010-10-31 23:26:18 +0000
commit4b9831cdce7ffa1fcb0fc5eda5e5686130096eb2 (patch)
tree31c40b514d03bf3134e0cf87c3b5518836ef957b /Source/Core/DSPCore/Src/DSPEmitter.cpp
parent2f2a76b28a0f612c2b2550d25cdae775de0614f5 (diff)
Core/DSPCore: Extended opcode handling fixes
* Make writeToBackLog private to DSPIntExtOps.cpp (JIT variants of 'l and 'ln are disabled and broken as is) * Make zeroing of the backlog conditional on doing an interpreter fallback and do it at a few more places * Fix selection of cleanup for extended opcodes. * Fix the DSP unit tests to correctly emit the function prolog/epilog (else EBX wouldn't be saved) * Add a few more DSP unit tests git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6325 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DSPCore/Src/DSPEmitter.cpp')
-rw-r--r--Source/Core/DSPCore/Src/DSPEmitter.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/DSPCore/Src/DSPEmitter.cpp b/Source/Core/DSPCore/Src/DSPEmitter.cpp
index 7b0a27c362..0976d88d5a 100644
--- a/Source/Core/DSPCore/Src/DSPEmitter.cpp
+++ b/Source/Core/DSPCore/Src/DSPEmitter.cpp
@@ -93,6 +93,7 @@ void DSPEmitter::checkExceptions(u32 retval) {
void DSPEmitter::EmitInstruction(UDSPInstruction inst)
{
const DSPOPCTemplate *tinst = GetOpTemplate(inst);
+ bool ext_is_jit = false;
// Call extended
if (tinst->extended) {
@@ -100,15 +101,19 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
if (! extOpTable[inst & 0x7F]->jitFunc) {
// Fall back to interpreter
ABI_CallFunctionC16((void*)extOpTable[inst & 0x7F]->intFunc, inst);
+ ext_is_jit = false;
} else {
(this->*extOpTable[inst & 0x7F]->jitFunc)(inst);
+ ext_is_jit = true;
}
} else {
if (!extOpTable[inst & 0xFF]->jitFunc) {
// Fall back to interpreter
ABI_CallFunctionC16((void*)extOpTable[inst & 0xFF]->intFunc, inst);
+ ext_is_jit = false;
} else {
(this->*extOpTable[inst & 0xFF]->jitFunc)(inst);
+ ext_is_jit = true;
}
}
}
@@ -125,8 +130,10 @@ void DSPEmitter::EmitInstruction(UDSPInstruction inst)
// Backlog
if (tinst->extended) {
- if (! extOpTable[inst & 0x7F]->jitFunc) {
- ABI_CallFunction((void*)applyWriteBackLog);
+ if (!ext_is_jit) {
+ //need to call the online cleanup function because
+ //the writeBackLog gets populated at runtime
+ ABI_CallFunction((void*)::applyWriteBackLog);
} else {
popExtValueToReg();
}