aco: fix alignment of vectors with 4 elements
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 25 May 2020 16:33:18 +0000 (18:33 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 9 Jun 2020 21:25:38 +0000 (21:25 +0000)
I think this case was just missing.

This fixes a bunch of 16-bit storage related CTS failures like
dEQP-VK.ssbo.phys.layout.single_basic_type.std430.u16vec4.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5226>

src/amd/compiler/aco_instruction_selection.cpp

index 66f6c8857e222e59642770d5dddcb84286ae3a8e..76462b1b23b3c31f763d58903ab437f13edbc2d3 100644 (file)
@@ -3027,9 +3027,12 @@ void byte_align_vector(isel_context *ctx, Temp vec, Operand offset, Temp dst)
 {
    Builder bld(ctx->program, ctx->block);
    if (offset.isTemp()) {
-      Temp tmp[3] = {vec, vec, vec};
+      Temp tmp[4] = {vec, vec, vec, vec};
 
-      if (vec.size() == 3) {
+      if (vec.size() == 4) {
+         tmp[0] = bld.tmp(v1), tmp[1] = bld.tmp(v1), tmp[2] = bld.tmp(v1), tmp[3] = bld.tmp(v1);
+         bld.pseudo(aco_opcode::p_split_vector, Definition(tmp[0]), Definition(tmp[1]), Definition(tmp[2]), Definition(tmp[3]), vec);
+      } else if (vec.size() == 3) {
          tmp[0] = bld.tmp(v1), tmp[1] = bld.tmp(v1), tmp[2] = bld.tmp(v1);
          bld.pseudo(aco_opcode::p_split_vector, Definition(tmp[0]), Definition(tmp[1]), Definition(tmp[2]), vec);
       } else if (vec.size() == 2) {