From 84139470a5606b64f3c31b02a1fe22445dd4d604 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 24 Feb 2024 00:45:54 -0800 Subject: [PATCH] intel/brw: Use VEC for emit_unzip() Helps make SIMD-split code more SSA-friendly. Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs_lower_simd_width.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/brw_fs_lower_simd_width.cpp b/src/intel/compiler/brw_fs_lower_simd_width.cpp index ab85e38aa77..6327fd2dee9 100644 --- a/src/intel/compiler/brw_fs_lower_simd_width.cpp +++ b/src/intel/compiler/brw_fs_lower_simd_width.cpp @@ -482,10 +482,13 @@ emit_unzip(const fs_builder &lbld, fs_inst *inst, unsigned i) const fs_reg src = horiz_offset(inst->src[i], lbld.group() - inst->group); if (needs_src_copy(lbld, inst, i)) { - const fs_reg tmp = lbld.vgrf(inst->src[i].type, inst->components_read(i)); + const unsigned num_components = inst->components_read(i); + const fs_reg tmp = lbld.vgrf(inst->src[i].type, num_components); - for (unsigned k = 0; k < inst->components_read(i); ++k) - lbld.MOV(offset(tmp, lbld, k), offset(src, inst->exec_size, k)); + fs_reg comps[num_components]; + for (unsigned k = 0; k < num_components; ++k) + comps[k] = offset(src, inst->exec_size, k); + lbld.VEC(tmp, comps, num_components); return tmp;