Revert "nir: Replace an odd comparison involving fmin of -b2f"
I originally noticed that3b30814791
("nir/algebraic: Optimize 1-bit Booleans") caused this pattern no longer be matched by incorrectly replacing b@32 with b@1. Making that correct had no effect on shader-db. When this pattern originally was added, it only affected 4 shaders, so it's not worth the effort to debug further. This reverts commitf50400cc80
. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6358>
This commit is contained in:
@@ -431,19 +431,6 @@ optimizations.extend([
|
||||
(('ieq', ('iadd', a, b), a), ('ieq', b, 0)),
|
||||
(('ine', ('iadd', a, b), a), ('ine', b, 0)),
|
||||
|
||||
# fmin(-b2f(a), b) >= 0.0
|
||||
# -b2f(a) >= 0.0 && b >= 0.0
|
||||
# -b2f(a) == 0.0 && b >= 0.0 -b2f can only be 0 or -1, never >0
|
||||
# b2f(a) == 0.0 && b >= 0.0
|
||||
# a == False && b >= 0.0
|
||||
# !a && b >= 0.0
|
||||
#
|
||||
# The fge in the second replacement is not a typo. I leave the proof that
|
||||
# "fmin(-b2f(a), b) >= 0 <=> fmin(-b2f(a), b) == 0" as an exercise for the
|
||||
# reader.
|
||||
(('fge', ('fmin', ('fneg', ('b2f', 'a@1')), 'b@1'), 0.0), ('iand', ('inot', a), ('fge', b, 0.0))),
|
||||
(('feq', ('fmin', ('fneg', ('b2f', 'a@1')), 'b@1'), 0.0), ('iand', ('inot', a), ('fge', b, 0.0))),
|
||||
|
||||
(('feq', ('b2f', 'a@1'), 0.0), ('inot', a)),
|
||||
(('~fneu', ('b2f', 'a@1'), 0.0), a),
|
||||
(('ieq', ('b2i', 'a@1'), 0), ('inot', a)),
|
||||
|
Reference in New Issue
Block a user