From e34add229ff06203fe852b15cb7ff32cf9e4c344 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 8 Apr 2020 19:06:27 -0400 Subject: pan/bi: Fix backwards registers ports Will matter when packing multiple instructions per bundle. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_pack.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/panfrost/bifrost') diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index ae2a6df30f2..61d3b4f1ee2 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -87,13 +87,13 @@ bi_print_ports(struct bi_registers *regs) if (regs->write_fma || regs->write_add) { printf("port 2 (%s): %u\n", - regs->write_fma ? "FMA" : "ADD", + regs->write_add ? "ADD" : "FMA", regs->port[2]); } if ((regs->write_fma && regs->write_add) || regs->read_port3) { printf("port 3 (%s): %u\n", - regs->read_port3 ? "read" : "ADD", + regs->read_port3 ? "read" : "FMA", regs->port[3]); } } @@ -274,15 +274,15 @@ bi_assign_ports(bi_bundle now, bi_bundle prev) /* Next, assign writes */ - if (prev.fma && prev.fma->dest & BIR_INDEX_REGISTER) { - regs.port[2] = prev.fma->dest & ~BIR_INDEX_REGISTER; - regs.write_fma = true; + if (prev.add && prev.add->dest & BIR_INDEX_REGISTER && !write_dreg) { + regs.port[2] = prev.add->dest & ~BIR_INDEX_REGISTER; + regs.write_add = true; } - if (prev.add && prev.add->dest & BIR_INDEX_REGISTER && !write_dreg) { - unsigned r = prev.add->dest & ~BIR_INDEX_REGISTER; + if (prev.fma && prev.fma->dest & BIR_INDEX_REGISTER) { + unsigned r = prev.fma->dest & ~BIR_INDEX_REGISTER; - if (regs.write_fma) { + if (regs.write_add) { /* Scheduler constraint: cannot read 3 and write 2 */ assert(!regs.read_port3); regs.port[3] = r; @@ -290,7 +290,7 @@ bi_assign_ports(bi_bundle now, bi_bundle prev) regs.port[2] = r; } - regs.write_add = true; + regs.write_fma = true; } /* Finally, ensure port 1 > port 0 for the 63-x trick to function */ -- cgit v1.2.3