mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
pan/bi: Add nullity/equality helpers for bi_index
We can no longer use the builtin equals, since they're structs now, but these helpers are almost as convenient. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
This commit is contained in:
parent
5dd756afed
commit
3a63b5d7cf
1 changed files with 18 additions and 0 deletions
|
|
@ -471,6 +471,24 @@ bi_passthrough(enum bifrost_packed_src value)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
bi_is_null(bi_index idx)
|
||||||
|
{
|
||||||
|
return idx.type == BI_INDEX_NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Compares equivalence as references. Does not compare offsets, swizzles, or
|
||||||
|
* modifiers. In other words, this forms bi_index equivalence classes by
|
||||||
|
* partitioning memory. E.g. -abs(foo[1].yx) == foo.xy but foo != bar */
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
bi_is_equiv(bi_index left, bi_index right)
|
||||||
|
{
|
||||||
|
return (left.type == right.type) &&
|
||||||
|
(left.reg == right.reg) &&
|
||||||
|
(left.value == right.value);
|
||||||
|
}
|
||||||
|
|
||||||
/* Represents the assignment of slots for a given bi_bundle */
|
/* Represents the assignment of slots for a given bi_bundle */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue