summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_opt_algebraic.py
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-01-30 13:49:48 -0800
committerEric Anholt <[email protected]>2015-02-18 14:47:51 -0800
commite5ecf8e4272522e1950d1d4318df19377bf49ae1 (patch)
tree9dd7c90b2549a3c9870c7b4809329d5579b1e845 /src/glsl/nir/nir_opt_algebraic.py
parent42a8ace66e539957b31ea96fe9a2aaacdb90f30e (diff)
nir: Add a flag for lowering ffma.
vc4 cse/algebraic-disabled stats: total uniforms in shared programs: 13966 -> 13791 (-1.25%) uniforms in affected programs: 435 -> 260 (-40.23%) total instructions in shared programs: 44732 -> 44356 (-0.84%) instructions in affected programs: 9599 -> 9223 (-3.92%) v2: Rebase to master (no TGSI->NIR present) Reviewed-by: Kenneth Graunke <[email protected]> (v1)
Diffstat (limited to 'src/glsl/nir/nir_opt_algebraic.py')
-rw-r--r--src/glsl/nir/nir_opt_algebraic.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index 8d5c03b0be7..83a02b6dad6 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -71,7 +71,8 @@ optimizations = [
(('flrp', a, b, 1.0), b),
(('flrp', a, a, b), a),
(('flrp', 0.0, a, b), ('fmul', a, b)),
- (('fadd', ('fmul', a, b), c), ('ffma', a, b, c)),
+ (('ffma', a, b, c), ('fadd', ('fmul', a, b), c), 'options->lower_ffma'),
+ (('fadd', ('fmul', a, b), c), ('ffma', a, b, c), '!options->lower_ffma'),
# Comparison simplifications
(('inot', ('flt', a, b)), ('fge', a, b)),
(('inot', ('fge', a, b)), ('flt', a, b)),