From ea4aa8e5a6ed764c4d2aca8bc6dbcdb1904a8cdc Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Thu, 28 Nov 2024 16:48:32 +0100 Subject: [PATCH] nir/opt_algebraic: optimize ffma(b2f, b2f, c) Foz-DB Navi21: Totals from 134 (0.17% of 79395) affected shaders: Instrs: 153297 -> 153326 (+0.02%); split: -0.03%, +0.05% CodeSize: 829520 -> 828444 (-0.13%); split: -0.13%, +0.00% Latency: 900489 -> 899964 (-0.06%); split: -0.07%, +0.01% InvThroughput: 267838 -> 267478 (-0.13%); split: -0.14%, +0.00% VClause: 2452 -> 2454 (+0.08%) Copies: 8331 -> 8353 (+0.26%); split: -0.25%, +0.52% PreSGPRs: 4974 -> 4964 (-0.20%) PreVGPRs: 6209 -> 6218 (+0.14%) VALU: 112317 -> 112092 (-0.20%); split: -0.21%, +0.01% SALU: 12451 -> 12694 (+1.95%) Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_opt_algebraic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index db3c9b681b6..8ba3a245547 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -1419,6 +1419,7 @@ optimizations.extend([ (('iand', ('b2i', 'a@1'), ('b2i', 'b@1')), ('b2i', ('iand', a, b))), (('ior', ('b2i', 'a@1'), ('b2i', 'b@1')), ('b2i', ('ior', a, b))), (('fmul', ('b2f', 'a@1'), ('b2f', 'b@1')), ('b2f', ('iand', a, b))), + (('ffma', ('b2f', 'a@1'), ('b2f', 'b@1'), c), ('fadd', ('b2f', ('iand', a, b)), c)), (('fsat', ('fadd', ('b2f', 'a@1'), ('b2f', 'b@1'))), ('b2f', ('ior', a, b))), (('iand', 'a@bool16', 1.0), ('b2f', a)), (('iand', 'a@bool32', 1.0), ('b2f', a)),