ac/nir/ngg: fix nogs culling with nuw add
We should not use "nuw" here as negative add positive may wrap around (negative is 0xffffff??). This problem can be observed with LLVM15 (I can't see when LLVM14): %.neg = mul nsw i32 %31, -4 %163 = add nuw nsw i32 %.neg, 16 %164 = lshr i32 257, %.neg %165 = lshr i32 %164, %163 LLVM just assume %.neg is possitive, so pre-shift 0x01010101 by 16. This get wrong value because we can't get back the shifted bits with a negative shift right. Fixes: 75dbb404 ("ac/nir: Remove byte permute from prefix sum of the repack sequence.") Reviewed-by:Timur Kristóf <timur.kristof@gmail.com> Signed-off-by:
Qiang Yu <yuq825@gmail.com> Part-of: <mesa/mesa!19718>