diff options
author | Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> | 2020-05-05 14:34:58 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-05-29 20:34:55 +0000 |
commit | ac64bf9b207f6a4e7f41d57ee123b173f631cb28 (patch) | |
tree | d87c1a4c02ef80395159a629bc172c8f8cf49aed | |
parent | 95e3776d3e0119f679bfb467028ed09226fdf95d (diff) |
pan/bi: Move bi_flip_ports out of port assignment
It's more of a packing fixup than anything scheduler-y, and port
assignment will soon be the domain of the scheduler.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
-rw-r--r-- | src/panfrost/bifrost/bi_pack.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 9c49ffceb27..0cc56584303 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -267,14 +267,6 @@ bi_assign_ports(bi_bundle *now, bi_bundle *prev) now->regs.write_fma = true; } - /* Finally, ensure port 1 > port 0 for the 63-x trick to function */ - - if (now->regs.enabled[0] && now->regs.enabled[1] && now->regs.port[1] < now->regs.port[0]) { - unsigned temp = now->regs.port[0]; - now->regs.port[0] = now->regs.port[1]; - now->regs.port[1] = temp; - } - return now->regs; } @@ -1676,6 +1668,20 @@ struct bi_packed_bundle { uint64_t hi; }; +/* We must ensure port 1 > port 0 for the 63-x trick to function, so we fix + * this up at pack time. (Scheduling doesn't care.) */ + +static void +bi_flip_ports(bi_registers *regs) +{ + if (regs->enabled[0] && regs->enabled[1] && regs->port[1] < regs->port[0]) { + unsigned temp = regs->port[0]; + regs->port[0] = regs->port[1]; + regs->port[1] = temp; + } + +} + static struct bi_packed_bundle bi_pack_bundle(bi_clause *clause, bi_bundle bundle, bi_bundle prev, bool first_bundle, gl_shader_stage stage) { @@ -1683,6 +1689,8 @@ bi_pack_bundle(bi_clause *clause, bi_bundle bundle, bi_bundle prev, bool first_b bi_assign_uniform_constant(clause, &bundle.regs, bundle); bundle.regs.first_instruction = first_bundle; + bi_flip_ports(&bundle.regs); + uint64_t reg = bi_pack_registers(bundle.regs); uint64_t fma = bi_pack_fma(clause, bundle, &bundle.regs); uint64_t add = bi_pack_add(clause, bundle, &bundle.regs, stage); |