When the accumulator saturates, it needs to be greater than, but not
equal to, the largest unsigned value as this is what the hardware does.
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+2011-06-18 Robin Getz <robin.getz@analog.com>
+
+ * bfin-sim.c (saturate_s40_astat): Change ">" to ">=".
+ (decode_macfunc): Likewise when mmod is M_IH.
+
2011-06-18 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_create_inferior): Change free to freeargv.
*v = 1;
return -((bs64)1 << 39);
}
- else if ((bs64)val >= ((bs64)1 << 39) - 1)
+ else if ((bs64)val > ((bs64)1 << 39) - 1)
{
*v = 1;
return ((bu64)1 << 39) - 1;
case M_IH:
if ((bs64)acc < -0x80000000ll)
acc = -0x80000000ull, sat = 1;
- else if ((bs64)acc >= 0x7fffffffll)
+ else if ((bs64)acc > 0x7fffffffll)
acc = 0x7fffffffull, sat = 1;
break;
case M_W32: