pan/bi: Add _MSCALE flag for FMA/ADD
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 14 Apr 2020 20:13:53 +0000 (16:13 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Apr 2020 20:25:35 +0000 (16:25 -0400)
So we can bias by exponents.

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

src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/compiler.h

index 5dc5947882efa5f67f5a28a684a81f3afe28da5b..d6440a5765a66c16e577eb544bd76ce997bb0f5e 100644 (file)
@@ -366,6 +366,9 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
         else
                 fprintf(fp, "%s", bi_class_name(ins->type));
 
+        if ((ins->type == BI_ADD || ins->type == BI_FMA) && ins->op.mscale)
+                fprintf(fp, ".mscale");
+
         if (ins->type == BI_MINMAX)
                 fprintf(fp, "%s", bi_minmax_mode_name(ins->minmax));
         else if (ins->type == BI_LOAD_VAR)
index c1350f480c5319ed292f3f7eadab5b636e12ab3e..2d3f1a13588d290b9d1e7e88c450be314241e320 100644 (file)
@@ -275,6 +275,9 @@ typedef struct {
                 enum bi_table_op table;
                 enum bi_frexp_op frexp;
                 enum bi_cond compare;
+
+                /* For FMA/ADD, should we add a biased exponent? */
+                bool mscale;
         } op;
 
         /* Union for class-specific information */