nir: Recognize sat(add(b2f(a), b2f(b))) as a logical OR.
Transform this into b2f(or(a, b)). instructions in affected programs: 432 -> 430 (-0.46%) helped: 2 Acked-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
@@ -97,6 +97,7 @@ optimizations = [
|
||||
(('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0), ('fmin', ('fmax', a, 0.0), 1.0)),
|
||||
# Emulating booleans
|
||||
(('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
|
||||
(('fsat', ('fadd', ('b2f', a), ('b2f', b))), ('b2f', ('ior', a, b))),
|
||||
# Comparison with the same args. Note that these are not done for
|
||||
# the float versions because NaN always returns false on float
|
||||
# inequalities.
|
||||
|
||||
Reference in New Issue
Block a user