Re: [Mesa-dev] [PATCH 6/7] nir/opt_algebraic: Add some boolean simplifications

2015-01-29 Thread Jason Ekstrand
On Thu, Jan 29, 2015 at 12:50 PM, Jason Ekstrand 
wrote:

> total instructions in shared programs: 8026509 -> 8026469 (-0.00%)
> instructions in affected programs: 6338 -> 6298 (-0.63%)
> helped:11
>

Ignore those numbers. they're bogus.  Here are the real ones:

total instructions in shared programs: 5998321 -> 5998287 (-0.00%)
instructions in affected programs: 4520 -> 4486 (-0.75%)
helped:8



> ---
>  src/glsl/nir/nir_opt_algebraic.py | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/glsl/nir/nir_opt_algebraic.py
> b/src/glsl/nir/nir_opt_algebraic.py
> index 1dea42a..e3b309c 100644
> --- a/src/glsl/nir/nir_opt_algebraic.py
> +++ b/src/glsl/nir/nir_opt_algebraic.py
> @@ -117,6 +117,11 @@ optimizations = [
> (('frcp', ('frcp', a)), a),
> (('frcp', ('fsqrt', a)), ('frsq', a)),
> (('frcp', ('frsq', a)), ('fsqrt', a)),
> +   # Boolean simplifications
> +   (('ine', 'a@bool', 0), 'a'),
> +   (('ieq', 'a@bool', 0), ('inot', 'a')),
> +   (('bcsel', 'a@bool', True, False), 'a'),
> +   (('bcsel', 'a@bool', False, True), ('inot', 'a')),
>
>  # This one may not be exact
> (('feq', ('fadd', a, b), 0.0), ('feq', a, ('fneg', b))),
> --
> 2.2.2
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 6/7] nir/opt_algebraic: Add some boolean simplifications

2015-01-29 Thread Jason Ekstrand
total instructions in shared programs: 8026509 -> 8026469 (-0.00%)
instructions in affected programs: 6338 -> 6298 (-0.63%)
helped:11
---
 src/glsl/nir/nir_opt_algebraic.py | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/glsl/nir/nir_opt_algebraic.py 
b/src/glsl/nir/nir_opt_algebraic.py
index 1dea42a..e3b309c 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -117,6 +117,11 @@ optimizations = [
(('frcp', ('frcp', a)), a),
(('frcp', ('fsqrt', a)), ('frsq', a)),
(('frcp', ('frsq', a)), ('fsqrt', a)),
+   # Boolean simplifications
+   (('ine', 'a@bool', 0), 'a'),
+   (('ieq', 'a@bool', 0), ('inot', 'a')),
+   (('bcsel', 'a@bool', True, False), 'a'),
+   (('bcsel', 'a@bool', False, True), ('inot', 'a')),
 
 # This one may not be exact
(('feq', ('fadd', a, b), 0.0), ('feq', a, ('fneg', b))),
-- 
2.2.2

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev