Mesa (main): pan/bi: Expose unit tested scheduler predicates

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 28 22:36:05 UTC 2021


Module: Mesa
Branch: main
Commit: 9358d1fca671e002fd781dd2d29e89a80714ea86
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9358d1fca671e002fd781dd2d29e89a80714ea86

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Jul 28 12:04:20 2021 -0400

pan/bi: Expose unit tested scheduler predicates

I want to move the tests to their own executable to integrate better
with meson.

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

---

 src/panfrost/bifrost/bi_schedule.c | 12 ++++++------
 src/panfrost/bifrost/compiler.h    |  9 ++++++++-
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c
index 53efcb417df..36653e6fc60 100644
--- a/src/panfrost/bifrost/bi_schedule.c
+++ b/src/panfrost/bifrost/bi_schedule.c
@@ -479,7 +479,7 @@ bi_can_iaddc(bi_instr *ins)
                 ins->src[1].swizzle == BI_SWIZZLE_H01);
 }
 
-static bool
+bool
 bi_can_fma(bi_instr *ins)
 {
         /* Errata: *V2F32_TO_V2F16 with distinct sources raises
@@ -507,7 +507,7 @@ bi_impacted_fadd_widens(bi_instr *I)
                 (swz0 == BI_SWIZZLE_H11 && swz1 == BI_SWIZZLE_H00);
 }
 
-static bool
+bool
 bi_can_add(bi_instr *ins)
 {
         /* +FADD.v2f16 lacks clamp modifier, use *FADD.v2f16 instead */
@@ -544,7 +544,7 @@ bi_must_not_last(bi_instr *ins)
  * be raised for unknown reasons (possibly an errata).
  */
 
-static bool
+bool
 bi_must_message(bi_instr *ins)
 {
         return (bi_opcode_props[ins->op].message != BIFROST_MESSAGE_NONE) ||
@@ -572,13 +572,13 @@ bi_fma_atomic(enum bi_opcode op)
         }
 }
 
-static bool
+bool
 bi_reads_zero(bi_instr *ins)
 {
         return !(bi_fma_atomic(ins->op) || ins->op == BI_OPCODE_IMULD);
 }
 
-static bool
+bool
 bi_reads_temps(bi_instr *ins, unsigned src)
 {
         switch (ins->op) {
@@ -593,7 +593,7 @@ bi_reads_temps(bi_instr *ins, unsigned src)
         }
 }
 
-static bool
+bool
 bi_reads_t(bi_instr *ins, unsigned src)
 {
         /* Branch offset cannot come from passthrough */
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 2c731ee9cae..b9d9870bb6e 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -893,10 +893,17 @@ void bi_opt_dce_post_ra(bi_context *ctx);
 void bi_opt_push_ubo(bi_context *ctx);
 void bi_lower_swizzle(bi_context *ctx);
 void bi_lower_fau(bi_context *ctx);
-void bi_schedule(bi_context *ctx);
 void bi_assign_scoreboard(bi_context *ctx);
 void bi_register_allocate(bi_context *ctx);
 
+void bi_schedule(bi_context *ctx);
+bool bi_can_fma(bi_instr *ins);
+bool bi_can_add(bi_instr *ins);
+bool bi_must_message(bi_instr *ins);
+bool bi_reads_zero(bi_instr *ins);
+bool bi_reads_temps(bi_instr *ins, unsigned src);
+bool bi_reads_t(bi_instr *ins, unsigned src);
+
 uint32_t bi_fold_constant(bi_instr *I, bool *unsupported);
 void bi_opt_constant_fold(bi_context *ctx);
 



More information about the mesa-commit mailing list