pan/mdg: Eliminate load_64
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 11 May 2020 19:06:53 +0000 (15:06 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 May 2020 17:49:14 +0000 (17:49 +0000)
It can always be inferred from the types.

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

src/panfrost/midgard/compiler.h
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_ra.c
src/panfrost/midgard/mir_promote_uniforms.c

index 9de53918644522e4c2f5cbb58f7cbc741773f397..f9cfcb09fc8b91320257b55e4a975dcf15ccaccc 100644 (file)
@@ -164,9 +164,6 @@ typedef struct midgard_instruction {
         unsigned nr_dependencies;
         BITSET_WORD *dependents;
 
-        /* For load/store ops.. force 64-bit destination */
-        bool load_64;
-
         union {
                 midgard_load_store_word load_store;
                 midgard_vector_alu alu;
index 643fe114b0da9438fe74e9d304b396841fe822bc..1ca2df891f63d8515cc4a268e78722bc7cc68283 100644 (file)
@@ -1135,9 +1135,7 @@ mir_set_intr_mask(nir_instr *instr, midgard_instruction *ins, bool is_read)
         /* Once we have the NIR mask, we need to normalize to work in 32-bit space */
         unsigned bytemask = pan_to_bytemask(dsize, nir_mask);
         mir_set_bytemask(ins, bytemask);
-
-        if (dsize == 64)
-                ins->load_64 = true;
+        ins->dest_type = nir_type_uint | dsize;
 }
 
 /* Uniforms and UBOs use a shared code path, as uniforms are just (slightly
index 95fd30ec337271e7bb46e1d23cf820b9e5a31463..faaa41f2839fec8d096a9e845b4e2143cef7be8d 100644 (file)
@@ -525,9 +525,6 @@ allocate_registers(compiler_context *ctx, bool *spilled)
                         (size == 64) ? 3 : /* (1 << 3) = 8-byte */
                         3; /* 8-bit todo */
 
-                if (ins->type == TAG_LOAD_STORE_4 && ins->load_64)
-                        min_alignment[dest] = 3;
-
                 /* We don't have a swizzle for the conditional and we don't
                  * want to muck with the conditional itself, so just force
                  * alignment for now */
index e29de78808d86c2aeefc512f6721ed4b65733a8f..0cd3a86a9dc83b273a1f3519ede7051634ef1284 100644 (file)
@@ -192,12 +192,12 @@ midgard_promote_uniforms(compiler_context *ctx)
                         needs_move |= BITSET_TEST(special, ins->dest);
 
                 if (needs_move) {
+                        unsigned type_size = nir_alu_type_get_type_size(ins->dest_type);
                         midgard_instruction mov = v_mov(promoted, ins->dest);
 
-                        if (ins->load_64)
+                        if (type_size == 64)
                                 mov.alu.reg_mode = midgard_reg_mode_64;
 
-                        unsigned type_size = nir_alu_type_get_type_size(ins->dest_type);
                         uint16_t rounded = mir_round_bytemask_up(mir_bytemask(ins), type_size);
                         mir_set_bytemask(&mov, rounded);
                         mir_insert_instruction_before(ctx, ins, mov);