nir: Clean up nir_op_is_vec() and its callers

The nir_op_is_vec() helper I added in 842338e2f0 ("nir: Add a
nir_op_is_vec helper") treats nir_op_mov as a vec even though the
semanitcs of the two are different.  In retrospect, this was a mistake
as the previous three fixup commits show.  This commit splits the helper
into two: nir_op_is_vec() and nir_op_is_vec_or_mov() and uses the
appropriate helper at each call site.  Hopefully, this rename will
encurage any future users of these helpers to think about nir_op_mov as
separate from nir_op_vecN and we can avoid these bugs.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24704>
This commit is contained in:
Faith Ekstrand
2023-08-15 10:59:11 -05:00
committed by Marge Bot
parent 408929289a
commit 4e2830c9ef
15 changed files with 47 additions and 35 deletions

View File

@@ -1229,11 +1229,12 @@ agx_emit_alu(agx_builder *b, nir_alu_instr *instr)
unsigned src_sz = srcs ? nir_src_bit_size(instr->src[0].src) : 0;
ASSERTED unsigned comps = instr->def.num_components;
assert(comps == 1 || nir_op_is_vec(instr->op));
assert(sz == 1 ||
((nir_op_is_vec(instr->op) || is_conversion_to_8bit(instr->op)) &&
sz == 8) ||
sz == 16 || sz == 32 || sz == 64);
assert(comps == 1 || nir_op_is_vec_or_mov(instr->op));
assert(
sz == 1 ||
((nir_op_is_vec_or_mov(instr->op) || is_conversion_to_8bit(instr->op)) &&
sz == 8) ||
sz == 16 || sz == 32 || sz == 64);
agx_index dst = agx_def_index(&instr->def);
agx_index s0 = srcs > 0 ? agx_alu_src_index(b, instr->src[0]) : agx_null();