aboutsummaryrefslogtreecommitdiff
path: root/sim/mips
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2015-12-15 14:09:14 +0100
committerAndreas Arnez <arnez@linux.vnet.ibm.com>2015-12-15 14:09:14 +0100
commit1d19cae752a7b032b8253feb4fa3b9f1dc162823 (patch)
treefcd5b5f015c8f9dc4e541049369e89e52ab6c8ba /sim/mips
parent08832196accd270fa053e8125c21e7a54ab19fe0 (diff)
downloadgdb-1d19cae752a7b032b8253feb4fa3b9f1dc162823.zip
gdb-1d19cae752a7b032b8253feb4fa3b9f1dc162823.tar.gz
gdb-1d19cae752a7b032b8253feb4fa3b9f1dc162823.tar.bz2
Fix invalid left shift of negative value
Fix occurrences of left-shifting negative constants in C code. sim/arm/ChangeLog: * thumbemu.c (handle_T2_insn): Fix left shift of negative value. * armemu.c (handle_v6_insn): Likewise. sim/avr/ChangeLog: * interp.c (sign_ext): Fix left shift of negative value. sim/mips/ChangeLog: * micromips.igen (process_isa_mode): Fix left shift of negative value. sim/msp430/ChangeLog: * msp430-sim.c (get_op, put_op): Fix left shift of negative value. sim/v850/ChangeLog: * simops.c (v850_bins): Fix left shift of negative value.
Diffstat (limited to 'sim/mips')
-rw-r--r--sim/mips/ChangeLog5
-rw-r--r--sim/mips/micromips.igen2
2 files changed, 6 insertions, 1 deletions
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index d37ab7a..040ae04 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-15 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * micromips.igen (process_isa_mode): Fix left shift of negative
+ value.
+
2015-11-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (WITH_MODULO_MEMORY): Delete.
diff --git a/sim/mips/micromips.igen b/sim/mips/micromips.igen
index 2c62376..f24220e 100644
--- a/sim/mips/micromips.igen
+++ b/sim/mips/micromips.igen
@@ -54,7 +54,7 @@
:function:::address_word:process_isa_mode:address_word target
{
SD->isa_mode = target & 0x1;
- return (target & (-1 << 1));
+ return (target & (-(1 << 1)));
}
:function:::address_word:do_micromips_jalr:int rt, int rs, address_word nia, int delayslot_instruction_size