nir/opt_algebraic: Fix mask in shift by constant combining.

The comment above is correct, but the code to calculate the mask was broken.

No Foz-db changes outside of noise.

Fixes: 0e6581b87d ("nir/algebraic: Reassociate shift-by-constant of shift-by-constant")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15990>
This commit is contained in:
Georg Lehmann 2022-04-16 13:36:17 +02:00 committed by Marge Bot
parent 81ad8c4979
commit 66e917fff6
1 changed files with 1 additions and 1 deletions

View File

@ -413,7 +413,7 @@ optimizations.extend([
# bits of the second source. These replacements must correctly handle the
# case where (b % bitsize) + (c % bitsize) >= bitsize.
for s in [8, 16, 32, 64]:
mask = (1 << s) - 1
mask = s - 1
ishl = "ishl@{}".format(s)
ishr = "ishr@{}".format(s)