aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-08-30 16:41:39 +0000
committerJeff Law <law@redhat.com>1996-08-30 16:41:39 +0000
commit0e4ccc58f2ed7cd7315833cb6857474ce2238445 (patch)
treea90e462742a79eba41f28584fa2c64fb35e7e336 /sim
parent83fc3bac9fd75bd785cf0016ca429b301c30fabd (diff)
downloadgdb-0e4ccc58f2ed7cd7315833cb6857474ce2238445.zip
gdb-0e4ccc58f2ed7cd7315833cb6857474ce2238445.tar.gz
gdb-0e4ccc58f2ed7cd7315833cb6857474ce2238445.tar.bz2
* simops.c: Fix satadd, satsub boundary case handling.
Diffstat (limited to 'sim')
-rw-r--r--sim/v850/ChangeLog2
-rw-r--r--sim/v850/simops.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 8c1cbbf..09156fe 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,5 +1,7 @@
Fri Aug 30 10:33:49 1996 Jeffrey A Law (law@cygnus.com)
+ * simops.c: Fix satadd, satsub boundary case handling.
+
* interp.c (hash): Fix.
* interp.c (do_format_8): Get operands correctly and
call the target function.
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index 1586b11..c6969fe 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -824,7 +824,7 @@ OP_C0 ()
| (sat ? PSW_SAT : 0));
/* Handle saturated results. */
- if (sat && (op0 & 0x80000000))
+ if (sat && s)
State.regs[OP[1]] = 0x80000000;
else if (sat)
State.regs[OP[1]] = 0x7fffffff;
@@ -861,7 +861,7 @@ OP_220 ()
| (sat ? PSW_SAT : 0));
/* Handle saturated results. */
- if (sat && (op0 & 0x80000000))
+ if (sat && s)
State.regs[OP[1]] = 0x80000000;
else if (sat)
State.regs[OP[1]] = 0x7fffffff;
@@ -894,7 +894,7 @@ OP_A0 ()
| (sat ? PSW_SAT : 0));
/* Handle saturated results. */
- if (sat && (op1 & 0x80000000))
+ if (sat && s)
State.regs[OP[1]] = 0x80000000;
else if (sat)
State.regs[OP[1]] = 0x7fffffff;
@@ -930,7 +930,7 @@ OP_660 ()
| (sat ? PSW_SAT : 0));
/* Handle saturated results. */
- if (sat && (op1 & 0x80000000))
+ if (sat && s)
State.regs[OP[1]] = 0x80000000;
else if (sat)
State.regs[OP[1]] = 0x7fffffff;
@@ -962,7 +962,7 @@ OP_80 ()
| (sat ? PSW_SAT : 0));
/* Handle saturated results. */
- if (sat && (op0 & 0x80000000))
+ if (sat && s)
State.regs[OP[1]] = 0x80000000;
else if (sat)
State.regs[OP[1]] = 0x7fffffff;