[Mesa-dev] [PATCH 3/3] nir: Add algebraic optimizations for comparisons with identical operands.
Jason Ekstrand
jason at jlekstrand.net
Fri Feb 6 21:38:25 PST 2015
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
On Feb 6, 2015 9:16 PM, "Eric Anholt" <eric at anholt.net> wrote:
> No change on shader-db on i965.
> ---
> src/glsl/nir/nir_opt_algebraic.py | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/src/glsl/nir/nir_opt_algebraic.py
> b/src/glsl/nir/nir_opt_algebraic.py
> index a5fe19a..0512a8f 100644
> --- a/src/glsl/nir/nir_opt_algebraic.py
> +++ b/src/glsl/nir/nir_opt_algebraic.py
> @@ -83,6 +83,15 @@ optimizations = [
> (('fne', ('fadd', a, b), 0.0), ('fne', a, ('fneg', b))),
> (('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
> (('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a)),
> + # Comparison with the same args. Note that these are not done for
> + # the float versions because float equality is used to test for
> + # NaN.
> + (('ilt', a, a), False),
> + (('ige', a, a), True),
> + (('ieq', a, a), True),
> + (('ine', a, a), False),
> + (('ult', a, a), False),
> + (('uge', a, a), True),
> # Logical and bit operations
> (('fand', a, 0.0), 0.0),
> (('iand', a, a), a),
> --
> 2.1.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150207/42c1cc67/attachment-0001.html>
More information about the mesa-dev
mailing list