intel/brw: Move most member functions from fs_reg 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:52:02 -07:00
committed by Marge Bot
parent ca1afe2726
commit e4f37c6ab9
4 changed files with 27 additions and 25 deletions

View File

@@ -567,19 +567,19 @@ fs_reg::fs_reg(struct ::brw_reg reg) :
}
bool
fs_reg::equals(const fs_reg &r) const
brw_reg::equals(const brw_reg &r) const
{
return brw_regs_equal(this, &r);
}
bool
fs_reg::negative_equals(const fs_reg &r) const
brw_reg::negative_equals(const brw_reg &r) const
{
return brw_regs_negative_equal(this, &r);
}
bool
fs_reg::is_contiguous() const
brw_reg::is_contiguous() const
{
switch (file) {
case ARF:
@@ -599,7 +599,7 @@ fs_reg::is_contiguous() const
}
unsigned
fs_reg::component_size(unsigned width) const
brw_reg::component_size(unsigned width) const
{
if (file == ARF || file == FIXED_GRF) {
const unsigned w = MIN2(width, 1u << this->width);

View File

@@ -50,22 +50,6 @@ public:
assert(offset == 0);
return static_cast<brw_reg &>(*this);
}
bool equals(const fs_reg &r) const;
bool negative_equals(const fs_reg &r) const;
bool is_contiguous() const;
bool is_zero() const;
bool is_one() const;
bool is_negative_one() const;
bool is_null() const;
bool is_accumulator() const;
/**
* Return the size in bytes of a single logical component of the
* register assuming the given execution width.
*/
unsigned component_size(unsigned width) const;
};
static inline fs_reg

View File

@@ -193,6 +193,24 @@ struct brw_reg {
/** Register region horizontal stride of virtual registers */
uint8_t stride;
#ifdef __cplusplus
bool equals(const brw_reg &r) const;
bool negative_equals(const brw_reg &r) const;
bool is_contiguous() const;
bool is_zero() const;
bool is_one() const;
bool is_negative_one() const;
bool is_null() const;
bool is_accumulator() const;
/**
* Return the size in bytes of a single logical component of the
* register assuming the given execution width.
*/
unsigned component_size(unsigned width) const;
#endif /* __cplusplus */
};
static inline unsigned

View File

@@ -183,7 +183,7 @@ fs_reg_abs_immediate(fs_reg *reg)
}
bool
fs_reg::is_zero() const
brw_reg::is_zero() const
{
if (file != IMM)
return false;
@@ -214,7 +214,7 @@ fs_reg::is_zero() const
}
bool
fs_reg::is_one() const
brw_reg::is_one() const
{
if (file != IMM)
return false;
@@ -245,7 +245,7 @@ fs_reg::is_one() const
}
bool
fs_reg::is_negative_one() const
brw_reg::is_negative_one() const
{
if (file != IMM)
return false;
@@ -273,14 +273,14 @@ fs_reg::is_negative_one() const
}
bool
fs_reg::is_null() const
brw_reg::is_null() const
{
return file == ARF && nr == BRW_ARF_NULL;
}
bool
fs_reg::is_accumulator() const
brw_reg::is_accumulator() const
{
return file == ARF && (nr & 0xF0) == BRW_ARF_ACCUMULATOR;
}