summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-08-17 15:03:01 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-08-19 02:05:23 -0700
commit7d0554f3419f693b7a43a47c1ed3b454dc5dc5f7 (patch)
tree87626b20d3d80fcb589d5cd8a23bf05c9ffb865a /src/compiler/nir
parent7ceb42ccc5f7943fc839ed19e06b9b7be38dacb0 (diff)
downloadexternal_mesa3d-7d0554f3419f693b7a43a47c1ed3b454dc5dc5f7.tar.gz
external_mesa3d-7d0554f3419f693b7a43a47c1ed3b454dc5dc5f7.tar.bz2
external_mesa3d-7d0554f3419f693b7a43a47c1ed3b454dc5dc5f7.zip
nir: Rely on the fact that bcsel takes a well formed boolean.
According to Connor, it's safe to assume that the first operand of bcsel, as well as the operand of b2f and b2i, must be well formed booleans. https://lists.freedesktop.org/archives/mesa-dev/2016-August/125658.html With the previous improvements to a@bool handling, this now has no change in shader-db instruction counts on Broadwell. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index 37cb700d6a..2de8050f85 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -155,7 +155,7 @@ optimizations = [
(('fge', ('fneg', ('fabs', a)), 0.0), ('feq', a, 0.0)),
(('bcsel', ('flt', b, a), b, a), ('fmin', a, b)),
(('bcsel', ('flt', a, b), b, a), ('fmax', a, b)),
- (('bcsel', ('inot', 'a@bool'), b, c), ('bcsel', a, c, b)),
+ (('bcsel', ('inot', a), b, c), ('bcsel', a, c, b)),
(('bcsel', a, ('bcsel', a, b, c), d), ('bcsel', a, b, d)),
(('bcsel', a, True, 'b@bool'), ('ior', a, b)),
(('fmin', a, a), a),
@@ -259,8 +259,8 @@ optimizations = [
(('ine', 'a@bool', True), ('inot', a)),
(('ine', 'a@bool', False), a),
(('ieq', 'a@bool', False), ('inot', 'a')),
- (('bcsel', a, True, False), ('ine', a, 0)),
- (('bcsel', a, False, True), ('ieq', a, 0)),
+ (('bcsel', a, True, False), a),
+ (('bcsel', a, False, True), ('inot', a)),
(('bcsel', True, b, c), b),
(('bcsel', False, b, c), c),
# The result of this should be hit by constant propagation and, in the