diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-28 13:27:31 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-29 20:34:55 +0000 |
commit | cd9a08d4f2360c227eb17f5b1f166ac46ca08ebe (patch) | |
tree | 92775847da625e0a4363b2c29c0173ec24339edd /src/panfrost/bifrost/bi_pack.c | |
parent | cdff3ebc9a28ffa0001012ab5ad913c81de7fb8a (diff) |
pan/bi: Assign constant port for branch offsets
By convention.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
Diffstat (limited to 'src/panfrost/bifrost/bi_pack.c')
-rw-r--r-- | src/panfrost/bifrost/bi_pack.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index f35de67abf2..b5cbc5fa948 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -123,6 +123,24 @@ bi_assign_uniform_constant_single( return true; } + if (ins->type == BI_BRANCH && clause->branch_constant) { + /* By convention branch constant is last */ + unsigned idx = clause->constant_count - 1; + + /* We can only jump to clauses which are qword aligned so the + * bottom 4-bits of the offset are necessarily 0 */ + unsigned lo = 0; + + /* Build the constant */ + unsigned C = bi_constant_field(idx) | lo; + + if (assigned && regs->uniform_constant != C) + unreachable("Mismatched uniform/const field: branch"); + + regs->uniform_constant = C; + return true; + } + bi_foreach_src(ins, s) { if (s == 0 && (ins->type == BI_LOAD_VAR_ADDRESS || ins->type == BI_LOAD_ATTR)) continue; if (s == 1 && (ins->type == BI_BRANCH)) continue; |