Patchwork [47/48] target-arm: fix neon vshll (shift < max)

login
register
mail settings
Submitter Riku Voipio
Date March 26, 2010, 4:07 p.m.
Message ID <9b04d1155a105ad03ea2985572ae07ad807605bf.1269617187.git.riku.voipio@nokia.com>
Download mbox | patch
Permalink /patch/48675/
State New
Headers show

Comments

Riku Voipio - March 26, 2010, 4:07 p.m.
From: Juha Riihimäki <juha.riihimaki@nokia.com>

Signed-Off-By: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
---
 target-arm/neon_helper.c |    1 -
 target-arm/translate.c   |    4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index 7cef783..d75cb47 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -1484,7 +1484,6 @@  uint64_t HELPER(neon_negl_u16)(uint64_t x)
     return result;
 }
 
-#include <stdio.h>
 uint64_t HELPER(neon_negl_u32)(uint64_t x)
 {
     uint32_t low = -x;
diff --git a/target-arm/translate.c b/target-arm/translate.c
index fd3a72e..cd9dbce 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -4855,7 +4855,7 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                         /* The shift is less than the width of the source
                            type, so we can just shift the whole register.  */
                         tcg_gen_shli_i64(cpu_V0, cpu_V0, shift);
-                        if (size < 2 || !u) {
+                        if (size < 2) {
                             uint64_t imm64;
                             if (size == 0) {
                                 imm = (0xffu >> (8 - shift));
@@ -4864,7 +4864,7 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                                 imm = 0xffff >> (16 - shift);
                             }
                             imm64 = imm | (((uint64_t)imm) << 32);
-                            tcg_gen_andi_i64(cpu_V0, cpu_V0, imm64);
+                            tcg_gen_andi_i64(cpu_V0, cpu_V0, ~imm64);
                         }
                     }
                     neon_store_reg64(cpu_V0, rd + pass);