DSP Jit enable ls* and sl* in jit.
Anyone feel like helping with the unit test? git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5390 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
282cf6c6b5
commit
d86167961c
|
@ -29,7 +29,7 @@
|
|||
|
||||
using namespace Gen;
|
||||
|
||||
DSPEmitter::DSPEmitter()
|
||||
DSPEmitter::DSPEmitter() : storeIndex(-1)
|
||||
{
|
||||
m_compiledCode = NULL;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class DSPEmitter : public Gen::XCodeBlock
|
|||
u16 compileSR;
|
||||
|
||||
// The index of the last stored ext value (compile time).
|
||||
u16 storeIndex;
|
||||
int storeIndex;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(DSPEmitter);
|
||||
|
||||
|
@ -70,6 +70,7 @@ public:
|
|||
// Ext command helpers
|
||||
void pushExtValueFromReg(u16 dreg, u16 sreg);
|
||||
void popExtValueToReg();
|
||||
void pushExtValueFromMem(u16 dreg, u16 sreg);
|
||||
|
||||
// Ext commands
|
||||
void l(const UDSPInstruction opc);
|
||||
|
|
|
@ -319,14 +319,14 @@ const DSPOPCTemplate opcodes_ext[] =
|
|||
{"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},
|
||||
|
||||
{"LS", 0x0080, 0x00ce, DSPInterpreter::Ext::ls, NULL /*&DSPEmitter::ls*/, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SL", 0x0082, 0x00ce, DSPInterpreter::Ext::sl, NULL /*&DSPEmitter::sl*/, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
{"LSN", 0x0084, 0x00ce, DSPInterpreter::Ext::lsn, NULL /*&DSPEmitter::lsn*/, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SLN", 0x0086, 0x00ce, DSPInterpreter::Ext::sln, NULL /*&DSPEmitter::sln*/, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
{"LSM", 0x0088, 0x00ce, DSPInterpreter::Ext::lsm, NULL /*&DSPEmitter::lsm*/, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SLM", 0x008a, 0x00ce, DSPInterpreter::Ext::slm, NULL /*&DSPEmitter::slm*/, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
{"LSNM", 0x008c, 0x00ce, DSPInterpreter::Ext::lsnm, NULL /*&DSPEmitter::lsnm*/, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SLNM", 0x008e, 0x00ce, DSPInterpreter::Ext::slnm, NULL /*&DSPEmitter::slnm*/, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
{"LS", 0x0080, 0x00ce, DSPInterpreter::Ext::ls, &DSPEmitter::ls, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SL", 0x0082, 0x00ce, DSPInterpreter::Ext::sl, &DSPEmitter::sl, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
{"LSN", 0x0084, 0x00ce, DSPInterpreter::Ext::lsn, &DSPEmitter::lsn, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SLN", 0x0086, 0x00ce, DSPInterpreter::Ext::sln, &DSPEmitter::sln, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
{"LSM", 0x0088, 0x00ce, DSPInterpreter::Ext::lsm, &DSPEmitter::lsm, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SLM", 0x008a, 0x00ce, DSPInterpreter::Ext::slm, &DSPEmitter::slm, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
{"LSNM", 0x008c, 0x00ce, DSPInterpreter::Ext::lsnm, &DSPEmitter::lsnm, 1, 2, {{P_REG18, 1, 0, 4, 0x0030}, {P_ACCM, 1, 0, 0, 0x0001}}, false, false},
|
||||
{"SLNM", 0x008e, 0x00ce, DSPInterpreter::Ext::slnm, &DSPEmitter::slnm, 1, 2, {{P_ACCM, 1, 0, 0, 0x0001}, {P_REG18, 1, 0, 4, 0x0030}}, false, false},
|
||||
|
||||
{"LD", 0x00c0, 0x00cc, DSPInterpreter::Ext::ld, NULL /*&DSPEmitter::ld*/, 1, 3, {{P_REGM18, 1, 0, 4, 0x0020}, {P_REGM19, 1, 0, 3, 0x0010}, {P_PRG, 1, 0, 0, 0x0003}}, false, false},
|
||||
{"LDN", 0x00c4, 0x00cc, DSPInterpreter::Ext::ldn, NULL /*&DSPEmitter::ldn*/, 1, 3, {{P_REGM18, 1, 0, 4, 0x0020}, {P_REGM19, 1, 0, 3, 0x0010}, {P_PRG, 1, 0, 0, 0x0003}}, false, false},
|
||||
|
|
|
@ -149,10 +149,9 @@ void DSPEmitter::ls(const UDSPInstruction opc)
|
|||
u8 dreg = ((opc >> 4) & 0x3) + DSP_REG_AXL0;
|
||||
|
||||
ext_dmem_write(DSP_REG_AR3, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR0]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
|
||||
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR0);
|
||||
|
||||
increment_addr_reg(DSP_REG_AR3);
|
||||
increment_addr_reg(DSP_REG_AR0);
|
||||
}
|
||||
|
@ -171,8 +170,7 @@ void DSPEmitter::lsn(const UDSPInstruction opc)
|
|||
|
||||
ext_dmem_write(DSP_REG_AR3, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR0]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR0);
|
||||
|
||||
increment_addr_reg(DSP_REG_AR3);
|
||||
increase_addr_reg(DSP_REG_AR0);
|
||||
|
@ -191,8 +189,7 @@ void DSPEmitter::lsm(const UDSPInstruction opc)
|
|||
|
||||
ext_dmem_write(DSP_REG_AR3, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR0]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR0);
|
||||
|
||||
increase_addr_reg(DSP_REG_AR3);
|
||||
increment_addr_reg(DSP_REG_AR0);
|
||||
|
@ -212,8 +209,7 @@ void DSPEmitter::lsnm(const UDSPInstruction opc)
|
|||
|
||||
ext_dmem_write(DSP_REG_AR3, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR0]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR0);
|
||||
|
||||
increase_addr_reg(DSP_REG_AR3);
|
||||
increase_addr_reg(DSP_REG_AR0);
|
||||
|
@ -230,9 +226,8 @@ void DSPEmitter::sl(const UDSPInstruction opc)
|
|||
u8 dreg = ((opc >> 4) & 0x3) + DSP_REG_AXL0;
|
||||
|
||||
ext_dmem_write(DSP_REG_AR0, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR3]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR3);
|
||||
|
||||
increment_addr_reg(DSP_REG_AR3);
|
||||
increment_addr_reg(DSP_REG_AR0);
|
||||
|
@ -251,8 +246,7 @@ void DSPEmitter::sln(const UDSPInstruction opc)
|
|||
|
||||
ext_dmem_write(DSP_REG_AR0, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR3]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR3);
|
||||
|
||||
increment_addr_reg(DSP_REG_AR3);
|
||||
increase_addr_reg(DSP_REG_AR0);
|
||||
|
@ -270,9 +264,8 @@ void DSPEmitter::slm(const UDSPInstruction opc)
|
|||
u8 dreg = ((opc >> 4) & 0x3) + DSP_REG_AXL0;
|
||||
|
||||
ext_dmem_write(DSP_REG_AR0, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR3]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR3);
|
||||
|
||||
increase_addr_reg(DSP_REG_AR3);
|
||||
increment_addr_reg(DSP_REG_AR0);
|
||||
|
@ -290,9 +283,8 @@ void DSPEmitter::slnm(const UDSPInstruction opc)
|
|||
u8 dreg = ((opc >> 4) & 0x3) + DSP_REG_AXL0;
|
||||
|
||||
ext_dmem_write(DSP_REG_AR0, sreg);
|
||||
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR3]);
|
||||
MOV(16, M(&g_dsp.r[dreg]), R(EAX));
|
||||
|
||||
pushExtValueFromMem(dreg, DSP_REG_AR3);
|
||||
|
||||
increase_addr_reg(DSP_REG_AR3);
|
||||
increase_addr_reg(DSP_REG_AR0);
|
||||
|
@ -531,9 +523,18 @@ void DSPEmitter::pushExtValueFromReg(u16 dreg, u16 sreg) {
|
|||
storeIndex = dreg;
|
||||
}
|
||||
|
||||
void DSPEmitter::popExtValueToReg() {
|
||||
MOV(16, M(&g_dsp.r[storeIndex]), R(EBX));
|
||||
void DSPEmitter::pushExtValueFromMem(u16 dreg, u16 sreg) {
|
||||
ext_dmem_read(g_dsp.r[DSP_REG_AR0]);
|
||||
MOV(16, R(EBX), R(EAX));
|
||||
|
||||
storeIndex = dreg;
|
||||
}
|
||||
|
||||
void DSPEmitter::popExtValueToReg() {
|
||||
if (storeIndex != -1)
|
||||
MOV(16, M(&g_dsp.r[storeIndex]), R(EBX));
|
||||
|
||||
storeIndex = -1;
|
||||
// TODO handle commands such as 'l
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue