pan/bi: Add helper to extract a word from an index

This pattern comes up surprisingly often due to the prevalance of
vectors.

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:
Alyssa Rosenzweig
2020-12-14 16:19:15 -05:00
parent 3a63b5d7cf
commit 903a818f33
+8
View File
@@ -471,6 +471,14 @@ bi_passthrough(enum bifrost_packed_src value)
};
}
/* Extracts a word from a vectored index */
static inline bi_index
bi_word(bi_index idx, unsigned component)
{
idx.offset += component;
return idx;
}
static inline bool
bi_is_null(bi_index idx)
{