From 083d2d89a5ef0d5f61de60bd241e65f43289a381 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 24 Jan 2016 20:20:39 -0800 Subject: Shader: Implement "invert condition" feature of IFU instruction If the bit 0 of the JMPU instruction is set, then the jump condition will be inverted. That is, a jump will happen when the boolean is false instead of when it is true. --- src/video_core/shader/shader_jit_x64.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/video_core/shader/shader_jit_x64.cpp') diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index 00415e402..6554830b2 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -710,7 +710,9 @@ void JitCompiler::Compile_JMP(Instruction instr) { else UNREACHABLE(); - FixupBranch b = J_CC(CC_NZ, true); + bool inverted_condition = (instr.opcode.Value() == OpCode::Id::JMPU) && + (instr.flow_control.num_instructions & 1); + FixupBranch b = J_CC(inverted_condition ? CC_Z : CC_NZ, true); Compile_Block(instr.flow_control.dest_offset); -- cgit v1.2.3