summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2024-03-24 14:25:40 -0700
committerJordan Justen <jordan.l.justen@intel.com>2024-03-25 02:26:29 -0700
commit8e1fd50c95e0092b133c4e62668a9b9bc16cbf4a (patch)
tree3b9f7b6808db6c436aad46fda55c31aa4a4ec9bd
parente947b68080e06f953f6adaf5206f7d45e3898762 (diff)
intel/brw: Update grf crossing check for Xe2xe2-update-vstride-check
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r--src/intel/compiler/brw_eu_validate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
index ec1c827e48b..2b717f08d30 100644
--- a/src/intel/compiler/brw_eu_validate.c
+++ b/src/intel/compiler/brw_eu_validate.c
@@ -1063,15 +1063,17 @@ general_restrictions_on_region_parameters(const struct brw_isa_info *isa,
* implies that elements within a 'Width' cannot cross GRF boundaries.
*/
unsigned rowbase = subreg;
+ assert(util_is_power_of_two_nonzero(reg_unit(devinfo)));
+ unsigned grf_size_shift = (5 - 1) + ffs(reg_unit(devinfo));
for (int y = 0; y < exec_size / width; y++) {
unsigned grfs_accessed = 0;
unsigned offset = rowbase;
for (int x = 0; x < width; x++) {
- const unsigned start_grf = offset / REG_SIZE;
+ const unsigned start_grf = offset >> grf_size_shift;
const unsigned end_byte = offset + (element_size - 1);
- const unsigned end_grf = end_byte / REG_SIZE;
+ const unsigned end_grf = end_byte >> grf_size_shift;
grfs_accessed |= (1U << start_grf) | (1U << end_grf);
offset += hstride * element_size;
}