summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2016-04-09 11:39:56 -0400
committerGravatar bunnei2016-04-13 23:04:50 -0400
commit1d45b57939b10bc1bc13ee33ad74e968850af703 (patch)
tree943d903b35618810ee136354be68d2ab707b3491 /src
parentshader_jit_x64: Get rid of unnecessary last_program_counter variable. (diff)
downloadyuzu-1d45b57939b10bc1bc13ee33ad74e968850af703.tar.gz
yuzu-1d45b57939b10bc1bc13ee33ad74e968850af703.tar.xz
yuzu-1d45b57939b10bc1bc13ee33ad74e968850af703.zip
shader_jit_x64: Separate initialization and code generation for readability.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/shader_jit_x64.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp
index fae7e8b41..efea55811 100644
--- a/src/video_core/shader/shader_jit_x64.cpp
+++ b/src/video_core/shader/shader_jit_x64.cpp
@@ -810,7 +810,15 @@ void JitCompiler::FindReturnOffsets() {
810} 810}
811 811
812void JitCompiler::Compile() { 812void JitCompiler::Compile() {
813 // Reset flow control state
813 program = (CompiledShader*)GetCodePtr(); 814 program = (CompiledShader*)GetCodePtr();
815 program_counter = 0;
816 looping = false;
817 code_ptr.fill(nullptr);
818 fixup_branches.clear();
819
820 // Find all `CALL` instructions and identify return locations
821 FindReturnOffsets();
814 822
815 // The stack pointer is 8 modulo 16 at the entry of a procedure 823 // The stack pointer is 8 modulo 16 at the entry of a procedure
816 ABI_PushRegistersAndAdjustStack(ABI_ALL_CALLEE_SAVED, 8); 824 ABI_PushRegistersAndAdjustStack(ABI_ALL_CALLEE_SAVED, 8);
@@ -833,15 +841,6 @@ void JitCompiler::Compile() {
833 MOV(PTRBITS, R(RAX), ImmPtr(&neg)); 841 MOV(PTRBITS, R(RAX), ImmPtr(&neg));
834 MOVAPS(NEGBIT, MatR(RAX)); 842 MOVAPS(NEGBIT, MatR(RAX));
835 843
836 // Find all `CALL` instructions and identify return locations
837 FindReturnOffsets();
838
839 // Reset flow control state
840 program_counter = 0;
841 looping = false;
842 code_ptr.fill(nullptr);
843 fixup_branches.clear();
844
845 // Jump to start of the shader program 844 // Jump to start of the shader program
846 JMPptr(R(ABI_PARAM2)); 845 JMPptr(R(ABI_PARAM2));
847 846