Tweak.
authorJeff Law <law@redhat.com>
Wed, 1 Jul 1998 23:15:55 +0000 (23:15 +0000)
committerJeff Law <law@redhat.com>
Wed, 1 Jul 1998 23:15:55 +0000 (23:15 +0000)
sim/mn10300/am33.igen

index 67295dbcc013b45f5c22e007186c69588069e6be..6e1e3b98985ec953dac3af2a1f5bea3d66ed0b0e 100644 (file)
 "add"
 *am33
 {
+  int z, c, n, v;
+  unsigned long sum;
   int srcreg1, srcreg2, dstreg;
 
   PC = cia;
   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
This page took 0.029832 seconds and 4 git commands to generate.