agx: Add and use agx_nir_ssa_index helper
Common subexpression that we'll repeat once more in the next patch. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
This commit is contained in:

committed by
Marge Bot

parent
ad459054ed
commit
eab4d6a96f
@@ -474,22 +474,23 @@ agx_size_for_bits(unsigned bits)
|
||||
}
|
||||
}
|
||||
|
||||
static inline agx_index
|
||||
agx_nir_ssa_index(nir_ssa_def *ssa)
|
||||
{
|
||||
return agx_get_index(ssa->index, agx_size_for_bits(ssa->bit_size));
|
||||
}
|
||||
|
||||
static inline agx_index
|
||||
agx_src_index(nir_src *src)
|
||||
{
|
||||
assert(src->is_ssa);
|
||||
|
||||
return agx_get_index(src->ssa->index,
|
||||
agx_size_for_bits(nir_src_bit_size(*src)));
|
||||
return agx_nir_ssa_index(src->ssa);
|
||||
}
|
||||
|
||||
static inline agx_index
|
||||
agx_dest_index(nir_dest *dst)
|
||||
{
|
||||
assert(dst->is_ssa);
|
||||
|
||||
return agx_get_index(dst->ssa.index,
|
||||
agx_size_for_bits(nir_dest_bit_size(*dst)));
|
||||
return agx_nir_ssa_index(&dst->ssa);
|
||||
}
|
||||
|
||||
static inline agx_index
|
||||
|
Reference in New Issue
Block a user