aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-28 14:00:45 -0400
committerMarge Bot <[email protected]>2020-05-29 20:34:55 +0000
commite945d4f79d6f4da1d6ad61ebcef43ba47aeb7833 (patch)
tree12c0d690914a194c2f1dd7d042cee12866b9b512 /src/panfrost/bifrost
parent682b63cdc2631de48d6d5e8ce739e272ae373c10 (diff)
pan/bi: Pack proper clause offsets
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r--src/panfrost/bifrost/bi_pack.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index 7366b16c6c6..4d5aa9f7bfd 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -1786,6 +1786,26 @@ bi_pack_constants(bi_context *ctx, bi_clause *clause,
assert(index == 0 && clause->bundle_count == 1);
assert(only);
+ /* Compute branch offset instead of a dummy 0 */
+ if (branches) {
+ bi_instruction *br = clause->bundles[clause->bundle_count - 1].add;
+ assert(br && br->type == BI_BRANCH && br->branch_target);
+
+ /* Put it in the high place */
+ int32_t qwords = bi_block_offset(ctx, clause, br->branch_target);
+ int32_t bytes = qwords * 16;
+
+ /* Copy so we get proper sign behaviour */
+ uint32_t raw = 0;
+ memcpy(&raw, &bytes, sizeof(raw));
+
+ /* Clear off top bits for the magic bits */
+ raw &= ~0xF0000000;
+
+ /* Put in top 32-bits */
+ clause->constants[index + 0] = ((uint64_t) raw) << 32ull;
+ }
+
uint64_t hi = clause->constants[index + 0] >> 60ull;
struct bifrost_fmt_constant quad = {