diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-11-21 20:01:35 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-11-21 20:12:30 +0100 |
commit | 642dfeda2ae2ee435b8b41854058aefcef7750af (patch) | |
tree | 7fb1665436f91281a9c11796003ed6bad9eeafe6 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | Merge pull request #1751 from bunnei/color-mask-fix (diff) | |
download | yuzu-642dfeda2ae2ee435b8b41854058aefcef7750af.tar yuzu-642dfeda2ae2ee435b8b41854058aefcef7750af.tar.gz yuzu-642dfeda2ae2ee435b8b41854058aefcef7750af.tar.bz2 yuzu-642dfeda2ae2ee435b8b41854058aefcef7750af.tar.lz yuzu-642dfeda2ae2ee435b8b41854058aefcef7750af.tar.xz yuzu-642dfeda2ae2ee435b8b41854058aefcef7750af.tar.zst yuzu-642dfeda2ae2ee435b8b41854058aefcef7750af.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 20 |
1 files changed, 20 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 5fde22ad4..4c662eedb 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1700,6 +1700,26 @@ private: break; } + case OpCode::Type::Bfi: { + UNIMPLEMENTED_IF(instr.generates_cc); + + const auto [base, packed_shift] = [&]() -> std::tuple<std::string, std::string> { + switch (opcode->get().GetId()) { + case OpCode::Id::BFI_IMM_R: + return {regs.GetRegisterAsInteger(instr.gpr39, 0, false), + std::to_string(instr.alu.GetSignedImm20_20())}; + default: + UNREACHABLE(); + } + }(); + const std::string offset = '(' + packed_shift + " & 0xff)"; + const std::string bits = "((" + packed_shift + " >> 8) & 0xff)"; + const std::string insert = regs.GetRegisterAsInteger(instr.gpr8, 0, false); + regs.SetRegisterToInteger( + instr.gpr0, false, 0, + "bitfieldInsert(" + base + ", " + insert + ", " + offset + ", " + bits + ')', 1, 1); + break; + } case OpCode::Type::Shift: { std::string op_a = regs.GetRegisterAsInteger(instr.gpr8, 0, true); std::string op_b; |