nir/algebraic: Require operands to iand be 32-bit
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 27 Apr 2020 19:11:17 +0000 (12:11 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Apr 2020 20:33:56 +0000 (20:33 +0000)
commit7b869710a1c29b535aceda74220594f12dc3beb0
tree4b6b4528699058260713f85ae77e6c1ca10b49d4
parent656051d735c949021e7eb206b6c4a633cc76936f
nir/algebraic: Require operands to iand be 32-bit

With the mask value 0x80000000, the other operand must be 32-bit.  This
fixes failures in
dEQP-VK.subgroups.ballot_mask.ext_shader_subgroup_ballot.*.gl_subgroupgemaskarb_*
tests from Vulkan 1.2.2 CTS.

Checking one of the tests, it appears that the tests are doing 64-bit
iand with 0x0000000080000000, then comparing the result with zero.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2834
Fixes: 88eb8f190bd ("nir/algebraic: Simplify logic to detect sign of an integer")
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4770>
src/compiler/nir/nir_opt_algebraic.py