OSDN Git Service

* cpu/m32r.opc (parse_hi16): Do not assume a 32-bit host word size.
authoramodra <amodra>
Thu, 27 Oct 2005 06:57:56 +0000 (06:57 +0000)
committeramodra <amodra>
Thu, 27 Oct 2005 06:57:56 +0000 (06:57 +0000)
cgen/ChangeLog
cgen/cpu/m32r.opc

index 21826e5..941a85f 100644 (file)
@@ -1,3 +1,7 @@
+2005-10-26  Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+       * cpu/m32r.opc (parse_hi16): Do not assume a 32-bit host word size.
+
 2005-10-24  DJ Delorie  <dj@redhat.com>
 
        * operand.scm (-anyof-merge-syntax): Print a more useful error
index 1248953..0c40f8f 100644 (file)
@@ -62,7 +62,6 @@ m32r_cgen_dis_hash (const char * buf ATTRIBUTE_UNUSED, CGEN_INSN_INT value)
 /* -- */
 \f
 /* -- 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;