From ac2b8a56cdb11f8d153160ed39604b430cc39fed Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 21 Dec 2020 16:23:34 -0500 Subject: [PATCH] pan/bi: Test read predicates Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/bi_schedule.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index a658738ff79..25d2c49b205 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -325,24 +325,42 @@ bi_test_units(bi_builder *b) assert(bi_can_add(mov)); assert(!bi_must_last(mov)); assert(!bi_must_message(mov)); + assert(bi_reads_zero(mov)); + assert(bi_reads_temps(mov, 0)); + assert(bi_reads_t(mov, 0)); bi_instr *fma = bi_fma_f32_to(b, TMP(), TMP(), TMP(), bi_zero(), BI_ROUND_NONE); assert(bi_can_fma(fma)); assert(!bi_can_add(fma)); assert(!bi_must_last(fma)); assert(!bi_must_message(fma)); + assert(bi_reads_zero(fma)); + for (unsigned i = 0; i < 3; ++i) { + assert(bi_reads_temps(fma, i)); + assert(bi_reads_t(fma, i)); + } bi_instr *load = bi_load_i128_to(b, TMP(), TMP(), TMP(), BI_SEG_UBO); assert(!bi_can_fma(load)); assert(bi_can_add(load)); assert(!bi_must_last(load)); assert(bi_must_message(load)); + for (unsigned i = 0; i < 2; ++i) { + assert(bi_reads_temps(load, i)); + assert(bi_reads_t(load, i)); + } bi_instr *blend = bi_blend_to(b, TMP(), TMP(), TMP(), TMP(), TMP()); assert(!bi_can_fma(load)); assert(bi_can_add(load)); assert(bi_must_last(blend)); assert(bi_must_message(blend)); + for (unsigned i = 0; i < 4; ++i) + assert(bi_reads_temps(blend, i)); + assert(!bi_reads_t(blend, 0)); + assert(bi_reads_t(blend, 1)); + assert(!bi_reads_t(blend, 2)); + assert(!bi_reads_t(blend, 3)); } int bi_test_scheduler(void)