brw: optimize load payload with immediate headers

Currently the condition to use a single MOV is failing on immediate
values, so we emit 2 MOVs in SIMD8 instead of a single SIMD16.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33704>
This commit is contained in:
Lionel Landwerlin 2025-02-24 10:39:54 +02:00 committed by Marge Bot
parent 513184fa44
commit 8b4f997168

View file

@ -68,8 +68,10 @@ brw_lower_load_payload(brw_shader &s)
* instruction.
*/
const unsigned n =
(i + 1 < inst->header_size && inst->src[i].stride == 1 &&
inst->src[i + 1].equals(byte_offset(inst->src[i], REG_SIZE))) ?
(i + 1 < inst->header_size &&
(inst->src[i].file == IMM ||
(inst->src[i].is_contiguous() &&
inst->src[i + 1].equals(byte_offset(inst->src[i], REG_SIZE))))) ?
2 : 1;
if (inst->src[i].file != BAD_FILE)