Jit_LoadStore: Make dcbz PIE-compliant

This commit is contained in:
MerryMage 2017-04-14 12:33:25 +01:00
parent 05fec44ff5
commit e10b715666
1 changed files with 5 additions and 4 deletions

View File

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