pan/bi: Add BI_SPECIAL_* enum
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 10 Mar 2020 01:20:03 +0000 (21:20 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 19:25:59 +0000 (19:25 +0000)
To disambiguate the different special ops from each other.

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

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

index d1b2feec4650e4989b41734d1ce02e4c73a32773..daccf91a98fb2cd67e5d04788023807dfaf3c9dc 100644 (file)
@@ -231,6 +231,22 @@ bi_bitwise_op_name(enum bi_bitwise_op op)
         }
 }
 
+static const char *
+bi_special_op_name(enum bi_special_op op)
+{
+        switch (op) {
+        case BI_SPECIAL_FRCP: return "frcp";
+        case BI_SPECIAL_FRSQ: return "frsq";
+        case BI_SPECIAL_FATAN: return "fatan";
+        case BI_SPECIAL_FSIN: return "fsin";
+        case BI_SPECIAL_FCOS: return "fcos";
+        case BI_SPECIAL_FEXP: return "fexp";
+        case BI_SPECIAL_FLOG2: return "flog2";
+        case BI_SPECIAL_FLOGE: return "flog";
+        default: return "invalid";
+        }
+}
+
 static void
 bi_print_load_vary(struct bi_load_vary *load, FILE *fp)
 {
@@ -294,6 +310,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
                 fprintf(fp, "%s", bi_bitwise_op_name(ins->op.bitwise));
         else if (ins->type == BI_ROUND)
                 fprintf(fp, ins->op.round == BI_ROUND_MODE ? "roundMode": "round");
+        else if (ins->type == BI_SPECIAL)
+                fprintf(fp, "%s", bi_special_op_name(ins->op.special));
         else
                 fprintf(fp, "%s", bi_class_name(ins->type));
 
index c99943fead30c92ea8ee0e0ae242b2ae0fadbcd8..c1c8d695be37ddcfc43571d556aa38fbd42be626 100644 (file)
@@ -167,6 +167,17 @@ enum bi_round_op {
         BI_ROUND_ROUND /* i.e.: fround() */
 };
 
+enum bi_special_op {
+        BI_SPECIAL_FRCP,
+        BI_SPECIAL_FRSQ,
+        BI_SPECIAL_FATAN,
+        BI_SPECIAL_FSIN,
+        BI_SPECIAL_FCOS,
+        BI_SPECIAL_FEXP,
+        BI_SPECIAL_FLOG2,
+        BI_SPECIAL_FLOGE
+};
+
 typedef struct {
         struct list_head link; /* Must be first */
         enum bi_class type;
@@ -223,6 +234,7 @@ typedef struct {
                 enum bi_minmax_op minmax;
                 enum bi_bitwise_op bitwise;
                 enum bi_round_op round;
+                enum bi_special_op special;
         } op;
 
         /* Union for class-specific information */