mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 17:58:26 +02:00
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> (cherry picked from commit66e917fff6)
This commit is contained in:
parent
3830fb9769
commit
e2c69cd976
2 changed files with 2 additions and 2 deletions
|
|
@ -454,7 +454,7 @@
|
||||||
"description": "nir/opt_algebraic: Fix mask in shift by constant combining.",
|
"description": "nir/opt_algebraic: Fix mask in shift by constant combining.",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "0e6581b87dc4e168fa864cd39e8947a58999189a"
|
"because_sha": "0e6581b87dc4e168fa864cd39e8947a58999189a"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -420,7 +420,7 @@ optimizations.extend([
|
||||||
# bits of the second source. These replacements must correctly handle the
|
# bits of the second source. These replacements must correctly handle the
|
||||||
# case where (b % bitsize) + (c % bitsize) >= bitsize.
|
# case where (b % bitsize) + (c % bitsize) >= bitsize.
|
||||||
for s in [8, 16, 32, 64]:
|
for s in [8, 16, 32, 64]:
|
||||||
mask = (1 << s) - 1
|
mask = s - 1
|
||||||
|
|
||||||
ishl = "ishl@{}".format(s)
|
ishl = "ishl@{}".format(s)
|
||||||
ishr = "ishr@{}".format(s)
|
ishr = "ishr@{}".format(s)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue