diff options
Diffstat (limited to 'sim/avr')
-rw-r--r-- | sim/avr/ChangeLog | 4 | ||||
-rw-r--r-- | sim/avr/interp.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sim/avr/ChangeLog b/sim/avr/ChangeLog index e72bcf4..6bc7b7d 100644 --- a/sim/avr/ChangeLog +++ b/sim/avr/ChangeLog @@ -1,3 +1,7 @@ +2015-12-15 Dominik Vogt <vogt@linux.vnet.ibm.com> + + * interp.c (sign_ext): Fix left shift of negative value. + 2015-11-21 Mike Frysinger <vapier@gentoo.org> * interp.c (pc, cycles, avr_pc22): Delete. diff --git a/sim/avr/interp.c b/sim/avr/interp.c index ca50474..7ea56fa 100644 --- a/sim/avr/interp.c +++ b/sim/avr/interp.c @@ -222,7 +222,7 @@ static byte sram[MAX_AVR_SRAM]; static int sign_ext (word val, int nb_bits) { if (val & (1 << (nb_bits - 1))) - return val | (-1 << nb_bits); + return val | -(1 << nb_bits); return val; } |