Our handling of the M_IU/M_TFU modes are missing signed saturation when
the MM flag is set, so add it to match the hardware behavior.
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 (extract_mult): Call saturate_s32 when MM is set
+ and mmod is M_IU. Call saturate_s16 when MM is set and mmod
+ is M_TFU.
+
+2011-06-18 Robin Getz <robin.getz@analog.com>
+
* bfin-sim.c (decode_multfunc): Call new is_macmod_signed, and
allow MM to sign extend all the time.
(decode_macfunc): Likewise. Drop sign extension of unsigned
case M_IS:
return saturate_s32 (res, overflow);
case M_IU:
+ if (MM)
+ return saturate_s32 (res, overflow);
return saturate_u32 (res, overflow);
case M_FU:
if (MM)
case M_T:
return saturate_s16 (trunc16 (res), overflow);
case M_TFU:
+ if (MM)
+ return saturate_s16 (trunc16 (res), overflow);
return saturate_u16 (trunc16 (res), overflow);
case M_S2RND: