mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-17 10:40:30 +01:00
nir: Optimize find_lsb/imsb/umsb error checks
Two of the ARB_shader_ballot piglit tests hit the find_lsb case, removing some of the noise allowed me to better debug the test when it was failing. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
069bf7c907
commit
aff108f2fd
1 changed files with 11 additions and 0 deletions
|
|
@ -357,6 +357,17 @@ optimizations = [
|
|||
(('~fadd', '#a', ('fadd', b, '#c')), ('fadd', ('fadd', a, c), b)),
|
||||
(('iadd', '#a', ('iadd', b, '#c')), ('iadd', ('iadd', a, c), b)),
|
||||
|
||||
# By definition...
|
||||
(('bcsel', ('ige', ('find_lsb', a), 0), ('find_lsb', a), -1), ('find_lsb', a)),
|
||||
(('bcsel', ('ige', ('ifind_msb', a), 0), ('ifind_msb', a), -1), ('ifind_msb', a)),
|
||||
(('bcsel', ('ige', ('ufind_msb', a), 0), ('ufind_msb', a), -1), ('ufind_msb', a)),
|
||||
|
||||
(('bcsel', ('ine', a, 0), ('find_lsb', a), -1), ('find_lsb', a)),
|
||||
(('bcsel', ('ine', a, 0), ('ifind_msb', a), -1), ('ifind_msb', a)),
|
||||
(('bcsel', ('ine', a, 0), ('ufind_msb', a), -1), ('ufind_msb', a)),
|
||||
|
||||
(('bcsel', ('ine', a, -1), ('ifind_msb', a), -1), ('ifind_msb', a)),
|
||||
|
||||
# Misc. lowering
|
||||
(('fmod@32', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod32'),
|
||||
(('fmod@64', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod64'),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue