aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost/compiler.h
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-02 22:00:07 -0500
committerMarge Bot <[email protected]>2020-03-05 14:35:38 +0000
commita35854c5eee542c47e8be3c6d85a19d8fad99acc (patch)
treeddd9f62880ef1c581387838bd9966c6e8555442b /src/panfrost/bifrost/compiler.h
parent99f3c1f34c0526a9d0a5177d71d0c4a6042c3409 (diff)
pan/bi: Add bi_clause, bi_bundle abstractions
These will be used during and after scheduling. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4061>
Diffstat (limited to 'src/panfrost/bifrost/compiler.h')
-rw-r--r--src/panfrost/bifrost/compiler.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 9f56ed2dcfa..9e0d4711fb4 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -144,9 +144,47 @@ typedef struct {
};
} bi_instruction;
+/* Scheduling takes place in two steps. Step 1 groups instructions within a
+ * block into distinct clauses (bi_clause). Step 2 schedules instructions
+ * within a clause into FMA/ADD pairs (bi_bundle).
+ *
+ * A bi_bundle contains two paired instruction pointers. If a slot is unfilled,
+ * leave it NULL; the emitter will fill in a nop.
+ */
+
+typedef struct {
+ bi_instruction *fma;
+ bi_instruction *add;
+} bi_bundle;
+
typedef struct {
+ struct list_head link;
+
+ /* A clause can have 8 instructions in bundled FMA/ADD sense, so there
+ * can be 8 bundles. But each bundle can have both an FMA and an ADD,
+ * so a clause can have up to 16 bi_instructions. Whether bundles or
+ * instructions are used depends on where in scheduling we are. */
+
+ unsigned instruction_count;
+ unsigned bundle_count;
+
+ union {
+ bi_instruction *instructions[16];
+ bi_bundle bundles[8];
+ };
+} bi_clause;
+
+typedef struct bi_block {
struct list_head link; /* must be first */
- struct list_head instructions; /* list of bi_instructions */
+ unsigned name; /* Just for pretty-printing */
+
+ /* If true, uses clauses; if false, uses instructions */
+ bool scheduled;
+
+ union {
+ struct list_head instructions; /* pre-schedule, list of bi_instructions */
+ struct list_head clauses; /* list of bi_clause */
+ };
} bi_block;
typedef struct {