From c008d2194798433784211334299f28b95cdc6689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 15 Aug 2025 10:58:02 -0700 Subject: [PATCH] intel/brw: Move brw_s0() to brw_reg.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It remove a duplication and also it will be used in a future patch from other file. Reviewed-by: Caio Oliveira Signed-off-by: José Roberto de Souza Part-of: --- src/intel/compiler/brw_lower.cpp | 16 ---------------- src/intel/compiler/brw_reg.h | 16 ++++++++++++++++ src/intel/compiler/test_eu_validate.cpp | 16 ---------------- 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/src/intel/compiler/brw_lower.cpp b/src/intel/compiler/brw_lower.cpp index 3ffdc1d5535..7bc7b7e58cc 100644 --- a/src/intel/compiler/brw_lower.cpp +++ b/src/intel/compiler/brw_lower.cpp @@ -857,22 +857,6 @@ brw_lower_vgrfs_to_fixed_grfs(brw_shader &s) BRW_DEPENDENCY_VARIABLES); } -static brw_reg -brw_s0(enum brw_reg_type type, unsigned subnr) -{ - return brw_make_reg(ARF, - BRW_ARF_SCALAR, - subnr, - 0, - 0, - type, - BRW_VERTICAL_STRIDE_0, - BRW_WIDTH_1, - BRW_HORIZONTAL_STRIDE_0, - BRW_SWIZZLE_XYZW, - WRITEMASK_XYZW); -} - static bool brw_lower_send_gather_inst(brw_shader &s, brw_send_inst *inst) { diff --git a/src/intel/compiler/brw_reg.h b/src/intel/compiler/brw_reg.h index 8c976e0a48b..fef46596d5e 100644 --- a/src/intel/compiler/brw_reg.h +++ b/src/intel/compiler/brw_reg.h @@ -561,6 +561,22 @@ brw_vecn_reg(unsigned width, enum brw_reg_file file, } } +static inline brw_reg +brw_s0(enum brw_reg_type type, unsigned subnr) +{ + return brw_make_reg(ARF, + BRW_ARF_SCALAR, + subnr, + 0, + 0, + type, + BRW_VERTICAL_STRIDE_0, + BRW_WIDTH_1, + BRW_HORIZONTAL_STRIDE_0, + BRW_SWIZZLE_XYZW, + WRITEMASK_XYZW); +} + static inline struct brw_reg retype(struct brw_reg reg, enum brw_reg_type type) { diff --git a/src/intel/compiler/test_eu_validate.cpp b/src/intel/compiler/test_eu_validate.cpp index 51289a0e131..8c83b373de4 100644 --- a/src/intel/compiler/test_eu_validate.cpp +++ b/src/intel/compiler/test_eu_validate.cpp @@ -3600,22 +3600,6 @@ TEST_P(validation_test, xe2_register_region_special_restrictions_for_src0_and_sr } } -static brw_reg -brw_s0(enum brw_reg_type type, unsigned subnr) -{ - return brw_make_reg(ARF, - BRW_ARF_SCALAR, - subnr, - 0, - 0, - type, - BRW_VERTICAL_STRIDE_0, - BRW_WIDTH_1, - BRW_HORIZONTAL_STRIDE_0, - BRW_SWIZZLE_XYZW, - WRITEMASK_XYZW); -} - static brw_reg brw_s0_with_region(enum brw_reg_type type, unsigned subnr, unsigned v, unsigned w, unsigned h) {