[Mesa-dev] [PATCH 03/11] nir/algebraic: Simplify fsat of fsign

Thomas Helland thomashelland90 at gmail.com
Mon Oct 8 19:39:46 UTC 2018


Den tir. 11. sep. 2018 kl. 01:30 skrev Ian Romanick <idr at freedesktop.org>:
>
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> These allows us to not support fsign.sat in the Intel compiler backend,
> and that will simplify some later changes.
>
> No shader-db changes on any Intel platform.
>

I was a bit skeptical to how this would impact other platforms
than intel, but I've settled on it being a wash.

Reviewed-by: Thomas Helland<thomashelland90 at gmail.com>

> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/compiler/nir/nir_opt_algebraic.py | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
> index 3267e93a583..422a8794d38 100644
> --- a/src/compiler/nir/nir_opt_algebraic.py
> +++ b/src/compiler/nir/nir_opt_algebraic.py
> @@ -329,6 +329,7 @@ optimizations = [
>     (('imax', a, ('ineg', a)), ('iabs', a)),
>     (('~fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'),
>     (('~fmax', ('fmin', a, 1.0), 0.0), ('fsat', a), '!options->lower_fsat'),
> +   (('fsat', ('fsign', a)), ('b2f', ('flt', 0.0, a))),
>     (('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),
>     (('fsat', ('fsat', a)), ('fsat', a)),
>     (('fmin', ('fmax', ('fmin', ('fmax', a, b), c), b), c), ('fmin', ('fmax', a, b), c)),
> --
> 2.14.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list