pan/bi: Futureproof COMBINE lowering against non-u32
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 1 May 2020 18:53:58 +0000 (14:53 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 4 May 2020 15:08:14 +0000 (11:08 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>

src/panfrost/bifrost/bi_lower_combine.c

index f915e3df22714965fd1c82fc4875efcfc3ad3ae7..ae9ceb9742fed1e32845b7e001408eeee5859d55 100644 (file)
@@ -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");
                         }
                 }