From 2f92479ffcfc9119729b55d1f49217c90993bf06 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 15 Aug 2019 09:53:25 -0700 Subject: [PATCH] pan/midgard: Add mir_foreach_src This is repeated often enough. Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/compiler.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 6f953d48cb8..217ab317090 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -381,6 +381,9 @@ mir_next_op(struct midgard_instruction *ins) _entry_##v = _mesa_set_next_entry(blk->predecessors, _entry_##v), \ v = (struct midgard_block *) (_entry_##v ? _entry_##v->key : NULL)) +#define mir_foreach_src(ins, v) \ + for (unsigned v = 0; v < ARRAY_SIZE(ins->ssa_args.src); ++v) + static inline midgard_instruction * mir_last_in_block(struct midgard_block *block) { -- 2.30.2