summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/x64/xbyak_abi.h32
-rw-r--r--src/video_core/macro/macro_jit_x64.cpp10
2 files changed, 21 insertions, 21 deletions
diff --git a/src/common/x64/xbyak_abi.h b/src/common/x64/xbyak_abi.h
index a5f5d4fc1..26e4bfda5 100644
--- a/src/common/x64/xbyak_abi.h
+++ b/src/common/x64/xbyak_abi.h
@@ -11,7 +11,7 @@
11 11
12namespace Common::X64 { 12namespace Common::X64 {
13 13
14inline std::size_t RegToIndex(const Xbyak::Reg& reg) { 14constexpr std::size_t RegToIndex(const Xbyak::Reg& reg) {
15 using Kind = Xbyak::Reg::Kind; 15 using Kind = Xbyak::Reg::Kind;
16 ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0, 16 ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0,
17 "RegSet only support GPRs and XMM registers."); 17 "RegSet only support GPRs and XMM registers.");
@@ -19,17 +19,17 @@ inline std::size_t RegToIndex(const Xbyak::Reg& reg) {
19 return reg.getIdx() + (reg.getKind() == Kind::REG ? 0 : 16); 19 return reg.getIdx() + (reg.getKind() == Kind::REG ? 0 : 16);
20} 20}
21 21
22inline Xbyak::Reg64 IndexToReg64(std::size_t reg_index) { 22constexpr Xbyak::Reg64 IndexToReg64(std::size_t reg_index) {
23 ASSERT(reg_index < 16); 23 ASSERT(reg_index < 16);
24 return Xbyak::Reg64(static_cast<int>(reg_index)); 24 return Xbyak::Reg64(static_cast<int>(reg_index));
25} 25}
26 26
27inline Xbyak::Xmm IndexToXmm(std::size_t reg_index) { 27constexpr Xbyak::Xmm IndexToXmm(std::size_t reg_index) {
28 ASSERT(reg_index >= 16 && reg_index < 32); 28 ASSERT(reg_index >= 16 && reg_index < 32);
29 return Xbyak::Xmm(static_cast<int>(reg_index - 16)); 29 return Xbyak::Xmm(static_cast<int>(reg_index - 16));
30} 30}
31 31
32inline Xbyak::Reg IndexToReg(std::size_t reg_index) { 32constexpr Xbyak::Reg IndexToReg(std::size_t reg_index) {
33 if (reg_index < 16) { 33 if (reg_index < 16) {
34 return IndexToReg64(reg_index); 34 return IndexToReg64(reg_index);
35 } else { 35 } else {
@@ -45,17 +45,17 @@ inline std::bitset<32> BuildRegSet(std::initializer_list<Xbyak::Reg> regs) {
45 return bits; 45 return bits;
46} 46}
47 47
48const std::bitset<32> ABI_ALL_GPRS(0x0000FFFF); 48constexpr inline std::bitset<32> ABI_ALL_GPRS(0x0000FFFF);
49const std::bitset<32> ABI_ALL_XMMS(0xFFFF0000); 49constexpr inline std::bitset<32> ABI_ALL_XMMS(0xFFFF0000);
50 50
51#ifdef _WIN32 51#ifdef _WIN32
52 52
53// Microsoft x64 ABI 53// Microsoft x64 ABI
54const Xbyak::Reg ABI_RETURN = Xbyak::util::rax; 54constexpr inline Xbyak::Reg ABI_RETURN = Xbyak::util::rax;
55const Xbyak::Reg ABI_PARAM1 = Xbyak::util::rcx; 55constexpr inline Xbyak::Reg ABI_PARAM1 = Xbyak::util::rcx;
56const Xbyak::Reg ABI_PARAM2 = Xbyak::util::rdx; 56constexpr inline Xbyak::Reg ABI_PARAM2 = Xbyak::util::rdx;
57const Xbyak::Reg ABI_PARAM3 = Xbyak::util::r8; 57constexpr inline Xbyak::Reg ABI_PARAM3 = Xbyak::util::r8;
58const Xbyak::Reg ABI_PARAM4 = Xbyak::util::r9; 58constexpr inline Xbyak::Reg ABI_PARAM4 = Xbyak::util::r9;
59 59
60const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({ 60const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
61 // GPRs 61 // GPRs
@@ -102,11 +102,11 @@ constexpr size_t ABI_SHADOW_SPACE = 0x20;
102#else 102#else
103 103
104// System V x86-64 ABI 104// System V x86-64 ABI
105const Xbyak::Reg ABI_RETURN = Xbyak::util::rax; 105constexpr inline Xbyak::Reg ABI_RETURN = Xbyak::util::rax;
106const Xbyak::Reg ABI_PARAM1 = Xbyak::util::rdi; 106constexpr inline Xbyak::Reg ABI_PARAM1 = Xbyak::util::rdi;
107const Xbyak::Reg ABI_PARAM2 = Xbyak::util::rsi; 107constexpr inline Xbyak::Reg ABI_PARAM2 = Xbyak::util::rsi;
108const Xbyak::Reg ABI_PARAM3 = Xbyak::util::rdx; 108constexpr inline Xbyak::Reg ABI_PARAM3 = Xbyak::util::rdx;
109const Xbyak::Reg ABI_PARAM4 = Xbyak::util::rcx; 109constexpr inline Xbyak::Reg ABI_PARAM4 = Xbyak::util::rcx;
110 110
111const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({ 111const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({
112 // GPRs 112 // GPRs
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp
index c1b9e4ad9..954b87515 100644
--- a/src/video_core/macro/macro_jit_x64.cpp
+++ b/src/video_core/macro/macro_jit_x64.cpp
@@ -14,11 +14,11 @@ MICROPROFILE_DEFINE(MacroJitCompile, "GPU", "Compile macro JIT", MP_RGB(173, 255
14MICROPROFILE_DEFINE(MacroJitExecute, "GPU", "Execute macro JIT", MP_RGB(255, 255, 0)); 14MICROPROFILE_DEFINE(MacroJitExecute, "GPU", "Execute macro JIT", MP_RGB(255, 255, 0));
15 15
16namespace Tegra { 16namespace Tegra {
17static const Xbyak::Reg64 STATE = Xbyak::util::rbx; 17constexpr Xbyak::Reg64 STATE = Xbyak::util::rbx;
18static const Xbyak::Reg32 RESULT = Xbyak::util::ebp; 18constexpr Xbyak::Reg32 RESULT = Xbyak::util::ebp;
19static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r12; 19constexpr Xbyak::Reg64 PARAMETERS = Xbyak::util::r12;
20static const Xbyak::Reg32 METHOD_ADDRESS = Xbyak::util::r14d; 20constexpr Xbyak::Reg32 METHOD_ADDRESS = Xbyak::util::r14d;
21static const Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15; 21constexpr Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15;
22 22
23static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({ 23static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({
24 STATE, 24 STATE,