This checks whether two register regions are an exact match. --- src/intel/compiler/brw_ir_fs.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/src/intel/compiler/brw_ir_fs.h b/src/intel/compiler/brw_ir_fs.h index f06a33c516d..cad333b6b6d 100644 --- a/src/intel/compiler/brw_ir_fs.h +++ b/src/intel/compiler/brw_ir_fs.h @@ -239,6 +239,19 @@ region_contained_in(const fs_reg &r, unsigned dr, const fs_reg &s, unsigned ds) reg_offset(r) + dr <= reg_offset(s) + ds; } +/** + * Check that the register region given by r [r.offset, r.offset + dr[ + * is exactly the same as the the register region given by s + * [s.offset, s.offset + ds[ + */ +static inline bool +region_match(const fs_reg &r, unsigned dr, const fs_reg &s, unsigned ds) +{ + return reg_space(r) == reg_space(s) && + reg_offset(r) == reg_offset(s) && + reg_offset(r) + dr == reg_offset(s) + ds; +} + /** * Return whether the given register region is n-periodic, i.e. whether the * original region remains invariant after shifting it by \p n scalar -- 2.14.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev