From 99d3755bddeb0d938819ea8a7af235f778195bb7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 14 Nov 2024 11:55:42 -0800 Subject: [PATCH] brw/const: Allow HF constants in MAD on Gfx11 These can't mix with F values, but if the non-constant sources are already HF, this is allowed in src0. No shader-db changes on any Intel platform. fossil-db: Ice Lake Totals: Instrs: 236027458 -> 236027442 (-0.00%) Cycle count: 24515944704 -> 24515945379 (+0.00%) Totals from 8 (0.00% of 798454) affected shaders: Instrs: 10226 -> 10210 (-0.16%) Cycle count: 58567 -> 59242 (+1.15%) Reviewed-by: Caio Oliveira Reviewed-by: Matt Turner Part-of: --- src/intel/compiler/brw_fs_combine_constants.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/brw_fs_combine_constants.cpp b/src/intel/compiler/brw_fs_combine_constants.cpp index 95739bffb40..896cf86cabd 100644 --- a/src/intel/compiler/brw_fs_combine_constants.cpp +++ b/src/intel/compiler/brw_fs_combine_constants.cpp @@ -1013,10 +1013,14 @@ supports_src_as_imm(const struct intel_device_info *devinfo, const fs_inst *inst case 110: /* For Gfx11, experiments seem to show that HF mixed with F is not * allowed in src0 or src2. It is possible that src1 is allowed, but - * that cannot have an immediate value. W (or UW) immediate mixed - * with other integer sizes can occur in either src0 or src2. + * that cannot have an immediate value. Experiments seem to show that + * HF immediate can only ever be src0. + * + * W (or UW) immediate mixed with other integer sizes can occur in + * either src0 or src2. */ - return src_idx != 1 && brw_type_is_int(inst->src[src_idx].type); + return (src_idx == 0 && inst->src[src_idx].type != BRW_TYPE_F) || + (src_idx == 2 && brw_type_is_int(inst->src[src_idx].type)); case 120: /* For Gfx12, experiments seem to show that HF immediate mixed with F