pan/bi: Treat +DISCARD.f32 as message-passing
authorAlyssa Rosenzweig <alyssa@collabora.com>
Sun, 7 Mar 2021 01:36:01 +0000 (01:36 +0000)
committerAlyssa Rosenzweig <alyssa@collabora.com>
Sun, 7 Mar 2021 15:10:28 +0000 (15:10 +0000)
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 <alyssa@collabora.com>
Tested-by: Icecream95 <ixn@disroot.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9446>

src/panfrost/bifrost/bi_schedule.c

index 66004aa..6f911b2 100644 (file)
@@ -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