pan/bi: Add strip_index helper

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>
This commit is contained in:
Alyssa Rosenzweig 2021-07-23 14:34:22 -04:00 committed by Marge Bot
parent a5727909e1
commit b55fb073a4
1 changed files with 14 additions and 0 deletions

View File

@ -236,6 +236,20 @@ bi_replace_index(bi_index old, bi_index replacement)
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)