summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2018-12-21 02:05:52 -0300
committerGravatar ReinUsesLisp2019-01-15 17:54:51 -0300
commita2819c204f1a72a63ee5e8cc9a9830cd27fb6853 (patch)
treea4637138bf7506ce120388b7740729e614056178 /src
parentshader_decode: Implement LOP32I (diff)
downloadyuzu-a2819c204f1a72a63ee5e8cc9a9830cd27fb6853.tar.gz
yuzu-a2819c204f1a72a63ee5e8cc9a9830cd27fb6853.tar.xz
yuzu-a2819c204f1a72a63ee5e8cc9a9830cd27fb6853.zip
shader_decode: Implement SHR
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/decode/shift.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/video_core/shader/decode/shift.cpp b/src/video_core/shader/decode/shift.cpp
index 41f5b8cb0..76938fa05 100644
--- a/src/video_core/shader/decode/shift.cpp
+++ b/src/video_core/shader/decode/shift.cpp
@@ -16,7 +16,32 @@ u32 ShaderIR::DecodeShift(BasicBlock& bb, u32 pc) {
16 const Instruction instr = {program_code[pc]}; 16 const Instruction instr = {program_code[pc]};
17 const auto opcode = OpCode::Decode(instr); 17 const auto opcode = OpCode::Decode(instr);
18 18
19 UNIMPLEMENTED(); 19 const Node op_a = GetRegister(instr.gpr8);
20 const Node op_b = [&]() {
21 if (instr.is_b_imm) {
22 return Immediate(instr.alu.GetSignedImm20_20());
23 } else if (instr.is_b_gpr) {
24 return GetRegister(instr.gpr20);
25 } else {
26 return GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset);
27 }
28 }();
29
30 switch (opcode->get().GetId()) {
31 case OpCode::Id::SHR_C:
32 case OpCode::Id::SHR_R:
33 case OpCode::Id::SHR_IMM: {
34 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
35 "Condition codes generation in SHR is not implemented");
36
37 const Node value = SignedOperation(OperationCode::IArithmeticShiftRight,
38 instr.shift.is_signed, PRECISE, op_a, op_b);
39 SetRegister(bb, instr.gpr0, value);
40 break;
41 }
42 default:
43 UNIMPLEMENTED_MSG("Unhandled shift instruction: {}", opcode->get().GetName());
44 }
20 45
21 return pc; 46 return pc;
22} 47}