From f2a56d0ad70bc43ea8c56272ea1d5261b2028cb5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 18 Jun 2011 19:44:14 +0000 Subject: sim: bfin: handle the MM flag in M_IU/M_TFU modes with dsp insns 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 Signed-off-by: Mike Frysinger --- sim/bfin/bfin-sim.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sim/bfin/bfin-sim.c') diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c index 017ddca..71fda3e 100644 --- a/sim/bfin/bfin-sim.c +++ b/sim/bfin/bfin-sim.c @@ -1516,6 +1516,8 @@ extract_mult (SIM_CPU *cpu, bu64 res, int mmod, int MM, 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) @@ -1559,6 +1561,8 @@ extract_mult (SIM_CPU *cpu, bu64 res, int mmod, int 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: -- cgit v1.1