From: Jeff Law Date: Wed, 1 Jul 1998 23:15:55 +0000 (+0000) Subject: Tweak. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee61616c43290eb233fec9958923761130dbfc6a;p=binutils-gdb.git Tweak. --- diff --git a/sim/mn10300/am33.igen b/sim/mn10300/am33.igen index 67295dbcc01..6e1e3b98985 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