radeonsi: stop vectorizing unpack_32_2x16_split
authorKarol Herbst <kherbst@redhat.com>
Tue, 27 Sep 2022 17:08:41 +0000 (19:08 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 1 Oct 2022 13:36:46 +0000 (13:36 +0000)
nir_to_llvm can't deal with them being vectors.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18802>

src/gallium/drivers/radeonsi/si_shader_nir.c

index beeaa9a..135f871 100644 (file)
@@ -48,8 +48,15 @@ static uint8_t si_vectorize_callback(const nir_instr *instr, const void *data)
       return 0;
 
    nir_alu_instr *alu = nir_instr_as_alu(instr);
-   if (nir_dest_bit_size(alu->dest.dest) == 16)
-      return 2;
+   if (nir_dest_bit_size(alu->dest.dest) == 16) {
+      switch (alu->op) {
+      case nir_op_unpack_32_2x16_split_x:
+      case nir_op_unpack_32_2x16_split_y:
+         return 1;
+      default:
+         return 2;
+      }
+   }
 
    return 1;
 }