pan/bi: Workaround *V2F32_TO_V2F16 erratum
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 13 Apr 2021 19:56:01 +0000 (15:56 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 3 May 2021 15:10:20 +0000 (15:10 +0000)
Exact conditions this workaround is needed unknown. Determined
experimentally.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10392>

src/panfrost/bifrost/bi_schedule.c

index 3b38c09..10c33bb 100644 (file)
@@ -383,6 +383,12 @@ bi_singleton(void *memctx, bi_instr *ins,
 ASSERTED static bool
 bi_can_fma(bi_instr *ins)
 {
+        /* Errata: *V2F32_TO_V2F16 with distinct sources raises
+         * INSTR_INVALID_ENC under certain conditions */
+        if (ins->op == BI_OPCODE_V2F32_TO_V2F16 &&
+                        !bi_is_word_equiv(ins->src[0], ins->src[1]))
+                return false;
+
         /* TODO: some additional fp16 constraints */
         return bi_opcode_props[ins->op].fma;
 }