From: amodra Date: Thu, 27 Oct 2005 06:57:56 +0000 (+0000) Subject: * cpu/m32r.opc (parse_hi16): Do not assume a 32-bit host word size. X-Git-Tag: before-mmap-revamp~373 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9b3d9d3e4efe894d1102612c686104927260f9e7;p=pf3gnuchains%2Fpf3gnuchains4x.git * cpu/m32r.opc (parse_hi16): Do not assume a 32-bit host word size. --- diff --git a/cgen/ChangeLog b/cgen/ChangeLog index 21826e5c6f..941a85f561 100644 --- a/cgen/ChangeLog +++ b/cgen/ChangeLog @@ -1,3 +1,7 @@ +2005-10-26 Kazuhiro Inaoka + + * cpu/m32r.opc (parse_hi16): Do not assume a 32-bit host word size. + 2005-10-24 DJ Delorie * operand.scm (-anyof-merge-syntax): Print a more useful error diff --git a/cgen/cpu/m32r.opc b/cgen/cpu/m32r.opc index 12489534d1..0c40f8fc8c 100644 --- a/cgen/cpu/m32r.opc +++ b/cgen/cpu/m32r.opc @@ -62,7 +62,6 @@ m32r_cgen_dis_hash (const char * buf ATTRIBUTE_UNUSED, CGEN_INSN_INT value) /* -- */ /* -- asm.c */ - static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'"); /* Handle '#' prefixes (i.e. skip over them). */ @@ -103,7 +102,10 @@ parse_hi16 (CGEN_CPU_DESC cd, ++*strp; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - value >>= 16; + { + value >>= 16; + value &= 0xffff; + } *valuep = value; return errmsg; } @@ -118,8 +120,9 @@ parse_hi16 (CGEN_CPU_DESC cd, if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) { - value = value + (value & 0x8000 ? 0x10000 : 0); + value += 0x8000; value >>= 16; + value &= 0xffff; } *valuep = value; return errmsg;