From e10b715666222e48781c8ae04c7c024baf4ede7b Mon Sep 17 00:00:00 2001 From: MerryMage Date: Fri, 14 Apr 2017 12:33:25 +0100 Subject: [PATCH] Jit_LoadStore: Make dcbz PIE-compliant --- Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp index bc770da4ea..503dd8eb19 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp @@ -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.