From d4600c43402b4473a7f0bf741be65ad8835d7f83 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 27 Apr 2020 16:33:54 -0400 Subject: [PATCH] pan/mdg: Remove nir_alu_src_index Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/compiler.h | 6 ------ src/panfrost/midgard/midgard_compile.c | 6 +++--- src/panfrost/midgard/midgard_derivatives.c | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index bc43309c7a1..4f9880ca031 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -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) { diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 905344bc6ac..bf2dadf16b3 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -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 diff --git a/src/panfrost/midgard/midgard_derivatives.c b/src/panfrost/midgard/midgard_derivatives.c index 7c0259f2e96..6ccf2b1de44 100644 --- a/src/panfrost/midgard/midgard_derivatives.c +++ b/src/panfrost/midgard/midgard_derivatives.c @@ -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, -- 2.30.2