From 08e85d0cd4cf52cce66368862b13f85246a357a5 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 28 Dec 2017 10:48:55 -0800 Subject: [PATCH] arm64jit: Autodetect pointerify support. Also, re-enable static alloc without pointerify, it works now. --- Core/MIPS/ARM64/Arm64Jit.cpp | 5 +++++ Core/MIPS/JitCommon/JitState.cpp | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Core/MIPS/ARM64/Arm64Jit.cpp b/Core/MIPS/ARM64/Arm64Jit.cpp index d656c0f951..86b80a3a57 100644 --- a/Core/MIPS/ARM64/Arm64Jit.cpp +++ b/Core/MIPS/ARM64/Arm64Jit.cpp @@ -66,6 +66,11 @@ using namespace Arm64Gen; using namespace Arm64JitConstants; Arm64Jit::Arm64Jit(MIPSState *mips) : blocks(mips, this), gpr(mips, &js, &jo), fpr(mips, &js, &jo), mips_(mips), fp(this) { + // Automatically disable incompatible options. + if (((intptr_t)Memory::base & 0x00000000FFFFFFFFUL) != 0) { + jo.enablePointerify = false; + } + logBlocks = 0; dontLogBlocks = 0; blocks.Init(); diff --git a/Core/MIPS/JitCommon/JitState.cpp b/Core/MIPS/JitCommon/JitState.cpp index 79a8daa8e7..7a603daf50 100644 --- a/Core/MIPS/JitCommon/JitState.cpp +++ b/Core/MIPS/JitCommon/JitState.cpp @@ -54,11 +54,8 @@ namespace MIPSComp { enablePointerify = false; #if PPSSPP_ARCH(ARM64) useStaticAlloc = true; + // iOS/etc. may disable at runtime if Memory::base is not nicely aligned. enablePointerify = true; -#endif -#if PPSSPP_PLATFORM(IOS) - useStaticAlloc = false; - enablePointerify = false; #endif } }