From 51be6233720c636ee9c471add0524ee4a76db207 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 6 Jan 2023 16:53:18 -0800 Subject: [PATCH] intel/eu/validate: Check predication and cmod for SEL, CMP, and CMPN Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw_eu_validate.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c index f51b81dd139..b30c9ba4197 100644 --- a/src/intel/compiler/brw_eu_validate.c +++ b/src/intel/compiler/brw_eu_validate.c @@ -2076,6 +2076,22 @@ instruction_restrictions(const struct brw_isa_info *isa, "If the destination is the null register, the {Switch} " "instruction option must be used."); } + + ERROR_IF(brw_inst_cond_modifier(devinfo, inst) == BRW_CONDITIONAL_NONE, + "CMP (or CMPN) must have a condition."); + } + + if (brw_inst_opcode(isa, inst) == BRW_OPCODE_SEL) { + if (devinfo->ver < 6) { + ERROR_IF(brw_inst_cond_modifier(devinfo, inst) != BRW_CONDITIONAL_NONE, + "SEL must not have a condition modifier"); + ERROR_IF(brw_inst_pred_control(devinfo, inst) == BRW_PREDICATE_NONE, + "SEL must be predicated"); + } else { + ERROR_IF((brw_inst_cond_modifier(devinfo, inst) != BRW_CONDITIONAL_NONE) == + (brw_inst_pred_control(devinfo, inst) != BRW_PREDICATE_NONE), + "SEL must either be predicated or have a condition modifiers"); + } } if (brw_inst_opcode(isa, inst) == BRW_OPCODE_MUL) {