From 1d0f42c264cdaec088375d379d29f5cc756d8d2d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 23 Jan 2026 15:52:47 -0500 Subject: [PATCH] brw/eu_emit: relax assertion to allow ARF NULL On new platforms, it's valid to use a NULL destination in conjunction with a cmod, where you care about the implicit flag write but you don't need to clobber any GRF. Something like: if (x * y > z) { compiling (with fast-math) to mad.gt.f0 _, -z, x, y (f0) if This patch allows us to emit that instruction. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Ian Romanick Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw/brw_eu_emit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw/brw_eu_emit.c b/src/intel/compiler/brw/brw_eu_emit.c index f78639e89a8..b19a3925b3b 100644 --- a/src/intel/compiler/brw/brw_eu_emit.c +++ b/src/intel/compiler/brw/brw_eu_emit.c @@ -589,7 +589,8 @@ brw_alu3(struct brw_codegen *p, unsigned opcode, struct brw_reg dest, if (brw_eu_inst_access_mode(devinfo, inst) == BRW_ALIGN_1) { assert(dest.file == FIXED_GRF || - brw_reg_is_arf(dest, BRW_ARF_ACCUMULATOR)); + brw_reg_is_arf(dest, BRW_ARF_ACCUMULATOR) || + brw_reg_is_arf(dest, BRW_ARF_NULL)); brw_eu_inst_set_3src_a1_dst_reg_file(devinfo, inst, phys_file(dest)); brw_eu_inst_set_3src_dst_reg_nr(devinfo, inst, phys_nr(devinfo, dest));