nir_iadd_imm(nir_builder *build, nir_ssa_def *x, uint64_t y)
{
assert(x->bit_size <= 64);
- if (x->bit_size < 64)
- y &= (1ull << x->bit_size) - 1;
+ y &= BITFIELD64_MASK(x->bit_size);
if (y == 0) {
return x;
_nir_mul_imm(nir_builder *build, nir_ssa_def *x, uint64_t y, bool amul)
{
assert(x->bit_size <= 64);
- if (x->bit_size < 64)
- y &= (1ull << x->bit_size) - 1;
+ y &= BITFIELD64_MASK(x->bit_size);
if (y == 0) {
return nir_imm_intN_t(build, 0, x->bit_size);
static inline nir_ssa_def *
nir_iand_imm(nir_builder *build, nir_ssa_def *x, uint64_t y)
{
+ assert(x->bit_size <= 64);
y &= BITFIELD64_MASK(x->bit_size);
if (y == 0) {