Implement lmw, stmw in jit

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1602 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-12-20 11:15:03 +00:00
parent c652c5e1f0
commit 7adccb616f
1 changed files with 30 additions and 34 deletions

View File

@ -393,39 +393,35 @@
// A few games use these heavily in video codecs. // A few games use these heavily in video codecs.
void Jit64::lmw(UGeckoInstruction inst) void Jit64::lmw(UGeckoInstruction inst)
{ {
Default(inst); gpr.FlushLockX(ECX);
return;
/*
/// BUGGY
//return _inst.RA ? (m_GPR[_inst.RA] + _inst.SIMM_16) : _inst.SIMM_16;
gpr.FlushLockX(ECX, EDX);
gpr.FlushLockX(ESI);
MOV(32, R(EAX), Imm32((u32)(s32)inst.SIMM_16)); MOV(32, R(EAX), Imm32((u32)(s32)inst.SIMM_16));
if (inst.RA) if (inst.RA)
ADD(32, R(EAX), gpr.R(inst.RA)); ADD(32, R(EAX), gpr.R(inst.RA));
MOV(32, R(ECX), Imm32(inst.RD)); else
MOV(32, R(ESI), Imm32(static_cast<u32>((u64)&PowerPC::ppcState.gpr[0]))); XOR(32, R(EAX), R(EAX));
const u8 *loopPtr = GetCodePtr(); for (int i = inst.RD; i < 32; i++)
MOV(32, R(EDX), MComplex(RBX, EAX, SCALE_1, 0)); {
MOV(32, MComplex(ESI, ECX, SCALE_4, 0), R(EDX)); MOV(32, R(ECX), MComplex(EBX, EAX, SCALE_1, (i - inst.RD) * 4));
ADD(32, R(EAX), Imm8(4)); BSWAP(32, ECX);
ADD(32, R(ESI), Imm8(4)); gpr.LoadToX64(i, false, true);
ADD(32, R(ECX), Imm8(1)); MOV(32, gpr.R(i), R(ECX));
CMP(32, R(ECX), Imm8(32)); }
gpr.UnlockAllX();*/ gpr.UnlockAllX();
} }
void Jit64::stmw(UGeckoInstruction inst) void Jit64::stmw(UGeckoInstruction inst)
{ {
Default(inst); gpr.FlushLockX(ECX);
return; MOV(32, R(EAX), Imm32((u32)(s32)inst.SIMM_16));
/* if (inst.RA)
u32 uAddress = Helper_Get_EA(_inst); ADD(32, R(EAX), gpr.R(inst.RA));
for (int iReg = _inst.RS; iReg <= 31; iReg++, uAddress+=4) else
XOR(32, R(EAX), R(EAX));
for (int i = inst.RD; i < 32; i++)
{ {
Memory::Write_U32(m_GPR[iReg], uAddress); MOV(32, R(ECX), gpr.R(i));
if (PowerPC::ppcState.Exceptions & EXCEPTION_DSI) BSWAP(32, ECX);
return; MOV(32, MComplex(EBX, EAX, SCALE_1, (i - inst.RD) * 4), R(ECX));
}*/ }
gpr.UnlockAllX();
} }