summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2021-01-13 14:13:47 +1300
committerMarge Bot <eric+marge@anholt.net>2021-01-13 03:53:45 +0000
commit9c8dfe4a65e4ba758e642aa928b993ad4ee2b634 (patch)
treef2ddff76938d50ce58733ac6b6f6839af4e67318 /src
parent37adeda1ffe6bac79df6961a7dab68d6842f7dfe (diff)
panfrost: Fix size assertion in bi_alu_src_index
Shifting by the bitsize was not only wrong, the shift is undefined behavior when bitsize is 32, causing the assertion to fire on AArch32. Fixes: 95d62ee7cfa ("pan/bi: Add bi_alu_src_index helper") Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8460>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 55a17f3bf35..22a196c2fe6 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -740,7 +740,7 @@ bi_alu_src_index(nir_alu_src src, unsigned comps)
assert(idx.swizzle == BI_SWIZZLE_H01);
/* Bigger vectors should have been lowered */
- assert(comps <= (1 << bitsize));
+ assert(comps <= (1 << subword_shift));
if (bitsize == 16) {
unsigned c0 = src.swizzle[0] & 1;