pan/bi: Change swizzled scalars to identity
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 4 May 2021 16:01:06 +0000 (12:01 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 6 May 2021 23:26:21 +0000 (23:26 +0000)
Allows packing for things like IADD.v2s16

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9239>

src/panfrost/bifrost/bi_lower_swizzle.c

index bae7739..5f39682 100644 (file)
@@ -77,7 +77,10 @@ bi_lower_swizzle_16(bi_context *ctx, bi_instr *ins, unsigned src)
         /* If the instruction is scalar we can ignore the other component */
         if (ins->dest[0].swizzle == BI_SWIZZLE_H00 &&
                         ins->src[src].swizzle == BI_SWIZZLE_H00)
+        {
+                ins->src[src].swizzle = BI_SWIZZLE_H01;
                 return;
+        }
 
         /* Lower it away */
         bi_builder b = bi_init_builder(ctx, bi_before_instr(ins));