panfrost: introduce LDST_ATOMIC property
[mesa.git] / src / panfrost / midgard / midgard_ops.h
index 64c91a5bcac57d399230005f5f1046b79a8b7728..ee4dca6ae9966d9262b5022bcc26b09e87ac4d55 100644 (file)
  * THE SOFTWARE.
  */
 
+#ifndef __MIDGARD_OPS
+#define __MIDGARD_OPS
+
 #include "helpers.h"
 
 /* Forward declare */
 
 extern struct mir_op_props alu_opcode_props[256];
-extern const char *load_store_opcode_names[256];
+extern struct mir_ldst_op_props load_store_opcode_props[256];
+extern struct mir_tag_props midgard_tag_props[16];
+
+#define OP_IS_ATOMIC(op) (load_store_opcode_props[op].props & LDST_ATOMIC)
+#define OP_IS_STORE(op) (load_store_opcode_props[op].props & LDST_STORE)
+#define OP_HAS_ADDRESS(op) (load_store_opcode_props[op].props & LDST_ADDRESS)
 
 /* Is this opcode that of an integer (regardless of signedness)? Instruction
  * names authoritatively determine types */
@@ -55,12 +63,12 @@ midgard_is_integer_out_op(int op)
 /* Determines effective writemask, taking quirks and expansion into account */
 
 static inline unsigned
-effective_writemask(midgard_vector_alu *alu, unsigned existing_mask)
+effective_writemask(midgard_alu_op op, unsigned existing_mask)
 {
         /* Channel count is off-by-one to fit in two-bits (0 channel makes no
          * sense) */
 
-        unsigned channel_count = GET_CHANNEL_COUNT(alu_opcode_props[alu->op].props);
+        unsigned channel_count = GET_CHANNEL_COUNT(alu_opcode_props[op].props);
 
         /* If there is a fixed channel count, construct the appropriate mask */
 
@@ -70,4 +78,4 @@ effective_writemask(midgard_vector_alu *alu, unsigned existing_mask)
         return existing_mask;
 };
 
-
+#endif