diff options
| author | 2020-06-15 22:01:00 +0100 | |
|---|---|---|
| committer | 2020-06-17 10:36:34 +0100 | |
| commit | a6ddd7c382e0362d5e86c1622c85c78c59c5aa3b (patch) | |
| tree | 10c242dcba2ce14eab5e4f7f5d35886c16af56df /src | |
| parent | Merge pull request #4089 from MerryMage/macrojit-cleanup-1 (diff) | |
| download | yuzu-a6ddd7c382e0362d5e86c1622c85c78c59c5aa3b.tar.gz yuzu-a6ddd7c382e0362d5e86c1622c85c78c59c5aa3b.tar.xz yuzu-a6ddd7c382e0362d5e86c1622c85c78c59c5aa3b.zip | |
macro_jit_x64: Should not skip zero registers for certain ALU ops
The code generated for these ALU ops assume src_a and src_b are always valid.
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp index 2eb98173d..08279b9bc 100644 --- a/src/video_core/macro/macro_jit_x64.cpp +++ b/src/video_core/macro/macro_jit_x64.cpp | |||
| @@ -56,11 +56,13 @@ void MacroJITx64Impl::Compile_ALU(Macro::Opcode opcode) { | |||
| 56 | const bool valid_operation = !is_a_zero && !is_b_zero; | 56 | const bool valid_operation = !is_a_zero && !is_b_zero; |
| 57 | const bool is_move_operation = !is_a_zero && is_b_zero; | 57 | const bool is_move_operation = !is_a_zero && is_b_zero; |
| 58 | const bool has_zero_register = is_a_zero || is_b_zero; | 58 | const bool has_zero_register = is_a_zero || is_b_zero; |
| 59 | const bool no_zero_reg_skip = opcode.alu_operation == Macro::ALUOperation::AddWithCarry || | ||
| 60 | opcode.alu_operation == Macro::ALUOperation::SubtractWithBorrow; | ||
| 59 | 61 | ||
| 60 | Xbyak::Reg32 src_a; | 62 | Xbyak::Reg32 src_a; |
| 61 | Xbyak::Reg32 src_b; | 63 | Xbyak::Reg32 src_b; |
| 62 | 64 | ||
| 63 | if (!optimizer.zero_reg_skip) { | 65 | if (!optimizer.zero_reg_skip || no_zero_reg_skip) { |
| 64 | src_a = Compile_GetRegister(opcode.src_a, RESULT); | 66 | src_a = Compile_GetRegister(opcode.src_a, RESULT); |
| 65 | src_b = Compile_GetRegister(opcode.src_b, eax); | 67 | src_b = Compile_GetRegister(opcode.src_b, eax); |
| 66 | } else { | 68 | } else { |