Patchwork [2/2] target-arm: Handle UNDEF cases for Neon VLD/VST multiple-structures

login
register
mail settings
Submitter Peter Maydell
Date April 18, 2011, 6:07 p.m.
Message ID <1303150032-29497-3-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/91825/
State New
Headers show

Comments

Peter Maydell - April 18, 2011, 6:07 p.m.
Correctly UNDEF for Neon VLD/VST "multiple structures" forms where the
align field is not valid.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 5820add..30ca7df 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -3830,6 +3830,21 @@  static int disas_neon_ls_insn(CPUState * env, DisasContext *s, uint32_t insn)
         size = (insn >> 6) & 3;
         if (op > 10)
             return 1;
+        /* Catch UNDEF cases for bad values of align field */
+        switch (op & 0xc) {
+        case 4:
+            if (((insn >> 5) & 1) == 1) {
+                return 1;
+            }
+            break;
+        case 8:
+            if (((insn >> 4) & 3) == 3) {
+                return 1;
+            }
+            break;
+        default:
+            break;
+        }
         nregs = neon_ls_element_type[op].nregs;
         interleave = neon_ls_element_type[op].interleave;
         spacing = neon_ls_element_type[op].spacing;