<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Jan 7, 2017 12:07 PM, "Timothy Arceri" <<a href="mailto:timothy.arceri@collabora.com">timothy.arceri@collabora.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">On Sat, 2017-01-07 at 11:14 -0800, Matt Turner wrote:<br>
> On Sat, Jan 7, 2017 at 3:58 AM, Timothy Arceri<br>
> <<a href="mailto:timothy.arceri@collabora.com">timothy.arceri@collabora.com</a>> wrote:<br>
> > On BDW:<br>
> ><br>
> > total instructions in shared programs: 13061890 -> 13061877 (-<br>
> > 0.00%)<br>
> > instructions in affected programs: 2441 -> 2428 (-0.53%)<br>
> > helped: 13<br>
> > HURT: 0<br>
> ><br>
> > total cycles in shared programs: 256612254 -> 256611784 (-0.00%)<br>
> > cycles in affected programs: 16418 -> 15948 (-2.86%)<br>
> > helped: 10<br>
> > HURT: 2<br>
> > ---<br>
> > src/compiler/nir/nir_opt_<wbr>algebraic.py | 1 +<br>
> > 1 file changed, 1 insertion(+)<br>
> ><br>
> > diff --git a/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
> > b/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
> > index fa9f3f1..7cee378 100644<br>
> > --- a/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
> > +++ b/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
> > @@ -111,6 +111,7 @@ optimizations = [<br>
> > (('~flrp', a, b, 1.0), b),<br>
> > (('~flrp', a, a, b), a),<br>
> > (('~flrp', 0.0, a, b), ('fmul', a, b)),<br>
> > + (('~flrp', a, 0.0, c), ('ffma', ('fneg', a), c, a), '!options-<br>
> > >lower_ffma'),<br>
><br>
> I don't think we want to be generating ffma directly in<br>
> nir_opt_algebraic?<br>
<br>
</div>We already have:<br>
<br>
(('~fadd', ('fmul', a, b), c), ('ffma', a, b, c), 'options-<br>
>fuse_ffma'),<br>
<br>
Is you concern backends that don't want ffma? The !options->lower_ffma<br>
should avoid problems there. Or I could switch to using options->fuse_ffma (I assume i965 is using it).</blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">In i965 we've generally taken the approach that you should do mul+add and let the ffma peephole sort it out.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">
> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></blockquote></div><br></div></div></div>