Mesa (master): nir: Drop support for lower_b2f
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Dec 16 21:03:23 UTC 2018
Module: Mesa
Branch: master
Commit: 517099809aec6f30633f315cff454d859d8c7431
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=517099809aec6f30633f315cff454d859d8c7431
Author: Jason Ekstrand <jason.ekstrand at 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 <alyssa at rosenzweig.io>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Tested-by: Bas Nieuwenhuizen <bas at 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 at 32'), ('b2i', 'b at 32')), ('b2i', ('iand', a, b))),
(('fmul', ('b2f', 'a at 32'), ('b2f', 'b at 32')), ('b2f', ('iand', a, b))),
(('fsat', ('fadd', ('b2f', 'a at 32'), ('b2f', 'b at 32'))), ('b2f', ('ior', a, b))),
- (('iand', 'a at bool', 1.0), ('b2f', a), '!options->lower_b2f'),
+ (('iand', 'a at 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 at 32')), a),
(('flt', ('fneg', ('b2f', 'a at 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 at 32'), ('iand', a, 1.0), 'options->lower_b2f'),
]
print(nir_algebraic.AlgebraicPass("nir_opt_algebraic", optimizations).render())
More information about the mesa-commit
mailing list