mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 04:50:11 +01:00
nir/algebraic: Simplify logic to detect sign of an integer
This occurs in a handful of places in the soft-fp64 code, and that is the primary reason for the change. v2: Fix a typo in a comment. Noticed by Matt. Copy the correct fp64 shader-db results to the commit message. I realized that I used accidentally used the results from the next commit. Results on the 308 shaders extracted from the fp64 portion of the OpenGL CTS: Tiger Lake and Ice Lake had similar results. (Tiger Lake shown) total instructions in shared programs: 906235 -> 906149 (<.01%) instructions in affected programs: 353966 -> 353880 (-0.02%) helped: 31 HURT: 2 helped stats (abs) min: 1 max: 8 x̄: 3.03 x̃: 3 helped stats (rel) min: 0.01% max: 1.59% x̄: 0.10% x̃: 0.04% HURT stats (abs) min: 3 max: 5 x̄: 4.00 x̃: 4 HURT stats (rel) min: 0.02% max: 0.02% x̄: 0.02% x̃: 0.02% 95% mean confidence interval for instructions value: -3.51 -1.70 95% mean confidence interval for instructions %-change: -0.19% <.01% Inconclusive result (%-change mean confidence interval includes 0). total cycles in shared programs: 7076552 -> 7076173 (<.01%) cycles in affected programs: 2878361 -> 2877982 (-0.01%) helped: 37 HURT: 2 helped stats (abs) min: 2 max: 48 x̄: 10.81 x̃: 6 helped stats (rel) min: <.01% max: 2.17% x̄: 0.47% x̃: 0.01% HURT stats (abs) min: 1 max: 20 x̄: 10.50 x̃: 10 HURT stats (rel) min: <.01% max: 0.01% x̄: <.01% x̃: <.01% 95% mean confidence interval for cycles value: -13.96 -5.48 95% mean confidence interval for cycles %-change: -0.72% -0.16% Cycles are helped. total fills in shared programs: 2064 -> 2065 (0.05%) fills in affected programs: 45 -> 46 (2.22%) helped: 0 HURT: 1 Regular shader-db results: All Gen7+ platforms had similar results. (Tiger Lake shown) total instructions in shared programs: 17611530 -> 17611506 (<.01%) instructions in affected programs: 5934 -> 5910 (-0.40%) helped: 10 HURT: 0 helped stats (abs) min: 1 max: 5 x̄: 2.40 x̃: 2 helped stats (rel) min: 0.14% max: 1.24% x̄: 0.47% x̃: 0.34% 95% mean confidence interval for instructions value: -3.53 -1.27 95% mean confidence interval for instructions %-change: -0.78% -0.17% Instructions are helped. total cycles in shared programs: 338419178 -> 338419218 (<.01%) cycles in affected programs: 19244 -> 19284 (0.21%) helped: 4 HURT: 2 helped stats (abs) min: 2 max: 4 x̄: 3.00 x̃: 3 helped stats (rel) min: 0.05% max: 0.11% x̄: 0.08% x̃: 0.08% HURT stats (abs) min: 26 max: 26 x̄: 26.00 x̃: 26 HURT stats (rel) min: 1.20% max: 1.20% x̄: 1.20% x̃: 1.20% 95% mean confidence interval for cycles value: -9.08 22.41 95% mean confidence interval for cycles %-change: -0.35% 1.04% Inconclusive result (value mean confidence interval includes 0). No changes on any earlier Intel platform. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4142>
This commit is contained in:
parent
e7f3a8d695
commit
88eb8f190b
1 changed files with 15 additions and 0 deletions
|
|
@ -497,6 +497,21 @@ optimizations.extend([
|
|||
(('umin', ('umin', a, b), b), ('umin', a, b)),
|
||||
(('imin', ('imin', a, b), b), ('imin', a, b)),
|
||||
(('iand@32', a, ('inot', ('ishr', a, 31))), ('imax', a, 0)),
|
||||
|
||||
# Simplify logic to detect sign of an integer.
|
||||
(('ieq', ('iand', a, 0x80000000), 0x00000000), ('ige', a, 0)),
|
||||
(('ine', ('iand', a, 0x80000000), 0x80000000), ('ige', a, 0)),
|
||||
(('ine', ('iand', a, 0x80000000), 0x00000000), ('ilt', a, 0)),
|
||||
(('ieq', ('iand', a, 0x80000000), 0x80000000), ('ilt', a, 0)),
|
||||
(('ine', ('ushr', 'a@32', 31), 0), ('ilt', a, 0)),
|
||||
(('ieq', ('ushr', 'a@32', 31), 0), ('ige', a, 0)),
|
||||
(('ieq', ('ushr', 'a@32', 31), 1), ('ilt', a, 0)),
|
||||
(('ine', ('ushr', 'a@32', 31), 1), ('ige', a, 0)),
|
||||
(('ine', ('ishr', 'a@32', 31), 0), ('ilt', a, 0)),
|
||||
(('ieq', ('ishr', 'a@32', 31), 0), ('ige', a, 0)),
|
||||
(('ieq', ('ishr', 'a@32', 31), -1), ('ilt', a, 0)),
|
||||
(('ine', ('ishr', 'a@32', 31), -1), ('ige', a, 0)),
|
||||
|
||||
(('fmin', a, ('fneg', a)), ('fneg', ('fabs', a))),
|
||||
(('imin', a, ('ineg', a)), ('ineg', ('iabs', a))),
|
||||
(('fmin', a, ('fneg', ('fabs', a))), ('fneg', ('fabs', a))),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue