From: Rhys Perry Date: Mon, 24 Aug 2020 19:00:10 +0000 (+0100) Subject: aco: fix byte_align_scalar for 3 dword vectors X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8faf85f68770ee3e060bb74c87e857070f336a02;p=mesa.git aco: fix byte_align_scalar for 3 dword vectors Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Fixes: fe08f0ccf94a7315bded5868b4f6a8bae744de79 ('aco: add byte_align_scalar() & trim_subdword_vector() helper functions') Part-of: --- diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 9b566442f51..f7205cd7ef3 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -447,10 +447,17 @@ void byte_align_scalar(isel_context *ctx, Temp vec, Operand offset, Temp dst) emit_split_vector(ctx, dst, 2); else emit_extract_vector(ctx, tmp, 0, dst); - } else if (vec.size() == 4) { - Temp lo = bld.tmp(s2), hi = bld.tmp(s2); - bld.pseudo(aco_opcode::p_split_vector, Definition(lo), Definition(hi), vec); - hi = bld.pseudo(aco_opcode::p_extract_vector, bld.def(s1), hi, Operand(0u)); + } else if (vec.size() == 3 || vec.size() == 4) { + Temp lo = bld.tmp(s2), hi; + if (vec.size() == 3) { + /* this can happen if we use VMEM for a uniform load */ + hi = bld.tmp(s1); + bld.pseudo(aco_opcode::p_split_vector, Definition(lo), Definition(hi), vec); + } else { + hi = bld.tmp(s2); + bld.pseudo(aco_opcode::p_split_vector, Definition(lo), Definition(hi), vec); + hi = bld.pseudo(aco_opcode::p_extract_vector, bld.def(s1), hi, Operand(0u)); + } if (select != Temp()) hi = bld.sop2(aco_opcode::s_cselect_b32, bld.def(s1), hi, Operand(0u), bld.scc(select)); lo = bld.sop2(aco_opcode::s_lshr_b64, bld.def(s2), bld.def(s1, scc), lo, shift);