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 <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7530>
This commit is contained in:
Boris Brezillon 2020-11-13 09:50:25 +01:00
parent 38bebba18a
commit ed057ca3d7

View file

@ -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))