[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] tcg: Fold unspecified opcode test into tcg_
From: |
Peter Maydell |
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 |
On 17 February 2018 at 16:40, Richard Henderson
<address@hidden> wrote:
> This releases the callers from having to check themselves,
> which tidies up the code a bit.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> 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 <address@hidden>
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