From ed057ca3d7b37b9571eabcf6aa0466f2c81bb493 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 13 Nov 2020 09:50:25 +0100 Subject: [PATCH] pan/bi: Allow lane selections on component 4 and above The lane selection only cares about intra-32b swizzling. Add a modulo on the test to allow selecting lanes when the swizzle is above 4 (needed for MKVEC.v4i8 lane selection). Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/gen_pack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/gen_pack.py b/src/panfrost/bifrost/gen_pack.py index 03c2f0401f1..e8ccf9ea12d 100644 --- a/src/panfrost/bifrost/gen_pack.py +++ b/src/panfrost/bifrost/gen_pack.py @@ -76,7 +76,7 @@ def pack_widen(mod, opts, body, pack_exprs): sz = 16 if op[0] == 'h' else 8 # Condition on the swizzle - conds = ['ins->swizzle[{}][{}] == {}'.format(marg, idx, lane) for idx, lane in enumerate(op[1:])] + conds = ['(ins->swizzle[{}][{}] % 4) == {}'.format(marg, idx, lane) for idx, lane in enumerate(op[1:])] cond = " && ".join(conds) body.append('{}if ({}_sz == {} && {}) {}_temp = {};'.format(t_else, mod, sz, cond, mod, i))