aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1998-07-01 23:15:55 +0000
committerJeff Law <law@redhat.com>1998-07-01 23:15:55 +0000
commitee61616c43290eb233fec9958923761130dbfc6a (patch)
tree0215e808d68cecbd7bcf7138b8282b2ea3ad417a /sim
parent0f7d73858c401771bf67905c063e2b09bbd26fe5 (diff)
downloadgdb-ee61616c43290eb233fec9958923761130dbfc6a.zip
gdb-ee61616c43290eb233fec9958923761130dbfc6a.tar.gz
gdb-ee61616c43290eb233fec9958923761130dbfc6a.tar.bz2
Tweak.
Diffstat (limited to 'sim')
-rw-r--r--sim/mn10300/am33.igen15
1 files changed, 14 insertions, 1 deletions
diff --git a/sim/mn10300/am33.igen b/sim/mn10300/am33.igen
index 67295db..6e1e3b9 100644
--- a/sim/mn10300/am33.igen
+++ b/sim/mn10300/am33.igen
@@ -2209,6 +2209,8 @@
"add"
*am33
{
+ int z, c, n, v;
+ unsigned long sum;
int srcreg1, srcreg2, dstreg;
PC = cia;
@@ -2234,7 +2236,18 @@
else
dstreg = REG_E0 + RD0;
- genericAdd3 (State.regs[srcreg1], State.regs[srcreg2], dstreg);
+ sum = source1 + source2;
+ State.regs[dstreg] = sum;
+
+ z = (sum == 0);
+ n = (sum & 0x80000000);
+ c = (sum < source1) || (sum < source2);
+ v = ((source1 & 0x80000000) == (source2 & 0x80000000)
+ && (source1 & 0x80000000) != (sum & 0x80000000));
+
+ PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+ PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
+ | (c ? PSW_C : 0) | (v ? PSW_V : 0));
}
// 1111 1101 1101 1000 Rn Rn IMM32; cmp imm24,Rn