gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / opcodes / m10300-dis.c
index 1ed50f174273727eb0278c9dd42e0c552fa21d81..00210c25cd359a67c3316d72a832fbe360efbc92 100644 (file)
@@ -1,6 +1,5 @@
 /* Disassemble MN10300 instructions.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1996-2020 Free Software Foundation, Inc.
 
    This file is part of the GNU opcodes library.
 
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */
 
-#include <stdio.h>
-
 #include "sysdep.h"
+#include <stdio.h>
 #include "opcode/mn10300.h"
-#include "dis-asm.h"
+#include "disassemble.h"
 #include "opintl.h"
 
 #define HAVE_AM33_2 (info->mach == AM33_2)
@@ -320,7 +318,13 @@ disassemble (bfd_vma memaddr,
              if ((operand->flags & MN10300_OPERAND_PLUS) != 0)
                nocomma = 1;
 
-             if ((operand->flags & MN10300_OPERAND_SPLIT) != 0)
+             if ((operand->flags & MN10300_OPERAND_DREG) != 0
+                 || (operand->flags & MN10300_OPERAND_AREG) != 0
+                 || (operand->flags & MN10300_OPERAND_RREG) != 0
+                 || (operand->flags & MN10300_OPERAND_XRREG) != 0)
+               value = ((insn >> (operand->shift + extra_shift))
+                        & ((1 << operand->bits) - 1));
+             else if ((operand->flags & MN10300_OPERAND_SPLIT) != 0)
                {
                  unsigned long temp;
 
@@ -412,18 +416,10 @@ disassemble (bfd_vma memaddr,
              nocomma = 0;
 
              if ((operand->flags & MN10300_OPERAND_DREG) != 0)
-               {
-                 value = ((insn >> (operand->shift + extra_shift))
-                          & ((1 << operand->bits) - 1));
-                 (*info->fprintf_func) (info->stream, "d%d", (int) value);
-               }
+               (*info->fprintf_func) (info->stream, "d%d", (int) value);
 
              else if ((operand->flags & MN10300_OPERAND_AREG) != 0)
-               {
-                 value = ((insn >> (operand->shift + extra_shift))
-                          & ((1 << operand->bits) - 1));
-                 (*info->fprintf_func) (info->stream, "a%d", (int) value);
-               }
+               (*info->fprintf_func) (info->stream, "a%d", (int) value);
 
              else if ((operand->flags & MN10300_OPERAND_SP) != 0)
                (*info->fprintf_func) (info->stream, "sp");
@@ -436,8 +432,6 @@ disassemble (bfd_vma memaddr,
 
              else if ((operand->flags & MN10300_OPERAND_RREG) != 0)
                {
-                 value = ((insn >> (operand->shift + extra_shift))
-                          & ((1 << operand->bits) - 1));
                  if (value < 8)
                    (*info->fprintf_func) (info->stream, "r%d", (int) value);
                  else if (value < 12)
@@ -448,8 +442,6 @@ disassemble (bfd_vma memaddr,
 
              else if ((operand->flags & MN10300_OPERAND_XRREG) != 0)
                {
-                 value = ((insn >> (operand->shift + extra_shift))
-                          & ((1 << operand->bits) - 1));
                  if (value == 0)
                    (*info->fprintf_func) (info->stream, "sp");
                  else
This page took 0.034499 seconds and 4 git commands to generate.