diff options
Diffstat (limited to 'src/video_core/shader')
| -rw-r--r-- | src/video_core/shader/decode/arithmetic_integer.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/arithmetic_integer.cpp b/src/video_core/shader/decode/arithmetic_integer.cpp index c8c1a7f40..1aa21010a 100644 --- a/src/video_core/shader/decode/arithmetic_integer.cpp +++ b/src/video_core/shader/decode/arithmetic_integer.cpp | |||
| @@ -138,6 +138,32 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) { | |||
| 138 | SetRegister(bb, instr.gpr0, value); | 138 | SetRegister(bb, instr.gpr0, value); |
| 139 | break; | 139 | break; |
| 140 | } | 140 | } |
| 141 | case OpCode::Id::ICMP_CR: | ||
| 142 | case OpCode::Id::ICMP_R: | ||
| 143 | case OpCode::Id::ICMP_RC: { | ||
| 144 | UNIMPLEMENTED_IF(instr.icmp.is_signed != 0); | ||
| 145 | const Node zero = Immediate(0); | ||
| 146 | |||
| 147 | const auto [op_a, op_b] = [&]() -> std::tuple<Node, Node> { | ||
| 148 | switch (opcode->get().GetId()) { | ||
| 149 | case OpCode::Id::ICMP_CR: | ||
| 150 | return {GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset), | ||
| 151 | GetRegister(instr.gpr39)}; | ||
| 152 | case OpCode::Id::ICMP_R: | ||
| 153 | return {GetRegister(instr.gpr20), GetRegister(instr.gpr39)}; | ||
| 154 | case OpCode::Id::ICMP_RC: | ||
| 155 | return {GetRegister(instr.gpr39), | ||
| 156 | GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset)}; | ||
| 157 | default: | ||
| 158 | UNIMPLEMENTED(); | ||
| 159 | return {zero, zero}; | ||
| 160 | } | ||
| 161 | }(); | ||
| 162 | const Node test = GetRegister(instr.gpr8); | ||
| 163 | const Node comparison = GetPredicateComparisonInteger(instr.icmp.cond, false, test, zero); | ||
| 164 | SetRegister(bb, instr.gpr0, Operation(OperationCode::Select, comparison, op_a, op_b)); | ||
| 165 | break; | ||
| 166 | } | ||
| 141 | case OpCode::Id::LOP_C: | 167 | case OpCode::Id::LOP_C: |
| 142 | case OpCode::Id::LOP_R: | 168 | case OpCode::Id::LOP_R: |
| 143 | case OpCode::Id::LOP_IMM: { | 169 | case OpCode::Id::LOP_IMM: { |