JIT64: use xor instead of mov for loading a zero regcache immediate

This commit is contained in:
Fiora 2014-08-24 12:45:16 -07:00
parent 27996a65cf
commit ad51fc7c4b
1 changed files with 4 additions and 1 deletions

View File

@ -299,7 +299,10 @@ void RegCache::StoreFromRegister(size_t i, FlushMode mode)
void GPRRegCache::LoadRegister(size_t preg, X64Reg newLoc)
{
emit->MOV(32, ::Gen::R(newLoc), regs[preg].location);
if (regs[preg].location.IsImm() && !regs[preg].location.offset)
emit->XOR(32, ::Gen::R(newLoc), ::Gen::R(newLoc));
else
emit->MOV(32, ::Gen::R(newLoc), regs[preg].location);
}
void GPRRegCache::StoreRegister(size_t preg, OpArg newLoc)