summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2018-09-09 13:40:02 -0700
committerIan Romanick <ian.d.romanick@intel.com>2018-10-09 13:56:42 -0700
commita68dd47b911053995ae387afcdc7fffe82e57420 (patch)
treee5b1dbd65561a7a95585867b8406e27039a17bdb
parent1546204cdd45476a2cc4ff4adcc742505366398f (diff)
nir/algebraic: Simplify fsat of fsign
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. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py1
1 files changed, 1 insertions, 0 deletions
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)),