Fix %hi() operator for 64-bit hosts.
authorNick Clifton <nickc@redhat.com>
Fri, 10 Feb 2006 12:05:12 +0000 (12:05 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 10 Feb 2006 12:05:12 +0000 (12:05 +0000)
cpu/ChangeLog
cpu/iq2000.opc
opcodes/ChangeLog
opcodes/iq2000-asm.c

index 358e366ef029e6f0ff7496720d28965aa2228443..baefa5cde955aec0efd27f3528fdf888aee141e1 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-10  Nick Clifton  <nickc@redhat.com>
+
+       * iq2000.opc (parse_hi16): Truncate shifted values to 16 bits.
+
 2006-01-06  DJ Delorie  <dj@redhat.com>
 
        * m32c.cpu (mov.w:q): Fix mode.
index 63ef0768dd53fb85eaca22cf14f65f20abd9b3bb..528750688f43b77cf921b44bc39227743e7a99ec 100644 (file)
@@ -218,6 +218,7 @@ parse_hi16 (CGEN_CPU_DESC cd,
          if (value & 0x8000)
            value += 0x10000;
          value >>= 16;
+         value &= 0xffff;
        }
       *valuep = value;
 
@@ -243,6 +244,7 @@ parse_hi16 (CGEN_CPU_DESC cd,
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
        value >>= 16;
 
+      value &= 0xffff;
       *valuep = value;
 
       return errmsg;
index 51bbb1c8165639b6b9d7068b2dc520c60068d2ed..9de01b6c023ff00657a0b425aa3494f806bbb8b7 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-10  Nick Clifton  <nickc@redhat.com>
+
+       * iq2000-asm.c: Regenerate.
+
 2006-02-07  Nathan Sidwell  <nathan@codesourcery.com>
 
        * m68k-dis.c (print_insn_m68k): Use bfd_m68k_mach_to_features.
index caab54f500be337dd52060493eca000346e2c02d..0ec59ce324343efff805457e90cf61d981ff2ab0 100644 (file)
@@ -213,6 +213,7 @@ parse_hi16 (CGEN_CPU_DESC cd,
             1 to the resultant %hi value.  */
          if (value & 0x8000)
            value += 0x10000;
+         value &= 0xffff;
          value >>= 16;
        }
       *valuep = value;
@@ -239,6 +240,7 @@ parse_hi16 (CGEN_CPU_DESC cd,
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
        value >>= 16;
 
+      value &= 0xffff;
       *valuep = value;
 
       return errmsg;