mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
nir: reuse nir_component_mask() where it makes sense
Avoiding local bit field manipulations. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
This commit is contained in:
parent
275ad509c1
commit
2259e1e932
2 changed files with 3 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ nir_builder_alu_instr_finish_and_insert(nir_builder *build, nir_alu_instr *instr
|
|||
|
||||
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);
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ nir_vec_scalars(nir_builder *build, nir_ssa_scalar *comp, unsigned num_component
|
|||
*/
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ validate_alu_dest(nir_alu_instr *instr, validate_state *state)
|
|||
* 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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue