From 60f252708fc7d0ad9b844c55b659e9fd3d6b5607 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 14 Apr 2020 18:36:28 -0400 Subject: [PATCH] pan/bi: Fix packing with low-nibble-set on hi constant Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_pack.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index f53effc..edeb050 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -115,13 +115,15 @@ bi_lookup_constant(bi_clause *clause, uint64_t cons, bool *hi, bool b64) /* Only check top 60-bits since that's what's actually embedded * in the clause, the bottom 4-bits are bundle-inline */ - unsigned candidates[2] = { + uint64_t candidates[2] = { clause->constants[i] >> 4, clause->constants[i] >> 36 }; + /* For <64-bit mode, we treat lo/hi separately */ + if (!b64) - candidates[0] &= 0xFFFFFFFF; + candidates[0] &= (0xFFFFFFFF >> 4); if (candidates[0] == want) return i; -- 2.7.4