nir/lower_subgroups: fix left shift of -1

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5365
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12901>
This commit is contained in:
Rhys Perry
2021-09-16 17:35:25 +01:00
committed by Marge Bot
parent 811a7a2d31
commit 34510ce3cc
+1 -1
View File
@@ -318,7 +318,7 @@ build_ballot_imm_ishl(nir_builder *b, int64_t val, nir_ssa_def *shift,
const nir_lower_subgroups_options *options)
{
/* This only works if all the high bits are the same as bit 1. */
assert(((val << 62) >> 62) == val);
assert((val >> 2) == (val & 0x2 ? -1 : 0));
/* First compute the result assuming one ballot component. */
nir_ssa_def *result =