aboutsummaryrefslogtreecommitdiff
path: root/sim/bfin/bfin-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-03-24 03:13:32 +0000
committerMike Frysinger <vapier@gentoo.org>2011-03-24 03:13:32 +0000
commitde0addfbefefa300907b90954f18f1e49f95e6bd (patch)
tree71be76ab4390c3dd942021d8b424d93b29118ea7 /sim/bfin/bfin-sim.c
parentbeb378a5f2d5d4920dab8b2d7a0b4e3a16a037a0 (diff)
downloadgdb-de0addfbefefa300907b90954f18f1e49f95e6bd.zip
gdb-de0addfbefefa300907b90954f18f1e49f95e6bd.tar.gz
gdb-de0addfbefefa300907b90954f18f1e49f95e6bd.tar.bz2
sim: bfin: always do 16bit sign extension with the SEARCH insn
The Blackfin PRM does not cover this case, but the hardware is clear: even if the search criteria is not met (and thus a new 16bit value is loaded up into the accumulator), the accumulator undergoes 16bit sign extension. So simply reload the low signed 16bits in that case. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/bfin/bfin-sim.c')
-rw-r--r--sim/bfin/bfin-sim.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index c78fe1a..85e281a 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -5041,11 +5041,16 @@ decode_dsp32alu_0 (SIM_CPU *cpu, bu16 iw0, bu16 iw1)
SET_AREG (1, src_hi);
SET_DREG (dst1, PREG (0));
}
+ else
+ SET_AREG (1, a1_lo);
+
if (up_lo)
{
SET_AREG (0, src_lo);
SET_DREG (dst0, PREG (0));
}
+ else
+ SET_AREG (0, a0_lo);
}
else
illegal_instruction (cpu);