pan/bi: Adapt branching for 1-bit bools
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 5 May 2021 16:51:30 +0000 (12:51 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 6 May 2021 23:26:21 +0000 (23:26 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9239>

src/panfrost/bifrost/bifrost_compile.c

index dffc75a..10800c3 100644 (file)
@@ -2670,8 +2670,9 @@ emit_if(bi_context *ctx, nir_if *nif)
 
         /* Speculatively emit the branch, but we can't fill it in until later */
         bi_builder _b = bi_init_builder(ctx, bi_after_block(ctx->current_block));
-        bi_instr *then_branch = bi_branchz_i32(&_b,
-                        bi_src_index(&nif->condition), bi_zero(), BI_CMPF_EQ);
+        bi_instr *then_branch = bi_branchz_i16(&_b,
+                        bi_half(bi_src_index(&nif->condition), false),
+                        bi_zero(), BI_CMPF_EQ);
 
         /* Emit the two subblocks. */
         bi_block *then_block = emit_cf_list(ctx, &nif->then_list);