Patchwork [13/13] target-arm: Handle UNDEF cases for VDUP (scalar)

login
register
mail settings
Submitter Peter Maydell
Date April 11, 2011, 3:26 p.m.
Message ID <1302535583-15733-14-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/90621/
State New
Headers show

Comments

Peter Maydell - April 11, 2011, 3:26 p.m.
From: Juha Riihimäki <juha.riihimaki@nokia.com>

Handle the UNDEF cases for VDUP(scalar):
 imm4 == x000
 Q == 1 && Vd<0> == 1

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
---
 target-arm/translate.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Peter Maydell - April 11, 2011, 3:37 p.m.
On 11 April 2011 16:26, Peter Maydell <peter.maydell@linaro.org> wrote:
> From: Juha Riihimäki <juha.riihimaki@nokia.com>
>
> Handle the UNDEF cases for VDUP(scalar):
>  imm4 == x000
>  Q == 1 && Vd<0> == 1
>
> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

(obviously... but I forgot to put that into the commit message.)

-- PMM

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index be25c8f..6190028 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -6057,6 +6057,9 @@  static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
                 tcg_temp_free_i32(tmp);
             } else if ((insn & 0x380) == 0) {
                 /* VDUP */
+                if ((insn & (7 << 16)) == 0 || (q && (rd & 1))) {
+                    return 1;
+                }
                 if (insn & (1 << 19)) {
                     tmp = neon_load_reg(rm, 1);
                 } else {