[Mesa-dev] [PATCH 2/9] nir/algebraic: Add two more fsat optimizations

Jason Ekstrand jason at jlekstrand.net
Thu Mar 17 17:21:39 UTC 2016


No shader-db changes on Broadwell, but it prevents a regression in one
rocketbirds shader that would otherwise be introduced by the next commit
---
 src/compiler/nir/nir_opt_algebraic.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 39be85f..2a3eb32 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -113,6 +113,8 @@ optimizations = [
    (('fmax', ('fmin', a, 1.0), 0.0), ('fsat', a), '!options->lower_fsat'),
    (('fsat', a), ('fmin', ('fmax', a, 0.0), 1.0), 'options->lower_fsat'),
    (('fsat', ('fsat', a)), ('fsat', a)),
+   (('fsat', ('fmin', a, 1.0)), ('fsat', a)),
+   (('fsat', ('fmax', a, 0.0)), ('fsat', a)),
    (('fmin', ('fmax', ('fmin', ('fmax', a, 0.0), 1.0), 0.0), 1.0), ('fmin', ('fmax', a, 0.0), 1.0)),
    (('ior', ('flt', a, b), ('flt', a, c)), ('flt', a, ('fmax', b, c))),
    (('ior', ('flt', a, c), ('flt', b, c)), ('flt', ('fmin', a, b), c)),
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list