summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar MerryMage2020-06-15 21:12:53 +0100
committerGravatar MerryMage2020-06-15 21:19:38 +0100
commitc09a9e5cc7f53280218cdfbfd7d7ff056f1c2ff5 (patch)
tree42709cd33842b88cef1f82c068862a322c676d06
parentmacro_jit_x64: Remove REGISTERS (diff)
downloadyuzu-c09a9e5cc7f53280218cdfbfd7d7ff056f1c2ff5.tar.gz
yuzu-c09a9e5cc7f53280218cdfbfd7d7ff056f1c2ff5.tar.xz
yuzu-c09a9e5cc7f53280218cdfbfd7d7ff056f1c2ff5.zip
macro_jit_x64: Select better registers
All registers are now callee-save registers. RBX and RBP selected for STATE and RESULT because these are most commonly accessed; this is to avoid the REX prefix. RBP not used for STATE because there are some SIB restrictions, RBX emits smaller code.
Diffstat (limited to '')
-rw-r--r--src/video_core/macro/macro_jit_x64.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp
index da3b86d3d..1e7b05ac9 100644
--- a/src/video_core/macro/macro_jit_x64.cpp
+++ b/src/video_core/macro/macro_jit_x64.cpp
@@ -14,18 +14,18 @@ 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 PARAMETERS = Xbyak::util::r9; 17static const Xbyak::Reg64 STATE = Xbyak::util::rbx;
18static const Xbyak::Reg64 STATE = Xbyak::util::r11; 18static const Xbyak::Reg32 RESULT = Xbyak::util::ebp;
19static const Xbyak::Reg64 NEXT_PARAMETER = Xbyak::util::r12; 19static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r12;
20static const Xbyak::Reg32 RESULT = Xbyak::util::r13d; 20static const Xbyak::Reg64 NEXT_PARAMETER = Xbyak::util::r13;
21static const Xbyak::Reg32 METHOD_ADDRESS = Xbyak::util::r14d; 21static const Xbyak::Reg32 METHOD_ADDRESS = Xbyak::util::r14d;
22static const Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15; 22static const Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15;
23 23
24static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({ 24static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({
25 PARAMETERS,
26 STATE, 25 STATE,
27 NEXT_PARAMETER,
28 RESULT, 26 RESULT,
27 PARAMETERS,
28 NEXT_PARAMETER,
29 METHOD_ADDRESS, 29 METHOD_ADDRESS,
30 BRANCH_HOLDER, 30 BRANCH_HOLDER,
31}); 31});
@@ -64,13 +64,13 @@ void MacroJITx64Impl::Compile_ALU(Macro::Opcode opcode) {
64 64
65 if (!optimizer.zero_reg_skip) { 65 if (!optimizer.zero_reg_skip) {
66 src_a = Compile_GetRegister(opcode.src_a, RESULT); 66 src_a = Compile_GetRegister(opcode.src_a, RESULT);
67 src_b = Compile_GetRegister(opcode.src_b, ebx); 67 src_b = Compile_GetRegister(opcode.src_b, eax);
68 } else { 68 } else {
69 if (!is_a_zero) { 69 if (!is_a_zero) {
70 src_a = Compile_GetRegister(opcode.src_a, RESULT); 70 src_a = Compile_GetRegister(opcode.src_a, RESULT);
71 } 71 }
72 if (!is_b_zero) { 72 if (!is_b_zero) {
73 src_b = Compile_GetRegister(opcode.src_b, ebx); 73 src_b = Compile_GetRegister(opcode.src_b, eax);
74 } 74 }
75 } 75 }
76 Xbyak::Label skip_carry{}; 76 Xbyak::Label skip_carry{};