diff mbox

[2/2] target-arm: Don't decode RFE or SRS on M profile cores

Message ID 1360937918-13244-3-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 00115976bb066d4b33dbb07a92f8bde5ec8b9518
Headers show

Commit Message

Peter Maydell Feb. 15, 2013, 2:18 p.m. UTC
M profile cores do not have the RFE or SRS instructions, so
correctly UNDEF these insn patterns on those cores.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/translate.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/target-arm/translate.c b/target-arm/translate.c
index 62a4c15..9746869 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -8135,9 +8135,10 @@  static int disas_thumb2_insn(CPUARMState *env, DisasContext *s, uint16_t insn_hw
         } else {
             /* Load/store multiple, RFE, SRS.  */
             if (((insn >> 23) & 1) == ((insn >> 24) & 1)) {
-                /* Not available in user mode.  */
-                if (IS_USER(s))
+                /* RFE, SRS: not available in user mode or on M profile */
+                if (IS_USER(s) || IS_M(env)) {
                     goto illegal_op;
+                }
                 if (insn & (1 << 20)) {
                     /* rfe */
                     addr = load_reg(s, rn);