summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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}