Patchwork [1/4] target-arm: neon - fix VRADDHN/VRSUBHN vs VADDHN/VSUBHN

login
register
mail settings
Submitter Riku Voipio
Date Feb. 5, 2010, 3:52 p.m.
Message ID <1265385151-11024-2-git-send-email-riku.voipio@iki.fi>
Download mbox | patch
Permalink /patch/44653/
State New
Headers show

Comments

Riku Voipio - Feb. 5, 2010, 3:52 p.m.
From: Riku Voipio <riku.voipio@nokia.com>

The rounding/truncating options were inverted. truncating
was done when rounding was meant and vice verse.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
---
 target-arm/translate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Laurent Desnogues - Feb. 7, 2010, 12:48 p.m.
On Fri, Feb 5, 2010 at 4:52 PM, Riku Voipio <riku.voipio@iki.fi> wrote:
> From: Riku Voipio <riku.voipio@nokia.com>
>
> The rounding/truncating options were inverted. truncating
> was done when rounding was meant and vice verse.
>
> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>

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


Laurent

> ---
>  target-arm/translate.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 5cf3e06..4bd813a 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -4957,7 +4957,7 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
>                     case 0: case 1: case 4: /* VADDL, VADDW, VADDHN, VRADDHN */
>                         gen_neon_addl(size);
>                         break;
> -                    case 2: case 3: case 6: /* VSUBL, VSUBW, VSUBHL, VRSUBHL */
> +                    case 2: case 3: case 6: /* VSUBL, VSUBW, VSUBHN, VRSUBHN */
>                         gen_neon_subl(size);
>                         break;
>                     case 5: case 7: /* VABAL, VABDL */
> @@ -5026,7 +5026,7 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
>                     } else if (op == 4 || op == 6) {
>                         /* Narrowing operation.  */
>                         tmp = new_tmp();
> -                        if (u) {
> +                        if (!u) {
>                             switch (size) {
>                             case 0:
>                                 gen_helper_neon_narrow_high_u8(tmp, cpu_V0);
> --
> 1.6.5
>
>
>
>
Aurelien Jarno - Feb. 28, 2010, 6:33 p.m.
On Fri, Feb 05, 2010 at 03:52:28PM +0000, Riku Voipio wrote:
> From: Riku Voipio <riku.voipio@nokia.com>
> 
> The rounding/truncating options were inverted. truncating
> was done when rounding was meant and vice verse.

Thanks, applied.

> Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
> ---
>  target-arm/translate.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index 5cf3e06..4bd813a 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -4957,7 +4957,7 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
>                      case 0: case 1: case 4: /* VADDL, VADDW, VADDHN, VRADDHN */
>                          gen_neon_addl(size);
>                          break;
> -                    case 2: case 3: case 6: /* VSUBL, VSUBW, VSUBHL, VRSUBHL */
> +                    case 2: case 3: case 6: /* VSUBL, VSUBW, VSUBHN, VRSUBHN */
>                          gen_neon_subl(size);
>                          break;
>                      case 5: case 7: /* VABAL, VABDL */
> @@ -5026,7 +5026,7 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
>                      } else if (op == 4 || op == 6) {
>                          /* Narrowing operation.  */
>                          tmp = new_tmp();
> -                        if (u) {
> +                        if (!u) {
>                              switch (size) {
>                              case 0:
>                                  gen_helper_neon_narrow_high_u8(tmp, cpu_V0);
> -- 
> 1.6.5
> 
> 
> 
>

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 5cf3e06..4bd813a 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -4957,7 +4957,7 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                     case 0: case 1: case 4: /* VADDL, VADDW, VADDHN, VRADDHN */
                         gen_neon_addl(size);
                         break;
-                    case 2: case 3: case 6: /* VSUBL, VSUBW, VSUBHL, VRSUBHL */
+                    case 2: case 3: case 6: /* VSUBL, VSUBW, VSUBHN, VRSUBHN */
                         gen_neon_subl(size);
                         break;
                     case 5: case 7: /* VABAL, VABDL */
@@ -5026,7 +5026,7 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                     } else if (op == 4 || op == 6) {
                         /* Narrowing operation.  */
                         tmp = new_tmp();
-                        if (u) {
+                        if (!u) {
                             switch (size) {
                             case 0:
                                 gen_helper_neon_narrow_high_u8(tmp, cpu_V0);