Patchwork [41/48] target-arm: fix neon vld1 single element to all lanes

login
register
mail settings
Submitter Riku Voipio
Date March 26, 2010, 4:07 p.m.
Message ID <05f23b98fb7ff175defc9612483bda8672415f9a.1269617187.git.riku.voipio@nokia.com>
Download mbox | patch
Permalink /patch/48685/
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/translate.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 964baf5..de2ea92 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -3798,7 +3798,11 @@  static int disas_neon_ls_insn(CPUState * env, DisasContext *s, uint32_t insn)
             }
             size = (insn >> 6) & 3;
             nregs = ((insn >> 8) & 3) + 1;
-            stride = (insn & (1 << 5)) ? 2 : 1;
+            if (nregs == 1) {
+                stride = 0;
+            } else {
+                stride = (insn & (1 << 5)) ? 2 : 1;
+            }
             load_reg_var(s, addr, rn);
             for (reg = 0; reg < nregs; reg++) {
                 switch (size) {
@@ -3819,7 +3823,12 @@  static int disas_neon_ls_insn(CPUState * env, DisasContext *s, uint32_t insn)
                 default: /* Avoid compiler warnings.  */
                     abort();
                 }
-                tcg_gen_addi_i32(addr, addr, 1 << size);
+                if (stride && reg < nregs - 1) {
+                    tcg_gen_addi_i32(addr, addr, 1 << size);
+                } else if (!stride) {
+                    tcg_gen_st_i32(tmp, cpu_env, neon_reg_offset(rd + 1, 0));
+                    tcg_gen_st_i32(tmp, cpu_env, neon_reg_offset(rd + 1, 1));
+                }
                 tmp2 = new_tmp();
                 tcg_gen_mov_i32(tmp2, tmp);
                 neon_store_reg(rd, 0, tmp2);