All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/2] tcg: Fold unspecified opcode test into tcg_can_emit_vec_op
Date: Thu, 22 Feb 2018 14:54:23 +0000	[thread overview]
Message-ID: <CAFEAcA9rLWsSH82XM4nvPZo_urJL3BZv_4g_CMCvxYsCT=hVyA@mail.gmail.com> (raw)
In-Reply-To: <20180217164037.15727-2-richard.henderson@linaro.org>

On 17 February 2018 at 16:40, Richard Henderson
<richard.henderson@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.henderson@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.maydell@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

  reply	other threads:[~2018-02-22 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 16:40 [Qemu-devel] [PATCH 0/2] tcg: tcg_can_emit_vec_op cleanup+fix Richard Henderson
2018-02-17 16:40 ` [Qemu-devel] [PATCH 1/2] tcg: Fold unspecified opcode test into tcg_can_emit_vec_op Richard Henderson
2018-02-22 14:54   ` Peter Maydell [this message]
2018-02-17 16:40 ` [Qemu-devel] [PATCH 2/2] tcg: Add missing tcg_can_emit_vec_op check in tcg_gen_gvec_2s Richard Henderson
2018-02-22 14:58   ` Peter Maydell
2018-02-22 15:32     ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA9rLWsSH82XM4nvPZo_urJL3BZv_4g_CMCvxYsCT=hVyA@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.