CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Core/MIPS/JitCommon/JitState.cpp
Views: 1401
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
useNEONVFPU = false; // true
41
if (Disabled(JitDisable::SIMD))
42
useNEONVFPU = false;
43
44
//ARM64
45
useASIMDVFPU = false; // !Disabled(JitDisable::SIMD);
46
47
// Common
48
49
// We can get block linking to work with W^X by doing even more unprotect/re-protect, but let's try without first.
50
// enableBlocklink = !PlatformIsWXExclusive(); // Revert to this line if block linking is slow in W^X mode
51
#if PPSSPP_ARCH(MIPS)
52
enableBlocklink = false;
53
#else
54
enableBlocklink = !Disabled(JitDisable::BLOCKLINK);
55
#endif
56
immBranches = false;
57
continueBranches = false;
58
continueJumps = false;
59
continueMaxInstructions = 300;
60
61
useStaticAlloc = false;
62
enablePointerify = false;
63
#if PPSSPP_ARCH(ARM64) || PPSSPP_ARCH(RISCV64)
64
useStaticAlloc = !Disabled(JitDisable::STATIC_ALLOC);
65
// iOS/etc. may disable at runtime if Memory::base is not nicely aligned.
66
enablePointerify = !Disabled(JitDisable::POINTERIFY);
67
#endif
68
#if PPSSPP_ARCH(RISCV64)
69
// Seems to perform slightly better than a checked entry at the start.
70
useBackJump = true;
71
#endif
72
}
73
74
bool JitOptions::Disabled(JitDisable bit) {
75
return (disableFlags & (uint32_t)bit) != 0;
76
}
77
}
78
79