Jit_LoadStore: Make dcbz PIE-compliant

This commit is contained in:
MerryMage 2017-04-14 12:33:25 +01:00
parent 05fec44ff5
commit e10b715666

View File

@ -345,10 +345,11 @@ void Jit64::dcbz(UGeckoInstruction inst)
if (UReg_MSR(MSR).DR) if (UReg_MSR(MSR).DR)
{ {
// Perform lookup to see if we can use fast path. // Perform lookup to see if we can use fast path.
MOV(32, R(RSCRATCH2), R(RSCRATCH)); MOV(64, R(RSCRATCH2), ImmPtr(&PowerPC::dbat_table[0]));
SHR(32, R(RSCRATCH2), Imm8(PowerPC::BAT_INDEX_SHIFT)); PUSH(RSCRATCH);
TEST(32, MScaled(RSCRATCH2, SCALE_4, PtrOffset(&PowerPC::dbat_table[0])), SHR(32, R(RSCRATCH), Imm8(PowerPC::BAT_INDEX_SHIFT));
Imm32(PowerPC::BAT_PHYSICAL_BIT)); TEST(32, MComplex(RSCRATCH, RSCRATCH2, SCALE_4, 0), Imm32(PowerPC::BAT_PHYSICAL_BIT));
POP(RSCRATCH);
FixupBranch slow = J_CC(CC_Z, true); FixupBranch slow = J_CC(CC_Z, true);
// Fast path: compute full address, then zero out 32 bytes of memory. // Fast path: compute full address, then zero out 32 bytes of memory.