From 1adb996acc3ca55906fbb36540fe053eb0182678 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 6 Jan 2021 13:40:31 -0500 Subject: [PATCH] pan/bi: Add subword 5/6 pack Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/bi_pack.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 2531e265688..f4bf7bd3531 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -710,6 +710,25 @@ bi_pack_t_ec(enum bi_clause_subword word, return bi_pack_tuple_bits(word, tuples, tuple_count, 0, 60); } +static uint32_t +bi_pack_subwords_56(enum bi_clause_subword t, + struct bi_packed_tuple *tuples, + ASSERTED unsigned tuple_count, + uint64_t header, uint64_t ec0, + unsigned tuple_subword) +{ + switch (t) { + case BI_CLAUSE_SUBWORD_HEADER: + return (header & ((1 << 30) - 1)); + case BI_CLAUSE_SUBWORD_RESERVED: + return 0; + case BI_CLAUSE_SUBWORD_CONSTANT: + return (ec0 >> 15) & ((1 << 30) - 1); + default: + return bi_pack_tuple_bits(t, tuples, tuple_count, tuple_subword * 15, 30); + } +} + static void bi_pack_clause(bi_context *ctx, bi_clause *clause, bi_clause *next_1, bi_clause *next_2,