From 1d885fab9cf5b1908209ef55b2c7581ca3cf61a2 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Fri, 1 Aug 2025 21:45:25 +0200 Subject: [PATCH] nir/opt_algebraic: optimize pack_half_rtz of b2f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Foz-DB Navi21: Totals from 13 (0.02% of 80255) affected shaders: Instrs: 2313 -> 2306 (-0.30%); split: -0.35%, +0.04% CodeSize: 13452 -> 13480 (+0.21%) Latency: 12066 -> 12013 (-0.44%); split: -0.45%, +0.01% InvThroughput: 2172 -> 2163 (-0.41%) Copies: 112 -> 114 (+1.79%) VALU: 1480 -> 1472 (-0.54%) SALU: 154 -> 155 (+0.65%) Reviewed-by: Marek Olšák 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 84fc1232b24..1bed02decd2 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -3033,6 +3033,8 @@ optimizations += [ ('bcsel', a, ('pack_half_2x16_rtz_split', b, d), ('pack_half_2x16_rtz_split', c, e))), (('pack_half_2x16_rtz_split', ('bcsel(is_used_once)', a, '#b', c), ('bcsel(is_used_once)', a, '#d', e)), ('bcsel', a, ('pack_half_2x16_rtz_split', b, d), ('pack_half_2x16_rtz_split', c, e))), + + (('pack_half_2x16_rtz_split', ('b2f', 'a@1'), ('b2f', a)), ('bcsel', a, 0x3c003c00, 0)), ] # Some operations such as iadd have the property that the bottom N bits of the