From c57ac9d1368e83ce001be4439c73473529e48135 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 20 Mar 2020 12:38:08 -0400 Subject: [PATCH] pan/bi: Generalize data register setting So we can use it for stores too. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_pack.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 4555b53e56e..c8070dbf96b 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -355,14 +355,26 @@ bi_pack_registers(struct bi_registers regs) } static void -bi_write_data_register(bi_clause *clause, bi_instruction *ins) +bi_set_data_register(bi_clause *clause, unsigned idx) { - assert(ins->dest & BIR_INDEX_REGISTER); - unsigned reg = ins->dest & ~BIR_INDEX_REGISTER; + assert(idx & BIR_INDEX_REGISTER); + unsigned reg = idx & ~BIR_INDEX_REGISTER; assert(reg <= 63); clause->data_register = reg; } +static void +bi_read_data_register(bi_clause *clause, bi_instruction *ins) +{ + bi_set_data_register(clause, ins->src[0]); +} + +static void +bi_write_data_register(bi_clause *clause, bi_instruction *ins) +{ + bi_set_data_register(clause, ins->dest); +} + static enum bifrost_packed_src bi_get_src_reg_port(struct bi_registers *regs, unsigned src) { -- 2.30.2