aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-07-19 19:14:43 (GMT)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-07-22 15:20:34 (GMT)
commit533d65786f43f23306c9e65d1d7022cf506a143f (patch)
tree11022a23135451a0881bde1e1ee6f6143772f7d2
parent076838ef0cba3bffd8d89a02146c2fcf18c30871 (diff)
downloadexternal_mesa3d-533d65786f43f23306c9e65d1d7022cf506a143f.zip
external_mesa3d-533d65786f43f23306c9e65d1d7022cf506a143f.tar.gz
external_mesa3d-533d65786f43f23306c9e65d1d7022cf506a143f.tar.bz2
panfrost/midgard: Add mir_has_arg helper
Helps scan the MIR for uses of an index. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-rw-r--r--src/panfrost/midgard/compiler.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 294831c..3002a07 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -417,6 +417,18 @@ v_mov(unsigned src, midgard_vector_alu_src mod, unsigned dest)
return ins;
}
+static inline bool
+mir_has_arg(midgard_instruction *ins, unsigned arg)
+{
+ if (ins->ssa_args.src0 == arg)
+ return true;
+
+ if (ins->ssa_args.src1 == arg && !ins->ssa_args.inline_constant)
+ return true;
+
+ return false;
+}
+
midgard_instruction
v_load_store_scratch(unsigned srcdest, unsigned index, bool is_store);