diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.cpp | 43 | ||||
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.h | 1 |
2 files changed, 26 insertions, 18 deletions
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp index 1b657236a..48501e582 100644 --- a/src/video_core/macro/macro_jit_x64.cpp +++ b/src/video_core/macro/macro_jit_x64.cpp | |||
| @@ -14,18 +14,6 @@ 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 | using JitFunction = void (MacroJITx64Impl::*)(Macro::Opcode opcode); | ||
| 18 | const std::array<JitFunction, 8> InstructionTable{ | ||
| 19 | &MacroJITx64Impl::Compile_ALU, | ||
| 20 | &MacroJITx64Impl::Compile_AddImmediate, | ||
| 21 | &MacroJITx64Impl::Compile_ExtractInsert, | ||
| 22 | &MacroJITx64Impl::Compile_ExtractShiftLeftImmediate, | ||
| 23 | &MacroJITx64Impl::Compile_ExtractShiftLeftRegister, | ||
| 24 | &MacroJITx64Impl::Compile_Read, | ||
| 25 | nullptr, | ||
| 26 | &MacroJITx64Impl::Compile_Branch, | ||
| 27 | }; | ||
| 28 | |||
| 29 | static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r9; | 17 | static const Xbyak::Reg64 PARAMETERS = Xbyak::util::r9; |
| 30 | static const Xbyak::Reg64 REGISTERS = Xbyak::util::r10; | 18 | static const Xbyak::Reg64 REGISTERS = Xbyak::util::r10; |
| 31 | static const Xbyak::Reg64 STATE = Xbyak::util::r11; | 19 | static const Xbyak::Reg64 STATE = Xbyak::util::r11; |
| @@ -489,12 +477,31 @@ bool MacroJITx64Impl::Compile_NextInstruction() { | |||
| 489 | 477 | ||
| 490 | L(labels[pc]); | 478 | L(labels[pc]); |
| 491 | 479 | ||
| 492 | const std::size_t op = static_cast<std::size_t>(opcode.operation.Value()); | 480 | switch (opcode.operation) { |
| 493 | 481 | case Macro::Operation::ALU: | |
| 494 | if (InstructionTable[op] == nullptr) { | 482 | Compile_ALU(opcode); |
| 495 | UNIMPLEMENTED_MSG("Unimplemented opcode {}", op); | 483 | break; |
| 496 | } else { | 484 | case Macro::Operation::AddImmediate: |
| 497 | ((*this).*InstructionTable[op])(opcode); | 485 | Compile_AddImmediate(opcode); |
| 486 | break; | ||
| 487 | case Macro::Operation::ExtractInsert: | ||
| 488 | Compile_ExtractInsert(opcode); | ||
| 489 | break; | ||
| 490 | case Macro::Operation::ExtractShiftLeftImmediate: | ||
| 491 | Compile_ExtractShiftLeftImmediate(opcode); | ||
| 492 | break; | ||
| 493 | case Macro::Operation::ExtractShiftLeftRegister: | ||
| 494 | Compile_ExtractShiftLeftRegister(opcode); | ||
| 495 | break; | ||
| 496 | case Macro::Operation::Read: | ||
| 497 | Compile_Read(opcode); | ||
| 498 | break; | ||
| 499 | case Macro::Operation::Branch: | ||
| 500 | Compile_Branch(opcode); | ||
| 501 | break; | ||
| 502 | default: | ||
| 503 | UNIMPLEMENTED_MSG("Unimplemented opcode {}", opcode.operation.Value()); | ||
| 504 | break; | ||
| 498 | } | 505 | } |
| 499 | 506 | ||
| 500 | if (optimizer.has_delayed_pc) { | 507 | if (optimizer.has_delayed_pc) { |
diff --git a/src/video_core/macro/macro_jit_x64.h b/src/video_core/macro/macro_jit_x64.h index 71cd6a3b0..729ed7713 100644 --- a/src/video_core/macro/macro_jit_x64.h +++ b/src/video_core/macro/macro_jit_x64.h | |||
| @@ -35,6 +35,7 @@ class MacroJITx64Impl : public Xbyak::CodeGenerator, public CachedMacro { | |||
| 35 | public: | 35 | public: |
| 36 | MacroJITx64Impl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code); | 36 | MacroJITx64Impl(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& code); |
| 37 | ~MacroJITx64Impl(); | 37 | ~MacroJITx64Impl(); |
| 38 | |||
| 38 | void Execute(std::vector<u32>& parameters, u32 method) override; | 39 | void Execute(std::vector<u32>& parameters, u32 method) override; |
| 39 | 40 | ||
| 40 | void Compile_ALU(Macro::Opcode opcode); | 41 | void Compile_ALU(Macro::Opcode opcode); |