summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar MerryMage2020-06-15 21:00:59 +0100
committerGravatar MerryMage2020-06-15 21:00:59 +0100
commit79aa7b3aceeecadfb5b15bc25431db7768434f23 (patch)
tree5e65abbc8c1ad752940858fe1a87cc0d146c8bdf /src
parentmacro_jit_x64: Remove JITState::parameters (diff)
downloadyuzu-79aa7b3aceeecadfb5b15bc25431db7768434f23.tar.gz
yuzu-79aa7b3aceeecadfb5b15bc25431db7768434f23.tar.xz
yuzu-79aa7b3aceeecadfb5b15bc25431db7768434f23.zip
macro_jit_x64: Remove REGISTERS
Unnecessary since this is just an offset from STATE.
Diffstat (limited to '')
-rw-r--r--src/video_core/macro/macro_jit_x64.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp
index f1d123f51..da3b86d3d 100644
--- a/src/video_core/macro/macro_jit_x64.cpp
+++ b/src/video_core/macro/macro_jit_x64.cpp
@@ -15,7 +15,6 @@ MICROPROFILE_DEFINE(MacroJitExecute, "GPU", "Execute macro JIT", MP_RGB(255, 255
15 15
16namespace Tegra { 16namespace Tegra {
17static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r9; 17static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r9;
18static const Xbyak::Reg64 REGISTERS = Xbyak::util::r10;
19static const Xbyak::Reg64 STATE = Xbyak::util::r11; 18static const Xbyak::Reg64 STATE = Xbyak::util::r11;
20static const Xbyak::Reg64 NEXT_PARAMETER = Xbyak::util::r12; 19static const Xbyak::Reg64 NEXT_PARAMETER = Xbyak::util::r12;
21static const Xbyak::Reg32 RESULT = Xbyak::util::r13d; 20static const Xbyak::Reg32 RESULT = Xbyak::util::r13d;
@@ -24,7 +23,6 @@ static const Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15;
24 23
25static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({ 24static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({
26 PARAMETERS, 25 PARAMETERS,
27 REGISTERS,
28 STATE, 26 STATE,
29 NEXT_PARAMETER, 27 NEXT_PARAMETER,
30 RESULT, 28 RESULT,
@@ -422,14 +420,12 @@ void MacroJITx64Impl::Compile() {
422 // JIT state 420 // JIT state
423 mov(STATE, Common::X64::ABI_PARAM1); 421 mov(STATE, Common::X64::ABI_PARAM1);
424 mov(PARAMETERS, Common::X64::ABI_PARAM2); 422 mov(PARAMETERS, Common::X64::ABI_PARAM2);
425 mov(REGISTERS, Common::X64::ABI_PARAM1);
426 add(REGISTERS, static_cast<Xbyak::uint32>(offsetof(JITState, registers)));
427 xor_(RESULT, RESULT); 423 xor_(RESULT, RESULT);
428 xor_(METHOD_ADDRESS, METHOD_ADDRESS); 424 xor_(METHOD_ADDRESS, METHOD_ADDRESS);
429 xor_(NEXT_PARAMETER, NEXT_PARAMETER); 425 xor_(NEXT_PARAMETER, NEXT_PARAMETER);
430 xor_(BRANCH_HOLDER, BRANCH_HOLDER); 426 xor_(BRANCH_HOLDER, BRANCH_HOLDER);
431 427
432 mov(dword[REGISTERS + 4], Compile_FetchParameter()); 428 mov(dword[STATE + offsetof(JITState, registers) + 4], Compile_FetchParameter());
433 429
434 // Track get register for zero registers and mark it as no-op 430 // Track get register for zero registers and mark it as no-op
435 optimizer.zero_reg_skip = true; 431 optimizer.zero_reg_skip = true;
@@ -543,7 +539,7 @@ Xbyak::Reg32 MacroJITx64Impl::Compile_GetRegister(u32 index, Xbyak::Reg32 dst) {
543 // Register 0 is always zero 539 // Register 0 is always zero
544 xor_(dst, dst); 540 xor_(dst, dst);
545 } else { 541 } else {
546 mov(dst, dword[REGISTERS + index * sizeof(u32)]); 542 mov(dst, dword[STATE + offsetof(JITState, registers) + index * sizeof(u32)]);
547 } 543 }
548 544
549 return dst; 545 return dst;
@@ -564,7 +560,7 @@ void MacroJITx64Impl::Compile_ProcessResult(Macro::ResultOperation operation, u3
564 if (reg == 0) { 560 if (reg == 0) {
565 return; 561 return;
566 } 562 }
567 mov(dword[REGISTERS + reg * sizeof(u32)], result); 563 mov(dword[STATE + offsetof(JITState, registers) + reg * sizeof(u32)], result);
568 }; 564 };
569 auto SetMethodAddress = [=](Xbyak::Reg32 reg) { mov(METHOD_ADDRESS, reg); }; 565 auto SetMethodAddress = [=](Xbyak::Reg32 reg) { mov(METHOD_ADDRESS, reg); };
570 566