From: Alan Modra 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-Url: https://sourceware.org/git/?a=commitdiff_plain;h=564c42f2d81aaaf1ef6fe1b89ebf8ae028716a7a;p=cgen.git * cpu/m32r.opc (parse_hi16): Do not assume a 32-bit host word size. --- diff --git a/ChangeLog b/ChangeLog index 21826e5..941a85f 100644 --- a/ChangeLog +++ b/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/cpu/m32r.opc b/cpu/m32r.opc index 1248953..0c40f8f 100644 --- a/cpu/m32r.opc +++ b/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;