From 3e7d61b225eae88144dfaff1ba52d2452766074f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 7 Nov 2005 00:19:12 +0000 Subject: [PATCH] * 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. --- opcodes/ChangeLog | 21 ++++++++++++++------- opcodes/i386-dis.c | 15 ++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 0496dbe732..b6f5ccd3d7 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2005-11-07 Alan Modra + + * 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 * iq2000-desc.c: Regenerated. @@ -109,7 +116,7 @@ * configure.in: Add target architecture bfd_arch_z80. * configure: Regenerated. - * disassemble.c (disassembler): Add case + * disassemble.c (disassembler): Add case bfd_arch_z80. * z80-dis.c: New file. @@ -270,7 +277,7 @@ 2005-08-23 David Ung * mips16-opc.c (mips16_opcodes): Add the MIPS16e jalrc/jrc - instructions to the table. + instructions to the table. 2005-08-18 Alan Modra @@ -405,7 +412,7 @@ * cgen-ops.h, cgen-types.h: New files. * Makefile.am (HFILES): List them. * Makefile.in: Regenerated. - + 2005-07-07 Kaveh R. Ghazi * arc-dis.c, arm-dis.c, cris-dis.c, crx-dis.c, d10v-dis.c, @@ -496,7 +503,7 @@ * vax-dis.c: Likewise. * w65-dis.c: Likewise. * z8kgen.c: Likewise. - + * fr30-*: Regenerate. * frv-*: Regenerate. * ip2k-*: Regenerate. @@ -513,13 +520,13 @@ 2005-06-16 David Ung - * 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 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 diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index a3b205a49d..47455e37e4 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -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; -- 2.34.1