Uh... This hurts overall... The optimization makes sense but do we have some justification for the hurt?
On Jan 7, 2017 3:59 AM, "Timothy Arceri" <timothy.arc...@collabora.com> wrote: From: Kenneth Graunke <kenn...@whitecape.org> On BDW: total instructions in shared programs: 13078708 -> 13078787 (0.00%) instructions in affected programs: 15926 -> 16005 (0.50%) helped: 19 HURT: 43 total cycles in shared programs: 256561142 -> 256562762 (0.00%) cycles in affected programs: 126122 -> 127742 (1.28%) helped: 21 HURT: 37 v2: Rely on b2f's operands being a well-formed boolean (Connor, Eric). Fix typo in commit title (Patrick). Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Ian Romanick <ian.d.roman...@intel.com> [v1] Reviewed-by: Timothy Arceri <timothy.arc...@collabora.com> --- src/compiler/nir/nir_opt_algebraic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index 434881f..fa9f3f1 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -150,6 +150,9 @@ optimizations = [ # inot(a) (('fge', 0.0, ('b2f', a)), ('inot', a)), + # -(b2f(a) + b2f(b)) >= 0 becomes !(a || b) + (('fge', ('fneg', ('fadd', ('b2f', a), ('b2f', b))), 0.0), ('inot', ('ior', a, b))), + # 0.0 < fabs(a) # fabs(a) > 0.0 # fabs(a) != 0.0 because fabs(a) must be >= 0 -- 2.9.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev