diff --git a/src/shader_recompiler/frontend/control_flow_graph.cpp b/src/shader_recompiler/frontend/control_flow_graph.cpp index 3faf8665..3ff788d5 100644 --- a/src/shader_recompiler/frontend/control_flow_graph.cpp +++ b/src/shader_recompiler/frontend/control_flow_graph.cpp @@ -22,6 +22,11 @@ struct Compare { }; static IR::Condition MakeCondition(Opcode opcode) { + if (IsCmpxOpcode(opcode)) { + ASSERT(opcode == Opcode::V_CMPX_NE_U32); + return IR::Condition::Execnz; + } + switch (opcode) { case Opcode::S_CBRANCH_SCC0: return IR::Condition::Scc0; @@ -37,7 +42,6 @@ static IR::Condition MakeCondition(Opcode opcode) { return IR::Condition::Execnz; case Opcode::S_AND_SAVEEXEC_B64: case Opcode::S_ANDN2_B64: - case Opcode::V_CMPX_NE_U32: return IR::Condition::Execnz; default: return IR::Condition::True; diff --git a/src/shader_recompiler/frontend/opcodes.h b/src/shader_recompiler/frontend/opcodes.h index cdc1e474..e7b8f4a8 100644 --- a/src/shader_recompiler/frontend/opcodes.h +++ b/src/shader_recompiler/frontend/opcodes.h @@ -2194,6 +2194,20 @@ enum class Opcode : u32 { EXP = 0 + (u32)OpcodeMap::OP_MAP_EXP, }; +static constexpr bool IsCmpxOpcode(Opcode op) { + if ((op >= Opcode::V_CMPX_F_F32 && op <= Opcode::V_CMPX_T_F32) || + (op >= Opcode::V_CMPX_F_F64 && op <= Opcode::V_CMPX_T_F64) || + (op >= Opcode::V_CMPSX_F_F32 && op <= Opcode::V_CMPSX_T_F32) || + (op >= Opcode::V_CMPSX_F_F64 && op <= Opcode::V_CMPSX_T_F64) || + (op >= Opcode::V_CMPX_F_I32 && op <= Opcode::V_CMPX_CLASS_F32) || + (op >= Opcode::V_CMPX_F_I64 && op <= Opcode::V_CMPX_CLASS_F64) || + (op >= Opcode::V_CMPX_F_U32 && op <= Opcode::V_CMPX_T_U32) || + (op >= Opcode::V_CMPX_F_U64 && op <= Opcode::V_CMPX_T_U64)) { + return true; + } + return false; +} + enum class EncodingMask : u32 { MASK_9bit = 0x000001FFULL << 23, MASK_7bit = 0x0000007FULL << 25, diff --git a/src/shader_recompiler/frontend/translate/vector_alu.cpp b/src/shader_recompiler/frontend/translate/vector_alu.cpp index 1bbc3c16..0216238a 100644 --- a/src/shader_recompiler/frontend/translate/vector_alu.cpp +++ b/src/shader_recompiler/frontend/translate/vector_alu.cpp @@ -280,6 +280,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) { return V_CMP_U32(ConditionOp::GT, true, false, inst); case Opcode::V_CMP_LT_I32: return V_CMP_U32(ConditionOp::LT, true, false, inst); + case Opcode::V_CMPX_GT_I32: + return V_CMP_U32(ConditionOp::GT, true, true, inst); case Opcode::V_CMPX_LT_I32: return V_CMP_U32(ConditionOp::LT, true, true, inst); case Opcode::V_CMPX_F_U32: