panfrost/midgard: Refactor schedule/emit pipeline
[mesa.git] / src / gallium / drivers / panfrost / midgard / helpers.h
index cf3a63e7587c35a059754925c25597da0140710e..9adc5b35195fb805eaa3bd86ce4f997c289e4251 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef __MDG_HELPERS_H
 #define __MDG_HELPERS_H
 
+#include "util/macros.h"
 #include <string.h>
 
 #define OP_IS_STORE_VARY(op) (\
 #define TAG_ALU_12 0xA
 #define TAG_ALU_16 0xB
 
+static inline int
+quadword_size(int tag)
+{
+        switch (tag) {
+        case TAG_ALU_4:
+        case TAG_LOAD_STORE_4:
+        case TAG_TEXTURE_4:
+                return 1;
+        case TAG_ALU_8:
+                return 2;
+        case TAG_ALU_12:
+                return 3;
+        case TAG_ALU_16:
+                return 4;
+        default:
+                unreachable("Unknown tag");
+        }
+}
+
 /* Special register aliases */
 
 #define MAX_WORK_REGISTERS 16