mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 11:50:36 +02:00
nir/algebraic: optimize bcsel(ieq(b, 0), a, shift(a, b))
nir_lower_mem_access_bit_sizes can create this. No fossil-db changes. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31904>
This commit is contained in:
parent
80b76ba692
commit
e95a3364b8
1 changed files with 6 additions and 0 deletions
|
|
@ -1508,6 +1508,12 @@ optimizations.extend([
|
|||
(('ishr', a, 0), a),
|
||||
(('ushr', 0, a), 0),
|
||||
(('ushr', a, 0), a),
|
||||
(('bcsel', ('ieq', b, 0), a, ('ushr', a, b)), ('ushr', a, b)),
|
||||
(('bcsel', ('ieq', b, 0), a, ('ishr', a, b)), ('ishr', a, b)),
|
||||
(('bcsel', ('ieq', b, 0), a, ('ishl', a, b)), ('ishl', a, b)),
|
||||
(('bcsel', ('ine', b, 0), ('ushr', a, b), a), ('ushr', a, b)),
|
||||
(('bcsel', ('ine', b, 0), ('ishr', a, b), a), ('ishr', a, b)),
|
||||
(('bcsel', ('ine', b, 0), ('ishl', a, b), a), ('ishl', a, b)),
|
||||
(('ior', ('ishl@16', a, b), ('ushr@16', a, ('iadd', 16, ('ineg', b)))), ('urol', a, b), 'options->has_rotate16'),
|
||||
(('ior', ('ishl@16', a, b), ('ushr@16', a, ('isub', 16, b))), ('urol', a, b), 'options->has_rotate16'),
|
||||
(('ior', ('ishl@32', a, b), ('ushr@32', a, ('iadd', 32, ('ineg', b)))), ('urol', a, b), 'options->has_rotate32'),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue