Patchwork [6/8] target-arm: Fix Neon VQ(R)SHRN instructions.

login
register
mail settings
Submitter Christophe LYON
Date Jan. 28, 2011, 3:51 p.m.
Message ID <1296229866-32011-7-git-send-email-christophe.lyon@st.com>
Download mbox | patch
Permalink /patch/80864/
State New
Headers show

Comments

Christophe LYON - Jan. 28, 2011, 3:51 p.m.
From: Christophe Lyon <christophe.lyon@st.com>

Handle unsigned variant of VQ(R)SHRN instructions.

Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
---
 target-arm/translate.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 452cb71..3b14b8f 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -4876,8 +4876,12 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                         } else { /* VSHRN / VRSHRN */
                             gen_neon_narrow(size - 1, tmp, cpu_V0);
                         }
-                    } else { /* VQSHRN / VQRSHRN */
-                        gen_neon_narrow_satu(size - 1, tmp, cpu_V0);
+                    } else {
+                        if (u) { /* VQSHRUN / VQRSHRUN */
+                            gen_neon_narrow_satu(size - 1, tmp, cpu_V0);
+                        } else { /* VQSHRN / VQRSHRN */
+                            gen_neon_narrow_sats(size - 1, tmp, cpu_V0);
+                        }
                     }
                     neon_store_reg(rd, pass, tmp);
                 } /* for pass */