Module: Mesa Branch: main Commit: 20e11cbb23a9c1e527602c1b41386e9e9125373b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=20e11cbb23a9c1e527602c1b41386e9e9125373b
Author: Alyssa Rosenzweig <[email protected]> Date: Thu Jul 8 17:31:05 2021 -0400 pan/bi: Add bi_before_tuple convenience method For constructing instructions during scheduling. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961> --- src/panfrost/bifrost/compiler.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 6966102e8aa..2de1f69a02e 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -918,15 +918,19 @@ bi_after_instr(bi_instr *instr) * in which case there must exist a nonempty penultimate tuple */ ATTRIBUTE_RETURNS_NONNULL static inline bi_instr * -bi_first_instr_in_clause(bi_clause *clause) +bi_first_instr_in_tuple(bi_tuple *tuple) { - bi_tuple tuple = clause->tuples[0]; - bi_instr *instr = tuple.fma ?: tuple.add; - + bi_instr *instr = tuple->fma ?: tuple->add; assert(instr != NULL); return instr; } +ATTRIBUTE_RETURNS_NONNULL static inline bi_instr * +bi_first_instr_in_clause(bi_clause *clause) +{ + return bi_first_instr_in_tuple(&clause->tuples[0]); +} + ATTRIBUTE_RETURNS_NONNULL static inline bi_instr * bi_last_instr_in_clause(bi_clause *clause) { @@ -964,6 +968,12 @@ bi_before_clause(bi_clause *clause) return bi_before_instr(bi_first_instr_in_clause(clause)); } +static inline bi_cursor +bi_before_tuple(bi_tuple *tuple) +{ + return bi_before_instr(bi_first_instr_in_tuple(tuple)); +} + static inline bi_cursor bi_after_clause(bi_clause *clause) { _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
