From c52ce6157facce3ff6ad720ba0ae443195ecee6c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 18 Nov 2024 09:25:53 -0800 Subject: [PATCH] brw/emit: Fix typo in recently added ADD3 assertion The current assertion fails as soon as a MAD with src0 and src2 being immediate is detected. The assertion was supposted to catch, "If it's ADD3, only one of src0 and src2 can be immediate." The detect this, the opcode test should have been !=. Reviewed-by: Caio Oliveira Reviewed-by: Matt Turner Fixes: c1c09e3c4a0 ("brw/emit: Add correct 3-source instruction assertions for each platform") Part-of: --- src/intel/compiler/brw_eu_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c index c22fd1435b4..1466f831601 100644 --- a/src/intel/compiler/brw_eu_emit.c +++ b/src/intel/compiler/brw_eu_emit.c @@ -562,7 +562,7 @@ brw_alu3(struct brw_codegen *p, unsigned opcode, struct brw_reg dest, /* Having two immediate sources is allowed, but this should have been * converted to a regular ADD by brw_fs_opt_algebraic. */ - assert(opcode == BRW_OPCODE_ADD3 || + assert(opcode != BRW_OPCODE_ADD3 || !(src0.file == IMM && src2.file == IMM)); }