diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/x64/xbyak_abi.h | 32 | ||||
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.cpp | 10 |
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 | ||
| 12 | namespace Common::X64 { | 12 | namespace Common::X64 { |
| 13 | 13 | ||
| 14 | inline std::size_t RegToIndex(const Xbyak::Reg& reg) { | 14 | constexpr 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 | ||
| 22 | inline Xbyak::Reg64 IndexToReg64(std::size_t reg_index) { | 22 | constexpr 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 | ||
| 27 | inline Xbyak::Xmm IndexToXmm(std::size_t reg_index) { | 27 | constexpr 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 | ||
| 32 | inline Xbyak::Reg IndexToReg(std::size_t reg_index) { | 32 | constexpr 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 | ||
| 48 | const std::bitset<32> ABI_ALL_GPRS(0x0000FFFF); | 48 | constexpr inline std::bitset<32> ABI_ALL_GPRS(0x0000FFFF); |
| 49 | const std::bitset<32> ABI_ALL_XMMS(0xFFFF0000); | 49 | constexpr 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 |
| 54 | const Xbyak::Reg ABI_RETURN = Xbyak::util::rax; | 54 | constexpr inline Xbyak::Reg ABI_RETURN = Xbyak::util::rax; |
| 55 | const Xbyak::Reg ABI_PARAM1 = Xbyak::util::rcx; | 55 | constexpr inline Xbyak::Reg ABI_PARAM1 = Xbyak::util::rcx; |
| 56 | const Xbyak::Reg ABI_PARAM2 = Xbyak::util::rdx; | 56 | constexpr inline Xbyak::Reg ABI_PARAM2 = Xbyak::util::rdx; |
| 57 | const Xbyak::Reg ABI_PARAM3 = Xbyak::util::r8; | 57 | constexpr inline Xbyak::Reg ABI_PARAM3 = Xbyak::util::r8; |
| 58 | const Xbyak::Reg ABI_PARAM4 = Xbyak::util::r9; | 58 | constexpr inline Xbyak::Reg ABI_PARAM4 = Xbyak::util::r9; |
| 59 | 59 | ||
| 60 | const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({ | 60 | const 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 |
| 105 | const Xbyak::Reg ABI_RETURN = Xbyak::util::rax; | 105 | constexpr inline Xbyak::Reg ABI_RETURN = Xbyak::util::rax; |
| 106 | const Xbyak::Reg ABI_PARAM1 = Xbyak::util::rdi; | 106 | constexpr inline Xbyak::Reg ABI_PARAM1 = Xbyak::util::rdi; |
| 107 | const Xbyak::Reg ABI_PARAM2 = Xbyak::util::rsi; | 107 | constexpr inline Xbyak::Reg ABI_PARAM2 = Xbyak::util::rsi; |
| 108 | const Xbyak::Reg ABI_PARAM3 = Xbyak::util::rdx; | 108 | constexpr inline Xbyak::Reg ABI_PARAM3 = Xbyak::util::rdx; |
| 109 | const Xbyak::Reg ABI_PARAM4 = Xbyak::util::rcx; | 109 | constexpr inline Xbyak::Reg ABI_PARAM4 = Xbyak::util::rcx; |
| 110 | 110 | ||
| 111 | const std::bitset<32> ABI_ALL_CALLER_SAVED = BuildRegSet({ | 111 | const 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 | |||
| 14 | MICROPROFILE_DEFINE(MacroJitExecute, "GPU", "Execute macro JIT", MP_RGB(255, 255, 0)); | 14 | MICROPROFILE_DEFINE(MacroJitExecute, "GPU", "Execute macro JIT", MP_RGB(255, 255, 0)); |
| 15 | 15 | ||
| 16 | namespace Tegra { | 16 | namespace Tegra { |
| 17 | static const Xbyak::Reg64 STATE = Xbyak::util::rbx; | 17 | constexpr Xbyak::Reg64 STATE = Xbyak::util::rbx; |
| 18 | static const Xbyak::Reg32 RESULT = Xbyak::util::ebp; | 18 | constexpr Xbyak::Reg32 RESULT = Xbyak::util::ebp; |
| 19 | static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r12; | 19 | constexpr Xbyak::Reg64 PARAMETERS = Xbyak::util::r12; |
| 20 | static const Xbyak::Reg32 METHOD_ADDRESS = Xbyak::util::r14d; | 20 | constexpr Xbyak::Reg32 METHOD_ADDRESS = Xbyak::util::r14d; |
| 21 | static const Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15; | 21 | constexpr Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15; |
| 22 | 22 | ||
| 23 | static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({ | 23 | static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({ |
| 24 | STATE, | 24 | STATE, |