// Copyright (c) 2013- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#include "ppsspp_config.h"18#include "Common/CPUDetect.h"19#include "Core/Config.h"20#include "Core/MIPS/JitCommon/JitState.h"21#include "Common/MemoryUtil.h"2223namespace MIPSComp {24JitOptions::JitOptions() {25disableFlags = g_Config.uJitDisableFlags;2627// x8628enableVFPUSIMD = !Disabled(JitDisable::SIMD);29// Set by Asm if needed.30reserveR15ForAsm = false;3132// ARM/ARM6433useBackJump = false;34useForwardJump = false;35cachePointers = !Disabled(JitDisable::CACHE_POINTERS);3637// ARM only38downcountInRegister = true;3940// Common4142// We can get block linking to work with W^X by doing even more unprotect/re-protect, but let's try without first.43// enableBlocklink = !PlatformIsWXExclusive(); // Revert to this line if block linking is slow in W^X mode44#if PPSSPP_ARCH(MIPS)45enableBlocklink = false;46#else47enableBlocklink = !Disabled(JitDisable::BLOCKLINK);48#endif49immBranches = false;50continueJumps = false;51continueMaxInstructions = 300;5253useStaticAlloc = false;54enablePointerify = false;55#if PPSSPP_ARCH(ARM64) || PPSSPP_ARCH(RISCV64) || PPSSPP_ARCH(LOONGARCH64)56useStaticAlloc = !Disabled(JitDisable::STATIC_ALLOC);57// iOS/etc. may disable at runtime if Memory::base is not nicely aligned.58enablePointerify = !Disabled(JitDisable::POINTERIFY);59#endif60#if PPSSPP_ARCH(RISCV64)61// Seems to perform slightly better than a checked entry at the start.62useBackJump = true;63#endif64}6566bool JitOptions::Disabled(JitDisable bit) {67return (disableFlags & (uint32_t)bit) != 0;68}69}707172