Skip to content

Commit

Permalink
Merge pull request #311 from Tilka/movbe
Browse files Browse the repository at this point in the history
Fix Fastmem on CPUs without MOVBE
  • Loading branch information
delroth committed Apr 24, 2014
2 parents 47373af + 886c887 commit 275f563
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions Source/Core/Common/x64Analyzer.cpp
Expand Up @@ -154,6 +154,7 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo *info)
info->immediate = *(u32*)codePtr;
codePtr += 4;
break;

case 8:
info->zeroExtend = true;
info->immediate = *(u32*)codePtr;
Expand Down
14 changes: 12 additions & 2 deletions Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp
Expand Up @@ -428,13 +428,23 @@ u8 *EmuCodeBlock::UnsafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acc
}
#if _M_X86_64
result = GetWritableCodePtr();
OpArg dest = MComplex(RBX, reg_addr, SCALE_1, offset);
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
{
MOV(accessSize, MComplex(RBX, reg_addr, SCALE_1, offset), R(reg_value));
MOV(accessSize, dest, R(reg_value));
}
#else
if (swap)
Expand Down

0 comments on commit 275f563

Please sign in to comment.