diff options
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.cpp | 10 |
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 | ||
| 16 | namespace Tegra { | 16 | namespace Tegra { |
| 17 | static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r9; | 17 | static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r9; |
| 18 | static const Xbyak::Reg64 REGISTERS = Xbyak::util::r10; | ||
| 19 | static const Xbyak::Reg64 STATE = Xbyak::util::r11; | 18 | static const Xbyak::Reg64 STATE = Xbyak::util::r11; |
| 20 | static const Xbyak::Reg64 NEXT_PARAMETER = Xbyak::util::r12; | 19 | static const Xbyak::Reg64 NEXT_PARAMETER = Xbyak::util::r12; |
| 21 | static const Xbyak::Reg32 RESULT = Xbyak::util::r13d; | 20 | static const Xbyak::Reg32 RESULT = Xbyak::util::r13d; |
| @@ -24,7 +23,6 @@ static const Xbyak::Reg64 BRANCH_HOLDER = Xbyak::util::r15; | |||
| 24 | 23 | ||
| 25 | static const std::bitset<32> PERSISTENT_REGISTERS = Common::X64::BuildRegSet({ | 24 | static 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 | ||