aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-11 14:40:01 -0400
committerMarge Bot <[email protected]>2020-03-11 20:28:21 +0000
commite94754a7c47bd59526de72115576519e015f4d76 (patch)
treee615332d32e048a8a8a25cab776c464a1d7f50de /src/panfrost/bifrost
parent9b75f410c44053a4fc84715dec473dadedf7aa14 (diff)
pan/bi: Paste over bi_has_arg
While we're at it, cleanup the Midgard one. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4150>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r--src/panfrost/bifrost/bir.c14
-rw-r--r--src/panfrost/bifrost/compiler.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bir.c b/src/panfrost/bifrost/bir.c
index 0f1efcb3388..5fe0ae48409 100644
--- a/src/panfrost/bifrost/bir.c
+++ b/src/panfrost/bifrost/bir.c
@@ -60,3 +60,17 @@ bi_is_src_swizzled(bi_instruction *ins, unsigned s)
return classy && small && first;
}
+
+bool
+bi_has_arg(bi_instruction *ins, unsigned arg)
+{
+ if (!ins)
+ return false;
+
+ bi_foreach_src(ins, s) {
+ if (ins->src[s] == arg)
+ return true;
+ }
+
+ return false;
+}
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 1c01b2d989b..cd0d4f56536 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -474,6 +474,7 @@ bir_dest_index(nir_dest *dst)
bool bi_has_outmod(bi_instruction *ins);
bool bi_has_source_mods(bi_instruction *ins);
bool bi_is_src_swizzled(bi_instruction *ins, unsigned s);
+bool bi_has_arg(bi_instruction *ins, unsigned arg);
/* BIR passes */