All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: Yongbok Kim <yongbok.kim@imgtec.com>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v2 11/20] target-mips: add MSA I5 format instruction
Date: Wed, 29 Oct 2014 23:27:43 +0000	[thread overview]
Message-ID: <545177EF.1090402@imgtec.com> (raw)
In-Reply-To: <1414546928-54642-12-git-send-email-yongbok.kim@imgtec.com>

On 29/10/14 01:41, Yongbok Kim wrote:
> +    uint8_t df = (ctx->opcode >> 21) & 0x3;
> +    int64_t s5 = (ctx->opcode >> 16) & 0x1f;
> +    s5 = (s5 << 59) >> 59; /* sign extend s5 to 64 bits*/

Mixed declarations and code are not allowed. This issue occurs also in
subsequent patches (12, 15, 17, 18) in this series. You may also
consider using sextract() for s5.

> +    uint8_t u5 = (ctx->opcode >> 16) & 0x1f;
> +    uint8_t ws = (ctx->opcode >> 11) & 0x1f;
> +    uint8_t wd = (ctx->opcode >> 6) & 0x1f;
> +
> +    TCGv_i32 tdf = tcg_const_i32(df);
> +    TCGv_i32 twd = tcg_const_i32(wd);
> +    TCGv_i32 tws = tcg_const_i32(ws);
> +    TCGv_i64 tu5 = tcg_const_i64(u5);
> +    TCGv_i64 ts5 = tcg_const_i64(s5);

One of above tcg variable is redundant as tu5 and ts5 are never used
together. Have you considered to have just one tcg variable initialized
later - in case blocks - with appropriate value? You already did this
for ts10 in case OPC_LDI_df.

> +
> +    switch (MASK_MSA_I5(opcode)) {
> +    case OPC_ADDVI_df:
> +        gen_helper_msa_addvi_df(cpu_env, tdf, twd, tws, tu5);
> +        break;
> +    case OPC_SUBVI_df:
> +        gen_helper_msa_subvi_df(cpu_env, tdf, twd, tws, tu5);
> +        break;
> +    case OPC_MAXI_S_df:
> +        gen_helper_msa_maxi_s_df(cpu_env, tdf, twd, tws, ts5);
> +        break;
> +    case OPC_MAXI_U_df:
> +        gen_helper_msa_maxi_u_df(cpu_env, tdf, twd, tws, tu5);
> +        break;
> +    case OPC_MINI_S_df:
> +        gen_helper_msa_mini_s_df(cpu_env, tdf, twd, tws, ts5);
> +        break;
> +    case OPC_MINI_U_df:
> +        gen_helper_msa_mini_u_df(cpu_env, tdf, twd, tws, tu5);
> +        break;
> +    case OPC_CEQI_df:
> +        gen_helper_msa_ceqi_df(cpu_env, tdf, twd, tws, ts5);
> +        break;
> +    case OPC_CLTI_S_df:
> +        gen_helper_msa_clti_s_df(cpu_env, tdf, twd, tws, ts5);
> +        break;
> +    case OPC_CLTI_U_df:
> +        gen_helper_msa_clti_u_df(cpu_env, tdf, twd, tws, tu5);
> +        break;
> +    case OPC_CLEI_S_df:
> +        gen_helper_msa_clei_s_df(cpu_env, tdf, twd, tws, ts5);
> +        break;
> +    case OPC_CLEI_U_df:
> +        gen_helper_msa_clei_u_df(cpu_env, tdf, twd, tws, tu5);
> +        break;
> +    case OPC_LDI_df:
> +        {
> +            int64_t s10 = (ctx->opcode >> 11) & 0x3ff;
> +            s10 = (s10 << 54) >> 54; /* sign extend s10 to 64 bits*/

Mixed declarations and code

> +
> +            TCGv_i32 ts10 = tcg_const_i32(s10);
> +            gen_helper_msa_ldi_df(cpu_env, tdf, twd, ts10);
> +            tcg_temp_free_i32(ts10);

  parent reply	other threads:[~2014-10-29 23:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29  1:41 [Qemu-devel] [PATCH v2 00/20] target-mips: add MSA module Yongbok Kim
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 01/20] target-mips: add MSA defines and data structure Yongbok Kim
2014-10-29  9:50   ` James Hogan
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 02/20] target-mips: add MSA exceptions Yongbok Kim
2014-10-29  9:56   ` James Hogan
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 03/20] target-mips: remove duplicated mips/ieee mapping function Yongbok Kim
2014-10-29 10:04   ` James Hogan
2014-10-29 22:55   ` Leon Alrae
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 04/20] target-mips: add 16, 64 bit load and store Yongbok Kim
2014-10-29 10:21   ` James Hogan
2014-10-29 22:56   ` Leon Alrae
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 05/20] target-mips: stop translation after ctc1 Yongbok Kim
2014-10-29 10:26   ` James Hogan
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 06/20] target-mips: add MSA opcode enum Yongbok Kim
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 07/20] target-mips: add msa_reset(), global msa register Yongbok Kim
2014-10-29 10:36   ` James Hogan
2014-11-05 17:36   ` Richard Henderson
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 08/20] target-mips: add msa_helper.c Yongbok Kim
2014-10-29 10:50   ` James Hogan
2014-10-29 22:57   ` Leon Alrae
2014-11-05 17:38   ` Richard Henderson
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 09/20] target-mips: add MSA branch instructions Yongbok Kim
2014-10-29 11:19   ` James Hogan
2014-11-05 17:41   ` Richard Henderson
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 10/20] target-mips: add MSA I8 format instructions Yongbok Kim
2014-10-29 11:38   ` James Hogan
2014-11-05 17:43   ` Richard Henderson
2014-11-06 11:49     ` Yongbok Kim
2014-10-29  1:41 ` [Qemu-devel] [PATCH v2 11/20] target-mips: add MSA I5 format instruction Yongbok Kim
2014-10-29 23:23   ` James Hogan
2014-10-29 23:27   ` Leon Alrae [this message]
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 12/20] target-mips: add MSA BIT format instructions Yongbok Kim
2014-10-30  8:02   ` Leon Alrae
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 13/20] target-mips: add MSA 3R " Yongbok Kim
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 14/20] target-mips: add MSA ELM " Yongbok Kim
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 15/20] target-mips: add MSA 3RF " Yongbok Kim
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 16/20] target-mips: add MSA VEC/2R " Yongbok Kim
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 17/20] target-mips: add MSA 2RF " Yongbok Kim
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 18/20] target-mips: add MSA MI10 " Yongbok Kim
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 19/20] disas/mips.c: disassemble MSA instructions Yongbok Kim
2014-10-29  1:42 ` [Qemu-devel] [PATCH v2 20/20] target-mips: add MSA support to mips32r5-generic Yongbok Kim

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=545177EF.1090402@imgtec.com \
    --to=leon.alrae@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=yongbok.kim@imgtec.com \
    /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.