This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] sim: bfin: always do 16bit sign extension with the SEARCH insn
- From: Mike Frysinger <vapier at gentoo dot org>
- To: gdb-patches at sourceware dot org
- Cc: Robin Getz <robin dot getz at analog dot com>
- Date: Tue, 22 Mar 2011 22:13:40 -0400
- Subject: [PATCH] sim: bfin: always do 16bit sign extension with the SEARCH insn
From: Robin Getz <robin.getz@analog.com>
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>
2011-03-21 Robin Getz <robin.getz@analog.com>
* bfin-sim.c (decode_dsp32alu_0): Set A1 to a1_lo when up_hi is false,
and set A0 to a0_lo when up_lo is false.
---
sim/bfin/bfin-sim.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index 7272d16..42c9c55 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -5053,11 +5053,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);
--
1.7.4.1