intel/brw: Move fs_reg data members up to brw_reg

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29791>
This commit is contained in:
Caio Oliveira
2024-06-18 14:00:53 -07:00
committed by Marge Bot
parent 2ce6dcf043
commit f54dfbf4fe
3 changed files with 24 additions and 12 deletions

View File

@@ -569,17 +569,13 @@ fs_reg::fs_reg(struct ::brw_reg reg) :
bool bool
fs_reg::equals(const fs_reg &r) const fs_reg::equals(const fs_reg &r) const
{ {
return brw_regs_equal(this, &r) && return brw_regs_equal(this, &r);
offset == r.offset &&
stride == r.stride;
} }
bool bool
fs_reg::negative_equals(const fs_reg &r) const fs_reg::negative_equals(const fs_reg &r) const
{ {
return brw_regs_negative_equal(this, &r) && return brw_regs_negative_equal(this, &r);
offset == r.offset &&
stride == r.stride;
} }
bool bool

View File

@@ -90,11 +90,8 @@ public:
using brw_reg::d64; using brw_reg::d64;
using brw_reg::u64; using brw_reg::u64;
/** Offset from the start of the (virtual) register in bytes. */ using brw_reg::offset;
uint16_t offset; using brw_reg::stride;
/** Register region horizontal stride */
uint8_t stride;
}; };
static inline fs_reg static inline fs_reg

View File

@@ -187,6 +187,12 @@ struct brw_reg {
int d; int d;
unsigned ud; unsigned ud;
}; };
/** Offset from the start of the virtual register in bytes. */
uint16_t offset;
/** Register region horizontal stride of virtual registers */
uint8_t stride;
}; };
static inline unsigned static inline unsigned
@@ -225,7 +231,10 @@ phys_subnr(const struct intel_device_info *devinfo, const struct brw_reg reg)
static inline bool static inline bool
brw_regs_equal(const struct brw_reg *a, const struct brw_reg *b) brw_regs_equal(const struct brw_reg *a, const struct brw_reg *b)
{ {
return a->bits == b->bits && a->u64 == b->u64; return a->bits == b->bits &&
a->u64 == b->u64 &&
a->offset == b->offset &&
a->stride == b->stride;
} }
static inline bool static inline bool
@@ -369,6 +378,16 @@ brw_reg(enum brw_reg_file file,
reg.width = width; reg.width = width;
reg.hstride = hstride; reg.hstride = hstride;
reg.pad1 = 0; reg.pad1 = 0;
reg.offset = 0;
reg.stride = 1;
if (file == IMM &&
type != BRW_TYPE_V &&
type != BRW_TYPE_UV &&
type != BRW_TYPE_VF) {
reg.stride = 0;
}
return reg; return reg;
} }