mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 20:50:44 +02:00
pan/bi: Add bi_load32_components helper
Pattern seems to crop up a lot. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4276>
This commit is contained in:
parent
8bb16138b6
commit
908341ea3f
2 changed files with 11 additions and 0 deletions
|
|
@ -105,6 +105,16 @@ bi_get_component_count(bi_instruction *ins)
|
|||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
bi_load32_components(bi_instruction *ins)
|
||||
{
|
||||
unsigned mask = bi_from_bytemask(ins->writemask, 4);
|
||||
unsigned count = util_bitcount(mask);
|
||||
assert(mask == ((1 << count) - 1));
|
||||
assert(count >= 1 && count <= 4);
|
||||
return count;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
bi_bytemask_of_read_components(bi_instruction *ins, unsigned node)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -531,6 +531,7 @@ bool bi_is_src_swizzled(bi_instruction *ins, unsigned s);
|
|||
bool bi_has_arg(bi_instruction *ins, unsigned arg);
|
||||
uint16_t bi_from_bytemask(uint16_t bytemask, unsigned bytes);
|
||||
unsigned bi_get_component_count(bi_instruction *ins);
|
||||
unsigned bi_load32_components(bi_instruction *ins);
|
||||
uint16_t bi_bytemask_of_read_components(bi_instruction *ins, unsigned node);
|
||||
|
||||
/* BIR passes */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue