aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-18 21:59:38 +0000
committerMike Frysinger <vapier@gentoo.org>2011-06-18 21:59:38 +0000
commitb4876e0485f5d16a5d9e213c0b15466323170cf0 (patch)
tree889d24e356cb0cb76684c4ff53108124623310ae
parentd5fcd950e4f812deac7669190b30efd1781a1266 (diff)
downloadgdb-b4876e0485f5d16a5d9e213c0b15466323170cf0.zip
gdb-b4876e0485f5d16a5d9e213c0b15466323170cf0.tar.gz
gdb-b4876e0485f5d16a5d9e213c0b15466323170cf0.tar.bz2
sim: bfin: do not touch ASTAT[V] when shifting accumulators
If we're shifting accumulators, we don't want to touch the V bit in ASTAT, so add size checks to the ashiftrt/lshiftrt helpers. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--sim/bfin/ChangeLog5
-rw-r--r--sim/bfin/bfin-sim.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index 4e656d7..8fd629a 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,5 +1,10 @@
2011-06-18 Robin Getz <robin.getz@analog.com>
+ * bfin-sim.c (ashiftrt): If size is 40, do not call SET_ASTATREG.
+ (lshiftrt): Likewise.
+
+2011-06-18 Robin Getz <robin.getz@analog.com>
+
* bfin-sim.c (decode_dsp32shift_0): Use get_unextended_acc
rather than get_extended_acc in LSHIFT insns.
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index 2c71f6c..dbfce6c 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -713,8 +713,8 @@ ashiftrt (SIM_CPU *cpu, bu40 val, int cnt, int size)
val |= sgn;
SET_ASTATREG (an, val >> (size - 1));
SET_ASTATREG (az, val == 0);
- /* XXX: Need to check ASTAT[v] behavior here. */
- SET_ASTATREG (v, 0);
+ if (size != 40)
+ SET_ASTATREG (v, 0);
return val;
}
@@ -742,7 +742,8 @@ lshiftrt (SIM_CPU *cpu, bu64 val, int cnt, int size)
}
SET_ASTATREG (an, val >> (size - 1));
SET_ASTATREG (az, val == 0);
- SET_ASTATREG (v, 0);
+ if (size != 40)
+ SET_ASTATREG (v, 0);
return val;
}