2015-04-12 11:41:26 -07:00
|
|
|
// Copyright (c) 2013- PPSSPP Project.
|
|
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
2021-03-02 20:42:55 -08:00
|
|
|
#include "ppsspp_config.h"
|
2015-04-12 11:41:26 -07:00
|
|
|
#include "Common/CPUDetect.h"
|
2019-02-03 13:58:24 -08:00
|
|
|
#include "Core/Config.h"
|
2015-04-12 11:41:26 -07:00
|
|
|
#include "Core/MIPS/JitCommon/JitState.h"
|
2016-08-28 14:52:08 +02:00
|
|
|
#include "Common/MemoryUtil.h"
|
2015-04-12 11:41:26 -07:00
|
|
|
|
|
|
|
|
namespace MIPSComp {
|
|
|
|
|
JitOptions::JitOptions() {
|
2019-02-03 13:58:24 -08:00
|
|
|
disableFlags = g_Config.uJitDisableFlags;
|
|
|
|
|
|
2015-04-12 11:41:26 -07:00
|
|
|
// x86
|
2019-02-03 13:58:24 -08:00
|
|
|
enableVFPUSIMD = !Disabled(JitDisable::SIMD);
|
2015-04-12 11:41:26 -07:00
|
|
|
// Set by Asm if needed.
|
|
|
|
|
reserveR15ForAsm = false;
|
|
|
|
|
|
|
|
|
|
// ARM/ARM64
|
|
|
|
|
useBackJump = false;
|
|
|
|
|
useForwardJump = false;
|
2019-02-03 13:58:24 -08:00
|
|
|
cachePointers = !Disabled(JitDisable::CACHE_POINTERS);
|
2015-04-12 11:41:26 -07:00
|
|
|
|
|
|
|
|
// ARM only
|
|
|
|
|
downcountInRegister = true;
|
2022-10-11 15:42:59 +02:00
|
|
|
useNEONVFPU = false; // true
|
2022-04-13 10:36:37 +02:00
|
|
|
if (Disabled(JitDisable::SIMD))
|
2015-04-12 11:41:26 -07:00
|
|
|
useNEONVFPU = false;
|
|
|
|
|
|
|
|
|
|
//ARM64
|
2019-02-03 13:58:24 -08:00
|
|
|
useASIMDVFPU = false; // !Disabled(JitDisable::SIMD);
|
2015-04-12 11:41:26 -07:00
|
|
|
|
|
|
|
|
// Common
|
2016-08-28 14:52:08 +02:00
|
|
|
|
|
|
|
|
// We can get block linking to work with W^X by doing even more unprotect/re-protect, but let's try without first.
|
2016-08-28 18:30:37 +02:00
|
|
|
// enableBlocklink = !PlatformIsWXExclusive(); // Revert to this line if block linking is slow in W^X mode
|
2021-02-08 23:30:14 -08:00
|
|
|
#if PPSSPP_ARCH(MIPS)
|
|
|
|
|
enableBlocklink = false;
|
|
|
|
|
#else
|
2019-02-03 13:58:24 -08:00
|
|
|
enableBlocklink = !Disabled(JitDisable::BLOCKLINK);
|
2021-02-08 23:30:14 -08:00
|
|
|
#endif
|
2015-04-12 11:41:26 -07:00
|
|
|
immBranches = false;
|
|
|
|
|
continueBranches = false;
|
|
|
|
|
continueJumps = false;
|
|
|
|
|
continueMaxInstructions = 300;
|
2015-07-06 21:16:49 +02:00
|
|
|
|
|
|
|
|
useStaticAlloc = false;
|
2017-12-27 16:19:36 -08:00
|
|
|
enablePointerify = false;
|
2023-02-12 12:10:29 -08:00
|
|
|
#if PPSSPP_ARCH(ARM64) || PPSSPP_ARCH(RISCV64)
|
2019-02-03 13:58:24 -08:00
|
|
|
useStaticAlloc = !Disabled(JitDisable::STATIC_ALLOC);
|
2017-12-28 10:48:55 -08:00
|
|
|
// iOS/etc. may disable at runtime if Memory::base is not nicely aligned.
|
2019-02-03 13:58:24 -08:00
|
|
|
enablePointerify = !Disabled(JitDisable::POINTERIFY);
|
2023-08-12 09:07:43 -07:00
|
|
|
#endif
|
|
|
|
|
#if PPSSPP_ARCH(RISCV64)
|
|
|
|
|
// Seems to perform slightly better than a checked entry at the start.
|
|
|
|
|
useBackJump = true;
|
2015-07-06 21:16:49 +02:00
|
|
|
#endif
|
2015-04-12 11:41:26 -07:00
|
|
|
}
|
2019-02-03 13:58:24 -08:00
|
|
|
|
|
|
|
|
bool JitOptions::Disabled(JitDisable bit) {
|
|
|
|
|
return (disableFlags & (uint32_t)bit) != 0;
|
|
|
|
|
}
|
2015-04-12 11:41:26 -07:00
|
|
|
}
|