Module: Mesa
Branch: master
Commit: 517099809aec6f30633f315cff454d859d8c7431
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=517099809aec6f30633f315cff454d859d8c7431

Author: Jason Ekstrand <jason.ekstr...@intel.com>
Date:   Wed Dec  5 21:26:46 2018 -0600

nir: Drop support for lower_b2f

This was originally added for the out-of-tree Mali driver but I think
we've all agreed it's easy enough for them to just do in their back-end.

Reviewed-by: Alyssa Rosenzweig <aly...@rosenzweig.io>
Reviewed-by: Eric Anholt <e...@anholt.net>
Reviewed-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>
Tested-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>

---

 src/compiler/nir/nir.h                | 3 ---
 src/compiler/nir/nir_opt_algebraic.py | 5 +----
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 403f3b066d..aae8e83db7 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2118,9 +2118,6 @@ typedef struct nir_shader_compiler_options {
    /** enables rules to lower idiv by power-of-two: */
    bool lower_idiv;
 
-   /* lower b2f to iand */
-   bool lower_b2f;
-
    /* Does the native fdot instruction replicate its result for four
     * components?  If so, then opt_algebraic_late will turn all fdotN
     * instructions into fdot_replicatedN instructions.
diff --git a/src/compiler/nir/nir_opt_algebraic.py 
b/src/compiler/nir/nir_opt_algebraic.py
index ea24094a92..57abe7c995 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -440,7 +440,7 @@ optimizations = [
    (('imul', ('b2i', 'a@32'), ('b2i', 'b@32')), ('b2i', ('iand', a, b))),
    (('fmul', ('b2f', 'a@32'), ('b2f', 'b@32')), ('b2f', ('iand', a, b))),
    (('fsat', ('fadd', ('b2f', 'a@32'), ('b2f', 'b@32'))), ('b2f', ('ior', a, 
b))),
-   (('iand', 'a@bool', 1.0), ('b2f', a), '!options->lower_b2f'),
+   (('iand', 'a@bool', 1.0), ('b2f', a)),
    # True/False are ~0 and 0 in NIR.  b2i of True is 1, and -1 is ~0 (True).
    (('ineg', ('b2i32', 'a@32')), a),
    (('flt', ('fneg', ('b2f', 'a@32')), 0), a), # Generated by TGSI KILL_IF.
@@ -916,9 +916,6 @@ late_optimizations = [
    # we do these late so that we don't get in the way of creating ffmas
    (('fmin', ('fadd(is_used_once)', '#c', a), ('fadd(is_used_once)', '#c', 
b)), ('fadd', c, ('fmin', a, b))),
    (('fmax', ('fadd(is_used_once)', '#c', a), ('fadd(is_used_once)', '#c', 
b)), ('fadd', c, ('fmax', a, b))),
-
-   # Lowered for backends without a dedicated b2f instruction
-   (('b2f32', 'a@32'), ('iand', a, 1.0), 'options->lower_b2f'),
 ]
 
 print(nir_algebraic.AlgebraicPass("nir_opt_algebraic", optimizations).render())

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to