Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4789>
static unsigned
bi_pack_add_select(bi_instruction *ins, struct bi_registers *regs)
{
- unsigned size = nir_alu_type_get_type_size(ins->dest_type);
+ unsigned size = nir_alu_type_get_type_size(ins->src_types[0]);
assert(size == 16);
unsigned swiz = (ins->swizzle[0][0] | (ins->swizzle[1][0] << 1));
}
case BI_SELECT: {
- if (ins->dest_type == nir_type_uint16) {
+ if (ins->src_types[0] == nir_type_uint16) {
for (unsigned c = 0; c < 2; ++c)
dest.u16[c] = srcs[c].u16[ins->swizzle[c][0]];
- } else if (ins->dest_type == nir_type_uint8) {
+ } else if (ins->src_types[0] == nir_type_uint8) {
for (unsigned c = 0; c < 4; ++c)
dest.u8[c] = srcs[c].u8[ins->swizzle[c][0]];
} else {
bit_fma_mscale_helper(dev, mscale_input, debug);
for (unsigned sz = 8; sz <= 16; sz *= 2) {
- bit_select_helper(dev, (uint32_t *) input32, 8, debug);
+ bit_select_helper(dev, (uint32_t *) input32, sz, debug);
}
}