Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/MIPS/JitCommon/JitState.cpp
5673 views
1
// Copyright (c) 2013- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#include "ppsspp_config.h"
19
#include "Common/CPUDetect.h"
20
#include "Core/Config.h"
21
#include "Core/MIPS/JitCommon/JitState.h"
22
#include "Common/MemoryUtil.h"
23
24
namespace MIPSComp {
25
JitOptions::JitOptions() {
26
disableFlags = g_Config.uJitDisableFlags;
27
28
// x86
29
enableVFPUSIMD = !Disabled(JitDisable::SIMD);
30
// Set by Asm if needed.
31
reserveR15ForAsm = false;
32
33
// ARM/ARM64
34
useBackJump = false;
35
useForwardJump = false;
36
cachePointers = !Disabled(JitDisable::CACHE_POINTERS);
37
38
// ARM only
39
downcountInRegister = true;
40
41
// Common
42
43
// We can get block linking to work with W^X by doing even more unprotect/re-protect, but let's try without first.
44
// enableBlocklink = !PlatformIsWXExclusive(); // Revert to this line if block linking is slow in W^X mode
45
#if PPSSPP_ARCH(MIPS)
46
enableBlocklink = false;
47
#else
48
enableBlocklink = !Disabled(JitDisable::BLOCKLINK);
49
#endif
50
immBranches = false;
51
continueJumps = false;
52
continueMaxInstructions = 300;
53
54
useStaticAlloc = false;
55
enablePointerify = false;
56
#if PPSSPP_ARCH(ARM64) || PPSSPP_ARCH(RISCV64) || PPSSPP_ARCH(LOONGARCH64)
57
useStaticAlloc = !Disabled(JitDisable::STATIC_ALLOC);
58
// iOS/etc. may disable at runtime if Memory::base is not nicely aligned.
59
enablePointerify = !Disabled(JitDisable::POINTERIFY);
60
#endif
61
#if PPSSPP_ARCH(RISCV64)
62
// Seems to perform slightly better than a checked entry at the start.
63
useBackJump = true;
64
#endif
65
}
66
67
bool JitOptions::Disabled(JitDisable bit) {
68
return (disableFlags & (uint32_t)bit) != 0;
69
}
70
}
71
72