aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost/bi_schedule.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-31 22:16:55 -0400
committerMarge Bot <[email protected]>2020-04-01 02:25:05 +0000
commit12cf9f43f02ac00b9604e12f1fb26e363941d90b (patch)
tree3d0cb707ee29de3e2e63c3d44253b24aa49025da /src/panfrost/bifrost/bi_schedule.c
parent357b8b59065c50dd4d8eecf437bb721be38092bd (diff)
pan/bi: Handle fmov class ops
We need to lower them to something reasonable (ideally, the modifier would be attached but we need to do something for the case it's not). We specifically have to lower pre-sched as well, but we can do the lower literally at schedule time for now (if this proves annoying, we can move it earlier, but I want to leave room for modifier-aware copyprop should that prove interesting). Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4396>
Diffstat (limited to 'src/panfrost/bifrost/bi_schedule.c')
-rw-r--r--src/panfrost/bifrost/bi_schedule.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c
index b3f7ca605c3..2885aeefe3a 100644
--- a/src/panfrost/bifrost/bi_schedule.c
+++ b/src/panfrost/bifrost/bi_schedule.c
@@ -89,6 +89,22 @@ bi_ambiguous_abs(bi_instruction *ins)
return classy && typey && absy;
}
+/* Lowers FMOV to ADD #0, since FMOV doesn't exist on the h/w and this is the
+ * latest time it's sane to lower (it's useful to distinguish before, but we'll
+ * need this handle during scheduling to ensure the ports get modeled
+ * correctly with respect to the new zero source) */
+
+static void
+bi_lower_fmov(bi_instruction *ins)
+{
+ if (ins->type != BI_FMOV)
+ return;
+
+ ins->type = BI_ADD;
+ ins->src[1] = BIR_INDEX_ZERO;
+ ins->src_types[1] = ins->src_types[0];
+}
+
/* Eventually, we'll need a proper scheduling, grouping instructions
* into clauses and ordering/assigning grouped instructions to the
* appropriate FMA/ADD slots. Right now we do the dumbest possible
@@ -108,6 +124,9 @@ bi_schedule(bi_context *ctx)
list_inithead(&bblock->clauses);
bi_foreach_instr_in_block(bblock, ins) {
+ /* Convenient time to lower */
+ bi_lower_fmov(ins);
+
unsigned props = bi_class_props[ins->type];
bi_clause *u = rzalloc(ctx, bi_clause);