DSP jit: 'mv 's 'sn are now jitted. Added
void pushExtValueFromReg(u16 dreg, u16 sreg); void popExtValueToReg(); instead of the backlog. Someone might want to add it to the Unit test git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5389 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
63d296fcba
commit
282cf6c6b5
|
@ -127,9 +127,12 @@ void DSPEmitter::WriteCallInterpreter(UDSPInstruction inst)
|
||||||
(this->*opTable[inst]->jitFunc)(inst);
|
(this->*opTable[inst]->jitFunc)(inst);
|
||||||
|
|
||||||
// Backlog
|
// Backlog
|
||||||
// TODO if for jit
|
|
||||||
if (tinst->extended) {
|
if (tinst->extended) {
|
||||||
ABI_CallFunction((void*)applyWriteBackLog);
|
if (! extOpTable[inst & 0x7F]->jitFunc) {
|
||||||
|
ABI_CallFunction((void*)applyWriteBackLog);
|
||||||
|
} else {
|
||||||
|
popExtValueToReg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@ class DSPEmitter : public Gen::XCodeBlock
|
||||||
u16 blockSize[0x10000];
|
u16 blockSize[0x10000];
|
||||||
bool *endBlock;
|
bool *endBlock;
|
||||||
u16 compileSR;
|
u16 compileSR;
|
||||||
|
|
||||||
|
// The index of the last stored ext value (compile time).
|
||||||
|
u16 storeIndex;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(DSPEmitter);
|
DISALLOW_COPY_AND_ASSIGN(DSPEmitter);
|
||||||
|
|
||||||
void ToMask(Gen::X64Reg value_reg = Gen::EDI, Gen::X64Reg temp_reg = Gen::ESI);
|
void ToMask(Gen::X64Reg value_reg = Gen::EDI, Gen::X64Reg temp_reg = Gen::ESI);
|
||||||
|
@ -62,7 +66,10 @@ public:
|
||||||
void decrease_addr_reg(int reg);
|
void decrease_addr_reg(int reg);
|
||||||
void ext_dmem_write(u32 src, u32 dest);
|
void ext_dmem_write(u32 src, u32 dest);
|
||||||
void ext_dmem_read(u16 addr);
|
void ext_dmem_read(u16 addr);
|
||||||
void storeExtValue(u16 value);
|
|
||||||
|
// Ext command helpers
|
||||||
|
void pushExtValueFromReg(u16 dreg, u16 sreg);
|
||||||
|
void popExtValueToReg();
|
||||||
|
|
||||||
// Ext commands
|
// Ext commands
|
||||||
void l(const UDSPInstruction opc);
|
void l(const UDSPInstruction opc);
|
||||||
|
|
|
@ -311,10 +311,10 @@ const DSPOPCTemplate opcodes_ext[] =
|
||||||
{"DR", 0x0004, 0x00fc, DSPInterpreter::Ext::dr, &DSPEmitter::dr, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false, false},
|
{"DR", 0x0004, 0x00fc, DSPInterpreter::Ext::dr, &DSPEmitter::dr, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false, false},
|
||||||
{"IR", 0x0008, 0x00fc, DSPInterpreter::Ext::ir, &DSPEmitter::ir, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false, false},
|
{"IR", 0x0008, 0x00fc, DSPInterpreter::Ext::ir, &DSPEmitter::ir, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false, false},
|
||||||
{"NR", 0x000c, 0x00fc, DSPInterpreter::Ext::nr, &DSPEmitter::nr, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false, false},
|
{"NR", 0x000c, 0x00fc, DSPInterpreter::Ext::nr, &DSPEmitter::nr, 1, 1, {{P_REG, 1, 0, 0, 0x0003}}, false, false},
|
||||||
{"MV", 0x0010, 0x00f0, DSPInterpreter::Ext::mv, NULL /*&DSPEmitter::mv*/, 1, +2, {{P_REG18, 1, 0, 2, 0x000c}, {P_REG1C, 1, 0, 0, 0x0003}}, false, false},
|
{"MV", 0x0010, 0x00f0, DSPInterpreter::Ext::mv, &DSPEmitter::mv, 1, 2, {{P_REG18, 1, 0, 2, 0x000c}, {P_REG1C, 1, 0, 0, 0x0003}}, false, false},
|
||||||
|
|
||||||
{"S", 0x0020, 0x00e4, DSPInterpreter::Ext::s, NULL /*&DSPEmitter::s*/, 1, 2, {{P_PRG, 1, 0, 0, 0x0003}, {P_REG1C, 1, 0, 3, 0x0018}}, false, false},
|
{"S", 0x0020, 0x00e4, DSPInterpreter::Ext::s, &DSPEmitter::s, 1, 2, {{P_PRG, 1, 0, 0, 0x0003}, {P_REG1C, 1, 0, 3, 0x0018}}, false, false},
|
||||||
{"SN", 0x0024, 0x00e4, DSPInterpreter::Ext::sn, NULL /*&DSPEmitter::sn*/, 1, 2, {{P_PRG, 1, 0, 0, 0x0003}, {P_REG1C, 1, 0, 3, 0x0018}}, false, false},
|
{"SN", 0x0024, 0x00e4, DSPInterpreter::Ext::sn, &DSPEmitter::sn, 1, 2, {{P_PRG, 1, 0, 0, 0x0003}, {P_REG1C, 1, 0, 3, 0x0018}}, false, false},
|
||||||
|
|
||||||
{"L", 0x0040, 0x00c4, DSPInterpreter::Ext::l, NULL /*&DSPEmitter::l*/, 1, 2, {{P_REG18, 1, 0, 3, 0x0038}, {P_PRG, 1, 0, 0, 0x0003}}, false, false},
|
{"L", 0x0040, 0x00c4, DSPInterpreter::Ext::l, NULL /*&DSPEmitter::l*/, 1, 2, {{P_REG18, 1, 0, 3, 0x0038}, {P_PRG, 1, 0, 0, 0x0003}}, false, false},
|
||||||
{"LN", 0x0044, 0x00c4, DSPInterpreter::Ext::ln, NULL /*&DSPEmitter::ln*/, 1, 2, {{P_REG18, 1, 0, 3, 0x0038}, {P_PRG, 1, 0, 0, 0x0003}}, false, false},
|
{"LN", 0x0044, 0x00c4, DSPInterpreter::Ext::ln, NULL /*&DSPEmitter::ln*/, 1, 2, {{P_REG18, 1, 0, 3, 0x0038}, {P_PRG, 1, 0, 0, 0x0003}}, false, false},
|
||||||
|
|
|
@ -53,8 +53,8 @@ void DSPEmitter::mv(const UDSPInstruction opc)
|
||||||
{
|
{
|
||||||
u8 sreg = (opc & 0x3) + DSP_REG_ACL0;
|
u8 sreg = (opc & 0x3) + DSP_REG_ACL0;
|
||||||
u8 dreg = ((opc >> 2) & 0x3);
|
u8 dreg = ((opc >> 2) & 0x3);
|
||||||
|
pushExtValueFromReg(dreg + DSP_REG_AXL0, sreg);
|
||||||
MOV(16, M(&g_dsp.r[dreg + DSP_REG_AXL0]), M(&g_dsp.r[sreg]));
|
// MOV(16, M(&g_dsp.r[dreg + DSP_REG_AXL0]), M(&g_dsp.r[sreg]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// S @$arD, $acS.S
|
// S @$arD, $acS.S
|
||||||
|
@ -524,8 +524,16 @@ void DSPEmitter::ldnm(const UDSPInstruction opc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DSPEmitter::storeExtValue(u16 value) {
|
// Push value from g_dsp.r[sreg] into EBX and stores the destinationindex in
|
||||||
|
// storeIndex
|
||||||
|
void DSPEmitter::pushExtValueFromReg(u16 dreg, u16 sreg) {
|
||||||
|
MOVZX(32, 16, EBX, M(&g_dsp.r[sreg]));
|
||||||
|
storeIndex = dreg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DSPEmitter::popExtValueToReg() {
|
||||||
|
MOV(16, M(&g_dsp.r[storeIndex]), R(EBX));
|
||||||
|
|
||||||
|
// TODO handle commands such as 'l
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue