summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-04-01 04:31:46 +0000
committerMike Frysinger <vapier@gentoo.org>2012-04-01 04:31:46 +0000
commit5841f3b2c5eddc10f6a3a1f07a082bf9daea9427 (patch)
treef2f8619a8a3bc5880830676a1b2167208edcb1be /sim
parent34b1f2f971ac17cc3d0b812c8c0017f8696030cb (diff)
downloadgdb-5841f3b2c5eddc10f6a3a1f07a082bf9daea9427.tar.gz
sim: bfin: throw VEC_ILGAL_I with 32bit insn in group1/group2 slots
Parallel insns can only do one 32bit, then two 16bits. So if we see a 2nd 32bit insn after the first 32bit in a parallel insn, abort. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim')
-rw-r--r--sim/bfin/ChangeLog5
-rw-r--r--sim/bfin/bfin-sim.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index 899d0ca776f..f4422247f94 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,5 +1,10 @@
2012-04-01 Mike Frysinger <vapier@gentoo.org>
+ * bfin-sim.c (_interp_insn_bfin): Call illegal_instruction_combination
+ when INSN_LEN is non-zero before 32bit decode.
+
+2012-04-01 Mike Frysinger <vapier@gentoo.org>
+
* bfin-dis.c (fmtconst): Replace decimal handling with a single
sprintf call and the '*' field width.
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index 54d6bcad346..a8c77940ef8 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -6187,6 +6187,9 @@ _interp_insn_bfin (SIM_CPU *cpu, bu32 pc)
/* Only cache on first run through (in case of parallel insns). */
if (INSN_LEN == 0)
INSN_LEN = insn_len;
+ else
+ /* Once you're past the first slot, only 16bit insns are valid. */
+ illegal_instruction_combination (cpu);
if ((iw0 & 0xf7ff) == 0xc003 && (iw1 & 0xfe00) == 0x1800)
{