From: Kenneth Graunke <[email protected]>
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 <[email protected]>
Reviewed-by: Ian Romanick <[email protected]> [v1]
Reviewed-by: Timothy Arceri <[email protected]>
---
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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev