Merge pull request #5261 from MerryMage/dbat

Jit_LoadStore: Make dcbz PIE-compliant
This commit is contained in:
Markus Wick 2017-04-14 13:40:19 +02:00 committed by GitHub
commit 0d98ffa2b2

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.