Needed to correctly lower sources to moves, used in the FAU lowering.
Technically, the issue is already present on Bifrost, but it's hidden
because Bifrost packing doesn't validate the absense of unsupported
modifiers. Valhall packing adds more safety, which caught this issue.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12026>
return replacement;
}
+/* Remove any modifiers. This has the property:
+ *
+ * replace_index(x, strip_index(x)) = x
+ *
+ * This ensures it is suitable to use when lowering sources to moves */
+
+static inline bi_index
+bi_strip_index(bi_index index)
+{
+ index.abs = index.neg = false;
+ index.swizzle = BI_SWIZZLE_H01;
+ return index;
+}
+
/* For bitwise instructions */
#define bi_not(x) bi_neg(x)