Added a check for a redundant mov in the fastmem writes code.

Fixes issue 6905.
This commit is contained in:
skidau 2014-01-13 22:18:19 +11:00
parent e00c3ce363
commit 8b53385c54
1 changed files with 8 additions and 4 deletions

View File

@ -117,12 +117,16 @@ const u8 *TrampolineCache::GetWriteTrampoline(const InstructionInfo &info, u32 r
PanicAlert("Incorrect use of SafeWriteRegToReg");
if (addrReg != ABI_PARAM1)
{
if (ABI_PARAM1 != dataReg)
MOV(64, R(ABI_PARAM1), R((X64Reg)dataReg));
if (ABI_PARAM2 != addrReg)
MOV(64, R(ABI_PARAM2), R((X64Reg)addrReg));
}
else
{
if (ABI_PARAM2 != addrReg)
MOV(64, R(ABI_PARAM2), R((X64Reg)addrReg));
if (ABI_PARAM1 != dataReg)
MOV(64, R(ABI_PARAM1), R((X64Reg)dataReg));
}