intel/brw: Move brw_s0() to brw_reg.h

It remove a duplication and also it will be used in a future patch
from other file.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37670>
This commit is contained in:
José Roberto de Souza 2025-08-15 10:58:02 -07:00
parent 5c82a3e114
commit c008d21947
3 changed files with 16 additions and 32 deletions

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{