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:

committed by
Marge Bot

parent
8a11d2a31b
commit
011ea32585
@@ -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 */
|
||||
}
|
||||
""")
|
||||
|
||||
|
Reference in New Issue
Block a user