aboutsummaryrefslogtreecommitdiff
path: root/sim/bfin/bfin-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-06-18 20:10:57 +0000
committerMike Frysinger <vapier@gentoo.org>2011-06-18 20:10:57 +0000
commita0a71a7f8b85f3d25403d140b7fb14b54b3e7f4a (patch)
tree82501167712b1235f722213e1e7ab8e728560b7c /sim/bfin/bfin-sim.c
parent388aa9fe20b5692d76ca36c61619bdb887d174b0 (diff)
downloadgdb-a0a71a7f8b85f3d25403d140b7fb14b54b3e7f4a.zip
gdb-a0a71a7f8b85f3d25403d140b7fb14b54b3e7f4a.tar.gz
gdb-a0a71a7f8b85f3d25403d140b7fb14b54b3e7f4a.tar.bz2
sim: bfin: fix M_IH saturation size
This reverts the previous commit and does it right. This change got lost in the shuffle of patches I have pending. Basically the logic is to change the 32bit saturation (and then masked to 16bits) to a proper 16bit saturation. Signed-off-by: Robin Getz <robin.getz@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/bfin/bfin-sim.c')
-rw-r--r--sim/bfin/bfin-sim.c13
1 files changed, 1 insertions, 12 deletions
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: