summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-03-30 09:29:19 +0000
committerNick Clifton <nickc@redhat.com>2004-03-30 09:29:19 +0000
commitbb9bce30158f17b8223769090c717f66fe5157d4 (patch)
tree60bd0054cf53ab6c4444e9edfc6bcfc8033ce73b /cpu
parent3e1fce47b168b0cd71ef854243eec22a8faa6d6b (diff)
downloadbinutils-redhat-bb9bce30158f17b8223769090c717f66fe5157d4.tar.gz
Fix bug parsing shigh(0xffff8000)
Diffstat (limited to 'cpu')
-rw-r--r--cpu/ChangeLog4
-rw-r--r--cpu/m32r.opc14
2 files changed, 11 insertions, 7 deletions
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index ce4468bac7..d8eaa9ec36 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,7 @@
+2004-03-30 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * m32r.opc (parse_hi16): Fixed shigh(0xffff8000) bug.
+
2004-03-01 Richard Sandiford <rsandifo@redhat.com>
* frv.cpu (define-arch frv): Add fr450 mach.
diff --git a/cpu/m32r.opc b/cpu/m32r.opc
index 6764223f2b..78bd0facef 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 @@
<arch>-opc.c additions use: "-- opc.c"
<arch>-asm.c additions use: "-- asm.c"
<arch>-dis.c additions use: "-- dis.c"
- <arch>-ibd.h additions use: "-- ibd.h"
-*/
+ <arch>-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;
}