This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] sim: bfin: do not touch ASTAT[V] when shifting accumulators


From: Robin Getz <robin.getz@analog.com>

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.

Committed.

Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 sim/bfin/bfin-sim.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

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;
 }
 
-- 
1.7.5.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]