mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
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>
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2011-06-18 Robin Getz <robin.getz@analog.com>
|
||||||
|
|
||||||
* bfin-sim.c (decode_macfunc): Add nosat_acc to track acc value
|
* bfin-sim.c (decode_macfunc): Add nosat_acc to track acc value
|
||||||
@ -21,11 +26,6 @@
|
|||||||
(decode_macfunc): Likewise. Drop sign extension of unsigned
|
(decode_macfunc): Likewise. Drop sign extension of unsigned
|
||||||
values.
|
values.
|
||||||
|
|
||||||
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>
|
2011-06-18 Robin Getz <robin.getz@analog.com>
|
||||||
|
|
||||||
* bfin-sim.c (saturate_s40_astat): Change ">=" to ">".
|
* bfin-sim.c (saturate_s40_astat): Change ">=" to ">".
|
||||||
|
@ -1534,19 +1534,8 @@ extract_mult (SIM_CPU *cpu, bu64 res, int mmod, int MM,
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
case M_W32:
|
case M_W32:
|
||||||
return saturate_s16 (rnd16 (res), overflow);
|
|
||||||
case M_IH:
|
case M_IH:
|
||||||
{
|
return saturate_s16 (rnd16 (res), overflow);
|
||||||
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;
|
|
||||||
}
|
|
||||||
case M_IS:
|
case M_IS:
|
||||||
return saturate_s16 (res, overflow);
|
return saturate_s16 (res, overflow);
|
||||||
case M_FU:
|
case M_FU:
|
||||||
|
Reference in New Issue
Block a user