aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sim/bfin/ChangeLog10
-rw-r--r--sim/bfin/bfin-sim.c13
2 files changed, 6 insertions, 17 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index 27d38a7..ffd9ff2 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,5 +1,10 @@
2011-06-18 Robin Getz <robin.getz@analog.com>
+ * bfin-sim.c (extract_mult): Call saturate_s16 directly when
+ mmod is M_IH rather than computing the result by hand.
+
+2011-06-18 Robin Getz <robin.getz@analog.com>
+
* bfin-sim.c (decode_macfunc): Add nosat_acc to track acc value
before saturation, set sat when more cases saturate, and set the
overflow bit based on these results. For M_TFU, M_IU, M_FU, and
@@ -23,11 +28,6 @@
2011-06-18 Robin Getz <robin.getz@analog.com>
- * bfin-sim.c (extract_mult): When mmod is M_IH, change the order
- from round/saturate to saturate/round/saturate.
-
-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.
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index d0ad051..38e5fe1 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -1534,19 +1534,8 @@ extract_mult (SIM_CPU *cpu, bu64 res, int mmod, int MM,
{
case 0:
case M_W32:
- return saturate_s16 (rnd16 (res), overflow);
case M_IH:
- {
- bu32 sgn = !!(res >> 39);
- bu16 val = rnd16 (saturate_s32 (res, overflow));
- bu32 sgn0 = (val >> 15) & 1;
- if (sgn == sgn0 || !val)
- return val;
- if (sgn)
- return 0x8000;
- *overflow = 1;
- return 0x7FFF;
- }
+ return saturate_s16 (rnd16 (res), overflow);
case M_IS:
return saturate_s16 (res, overflow);
case M_FU: