summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2017-07-31 18:26:49 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2017-08-05 00:09:25 +0100
commita90d99f7a5f091c2f5697dd7b11d9803f369aa3a (patch)
tree3127e44c551186e6a8a826da4c29ddf52023a938
parent6806773905e0a3654ebd0d2a963a706bb70f0a64 (diff)
nir: fix algebraic optimizations
The optimizations are only valid for 32-bit integers. They were mistakenly firing for 64-bit integers as well. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Matt Turner <mattst88@gmail.com> (cherry picked from commit de914615753678c5514733a37ac7d0360a43e525)
-rw-r--r--src/compiler/nir/nir_opt_algebraic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
index df5854270c4..ad75228a50f 100644
--- a/src/compiler/nir/nir_opt_algebraic.py
+++ b/src/compiler/nir/nir_opt_algebraic.py
@@ -250,8 +250,8 @@ optimizations = [
(('ishr', a, 0), a),
(('ushr', 0, a), 0),
(('ushr', a, 0), a),
- (('iand', 0xff, ('ushr', a, 24)), ('ushr', a, 24)),
- (('iand', 0xffff, ('ushr', a, 16)), ('ushr', a, 16)),
+ (('iand', 0xff, ('ushr@32', a, 24)), ('ushr', a, 24)),
+ (('iand', 0xffff, ('ushr@32', a, 16)), ('ushr', a, 16)),
# Exponential/logarithmic identities
(('~fexp2', ('flog2', a)), a), # 2^lg2(a) = a
(('~flog2', ('fexp2', a)), a), # lg2(2^a) = a