qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 1/1] target/m68k: correctly disassemble move16


From: Laurent Vivier
Subject: [Qemu-devel] [PULL 1/1] target/m68k: correctly disassemble move16
Date: Mon, 2 Jul 2018 12:28:21 +0200

"move16 address@hidden,%a1@" and "fmovel (cpid=3) address@hidden,%fpcr"
share the same opcode.

To fix that, backport the fix from binutils:

  2005-11-10  Andreas Schwab  <address@hidden>

     * m68k-dis.c (print_insn_m68k): Only match FPU insns with
     coprocessor ID 1.

Reported-by: Thomas Huth <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
Tested-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
---
 disas/m68k.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/disas/m68k.c b/disas/m68k.c
index 61b689ef3e..a687df437c 100644
--- a/disas/m68k.c
+++ b/disas/m68k.c
@@ -2017,6 +2017,20 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
                }
            }
 
+          /* Don't match FPU insns with non-default coprocessor ID.  */
+          if (*d == '\0')
+            {
+              for (d = opc->args; *d; d += 2)
+                {
+                  if (d[0] == 'I')
+                    {
+                      val = fetch_arg (buffer, 'd', 3, info);
+                      if (val != 1)
+                        break;
+                    }
+                }
+            }
+
          if (*d == '\0')
            if ((val = match_insn_m68k (memaddr, info, opc, & priv)))
              return val;
-- 
2.14.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]