From 1db83fc75d95a8f5c787e9bd3b75ba235831dd46 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 14 Oct 2020 20:35:59 -0400 Subject: [PATCH] pan/bi: Add bi_rewrite_index_src_single helper Ported from Midgard. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_ra.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index 753089f9156..3cd15e8a5cf 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -174,6 +174,15 @@ bi_install_registers(bi_context *ctx, struct lcra_state *l) } } +static void +bi_rewrite_index_src_single(bi_instruction *ins, unsigned old, unsigned new) +{ + bi_foreach_src(ins, i) { + if (ins->src[i] == old) + ins->src[i] = new; + } +} + static bi_instruction bi_spill(unsigned node, uint64_t offset, unsigned channels) {