pan/bi: Add node_to_index helper
To invert index_to_node for RA. 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:
@@ -778,6 +778,15 @@ bi_get_node(bi_index index)
|
||||
return (index.value << 1) | index.reg;
|
||||
}
|
||||
|
||||
static inline bi_index
|
||||
bi_node_to_index(unsigned node, unsigned node_count)
|
||||
{
|
||||
assert(node < node_count);
|
||||
assert(node_count < ~0);
|
||||
|
||||
return bi_get_index(node >> 1, node & PAN_IS_REG, 0);
|
||||
}
|
||||
|
||||
/* Iterators for Bifrost IR */
|
||||
|
||||
#define bi_foreach_block(ctx, v) \
|
||||
|
||||
Reference in New Issue
Block a user