From 6fed6161876681920b0d2c59cb7413d7c43fda45 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 22 Aug 2022 13:38:16 -0400 Subject: [PATCH] pan/mdg: Print 3 sources for CSEL The third source exists logically but not architecturally. We still need to print it. Caught by the assertion. Fixes: 0ee24c46e0a ("pan/mdg: Only print 2 sources for ALU") Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/midgard/midgard_print.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c index ed0d80b2c7e..06b92e032a5 100644 --- a/src/panfrost/midgard/midgard_print.c +++ b/src/panfrost/midgard/midgard_print.c @@ -293,8 +293,22 @@ mir_print_instruction(midgard_instruction *ins) mir_print_src(ins, 1); if (is_alu) { - /* ALU ops are all 2-src */ - assert(ins->src[2] == ~0); + /* ALU ops are all 2-src, though CSEL is treated like a 3-src + * pseudo op with the third source scheduler lowered + */ + switch (ins->op) { + case midgard_alu_op_icsel: + case midgard_alu_op_fcsel: + case midgard_alu_op_icsel_v: + case midgard_alu_op_fcsel_v: + printf(", "); + mir_print_src(ins, 2); + break; + default: + assert(ins->src[2] == ~0); + break; + } + assert(ins->src[3] == ~0); } else { for (unsigned c = 2; c <= 3; ++c) {