The constant has to changed to unsigned long long, as shifting a
32-bit value by 32 is undefined behaviour.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3943>
nir_const_value factor[NIR_MAX_VEC_COMPONENTS];
memset(factor, 0, sizeof(factor));
for (unsigned i = 0; i < num_components; i++) {
- assert(bits[i] < 32);
- factor[i].f32 = (1ul << (bits[i] - is_signed)) - 1;
+ assert(bits[i] <= 32);
+ factor[i].f32 = (1ull << (bits[i] - is_signed)) - 1;
}
return nir_build_imm(b, num_components, 32, factor);
}