pan/bi: Fix packing with low-nibble-set on hi constant
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 14 Apr 2020 22:36:28 +0000 (18:36 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Apr 2020 20:25:35 +0000 (16:25 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>

src/panfrost/bifrost/bi_pack.c

index f53effc7275dd6fdacca626de00d617628c58806..edeb050aae121d426745eabfecf863152b59b23b 100644 (file)
@@ -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;