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 <caio.oliveira@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32436>
This commit is contained in:
Ian Romanick
2024-11-14 11:55:42 -08:00
committed by Marge Bot
parent 4c462b6b32
commit 99d3755bdd
@@ -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