pan/bi: Model 3-bit Bifrost srcs in IR
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 18 Mar 2020 13:57:32 +0000 (09:57 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 19 Mar 2020 03:23:07 +0000 (03:23 +0000)
We'll want to set these manually for schedule-time passthrough, as well
as use the enum for packing.

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

src/panfrost/bifrost/bifrost.h
src/panfrost/bifrost/compiler.h

index 41bf16cfafcad8608d29f2309c38290bd80f1680..8f5dec578f76cfbde224f40150d756d2e189098b 100644 (file)
@@ -72,6 +72,17 @@ struct bifrost_header {
         unsigned unk4 : 1; // part of nextClauseType?
 } __attribute__((packed));
 
+enum bifrost_packed_src {
+        BIFROST_SRC_PORT0    = 0,
+        BIFROST_SRC_PORT1    = 1,
+        BIFROST_SRC_PORT3    = 2,
+        BIFROST_SRC_STAGE    = 3,
+        BIFROST_SRC_CONST_LO = 4,
+        BIFROST_SRC_CONST_HI = 5,
+        BIFROST_SRC_PASS_FMA = 6,
+        BIFROST_SRC_PASS_ADD = 7,
+};
+
 struct bifrost_fma_inst {
         unsigned src0 : 3;
         unsigned op   : 20;
index 9ff728c55a2672d2ffa5f2b175545187ad641d7b..b69c0fee5e7ad72d6b5aeddb89b786b5366ed090 100644 (file)
@@ -371,17 +371,19 @@ bi_remove_instruction(bi_instruction *ins)
  *  Uniform: access a uniform register given by low bits.
  *  Constant: access the specified constant 
  *  Zero: special cased to avoid wasting a constant
+ *  Passthrough: a bifrost_packed_src to passthrough T/T0/T1
  */
 
 #define BIR_INDEX_REGISTER (1 << 31)
 #define BIR_INDEX_UNIFORM  (1 << 30)
 #define BIR_INDEX_CONSTANT (1 << 29)
 #define BIR_INDEX_ZERO     (1 << 28)
+#define BIR_INDEX_PASS     (1 << 27)
 
 /* Keep me synced please so we can check src & BIR_SPECIAL */
 
 #define BIR_SPECIAL        ((BIR_INDEX_REGISTER | BIR_INDEX_UNIFORM) | \
-        (BIR_INDEX_CONSTANT | BIR_INDEX_ZERO))
+        (BIR_INDEX_CONSTANT | BIR_INDEX_ZERO | BIR_INDEX_PASS))
 
 static inline unsigned
 bi_max_temp(bi_context *ctx)