[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 11/20] target-mips: add MSA I5 format instruc
From: |
Leon Alrae |
Subject: |
Re: [Qemu-devel] [PATCH v2 11/20] target-mips: add MSA I5 format instruction |
Date: |
Wed, 29 Oct 2014 23:27:43 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 |
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);
- Re: [Qemu-devel] [PATCH v2 07/20] target-mips: add msa_reset(), global msa register, (continued)
- [Qemu-devel] [PATCH v2 08/20] target-mips: add msa_helper.c, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 09/20] target-mips: add MSA branch instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 10/20] target-mips: add MSA I8 format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 11/20] target-mips: add MSA I5 format instruction, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 12/20] target-mips: add MSA BIT format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 14/20] target-mips: add MSA ELM format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 13/20] target-mips: add MSA 3R format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 16/20] target-mips: add MSA VEC/2R format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 17/20] target-mips: add MSA 2RF format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 18/20] target-mips: add MSA MI10 format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 15/20] target-mips: add MSA 3RF format instructions, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 20/20] target-mips: add MSA support to mips32r5-generic, Yongbok Kim, 2014/10/28
- [Qemu-devel] [PATCH v2 19/20] disas/mips.c: disassemble MSA instructions, Yongbok Kim, 2014/10/28