Funny thing about this... this is how i915 implements ABS. :) Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
On 07/23/2018 12:02 AM, Jason Ekstrand wrote: > Spotted in a shader in Batman: Arkham City. > --- > src/compiler/nir/nir_opt_algebraic.py | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/compiler/nir/nir_opt_algebraic.py > b/src/compiler/nir/nir_opt_algebraic.py > index f49b43f3213..ba277fdfd0e 100644 > --- a/src/compiler/nir/nir_opt_algebraic.py > +++ b/src/compiler/nir/nir_opt_algebraic.py > @@ -229,6 +229,8 @@ optimizations = [ > (('imax', a, a), a), > (('umin', a, a), a), > (('umax', a, a), a), > + (('fmax', a, ('fneg', a)), ('fabs', a)), > + (('imax', a, ('ineg', a)), ('iabs', a)), > (('fmin', a, ('fneg', a)), ('fneg', ('fabs', a))), > (('imin', a, ('ineg', a)), ('ineg', ('iabs', a))), > (('fmin', a, ('fneg', ('fabs', a))), ('fneg', ('fabs', a))), > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev