<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 5, 2018 at 2:25 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/05/2018 02:07 PM, Jason Ekstrand wrote:<br>
> On Mon, Mar 5, 2018 at 11:11 AM, Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a><br>
</span><span class="">> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>> wrote:<br>
><br>
> On 02/28/2018 12:48 PM, Jason Ekstrand wrote:<br>
> > Rb<br>
><br>
> For both or just this one?<br>
><br>
><br>
> If you put the ~ on there, both.<br>
<br>
</span>I'm not sure what you mean. That's all the other patch ([PATCH 11.1/22]<br>
nir: Mark bcsel-to-fmin (or fmax) transformations as inexact) does.<span class=""><br></span></blockquote><div><br></div><div>Sorry, I got confused. Yes, RB to both.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> > On Wed, Feb 28, 2018 at 12:18 PM, Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>><br>
</span><span class="">> > <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>>> wrote:<br>
> ><br>
> > From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a> <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.<wbr>com</a>><br>
</span>> > <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.<wbr>com</a><br>
<div><div class="h5">> <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.<wbr>com</a>>>><br>
> ><br>
> > This transformation is inexact because section 4.7.1 (Range and<br>
> > Precision) says:<br>
> ><br>
> > Operations and built-in functions that operate on a NaN<br>
> are not<br>
> > required to return a NaN as the result.<br>
> ><br>
> > The fmin or fmax might not return NaN in cases where the original<br>
> > expression would be required to return NaN.<br>
> ><br>
> > v2: Reorder operands and mark as inexact. The latter suggested by<br>
> > Jason.<br>
> ><br>
> > shader-db results:<br>
> ><br>
> > Haswell, Broadwell, and Skylake had similar results. (Skylake<br>
> shown)<br>
> > total instructions in shared programs: 14514817 -> 14514808<br>
> (<.01%)<br>
> > instructions in affected programs: 229 -> 220 (-3.93%)<br>
> > helped: 3<br>
> > HURT: 0<br>
> > helped stats (abs) min: 1 max: 4 x̄: 3.00 x̃: 4<br>
> > helped stats (rel) min: 2.86% max: 4.12% x̄: 3.70% x̃: 4.12%<br>
> ><br>
> > total cycles in shared programs: 533145211 -> 533144939 (<.01%)<br>
> > cycles in affected programs: 37268 -> 36996 (-0.73%)<br>
> > helped: 8<br>
> > HURT: 0<br>
> > helped stats (abs) min: 2 max: 134 x̄: 34.00 x̃: 2<br>
> > helped stats (rel) min: 0.02% max: 14.22% x̄: 3.53% x̃: 0.05%<br>
> ><br>
> > Sandy Bridge and Ivy Bridge had similar results. (Ivy Bridge<br>
> shown)<br>
> > total cycles in shared programs: 257618409 -> 257618403 (<.01%)<br>
> > cycles in affected programs: 12582 -> 12576 (-0.05%)<br>
> > helped: 3<br>
> > HURT: 0<br>
> > helped stats (abs) min: 2 max: 2 x̄: 2.00 x̃: 2<br>
> > helped stats (rel) min: 0.05% max: 0.05% x̄: 0.05% x̃: 0.05%<br>
> ><br>
> > No changes on Iron Lake or GM45.<br>
> ><br>
> > Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
> <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.<wbr>com</a>><br>
</div></div>> > <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.<wbr>com</a><br>
<span class="">> <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.<wbr>com</a>>>><br>
> > ---<br>
> > src/compiler/nir/nir_opt_<wbr>algebraic.py | 2 ++<br>
> > 1 file changed, 2 insertions(+)<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 d40d59b..17f4d9c 100644<br>
> > --- a/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
> > +++ b/src/compiler/nir/nir_opt_<wbr>algebraic.py<br>
> > @@ -170,6 +170,8 @@ optimizations = [<br>
> > (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),<br>
> > (('bcsel', ('flt', b, a), b, a), ('fmin', a, b)),<br>
> > (('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),<br>
> > + (('~bcsel', ('fge', a, b), b, a), ('fmin', a, b)),<br>
> > + (('~bcsel', ('fge', b, a), b, a), ('fmax', a, b)),<br>
> > (('bcsel', ('inot', a), b, c), ('bcsel', a, c, b)),<br>
> > (('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)),<br>
> > (('bcsel', a, True, 'b@bool'), ('ior', a, b)),<br>
> > --<br>
> > 2.9.5<br>
> ><br>
> > _____________________________<wbr>__________________<br>
> > mesa-dev mailing list<br>
> > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.<wbr>org</a><br>
> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.<wbr>freedesktop.org</a>><br>
</span>> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.<wbr>freedesktop.org</a><br>
<span class="">> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.<wbr>freedesktop.org</a>>><br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.<wbr>org/mailman/listinfo/mesa-dev</a><br>
> <<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.<wbr>org/mailman/listinfo/mesa-dev</a>><br>
</span>> > <<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.<wbr>org/mailman/listinfo/mesa-dev</a><br>
> <<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.<wbr>org/mailman/listinfo/mesa-dev</a>><wbr>><br>
> ><br>
> ><br>
><br>
><br>
<br>
</blockquote></div><br></div></div>