Now that we lower them away, a bunch of special cases disappear.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4276>
static void
bi_print_swizzle(bi_instruction *ins, unsigned src, FILE *fp)
{
- unsigned size = MAX2(nir_alu_type_get_type_size(ins->dest_type), 8);
+ unsigned size = nir_alu_type_get_type_size(ins->dest_type);
unsigned count = (size == 64) ? 1 : (32 / size);
fprintf(fp, ".");
{
unsigned bits_per_comp = nir_alu_type_get_type_size(ins->dest_type);
assert(bits_per_comp);
- unsigned bytes_per_comp = MAX2(bits_per_comp / 8, 1);
+ unsigned bytes_per_comp = bits_per_comp / 8;
unsigned comps = 16 / bytes_per_comp;
unsigned smask = (1 << bytes_per_comp) - 1;
fprintf(fp, ".");
/* Use the swizzle as component select */
nir_alu_type T = ins->src_types[src];
unsigned size = nir_alu_type_get_type_size(T);
- unsigned bytes = (MAX2(size, 8) / 8);
- unsigned comps_per_reg = 4 / bytes;
+ assert(size <= 32); /* TODO: 64-bit */
+ unsigned comps_per_reg = 32 / size;
unsigned components = bi_get_component_count(ins, src);
for (unsigned i = 0; i < components; ++i) {
unsigned tz = __builtin_ctz(ins->writemask);
- /* Recall writemask is one bit per byte, so tz is in bytes */
+ /* Recall writemask is one bit per byte, so tz is in eytes */
unsigned regs = tz / 4;
offset = regs * 4;
unsigned comps = instr->dest.dest.ssa.num_components;
assert(comps == 1);
unsigned bits = bits_per_comp * comps;
- unsigned bytes = MAX2(bits / 8, 1);
+ unsigned bytes = bits / 8;
alu.writemask = (1 << bytes) - 1;
} else {
unsigned comp_mask = instr->dest.write_mask;
} else {
/* Stores imply VECTOR */
assert(ins->dest_type);
- unsigned bytes = MAX2(nir_alu_type_get_type_size(ins->dest_type), 8);
+ unsigned bytes = nir_alu_type_get_type_size(ins->dest_type);
return 32 / bytes;
}
}
unsigned component_count = bi_get_component_count(ins, s);
nir_alu_type T = ins->src_types[s];
unsigned size = nir_alu_type_get_type_size(T);
- unsigned bytes = (MAX2(size, 8) / 8);
+ unsigned bytes = size / 8;
unsigned cmask = (1 << bytes) - 1;
for (unsigned i = 0; i < component_count; ++i) {