mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 21:30:09 +01:00
nir/algebraic: optimize fabs(bcsel(b, fneg(a), a))
fossil-db (Sienna Cichlid): Totals from 207 (0.15% of 134913) affected shaders: VGPRs: 7152 -> 6928 (-3.13%) CodeSize: 762404 -> 752888 (-1.25%) MaxWaves: 6138 -> 6146 (+0.13%) Instrs: 144031 -> 142184 (-1.28%) Latency: 817783 -> 807286 (-1.28%) InvThroughput: 151031 -> 147497 (-2.34%) VClause: 1490 -> 1453 (-2.48%) SClause: 3357 -> 3331 (-0.77%); split: -0.92%, +0.15% Copies: 9632 -> 9555 (-0.80%); split: -0.81%, +0.01% Branches: 4306 -> 4270 (-0.84%) PreSGPRs: 11232 -> 11218 (-0.12%); split: -0.15%, +0.03% PreVGPRs: 6307 -> 6121 (-2.95%) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14772>
This commit is contained in:
parent
33e60798e1
commit
b301c33f65
1 changed files with 2 additions and 0 deletions
|
|
@ -1676,6 +1676,8 @@ optimizations.extend([
|
|||
(('~fmul', ('bcsel(is_used_once)', c, 1.0, -1.0), b), ('bcsel', c, b, ('fneg', b))),
|
||||
(('~fmulz', ('bcsel(is_used_once)', c, -1.0, 1.0), b), ('bcsel', c, ('fneg', b), b)),
|
||||
(('~fmulz', ('bcsel(is_used_once)', c, 1.0, -1.0), b), ('bcsel', c, b, ('fneg', b))),
|
||||
(('fabs', ('bcsel(is_used_once)', b, ('fneg', a), a)), ('fabs', a)),
|
||||
(('fabs', ('bcsel(is_used_once)', b, a, ('fneg', a))), ('fabs', a)),
|
||||
(('~bcsel', ('flt', a, 0.0), ('fneg', a), a), ('fabs', a)),
|
||||
|
||||
(('bcsel', a, ('bcsel', b, c, d), d), ('bcsel', ('iand', a, b), c, d)),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue