pan/midgard: Enable lower_(un)pack_* lowering
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 24 Dec 2019 19:01:33 +0000 (14:01 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 25 Dec 2019 00:21:52 +0000 (19:21 -0500)
These show up in some blend shaders. Let's use the shared lowering and
remove our own.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_compile.h
src/panfrost/midgard/midgard_nir_algebraic.py

index 51966b46471091031022894918b396e24bff8445..97dac0e812505587faf0acab66d256fe17c87502 100644 (file)
@@ -123,6 +123,19 @@ static const nir_shader_compiler_options midgard_nir_options = {
         .lower_extract_word = true,
         .lower_rotate = true,
 
+        .lower_pack_half_2x16 = true,
+        .lower_pack_half_2x16_split = true,
+        .lower_pack_unorm_2x16 = true,
+        .lower_pack_snorm_2x16 = true,
+        .lower_pack_unorm_4x8 = true,
+        .lower_pack_snorm_4x8 = true,
+        .lower_unpack_half_2x16 = true,
+        .lower_unpack_half_2x16_split = true,
+        .lower_unpack_unorm_2x16 = true,
+        .lower_unpack_snorm_2x16 = true,
+        .lower_unpack_unorm_4x8 = true,
+        .lower_unpack_snorm_4x8 = true,
+
         .lower_doubles_options = nir_lower_dmod,
 
         .vectorize_io = true,
index faf83364c3ada4d536f7305fb9291e5f670a58d3..951b4b2324101767638cd15f355d1708fb11c4c0 100644 (file)
@@ -60,8 +60,6 @@ converts = [
 
     # Totally redundant
     (('~f2f16', ('f2f32', 'a@16')), a),
-
-    (('pack_half_2x16_split', 'a@32', 'b@32'), ('ior', ('ishl', ('i2i32', ('f2f16', b)), 16), ('i2i32', ('f2f16', a)))),
 ]
 
 # Midgard scales fsin/fcos arguments by pi.