From 8b4f99716845175ec6bf1563c9a72b5b3f37500c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 24 Feb 2025 10:39:54 +0200 Subject: [PATCH] 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 Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_lower.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_lower.cpp b/src/intel/compiler/brw_lower.cpp index 251bd049cc4..f4605d886cc 100644 --- a/src/intel/compiler/brw_lower.cpp +++ b/src/intel/compiler/brw_lower.cpp @@ -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)