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
This commit is contained in:
pierre
2010-10-31 23:26:18 +00:00
parent 2f2a76b28a
commit 4b9831cdce
8 changed files with 269 additions and 15 deletions

View File

@ -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();
}