X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fpanfrost%2Fbifrost%2Fbi_ra.c;h=1936958c28f33dc76c48b298c41a0e7380686110;hb=a7b2317d0a06c0c4c7f0fb2d7ab0c72f68ce6383;hp=b6da1df7038c1df2efe2a21817da669e3cefc2b7;hpb=b2c6cf2b6db11eb2293f59b42dfeb3d7481477b0;p=mesa.git diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index b6da1df7038..1936958c28f 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -67,7 +67,7 @@ bi_allocate_registers(bi_context *ctx, bool *success) unsigned node_count = bi_max_temp(ctx); struct lcra_state *l = - lcra_alloc_equations(node_count, 1, 8, 16, 1); + lcra_alloc_equations(node_count, 1); l->class_start[BI_REG_CLASS_WORK] = 0; l->class_size[BI_REG_CLASS_WORK] = 64 * 4; /* R0 - R63, all 32-bit */ @@ -79,7 +79,7 @@ bi_allocate_registers(bi_context *ctx, bool *success) continue; l->class[dest] = BI_REG_CLASS_WORK; - lcra_set_alignment(l, dest, 2); /* 2^2 = 4 */ + lcra_set_alignment(l, dest, 2, 16); /* 2^2 = 4 */ lcra_restrict_range(l, dest, 4); } @@ -124,8 +124,14 @@ bi_adjust_src_ra(bi_instruction *ins, struct lcra_state *l, unsigned src) /* Use the swizzle as component select */ unsigned components = bi_get_component_count(ins, src); + nir_alu_type T = ins->src_types[src]; + unsigned size = nir_alu_type_get_type_size(T); + + /* TODO: 64-bit? */ + unsigned components_per_word = MAX2(32 / size, 1); + for (unsigned i = 0; i < components; ++i) { - unsigned off = ins->swizzle[src][i] / components; + unsigned off = ins->swizzle[src][i] / components_per_word; /* We can't cross register boundaries in a swizzle */ if (i == 0) @@ -133,7 +139,7 @@ bi_adjust_src_ra(bi_instruction *ins, struct lcra_state *l, unsigned src) else assert(off == offset); - ins->swizzle[src][i] %= components; + ins->swizzle[src][i] %= components_per_word; } } @@ -147,6 +153,7 @@ bi_adjust_dest_ra(bi_instruction *ins, struct lcra_state *l) return; ins->dest = bi_reg_from_index(l, ins->dest, ins->dest_offset); + ins->dest_offset = 0; } static void