nir/opt_algebraic: update open coded flerp(..., b2f(c)) to bcsel patterns

We remove 1.0 - b2f(a) since 6a662a59b7.

Foz-DB Navi48:
Totals from 200 (0.10% of 205032) affected shaders:

Instrs: 410309 -> 409750 (-0.14%); split: -0.18%, +0.05%
CodeSize: 2140424 -> 2136956 (-0.16%); split: -0.21%, +0.05%
Latency: 5834394 -> 5834042 (-0.01%); split: -0.02%, +0.01%
InvThroughput: 906879 -> 906374 (-0.06%); split: -0.06%, +0.01%
VClause: 8247 -> 8244 (-0.04%)
SClause: 7721 -> 7723 (+0.03%); split: -0.03%, +0.05%
Copies: 20515 -> 20487 (-0.14%); split: -0.29%, +0.16%
PreVGPRs: 14510 -> 14481 (-0.20%)
VALU: 228703 -> 228235 (-0.20%); split: -0.28%, +0.07%
SALU: 62832 -> 62914 (+0.13%); split: -0.18%, +0.31%
VOPD: 929 -> 927 (-0.22%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40730>
This commit is contained in:
Georg Lehmann 2026-03-31 16:58:55 +02:00 committed by Marge Bot
parent fc19ce6c17
commit f192fe99eb

View file

@ -466,10 +466,10 @@ for s in [16, 32, 64]:
(('~fadd@{}'.format(s), ('fmul', a, ('fsat', ('fadd', 1.0, ('fneg', c)))), ('fmul', b, ('fsat', c))), ('flrp', a, b, ('fsat', c)), '!options->lower_flrp{}'.format(s)),
(('~fadd@{}'.format(s), a, ('fmul', c, ('fadd', b, ('fneg', a)))), ('flrp', a, b, c), '!options->lower_flrp{}'.format(s)),
(('~fadd@{}'.format(s), ('fmul', a, ('fadd', 1.0, ('fneg', ('b2f', 'c@1')))), ('fmul', b, ('b2f', c))), ('bcsel', c, b, a), 'options->lower_flrp{}'.format(s)),
(('~fadd@{}'.format(s), ('fmul', a, ('b2f', ('inot', 'c@1'))), ('fmul', b, ('b2f', c))), ('bcsel', c, ('fcanonicalize', b), ('fcanonicalize', a)), 'options->lower_flrp{}'.format(s)),
(('~fadd@{}'.format(s), a, ('fmul', ('b2f', 'c@1'), ('fadd', b, ('fneg', a)))), ('bcsel', c, ('fcanonicalize', b), ('fcanonicalize', a)), 'options->lower_flrp{}'.format(s)),
(('~ffma@{}'.format(s), a, ('fadd', 1.0, ('fneg', ('b2f', 'c@1'))), ('fmul', b, ('b2f', 'c@1'))), ('bcsel', c, ('fcanonicalize', b), ('fcanonicalize', a))),
(('~ffma@{}'.format(s), a, ('b2f', ('inot', 'c@1')), ('fmul', b, ('b2f', 'c@1'))), ('bcsel', c, ('fcanonicalize', b), ('fcanonicalize', a))),
(('~ffma@{}'.format(s), b, ('b2f', 'c@1'), ('ffma', ('fneg', a), ('b2f', 'c@1'), a)), ('bcsel', c, ('fcanonicalize', b), ('fcanonicalize', a))),
# These two aren't flrp lowerings, but do appear in some shaders.