[Mesa-dev] [PATCH 3/3] nir: Simplify ine/ieq(ineg(a), a) -> ine/ieq(a, 0)

Thomas Helland thomashelland90 at gmail.com
Thu Aug 6 04:36:06 PDT 2015


The same rationale as in the other patches.
No shader-db changes.

Signed-off-by: Thomas Helland <thomashelland90 at gmail.com>
---
 src/glsl/nir/nir_opt_algebraic.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/glsl/nir/nir_opt_algebraic.py b/src/glsl/nir/nir_opt_algebraic.py
index 3e483fb..d005f81 100644
--- a/src/glsl/nir/nir_opt_algebraic.py
+++ b/src/glsl/nir/nir_opt_algebraic.py
@@ -115,6 +115,8 @@ optimizations = [
    (('sne', a, b), ('b2f', ('fne', a, b)), 'options->lower_scmp'),
    (('fne', ('fneg', a), a), ('fne', a, 0.0)),
    (('feq', ('fneg', a), a), ('feq', a, 0.0)),
+   (('ine', ('ineg', a), a), ('ine', a, 0)),
+   (('ieq', ('ineg', a), a), ('ieq', a, 0)),
    # Emulating booleans
    (('imul', ('b2i', a), ('b2i', b)), ('b2i', ('iand', a, b))),
    (('fmul', ('b2f', a), ('b2f', b)), ('b2f', ('iand', a, b))),
-- 
2.5.0



More information about the mesa-dev mailing list