From: Alyssa Rosenzweig Date: Thu, 15 Aug 2019 16:53:25 +0000 (-0700) Subject: pan/midgard: Add mir_foreach_src X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f92479ffcfc9119729b55d1f49217c90993bf06;p=mesa.git pan/midgard: Add mir_foreach_src This is repeated often enough. Signed-off-by: Alyssa Rosenzweig --- 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) {