mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Fix Fastmem on CPUs without MOVBE
The problem was that when BSWAP was used, UnsafeWriteRegToReg() returned the address of that instead of the MOV.
This commit is contained in:
parent
47373af9d9
commit
886c887e80
@ -154,6 +154,7 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo *info)
|
|||||||
info->immediate = *(u32*)codePtr;
|
info->immediate = *(u32*)codePtr;
|
||||||
codePtr += 4;
|
codePtr += 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
info->zeroExtend = true;
|
info->zeroExtend = true;
|
||||||
info->immediate = *(u32*)codePtr;
|
info->immediate = *(u32*)codePtr;
|
||||||
|
@ -428,13 +428,23 @@ u8 *EmuCodeBlock::UnsafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acc
|
|||||||
}
|
}
|
||||||
#if _M_X86_64
|
#if _M_X86_64
|
||||||
result = GetWritableCodePtr();
|
result = GetWritableCodePtr();
|
||||||
|
OpArg dest = MComplex(RBX, reg_addr, SCALE_1, offset);
|
||||||
if (swap)
|
if (swap)
|
||||||
{
|
{
|
||||||
SwapAndStore(accessSize, MComplex(RBX, reg_addr, SCALE_1, offset), reg_value);
|
if (cpu_info.bMOVBE)
|
||||||
|
{
|
||||||
|
MOVBE(accessSize, dest, R(reg_value));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BSWAP(accessSize, reg_value);
|
||||||
|
result = GetWritableCodePtr();
|
||||||
|
MOV(accessSize, dest, R(reg_value));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MOV(accessSize, MComplex(RBX, reg_addr, SCALE_1, offset), R(reg_value));
|
MOV(accessSize, dest, R(reg_value));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (swap)
|
if (swap)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user