From f4453dfa0a55ca903d7f44216b872c974466a2f3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 30 Mar 2004 09:29:19 +0000 Subject: [PATCH] Fix bug parsing shigh(0xffff8000) --- cpu/ChangeLog | 4 ++++ cpu/m32r.opc | 14 +++++++------- opcodes/ChangeLog | 4 ++++ opcodes/m32r-asm.c | 7 +++++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/cpu/ChangeLog b/cpu/ChangeLog index ce4468b..d8eaa9e 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,7 @@ +2004-03-30 Kazuhiro Inaoka + + * m32r.opc (parse_hi16): Fixed shigh(0xffff8000) bug. + 2004-03-01 Richard Sandiford * frv.cpu (define-arch frv): Add fr450 mach. diff --git a/cpu/m32r.opc b/cpu/m32r.opc index 6764223..78bd0fa 100644 --- a/cpu/m32r.opc +++ b/cpu/m32r.opc @@ -1,6 +1,6 @@ /* M32R opcode support. -*- C -*- - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. Contributed by Red Hat Inc; developed under contract from Mitsubishi Electric Corporation. @@ -23,9 +23,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This file is an addendum to m32r.cpu. Heavy use of C code isn't appropriate in .cpu files, so it resides here. This especially applies @@ -40,8 +38,7 @@ -opc.c additions use: "-- opc.c" -asm.c additions use: "-- asm.c" -dis.c additions use: "-- dis.c" - -ibd.h additions use: "-- ibd.h" -*/ + -ibd.h additions use: "-- ibd.h" */ /* -- opc.h */ @@ -153,7 +150,10 @@ parse_hi16 (cd, strp, opindex, valuep) ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - value = (value >> 16) + (value & 0x8000 ? 1 : 0); + { + value = value + (value & 0x8000 ? 0x10000 : 0); + value >>= 16; + } *valuep = value; return errmsg; } diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 2f82203..65b0898 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2004-03-30 Kazuhiro Inaoka + + * m32r-asm.c: Regenerate. + 2004-03-29 Stan Shebs * mpw-config.in, mpw-make.sed: Remove MPW support files, no longer diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c index 8c2cc81..87c33f0 100644 --- a/opcodes/m32r-asm.c +++ b/opcodes/m32r-asm.c @@ -4,7 +4,7 @@ THIS FILE IS MACHINE GENERATED WITH CGEN. - the resultant file is machine generated, cgen-asm.in isn't -Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU Binutils and GDB, the GNU debugger. @@ -111,7 +111,10 @@ parse_hi16 (cd, strp, opindex, valuep) ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - value = (value >> 16) + (value & 0x8000 ? 1 : 0); + { + value = value + (value & 0x8000 ? 0x10000 : 0); + value >>= 16; + } *valuep = value; return errmsg; } -- 2.7.4