From 3436e5295b11fa987e06afee9eccccce83f0462e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 7 Mar 2021 01:36:01 +0000 Subject: [PATCH] pan/bi: Treat +DISCARD.f32 as message-passing Likely errata, matches blob's handling. Closes #4387 total nops in shared programs: 86266 -> 86272 (<.01%) nops in affected programs: 347 -> 353 (1.73%) helped: 1 HURT: 2 total clauses in shared programs: 20813 -> 20833 (0.10%) clauses in affected programs: 343 -> 363 (5.83%) helped: 0 HURT: 20 Clauses are HURT. total quadwords in shared programs: 91572 -> 91588 (0.02%) quadwords in affected programs: 1322 -> 1338 (1.21%) helped: 1 HURT: 14 Quadwords are HURT. Signed-off-by: Alyssa Rosenzweig Tested-by: Icecream95 Cc: mesa-stable Part-of: --- src/panfrost/bifrost/bi_schedule.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index 66004aaacdc..6f911b28f64 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -412,10 +412,17 @@ bi_must_not_last(bi_instr *ins) return !bi_is_null(ins->dest[0]) && !bi_is_null(ins->dest[1]); } +/* Check for a message-passing instruction. +DISCARD.f32 is special-cased; we + * treat it as a message-passing instruction for the purpose of scheduling + * despite no passing no logical message. Otherwise invalid encoding faults may + * be raised for unknown reasons (possibly an errata). + */ + ASSERTED static bool bi_must_message(bi_instr *ins) { - return bi_opcode_props[ins->op].message != BIFROST_MESSAGE_NONE; + return (bi_opcode_props[ins->op].message != BIFROST_MESSAGE_NONE) || + (ins->op == BI_OPCODE_DISCARD_F32); } static bool