diff options
author | Connor Abbott <[email protected]> | 2017-07-31 18:26:49 -0700 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-08-03 00:19:07 +0100 |
commit | 2ac59aa824dd30b928ba96bbbe360593af4a1b83 (patch) | |
tree | 54ede2c227f62e6baccd2bd83ff36f6372811289 /src/compiler | |
parent | 58e9060fb0c30bc915f9dced5f9160500e797a13 (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: [email protected]
Reviewed-by: Matt Turner <[email protected]>
(cherry picked from commit de914615753678c5514733a37ac7d0360a43e525)
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 4 |
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 49c1460e25a..72f907ccde0 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -246,8 +246,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 |