summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index d7ad1f2fbf3..68938000098 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -171,6 +171,18 @@ optimizations = [
(('imax', a, a), a),
(('umin', a, a), a),
(('umax', a, a), a),
+ (('fmin', a, ('fneg', a)), ('fneg', ('fabs', a))),
+ (('imin', a, ('ineg', a)), ('ineg', ('iabs', a))),
+ (('fmin', a, ('fneg', ('fabs', a))), ('fneg', ('fabs', a))),
+ (('imin', a, ('ineg', ('iabs', a))), ('ineg', ('iabs', a))),
+ (('fmin', a, ('fabs', a)), a),
+ (('imin', a, ('iabs', a)), a),
+ (('fmax', a, ('fneg', ('fabs', a))), a),
+ (('imax', a, ('ineg', ('iabs', a))), a),
+ (('fmax', a, ('fabs', a)), ('fabs', a)),
+ (('imax', a, ('iabs', a)), ('iabs', a)),
+ (('fmax', a, ('fneg', a)), ('fabs', a)),
+ (('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', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),