From 344d4ee9f0ecc75cacd0f1079c57e8e4d10425e9 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 3 Jan 2024 08:06:36 -0800 Subject: [PATCH] intel/brw: Make VEC() perform a single write to its destination. This gathers a number of sources into a contiguous vector register, typically using LOAD_PAYLOAD. However, it uses MOV for a single source. Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_fs_builder.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/intel/compiler/brw_fs_builder.h b/src/intel/compiler/brw_fs_builder.h index c2bb9d82d2a..0f43cef2af2 100644 --- a/src/intel/compiler/brw_fs_builder.h +++ b/src/intel/compiler/brw_fs_builder.h @@ -789,16 +789,11 @@ namespace brw { return inst; } - void + fs_inst * VEC(const fs_reg &dst, const fs_reg *src, unsigned sources) const { - /* For now, this emits a series of MOVs to ease the transition - * to the new helper. The intention is to have this emit either - * a single MOV or a LOAD_PAYLOAD to fully initialize dst from a - * the list of sources. - */ - for (unsigned i = 0; i < sources; i++) - MOV(offset(dst, dispatch_width(), i), src[i]); + return sources == 1 ? MOV(dst, src[0]) + : LOAD_PAYLOAD(dst, src, sources, 0); } fs_inst *