diff options
author | Subv <subv2112@gmail.com> | 2018-06-04 20:24:31 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2018-06-04 20:56:31 +0200 |
commit | 0c688b421cf3488c9b4a46a8ca58053be9defad3 (patch) | |
tree | bab57d98c4a5a2339a313af4e07725f74f2c9acc /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | Merge pull request #499 from bunnei/am-stuff (diff) | |
download | yuzu-0c688b421cf3488c9b4a46a8ca58053be9defad3.tar yuzu-0c688b421cf3488c9b4a46a8ca58053be9defad3.tar.gz yuzu-0c688b421cf3488c9b4a46a8ca58053be9defad3.tar.bz2 yuzu-0c688b421cf3488c9b4a46a8ca58053be9defad3.tar.lz yuzu-0c688b421cf3488c9b4a46a8ca58053be9defad3.tar.xz yuzu-0c688b421cf3488c9b4a46a8ca58053be9defad3.tar.zst yuzu-0c688b421cf3488c9b4a46a8ca58053be9defad3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index bb5209a7e..e29f0a1d3 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -808,6 +808,49 @@ private: } break; } + case OpCode::Type::Logic: { + std::string op_a = regs.GetRegisterAsInteger(instr.gpr8, 0, false); + + if (instr.alu.lop.invert_a) + op_a = "~(" + op_a + ')'; + + switch (opcode->GetId()) { + case OpCode::Id::LOP32I: { + u32 imm = static_cast<u32>(instr.alu.imm20_32.Value()); + + if (instr.alu.lop.invert_b) + imm = ~imm; + + switch (instr.alu.lop.operation) { + case Tegra::Shader::LogicOperation::And: { + regs.SetRegisterToInteger(instr.gpr0, false, 0, + '(' + op_a + " & " + std::to_string(imm) + ')', 1, 1); + break; + } + case Tegra::Shader::LogicOperation::Or: { + regs.SetRegisterToInteger(instr.gpr0, false, 0, + '(' + op_a + " | " + std::to_string(imm) + ')', 1, 1); + break; + } + case Tegra::Shader::LogicOperation::Xor: { + regs.SetRegisterToInteger(instr.gpr0, false, 0, + '(' + op_a + " ^ " + std::to_string(imm) + ')', 1, 1); + break; + } + default: + NGLOG_CRITICAL(HW_GPU, "Unimplemented lop32i operation: {}", + static_cast<u32>(instr.alu.lop.operation.Value())); + UNREACHABLE(); + } + break; + } + default: { + NGLOG_CRITICAL(HW_GPU, "Unhandled logic instruction: {}", opcode->GetName()); + UNREACHABLE(); + } + } + break; + } case OpCode::Type::Ffma: { std::string op_a = regs.GetRegisterAsFloat(instr.gpr8); std::string op_b = instr.ffma.negate_b ? "-" : ""; |