* i386-dis.c (ckprefix): Handle rex on fwait. Don't print
authorAlan Modra <amodra@gmail.com>
Mon, 7 Nov 2005 00:19:12 +0000 (00:19 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 7 Nov 2005 00:19:12 +0000 (00:19 +0000)
ignored rex prefixes here.
(print_insn): Instead, handle them similarly to fwait followed
by non-fp insns.

opcodes/ChangeLog
opcodes/i386-dis.c

index 0496dbe..b6f5ccd 100644 (file)
@@ -1,3 +1,10 @@
+2005-11-07  Alan Modra  <amodra@bigpond.net.au>
+
+       * i386-dis.c (ckprefix): Handle rex on fwait.  Don't print
+       ignored rex prefixes here.
+       (print_insn): Instead, handle them similarly to fwait followed
+       by non-fp insns.
+
 2005-11-02  H.J. Lu  <hongjiu.lu@intel.com>
 
        * iq2000-desc.c: Regenerated.
 
        * configure.in: Add target architecture bfd_arch_z80.
        * configure: Regenerated.
-       * disassemble.c (disassembler)<ARCH_z80>: Add case  
+       * disassemble.c (disassembler)<ARCH_z80>: Add case
        bfd_arch_z80.
        * z80-dis.c: New file.
 
 2005-08-23  David Ung  <davidu@mips.com>
 
        * mips16-opc.c (mips16_opcodes): Add the MIPS16e jalrc/jrc
-       instructions to the table. 
+       instructions to the table.
 
 2005-08-18  Alan Modra  <amodra@bigpond.net.au>
 
        * cgen-ops.h, cgen-types.h: New files.
        * Makefile.am (HFILES): List them.
        * Makefile.in: Regenerated.
-       
+
 2005-07-07  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * arc-dis.c, arm-dis.c, cris-dis.c, crx-dis.c, d10v-dis.c,
        * vax-dis.c: Likewise.
        * w65-dis.c: Likewise.
        * z8kgen.c: Likewise.
-       
+
        * fr30-*: Regenerate.
        * frv-*: Regenerate.
        * ip2k-*: Regenerate.
 
 2005-06-16  David Ung  <davidu@mips.com>
 
-        * mips16-opc.c (mips16_opcodes): Add the following MIPS16e
-        instructions to the table; seb/seh/sew/zeb/zeh/zew.
+       * mips16-opc.c (mips16_opcodes): Add the following MIPS16e
+       instructions to the table; seb/seh/sew/zeb/zeh/zew.
 
 2005-06-15  Dave Brolley  <brolley@redhat.com>
 
        Contribute Morpho ms1 on behalf of Red Hat
-       * ms1-asm.c, ms1-desc.c, ms1-dis.c, ms1-ibld.c, ms1-opc.c, 
+       * ms1-asm.c, ms1-desc.c, ms1-dis.c, ms1-ibld.c, ms1-opc.c,
        ms1-opc.h: New files, Morpho ms1 target.
 
        2004-05-14  Stan Cox  <scox@redhat.com>
index a3b205a..47455e3 100644 (file)
@@ -1814,7 +1814,7 @@ ckprefix (void)
          /* fwait is really an instruction.  If there are prefixes
             before the fwait, they belong to the fwait, *not* to the
             following instruction.  */
-         if (prefixes)
+         if (prefixes || rex)
            {
              prefixes |= PREFIX_FWAIT;
              codep++;
@@ -1828,8 +1828,8 @@ ckprefix (void)
       /* Rex is ignored when followed by another prefix.  */
       if (rex)
        {
-         oappend (prefix_name (rex, 0));
-         oappend (" ");
+         rex_used = rex;
+         return;
        }
       rex = newrex;
       codep++;
@@ -2117,13 +2117,14 @@ print_insn (bfd_vma pc, disassemble_info *info)
   FETCH_DATA (info, codep + 1);
   two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
 
-  if ((prefixes & PREFIX_FWAIT)
-      && ((*codep < 0xd8) || (*codep > 0xdf)))
+  if (((prefixes & PREFIX_FWAIT)
+       && ((*codep < 0xd8) || (*codep > 0xdf)))
+      || (rex && rex_used))
     {
       const char *name;
 
-      /* fwait not followed by floating point instruction.  Print the
-        first prefix, which is probably fwait itself.  */
+      /* fwait not followed by floating point instruction, or rex followed
+        by other prefixes.  Print the first prefix.  */
       name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
       if (name == NULL)
        name = INTERNAL_DISASSEMBLER_ERROR;