On 17 February 2018 at 16:40, Richard Henderson <richard.hender...@linaro.org> wrote: > This releases the callers from having to check themselves, > which tidies up the code a bit. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > --- > tcg/aarch64/tcg-target.inc.c | 4 ++++ > tcg/i386/tcg-target.inc.c | 4 ++++ > tcg/tcg-op-gvec.c | 28 ++++++++++++---------------- > 3 files changed, 20 insertions(+), 16 deletions(-) > > diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c > index be3192078d..9b0a803d79 100644 > --- a/tcg/aarch64/tcg-target.inc.c > +++ b/tcg/aarch64/tcg-target.inc.c > @@ -2217,6 +2217,10 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode > opc, > int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) > { > switch (opc) { > + case 0: > + /* Unspecified opcode */ > + return 1; > + > case INDEX_op_add_vec: > case INDEX_op_sub_vec: > case INDEX_op_mul_vec:
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> since there's clearly no behaviour change here. But it isn't clear to me why tcg_can_emit_vec_op() should return 1 for unspecified opcodes -- shouldn't the default be "we can't vectorize something we don't know about", not "no idea what this is so let's assume it's vectorizable" ? A comment about why unspecified opcodes are always OK might be helpful. thanks -- PMM