summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2019-10-01 09:42:07 -0700
committerIan Romanick <ian.d.romanick@intel.com>2019-10-08 10:36:02 -0700
commit5e82532f2b823b6ca7d4f7fb876becac8474ffd7 (patch)
tree0b0fe00905a18b55b6f3d000dd8651f6b3f8fb0f
parent0dc0ce3594d153ac02dcfd0a0b0ea0a41e50833f (diff)
WIP: nir/algebraic: fsat(fsat(a)*fsat(b)) -> fsat(a)*fsat(b)experiment/fsat-algebraic
Helped 2 shaders in Unreal tech demos.
-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 b17a86bfda8..b9e40c2a297 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -122,6 +122,7 @@ optimizations = [
(('~fadd', ('fneg', a), ('fadd', a, b)), b),
(('~fadd', a, ('fadd', ('fneg', a), b)), b),
(('fadd', ('fsat', a), ('fsat', ('fneg', a))), ('fsat', ('fabs', a))),
+ (('fsat', ('fmul', ('fsat', a), ('fsat', b))), ('fmul', ('fsat', a), ('fsat', b))),
(('~fmul', a, 0.0), 0.0),
(('imul', a, 0), 0),
(('umul_unorm_4x8', a, 0), 0),