mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
nir: fix constant expression of ibitfield_extract
This fixes dEQP-VK.graphicsfuzz.cov-condition-bitfield-extract-integer. For example, nir_ibitfield_extract(3, 1, 2) should return 1. Cc: 21.3 mesa-stable Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13791>
This commit is contained in:
parent
8a11d2a31b
commit
011ea32585
1 changed files with 1 additions and 1 deletions
|
|
@ -1056,7 +1056,7 @@ if (bits == 0) {
|
|||
} else if (offset < 0 || bits < 0 || offset + bits > 32) {
|
||||
dst = 0;
|
||||
} else {
|
||||
dst = (base << (32 - offset - bits)) >> offset; /* use sign-extending shift */
|
||||
dst = (base << (32 - offset - bits)) >> (32 - bits); /* use sign-extending shift */
|
||||
}
|
||||
""")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue