From ef970c5a9d6226faa51ad3bcdf85abebfb100d4c Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Mon, 26 Aug 2024 17:43:33 +0200 Subject: [PATCH] nir: optimize pack_uint_2x16 of pack_half(a, 0) Foz-DB Navi31: Totals from 31 (0.04% of 79395) affected shaders: Instrs: 6157 -> 6065 (-1.49%) CodeSize: 35676 -> 34936 (-2.07%) Latency: 23979 -> 23805 (-0.73%); split: -0.79%, +0.07% InvThroughput: 5248 -> 5124 (-2.36%) VALU: 3224 -> 3162 (-1.92%) Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 3627f1af386..ee33786c732 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -1888,6 +1888,8 @@ optimizations.extend([ (('iadd', ('pack_half_2x16_rtz_split', a, 0), ('pack_half_2x16_rtz_split', 0, b)), ('pack_half_2x16_rtz_split', a, b)), (('ior', ('pack_half_2x16_rtz_split', a, 0), ('pack_half_2x16_rtz_split', 0, b)), ('pack_half_2x16_rtz_split', a, b)), + (('pack_uint_2x16', ('vec2', ('pack_half_2x16_rtz_split', a, 0), ('pack_half_2x16_rtz_split', b, 0))), ('pack_half_2x16_rtz_split', a, b)), + (('bfi', 0xffff0000, ('pack_half_2x16_split', a, b), ('pack_half_2x16_split', c, d)), ('pack_half_2x16_split', c, a)),