pan/bi: Round constants to 32-bit
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Apr 2020 19:52:03 +0000 (15:52 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Apr 2020 20:25:36 +0000 (16:25 -0400)
We can only access lo/hi at 32-bit intervals.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>

src/panfrost/bifrost/bifrost_compile.c

index 9671a485c2a7a3aa2eb914d41cfbeb1cbeeafd4d..339035f40d2325510f6e112c56d7cea5dcf6c9de 100644 (file)
@@ -497,7 +497,7 @@ bi_copy_src(bi_instruction *alu, nir_alu_instr *instr, unsigned i, unsigned to,
                 alu->constant.u64 |= cons << *constant_shift;
                 alu->src[to] = BIR_INDEX_CONSTANT | (*constant_shift);
                 --(*constants_left);
-                (*constant_shift) += dest_bits;
+                (*constant_shift) += MAX2(dest_bits, 32); /* lo/hi */
                 return;
         }