On Tue, Dec 1, 2015 at 4:16 PM, Matt Turner <matts...@gmail.com> wrote: > --- > I add the true/false variables for clarity since there are some existing > optimizations using ~0 where it actually has nothing to do with true. > > I could take it or leave it. We obviously can't use them for feq and > friends. Maybe itrue/ifalse and ftrue/ffalse? > > 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 6aa8b1f..04261e7 100644 > --- a/src/glsl/nir/nir_opt_algebraic.py > +++ b/src/glsl/nir/nir_opt_algebraic.py > @@ -32,6 +32,9 @@ b = 'b' > c = 'c' > d = 'd' > > +true = ~0 > +false = 0
I think you can just use the python True and False and it works fine. With that changed, Reviewed-by: Jason Ekstrand <jason.ekstr...@intel.com> > + > # Written in the form (<search>, <replace>) where <search> is an expression > # and <replace> is either an expression or a value. An expression is > # defined as a tuple of the form (<op>, <src0>, <src1>, <src2>, <src3>) > @@ -94,6 +97,8 @@ optimizations = [ > (('inot', ('ige', a, b)), ('ilt', a, b)), > (('inot', ('ieq', a, b)), ('ine', a, b)), > (('inot', ('ine', a, b)), ('ieq', a, b)), > + (('ieq', 'a@bool', true), a), > + (('ine', 'a@bool', false), a), > (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)), > (('bcsel', ('flt', a, b), a, b), ('fmin', a, b)), > (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)), > -- > 2.4.9 > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev