summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/shader_bytecode.h2
-rw-r--r--src/video_core/shader/decode/arithmetic_integer.cpp15
2 files changed, 11 insertions, 6 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 82d912c76..203e7758c 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -1636,6 +1636,7 @@ public:
1636 ICMP_RC, 1636 ICMP_RC,
1637 ICMP_R, 1637 ICMP_R,
1638 ICMP_CR, 1638 ICMP_CR,
1639 ICMP_IMM,
1639 MUFU, // Multi-Function Operator 1640 MUFU, // Multi-Function Operator
1640 RRO_C, // Range Reduction Operator 1641 RRO_C, // Range Reduction Operator
1641 RRO_R, 1642 RRO_R,
@@ -1903,6 +1904,7 @@ private:
1903 INST("010100110100----", Id::ICMP_RC, Type::ArithmeticInteger, "ICMP_RC"), 1904 INST("010100110100----", Id::ICMP_RC, Type::ArithmeticInteger, "ICMP_RC"),
1904 INST("010110110100----", Id::ICMP_R, Type::ArithmeticInteger, "ICMP_R"), 1905 INST("010110110100----", Id::ICMP_R, Type::ArithmeticInteger, "ICMP_R"),
1905 INST("010010110100----", Id::ICMP_CR, Type::ArithmeticInteger, "ICMP_CR"), 1906 INST("010010110100----", Id::ICMP_CR, Type::ArithmeticInteger, "ICMP_CR"),
1907 INST("0011011-0100----", Id::ICMP_IMM, Type::ArithmeticInteger, "ICMP_IMM"),
1906 INST("0101101111011---", Id::LEA_R2, Type::ArithmeticInteger, "LEA_R2"), 1908 INST("0101101111011---", Id::LEA_R2, Type::ArithmeticInteger, "LEA_R2"),
1907 INST("0101101111010---", Id::LEA_R1, Type::ArithmeticInteger, "LEA_R1"), 1909 INST("0101101111010---", Id::LEA_R1, Type::ArithmeticInteger, "LEA_R1"),
1908 INST("001101101101----", Id::LEA_IMM, Type::ArithmeticInteger, "LEA_IMM"), 1910 INST("001101101101----", Id::LEA_IMM, Type::ArithmeticInteger, "LEA_IMM"),
diff --git a/src/video_core/shader/decode/arithmetic_integer.cpp b/src/video_core/shader/decode/arithmetic_integer.cpp
index 1aa21010a..b73f6536e 100644
--- a/src/video_core/shader/decode/arithmetic_integer.cpp
+++ b/src/video_core/shader/decode/arithmetic_integer.cpp
@@ -140,11 +140,11 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
140 } 140 }
141 case OpCode::Id::ICMP_CR: 141 case OpCode::Id::ICMP_CR:
142 case OpCode::Id::ICMP_R: 142 case OpCode::Id::ICMP_R:
143 case OpCode::Id::ICMP_RC: { 143 case OpCode::Id::ICMP_RC:
144 UNIMPLEMENTED_IF(instr.icmp.is_signed != 0); 144 case OpCode::Id::ICMP_IMM: {
145 const Node zero = Immediate(0); 145 const Node zero = Immediate(0);
146 146
147 const auto [op_a, op_b] = [&]() -> std::tuple<Node, Node> { 147 const auto [op_b, test] = [&]() -> std::pair<Node, Node> {
148 switch (opcode->get().GetId()) { 148 switch (opcode->get().GetId()) {
149 case OpCode::Id::ICMP_CR: 149 case OpCode::Id::ICMP_CR:
150 return {GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset), 150 return {GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset),
@@ -154,13 +154,16 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
154 case OpCode::Id::ICMP_RC: 154 case OpCode::Id::ICMP_RC:
155 return {GetRegister(instr.gpr39), 155 return {GetRegister(instr.gpr39),
156 GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset)}; 156 GetConstBuffer(instr.cbuf34.index, instr.cbuf34.offset)};
157 case OpCode::Id::ICMP_IMM:
158 return {Immediate(instr.alu.GetSignedImm20_20()), GetRegister(instr.gpr39)};
157 default: 159 default:
158 UNIMPLEMENTED(); 160 UNREACHABLE();
159 return {zero, zero}; 161 return {zero, zero};
160 } 162 }
161 }(); 163 }();
162 const Node test = GetRegister(instr.gpr8); 164 const Node op_a = GetRegister(instr.gpr8);
163 const Node comparison = GetPredicateComparisonInteger(instr.icmp.cond, false, test, zero); 165 const Node comparison =
166 GetPredicateComparisonInteger(instr.icmp.cond, instr.icmp.is_signed != 0, test, zero);
164 SetRegister(bb, instr.gpr0, Operation(OperationCode::Select, comparison, op_a, op_b)); 167 SetRegister(bb, instr.gpr0, Operation(OperationCode::Select, comparison, op_a, op_b));
165 break; 168 break;
166 } 169 }