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>
}
}
+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)
{
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 */