Patchwork [v2,01/10] target-arm: fix neon vshrn/vrshrn ops

login
register
mail settings
Submitter Juha.Riihimaki@nokia.com
Date Oct. 24, 2009, 12:19 p.m.
Message ID <1256386749-85299-2-git-send-email-juha.riihimaki@nokia.com>
Download mbox | patch
Permalink /patch/36831/
State New
Headers show

Comments

Juha.Riihimaki@nokia.com - Oct. 24, 2009, 12:19 p.m.
From: Juha Riihimäki <juha.riihimaki@nokia.com>

In the existing code shift value is clobbered during the pass loop.
This patch changes the code so that it stores the intermediate
result in the target neon register directly and eliminates the need
to use a temporary to hold the intermediate value thus leaving the
shift value in the temporary variable intact. This is a new patch
in this version of the patch series.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
---
 target-arm/translate.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
Laurent Desnogues - Oct. 25, 2009, 10:58 a.m.
On Sat, Oct 24, 2009 at 1:19 PM,  <juha.riihimaki@nokia.com> wrote:
> From: Juha Riihimäki <juha.riihimaki@nokia.com>
>
> In the existing code shift value is clobbered during the pass loop.
> This patch changes the code so that it stores the intermediate
> result in the target neon register directly and eliminates the need
> to use a temporary to hold the intermediate value thus leaving the
> shift value in the temporary variable intact. This is a new patch
> in this version of the patch series.
>
> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>

Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>


Laurent

> ---
>  target-arm/translate.c |   12 +++---------
>  1 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 9d13d42..8a85db6 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -4680,18 +4680,12 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
>                         else
>                             gen_neon_narrow_satu(size - 1, tmp, cpu_V0);
>                     }
> -                    if (pass == 0) {
> -                        if (size != 3) {
> -                            dead_tmp(tmp2);
> -                        }
> -                        tmp2 = tmp;
> -                    } else {
> -                        neon_store_reg(rd, 0, tmp2);
> -                        neon_store_reg(rd, 1, tmp);
> -                    }
> +                    neon_store_reg(rd, pass, tmp);
>                 } /* for pass */
>                 if (size == 3) {
>                     tcg_temp_free_i64(tmp64);
> +                } else {
> +                    dead_tmp(tmp2);
>                 }
>             } else if (op == 10) {
>                 /* VSHLL */
> --
> 1.6.5
>
>
>
>

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 9d13d42..8a85db6 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -4680,18 +4680,12 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                         else
                             gen_neon_narrow_satu(size - 1, tmp, cpu_V0);
                     }
-                    if (pass == 0) {
-                        if (size != 3) {
-                            dead_tmp(tmp2);
-                        }
-                        tmp2 = tmp;
-                    } else {
-                        neon_store_reg(rd, 0, tmp2);
-                        neon_store_reg(rd, 1, tmp);
-                    }
+                    neon_store_reg(rd, pass, tmp);
                 } /* for pass */
                 if (size == 3) {
                     tcg_temp_free_i64(tmp64);
+                } else {
+                    dead_tmp(tmp2);
                 }
             } else if (op == 10) {
                 /* VSHLL */