aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-01 14:53:58 -0400
committerAlyssa Rosenzweig <[email protected]>2020-05-04 11:08:14 -0400
commit0561fe3a06d61a182679eb43888797af5d8cc217 (patch)
tree599657039af987d9297d356b55936bf3647cd749
parentc48839086dbb04bbf23efc1d9bfee73f21f94561 (diff)
pan/bi: Futureproof COMBINE lowering against non-u32
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
-rw-r--r--src/panfrost/bifrost/bi_lower_combine.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/panfrost/bifrost/bi_lower_combine.c b/src/panfrost/bifrost/bi_lower_combine.c
index f915e3df227..ae9ceb9742f 100644
--- a/src/panfrost/bifrost/bi_lower_combine.c
+++ b/src/panfrost/bifrost/bi_lower_combine.c
@@ -198,6 +198,7 @@ bi_lower_combine(bi_context *ctx, bi_block *block)
if (ins->type != BI_COMBINE) continue;
unsigned R = bi_make_temp_reg(ctx);
+ unsigned sz = nir_alu_type_get_type_size(ins->dest_type);
bi_foreach_src(ins, s) {
/* We're done early for vec2/3 */
@@ -215,11 +216,13 @@ bi_lower_combine(bi_context *ctx, bi_block *block)
bi_insert_combine_mov(ctx, ins, s, R);
}
#endif
- if (ins->dest_type == nir_type_uint32)
+ if (sz == 32)
bi_combine_mov32(ctx, ins, s, R);
- else {
+ else if (sz == 16) {
bi_combine_sel16(ctx, ins, s, R);
s++;
+ } else {
+ unreachable("Unknown COMBINE size");
}
}