handling for 32bit ALU insns.
+Fri Apr 12 09:39:56 1996 Jeffrey A Law (law@cygnus.com)
+
+ * compile.c (sim_resume): Fix and simplify overflow and carry
+ handling for 32bit ALU insns.
+
Mon Apr 8 23:58:49 1996 Jeffrey A Law (law@cygnus.com)
* compile.c (sim_resume): Fix overflow checks for ALU insns.
case O_ADD:
v = ((rd & 0x80000000) == (ea & 0x80000000)
&& (rd & 0x80000000) != (res & 0x80000000));
+ c = ((unsigned) res < (unsigned) rd) || ((unsigned) res < (unsigned) ea);
break;
case O_SUB:
case O_CMP:
v = ((rd & 0x80000000) != (-ea & 0x80000000)
&& (rd & 0x80000000) != (res & 0x80000000));
- break;
- case O_NEG:
- v = (rd == 0x80000000);
- break;
- }
- goto next;
- switch (code->opcode / 4)
- {
- case O_ADD:
- c = ((unsigned) res < (unsigned) rd) || ((unsigned) res < (unsigned) ea);
- break;
- case O_SUB:
- case O_CMP:
c = (unsigned) rd < (unsigned) -ea;
break;
case O_NEG:
+ v = (rd == 0x80000000);
c = res != 0;
break;
}