nir/optimize cmp(a, -0.0)
+0.0 can use an inline constant for AMD hardware, -0.0 needs a literal. Foz-DB Navi21: Totals from 1014 (1.28% of 79395) affected shaders: Instrs: 3037490 -> 3036849 (-0.02%); split: -0.02%, +0.00% CodeSize: 17060228 -> 17051276 (-0.05%); split: -0.05%, +0.00% Latency: 45916788 -> 45916600 (-0.00%); split: -0.00%, +0.00% InvThroughput: 12982201 -> 12982187 (-0.00%); split: -0.00%, +0.00% VClause: 79475 -> 79478 (+0.00%) SClause: 119935 -> 119934 (-0.00%); split: -0.00%, +0.00% Copies: 301641 -> 300964 (-0.22%); split: -0.23%, +0.00% PreSGPRs: 59155 -> 59144 (-0.02%) VALU: 2032016 -> 2032034 (+0.00%) SALU: 386424 -> 385729 (-0.18%) Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29467>
This commit is contained in:
@@ -608,6 +608,12 @@ optimizations.extend([
|
||||
(('fge', -1.0, ('fneg', a)), ('fge', a, 1.0)),
|
||||
(('fneu', ('fneg', a), -1.0), ('fneu', 1.0, a)),
|
||||
(('feq', -1.0, ('fneg', a)), ('feq', a, 1.0)),
|
||||
(('flt', a, '#b(is_negative_zero)'), ('flt', a, 0.0)),
|
||||
(('flt', '#b(is_negative_zero)', a), ('flt', 0.0, a)),
|
||||
(('fge', a, '#b(is_negative_zero)'), ('fge', a, 0.0)),
|
||||
(('fge', '#b(is_negative_zero)', a), ('fge', 0.0, a)),
|
||||
(('fneu', a, '#b(is_negative_zero)'), ('fneu', 0.0, a)),
|
||||
(('feq', '#b(is_negative_zero)', a), ('feq', a, 0.0)),
|
||||
|
||||
(('ieq', ('ineg', a), 0), ('ieq', a, 0)),
|
||||
(('ine', ('ineg', a), 0), ('ine', a, 0)),
|
||||
|
||||
Reference in New Issue
Block a user