Mesa (master): nir: Recognize trivial min/max.
Matt Turner
mattst88 at kemper.freedesktop.org
Thu May 7 18:03:16 UTC 2015
Module: Mesa
Branch: master
Commit: ceb8b739ce37ee041b903643656d9d16c371ff95
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ceb8b739ce37ee041b903643656d9d16c371ff95
Author: Matt Turner <mattst88 at gmail.com>
Date: Tue May 5 20:20:30 2015 -0700
nir: Recognize trivial min/max.
No changes, but does prevent some regressions in the next commit.
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Glenn Kennard <glenn.kennard at gmail.com>
---
src/glsl/nir/nir_opt_algebraic.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index fda4bd5..42f4f47 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -90,6 +90,12 @@ optimizations = [
(('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),
(('bcsel', ('inot', 'a at bool'), b, c), ('bcsel', a, c, b)),
(('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)),
+ (('fmin', a, a), a),
+ (('fmax', a, a), a),
+ (('imin', a, a), a),
+ (('imax', a, a), a),
+ (('umin', a, a), a),
+ (('umax', a, a), a),
(('fmin', ('fmax', a, 0.0), 1.0), ('fsat', a), '!options->lower_fsat'),
(('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),
(('fsat', ('fsat', a)), ('fsat', a)),
More information about the mesa-commit
mailing list