Jit64: Use ImmPtr for mtcrf.

Only a small overhead, but PIE compatible.
This commit is contained in:
degasus 2016-11-03 20:15:53 +01:00
parent 8189ef432b
commit d26709f713
1 changed files with 2 additions and 1 deletions

View File

@ -483,6 +483,7 @@ void Jit64::mtcrf(UGeckoInstruction inst)
} }
else else
{ {
MOV(64, R(RSCRATCH2), ImmPtr(m_crTable));
gpr.Lock(inst.RS); gpr.Lock(inst.RS);
gpr.BindToRegister(inst.RS, true, false); gpr.BindToRegister(inst.RS, true, false);
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
@ -494,7 +495,7 @@ void Jit64::mtcrf(UGeckoInstruction inst)
SHR(32, R(RSCRATCH), Imm8(28 - (i * 4))); SHR(32, R(RSCRATCH), Imm8(28 - (i * 4)));
if (i != 0) if (i != 0)
AND(32, R(RSCRATCH), Imm8(0xF)); AND(32, R(RSCRATCH), Imm8(0xF));
MOV(64, R(RSCRATCH), MScaled(RSCRATCH, SCALE_8, (u32)(u64)m_crTable)); MOV(64, R(RSCRATCH), MComplex(RSCRATCH2, RSCRATCH, SCALE_8, 0));
MOV(64, PPCSTATE(cr_val[i]), R(RSCRATCH)); MOV(64, PPCSTATE(cr_val[i]), R(RSCRATCH));
} }
} }