Module: Mesa
Branch: master
Commit: 20c7d57ede3a5e71aa6e2ef901d42eafcc39f1ae
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=20c7d57ede3a5e71aa6e2ef901d42eafcc39f1ae

Author: Alyssa Rosenzweig <alyssa.rosenzw...@collabora.com>
Date:   Tue Mar 10 08:47:20 2020 -0400

pan/bi: Specify comparison op for BI_CMP

...and adjust printing so we can use it as an op name.

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

---

 src/panfrost/bifrost/bi_print.c | 20 +++++++++++---------
 src/panfrost/bifrost/compiler.h |  1 +
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c
index 06b4a034cfc..a91bb5e8af4 100644
--- a/src/panfrost/bifrost/bi_print.c
+++ b/src/panfrost/bifrost/bi_print.c
@@ -264,13 +264,13 @@ static const char *
 bi_cond_name(enum bi_cond cond)
 {
         switch (cond) {
-        case BI_COND_ALWAYS: return ".always";
-        case BI_COND_LT: return ".lt";
-        case BI_COND_LE: return ".le";
-        case BI_COND_GE: return ".ge";
-        case BI_COND_GT: return ".gt";
-        case BI_COND_EQ: return ".eq";
-        case BI_COND_NE: return ".ne";
+        case BI_COND_ALWAYS: return "always";
+        case BI_COND_LT: return "lt";
+        case BI_COND_LE: return "le";
+        case BI_COND_GE: return "ge";
+        case BI_COND_GT: return "gt";
+        case BI_COND_EQ: return "eq";
+        case BI_COND_NE: return "ne";
         default: return "invalid";
         }
 }
@@ -278,7 +278,7 @@ bi_cond_name(enum bi_cond cond)
 static void
 bi_print_branch(struct bi_branch *branch, FILE *fp)
 {
-        fprintf(fp, "%s", bi_cond_name(branch->cond));
+        fprintf(fp, ".%s", bi_cond_name(branch->cond));
 }
 
 static void
@@ -313,6 +313,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
                 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 if (ins->type == BI_CMP)
+                fprintf(fp, "%s", bi_cond_name(ins->op.compare));
         else
                 fprintf(fp, "%s", bi_class_name(ins->type));
 
@@ -323,7 +325,7 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
         else if (ins->type == BI_BRANCH)
                 bi_print_branch(&ins->branch, fp);
         else if (ins->type == BI_CSEL)
-                fprintf(fp, "%s", bi_cond_name(ins->csel_cond));
+                fprintf(fp, ".%s", bi_cond_name(ins->csel_cond));
         else if (ins->type == BI_BLEND)
                 fprintf(fp, ".loc%u", ins->blend_location);
 
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index ec1a6f3768c..cd0408b6119 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -236,6 +236,7 @@ typedef struct {
                 enum bi_bitwise_op bitwise;
                 enum bi_round_op round;
                 enum bi_special_op special;
+                enum bi_cond compare;
         } op;
 
         /* Union for class-specific information */

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to