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>
};
}
+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 */
typedef struct {