From 3c867bf2c7a52737c519eaf0734e76dc30353bcd Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 3 Jan 2024 08:06:36 -0800 Subject: [PATCH] intel/brw: Add a new VEC() helper. This gathers a number of sources into a contiguous vector register. Eventually, the plan is that it will use a MOV for a single source, or LOAD_PAYLOAD for multiple sources. For now, it emits a series of MOVs to allow us to rewrite a bunch of existing code to use the new helper, then change them all over at once later. Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs_builder.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/intel/compiler/brw_fs_builder.h b/src/intel/compiler/brw_fs_builder.h index de1d4a373d2..dd0daaa850e 100644 --- a/src/intel/compiler/brw_fs_builder.h +++ b/src/intel/compiler/brw_fs_builder.h @@ -789,6 +789,18 @@ namespace brw { return inst; } + void + 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]); + } + fs_inst * SYNC(enum tgl_sync_function sync) const {