From: Alyssa Rosenzweig Date: Fri, 20 Mar 2020 16:38:08 +0000 (-0400) Subject: pan/bi: Generalize data register setting X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c57ac9d1368e83ce001be4439c73473529e48135;p=mesa.git pan/bi: Generalize data register setting So we can use it for stores too. Signed-off-by: Alyssa Rosenzweig Part-of: --- 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) {