The current handling of the subtraction insn with the RND12 modifier
works when saturation isn't involved. So add handling for this edge
case to match the hardware.
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-26 Robin Getz <robin.getz@analog.com>
+ * bfin-sim.c (decode_dsp32alu_0): Set result to 0x7FFFFFFF when
+ the result was 0x80000000 for RND12 subtraction.
+
+2011-03-26 Robin Getz <robin.getz@analog.com>
+
* bfin-sim.c (decode_dsp32alu_0): Set VS when V is set.
2011-03-24 Mike Frysinger <vapier@gentoo.org>
/* If subtract, just invert and add one. */
if (aop & 0x1)
- val1 = ~val1 + 1;
+ {
+ if (val1 == 0x80000000)
+ val1 = 0x7FFFFFFF;
+ else
+ val1 = ~val1 + 1;
+ }
/* Get the sign bits, since we need them later. */
sBit1 = !!(val0 & 0x80000000);