From 782055106f4abd11a236c2bb1d83c34dbd2e80a0 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 29 Jul 2023 20:58:53 -0400 Subject: [PATCH] agx: Use unconditional else instruction Rather than duplicating the condition. This matches the blob, so is presumably the most energy-efficient way of expressing the logic. No shader-db changes. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index f52406013af..cb049a20e32 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -1878,8 +1878,11 @@ emit_if(agx_context *ctx, nir_if *nif) agx_block *else_block = emit_cf_list(ctx, &nif->else_list); agx_block *end_else = ctx->current_block; + /* Insert an else instruction at the beginning of the else block. We use + * "else_fcmp 0.0, 0.0, eq" as unconditional else, matching the blob. + */ _b.cursor = agx_before_block(else_block); - agx_else_icmp(&_b, cond, agx_zero(), 1, AGX_ICOND_UEQ, false); + agx_else_fcmp(&_b, agx_zero(), agx_zero(), 1, AGX_FCOND_EQ, false); ctx->after_block = agx_create_block(ctx);