[Mesa-dev] [PATCH] nir: Merge redudant integer clamping.

Jason Ekstrand jason at jlekstrand.net
Sat Apr 9 19:20:47 UTC 2016


On Apr 9, 2016 11:05 AM, "Kenneth Graunke" <kenneth at whitecape.org> wrote:
>
> On Saturday, April 9, 2016 3:31:16 AM PDT Markus Wick wrote:
> > Dolphin uses them a lot. Range tracking would be better in the long
term,
> > but this two lines works fine for now.
>
> these four lines
>
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
>
> Thanks for fixing this!  I can push the patch for you in a day or two
> assuming nobody else has feedback.

LGTM.  Of course, shader-db numbers would be nice.

> > Signed-off-by: Markus Wick <markus at selfnet.de>
> > ---
> >  src/compiler/nir/nir_opt_algebraic.py | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/
> nir_opt_algebraic.py
> > index e72b4a7..31d7655 100644
> > --- a/src/compiler/nir/nir_opt_algebraic.py
> > +++ b/src/compiler/nir/nir_opt_algebraic.py
> > @@ -137,7 +137,10 @@ optimizations = [
> >     (('~fmax', ('fmin', a, 1.0), 0.0), ('fsat', a),
'!options->lower_fsat'),
> >     (('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0),
'options->lower_fsat'),
> >     (('fsat', ('fsat', a)), ('fsat', a)),
> > -   (('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0),
('fmin',
> ('fmax', a, 0.0), 1.0)),
> > +   (('fmin', ('fmax', ('fmin', ('fmax', a, b), c), b), c), ('fmin',
> ('fmax', a, b), c)),
> > +   (('imin', ('imax', ('imin', ('imax', a, b), c), b), c), ('imin',
> ('imax', a, b), c)),
> > +   (('umin', ('umax', ('umin', ('umax', a, b), c), b), c), ('umin',
> ('umax', a, b), c)),
> > +   (('extract_u8', ('imin', ('imax', a, 0), 0xff), 0), ('imin',
('imax', a,
> 0), 0xff)),
> >     (('~ior', ('flt', a, b), ('flt', a, c)), ('flt', a, ('fmax', b,
c))),
> >     (('~ior', ('flt', a, c), ('flt', b, c)), ('flt', ('fmin', a, b),
c)),
> >     (('~ior', ('fge', a, b), ('fge', a, c)), ('fge', a, ('fmin', b,
c))),
> >
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160409/a322a154/attachment.html>


More information about the mesa-dev mailing list