nir_ssa_dest_init(&instr->instr, &instr->dest.dest, num_components,
bit_size, NULL);
- instr->dest.write_mask = (1 << num_components) - 1;
+ instr->dest.write_mask = nir_component_mask(num_components);
nir_builder_instr_insert(build, &instr->instr);
*/
nir_ssa_dest_init(&instr->instr, &instr->dest.dest, num_components,
comp[0].def->bit_size, NULL);
- instr->dest.write_mask = (1 << num_components) - 1;
+ instr->dest.write_mask = nir_component_mask(num_components);
nir_builder_instr_insert(build, &instr->instr);
* validate that the instruction doesn't write to components not in the
* register/SSA value
*/
- validate_assert(state, !(dest->write_mask & ~((1 << dest_size) - 1)));
+ validate_assert(state, !(dest->write_mask & ~nir_component_mask(dest_size)));
/* validate that saturate is only ever used on instructions with
* destinations of type float