Mesa (main): pan/bi: Test restrictions on same-cycle temporaries

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 29 19:46:12 UTC 2021


Module: Mesa
Branch: main
Commit: 67b9b73f9f16643fc511f6a3dbc8286fb1291584
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=67b9b73f9f16643fc511f6a3dbc8286fb1291584

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Thu Jul 29 14:34:32 2021 -0400

pan/bi: Test restrictions on same-cycle temporaries

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12114>

---

 src/panfrost/bifrost/test/test-scheduler-predicates.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/panfrost/bifrost/test/test-scheduler-predicates.c b/src/panfrost/bifrost/test/test-scheduler-predicates.c
index 95e1598e3e9..abd3fff0d42 100644
--- a/src/panfrost/bifrost/test/test-scheduler-predicates.c
+++ b/src/panfrost/bifrost/test/test-scheduler-predicates.c
@@ -71,6 +71,19 @@ int main(int argc, char **argv)
    BIT_ASSERT(!bi_reads_t(blend, 2));
    BIT_ASSERT(!bi_reads_t(blend, 3));
 
+   /* Test restrictions on modifiers of same cycle temporaries */
+   bi_instr *fadd = bi_fadd_f32_to(b, TMP(), TMP(), TMP(), BI_ROUND_NONE);
+   BIT_ASSERT(bi_reads_t(fadd, 0));
+
+   for (unsigned i = 0; i < 2; ++i) {
+      for (unsigned j = 0; j < 2; ++j) {
+         bi_instr *fadd = bi_fadd_f32_to(b, TMP(), TMP(), TMP(), BI_ROUND_NONE);
+         fadd->src[i] = bi_swz_16(TMP(), j, j);
+         BIT_ASSERT(bi_reads_t(fadd, 1 - i));
+         BIT_ASSERT(!bi_reads_t(fadd, i));
+      }
+   }
+
    ralloc_free(ralloc_ctx);
    TEST_END(nr_pass, nr_fail);
 }



More information about the mesa-commit mailing list