pan/mdg: Eliminate 64-bit swizzle packing division
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 21 May 2020 22:05:29 +0000 (18:05 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 21 May 2020 22:29:53 +0000 (18:29 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5154>

src/panfrost/midgard/midgard_emit.c

index 6431dc02c0e0f6eefd66c2323b25bc04c37a08a9..cf283dd3ed5b1650f1f8f756ec0be125ca0b3cf1 100644 (file)
@@ -200,7 +200,8 @@ mir_pack_swizzle(unsigned mask, unsigned *swizzle,
         unsigned sz = nir_alu_type_get_type_size(T);
 
         if (reg_mode == midgard_reg_mode_64) {
-                unsigned components = 64 / sz;
+                assert(sz == 64 || sz == 32);
+                unsigned components = (sz == 32) ? 4 : 2;
 
                 packed = mir_pack_swizzle_64(swizzle, components);