From bb0606f0bab1e12f8407bfc536faea3068a95470 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 24 Jun 2022 16:30:24 -0400 Subject: [PATCH] pan/bi: Handle swizzles in unpack_64_2x32_split_{x,y} No known fixes but this would still be wrong for OpenCL. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index a3ceea42912..4676c850503 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2332,12 +2332,18 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) } case nir_op_unpack_64_2x32_split_x: - bi_mov_i32_to(b, dst, bi_extract(b, bi_src_index(&instr->src[0].src), 0)); + { + unsigned chan = (instr->src[0].swizzle[0] * 2) + 0; + bi_mov_i32_to(b, dst, bi_extract(b, bi_src_index(&instr->src[0].src), chan)); return; + } case nir_op_unpack_64_2x32_split_y: - bi_mov_i32_to(b, dst, bi_extract(b, bi_src_index(&instr->src[0].src), 1)); + { + unsigned chan = (instr->src[0].swizzle[0] * 2) + 1; + bi_mov_i32_to(b, dst, bi_extract(b, bi_src_index(&instr->src[0].src), chan)); return; + } case nir_op_pack_64_2x32_split: bi_collect_v2i32_to(b, dst,