<p dir="ltr"></p>
<p dir="ltr">On Aug 10, 2016 1:00 AM, "Erik Faye-Lund" <<a href="mailto:kusmabite@gmail.com">kusmabite@gmail.com</a>> wrote:<br>
><br>
> On Wed, Aug 10, 2016 at 4:30 AM, Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br>
> > On Haswell (GL 3.3):<br>
> ><br>
> > total instructions in shared programs: 6211678 -> 6211584 (-0.00%)<br>
> > instructions in affected programs: 18968 -> 18874 (-0.50%)<br>
> > helped: 62<br>
> > HURT: 0<br>
> > LOST:   0<br>
> > GAINED: 4<br>
> ><br>
> > On Broadwell (GL 4.4):<br>
> ><br>
> > total instructions in shared programs: 11638930 -> 11638181 (-0.01%)<br>
> > instructions in affected programs: 84768 -> 84019 (-0.88%)<br>
> > helped: 505<br>
> > HURT: 45<br>
> ><br>
> > Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
> > ---<br>
> >  src/compiler/nir/nir_opt_algebraic.py | 1 +<br>
> >  1 file changed, 1 insertion(+)<br>
> ><br>
> > diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py<br>
> > index 0f0896b..1cf614c 100644<br>
> > --- a/src/compiler/nir/nir_opt_algebraic.py<br>
> > +++ b/src/compiler/nir/nir_opt_algebraic.py<br>
> > @@ -180,6 +180,7 @@ optimizations = [<br>
> >     (('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),<br>
> >     (('fsat', ('fadd', ('b2f', a), ('b2f', b))), ('b2f', ('ior', a, b))),<br>
> >     (('iand', 'a@bool', 1.0), ('b2f', a)),<br>
> > +   (('ineg', ('b2i', 'a@bool')), a),<br>
> >     (('flt', ('fneg', ('b2f', a)), 0), a), # Generated by TGSI KILL_IF.<br>
> >     (('flt', ('fsub', 0.0, ('b2f', a)), 0), a), # Generated by TGSI KILL_IF.<br>
> >     # Comparison with the same args.  Note that these are not done for<br>
><br>
> Are you sure this shouldn't be conditional? This being an improvement<br>
> sounds like an intel-ism, and not something that applies to most<br>
> hardware...</p>
<p dir="ltr">Why? You're replacing two instructions with zero. That should help everyone.<br></p>