pan/mdg: Remove nir_alu_src_index
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 27 Apr 2020 20:33:54 +0000 (16:33 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Apr 2020 15:18:38 +0000 (15:18 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4792>

src/panfrost/midgard/compiler.h
src/panfrost/midgard/midgard_compile.c
src/panfrost/midgard/midgard_derivatives.c

index bc43309c7a16452b379c8f5d86423da32e0b05ae..4f9880ca0319dcafd90947e0c20e8aa0d46ad1e1 100644 (file)
@@ -458,12 +458,6 @@ nir_src_index(compiler_context *ctx, nir_src *src)
         }
 }
 
-static inline unsigned
-nir_alu_src_index(compiler_context *ctx, nir_alu_src *src)
-{
-        return nir_src_index(ctx, &src->src);
-}
-
 static inline unsigned
 nir_dest_index(nir_dest *dst)
 {
index 905344bc6ac4275f4cfd1eeb93ec123312780ee8..bf2dadf16b3db828d6a8fa243e0fa7ed807fd080 100644 (file)
@@ -920,9 +920,9 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
          * instructions. The latter can only be fetched if the instruction
          * needs it, or else we may segfault. */
 
-        unsigned src0 = nir_alu_src_index(ctx, &instr->src[0]);
-        unsigned src1 = nr_inputs >= 2 ? nir_alu_src_index(ctx, &instr->src[1]) : ~0;
-        unsigned src2 = nr_inputs == 3 ? nir_alu_src_index(ctx, &instr->src[2]) : ~0;
+        unsigned src0 = nir_src_index(ctx, &instr->src[0].src);
+        unsigned src1 = nr_inputs >= 2 ? nir_src_index(ctx, &instr->src[1].src) : ~0;
+        unsigned src2 = nr_inputs == 3 ? nir_src_index(ctx, &instr->src[2].src) : ~0;
         assert(nr_inputs <= 3);
 
         /* Rather than use the instruction generation helpers, we do it
index 7c0259f2e96f6113dd1f1d4a1972ae0e8512e65f..6ccf2b1de440edcf7490732ff0abd8cde1c6d16b 100644 (file)
@@ -102,7 +102,7 @@ midgard_emit_derivatives(compiler_context *ctx, nir_alu_instr *instr)
                 .type = TAG_TEXTURE_4,
                 .mask = mask_of(nr_components),
                 .dest = nir_dest_index(&instr->dest.dest),
-                .src = { nir_alu_src_index(ctx, &instr->src[0]), ~0, ~0, ~0 },
+                .src = { nir_src_index(ctx, &instr->src[0].src), ~0, ~0, ~0 },
                 .texture = {
                         .op = mir_derivative_op(instr->op),
                         .format = MALI_TEX_2D,