pan/midgard: Add LDST_ADDRESS property
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 27 Feb 2020 14:35:50 +0000 (09:35 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 27 Feb 2020 21:02:35 +0000 (21:02 +0000)
Many load/store ops (used for globals, SSBOs, shared memory, etc) have
the ability to compute addresses directly. Mark off which ones behave
like this.

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

src/panfrost/midgard/helpers.h
src/panfrost/midgard/midgard_ops.c
src/panfrost/midgard/midgard_ops.h

index 9acc5dd6664d29a7996bf68f1c19bf51379e5649..7aa2e776008738e58714e6181be14fa99388b441 100644 (file)
@@ -230,6 +230,9 @@ struct mir_tag_props {
  * its mask is 0 */
 #define LDST_SIDE_FX (1 << 4)
 
+/* Computes an address according to indirects/zext/shift/etc */
+#define LDST_ADDRESS (1 << 5)
+
 /* This file is common, so don't define the tables themselves. #include
  * midgard_op.h if you need that, or edit midgard_ops.c directly */
 
index cb0e50dfbffb2739b93677557407ed10b03ab25d..ec00e2af47508dfa60d12f6307bf5b09d67f9f50 100644 (file)
@@ -207,12 +207,12 @@ struct mir_ldst_op_props load_store_opcode_props[256] = {
         [midgard_op_atomic_umax64] = {"atomic_umax64", M64 | LDST_SIDE_FX},
         [midgard_op_atomic_xchg64] = {"atomic_xchg64", M64 | LDST_SIDE_FX},
 
-        [midgard_op_ld_char]   = {"ld_char",   M32},
-        [midgard_op_ld_char2]  = {"ld_char2",  M16},
-        [midgard_op_ld_short]  = {"ld_short",  M32},
-        [midgard_op_ld_char4]  = {"ld_char4",  M32},
-        [midgard_op_ld_short4] = {"ld_short4", M32},
-        [midgard_op_ld_int4]   = {"ld_int4",   M32},
+        [midgard_op_ld_char]   = {"ld_char",   M32 | LDST_ADDRESS},
+        [midgard_op_ld_char2]  = {"ld_char2",  M16 | LDST_ADDRESS},
+        [midgard_op_ld_short]  = {"ld_short",  M32 | LDST_ADDRESS},
+        [midgard_op_ld_char4]  = {"ld_char4",  M32 | LDST_ADDRESS},
+        [midgard_op_ld_short4] = {"ld_short4", M32 | LDST_ADDRESS},
+        [midgard_op_ld_int4]   = {"ld_int4",   M32 | LDST_ADDRESS},
 
         [midgard_op_ld_attr_32]  = {"ld_attr_32",  M32},
         [midgard_op_ld_attr_32i] = {"ld_attr_32i", M32},
@@ -234,11 +234,11 @@ struct mir_ldst_op_props load_store_opcode_props[256] = {
         [midgard_op_ld_ubo_short4] = {"ld_ubo_short4", M32},
         [midgard_op_ld_ubo_int4]   = {"ld_ubo_int4",   M32},
 
-        [midgard_op_st_char]   = {"st_char",   M32 | LDST_STORE},
-        [midgard_op_st_char2]  = {"st_char2",  M16 | LDST_STORE},
-        [midgard_op_st_char4]  = {"st_char4",  M32 | LDST_STORE},
-        [midgard_op_st_short4] = {"st_short4", M32 | LDST_STORE},
-        [midgard_op_st_int4]   = {"st_int4",   M32 | LDST_STORE},
+        [midgard_op_st_char]   = {"st_char",   M32 | LDST_STORE | LDST_ADDRESS},
+        [midgard_op_st_char2]  = {"st_char2",  M16 | LDST_STORE | LDST_ADDRESS},
+        [midgard_op_st_char4]  = {"st_char4",  M32 | LDST_STORE | LDST_ADDRESS},
+        [midgard_op_st_short4] = {"st_short4", M32 | LDST_STORE | LDST_ADDRESS},
+        [midgard_op_st_int4]   = {"st_int4",   M32 | LDST_STORE | LDST_ADDRESS},
 
         [midgard_op_st_vary_32]  = {"st_vary_32",  M32 | LDST_STORE},
         [midgard_op_st_vary_32i] = {"st_vary_32i", M32 | LDST_STORE},
index f0cfc5db424563e58bf3923cd787aac85206e66c..6919c3155b69e937145752773beaa23b7485d06f 100644 (file)
@@ -31,6 +31,7 @@ extern struct mir_ldst_op_props load_store_opcode_props[256];
 extern struct mir_tag_props midgard_tag_props[16];
 
 #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 */