Use getters/setters to access ARM branch type
[binutils-gdb.git] / opcodes / mips-dis.c
index 820092024af270f50218ed3fb73a7134b280042f..7822295eceb629c2997840619ffbe0aa9a34fe43 100644 (file)
@@ -1,5 +1,5 @@
 /* Print mips instructions for GDB, the GNU debugger, or for objdump.
-   Copyright (C) 1989-2015 Free Software Foundation, Inc.
+   Copyright (C) 1989-2016 Free Software Foundation, Inc.
    Contributed by Nobuyuki Hikichi(hikichi@sra.co.jp).
 
    This file is part of the GNU opcodes library.
@@ -1894,11 +1894,13 @@ print_mips16_insn_arg (struct disassemble_info *info,
                {
                  operand = ext_operand;
                  if (operand->size == 16)
-                   uval |= ((extend & 0x1f) << 11) | (extend & 0x7e0);
+                   uval = (((extend & 0x1f) << 11) | (extend & 0x7e0)
+                           | (uval & 0x1f));
                  else if (operand->size == 15)
                    uval |= ((extend & 0xf) << 11) | (extend & 0x7f0);
                  else
-                   uval = ((extend >> 6) & 0x1f) | (extend & 0x20);
+                   uval = ((((extend >> 6) & 0x1f) | (extend & 0x20))
+                           & ((1U << operand->size) - 1));
                }
            }
        }
@@ -2185,41 +2187,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
   else
     insn = bfd_getl16 (buffer);
 
-  if ((insn & 0xfc00) == 0x7c00)
-    {
-      /* This is a 48-bit microMIPS instruction.  */
-      higher = insn;
-
-      status = (*info->read_memory_func) (memaddr + 2, buffer, 2, info);
-      if (status != 0)
-       {
-         infprintf (is, "micromips 0x%x", higher);
-         (*info->memory_error_func) (status, memaddr + 2, info);
-         return -1;
-       }
-      if (info->endian == BFD_ENDIAN_BIG)
-       insn = bfd_getb16 (buffer);
-      else
-       insn = bfd_getl16 (buffer);
-      higher = (higher << 16) | insn;
-
-      status = (*info->read_memory_func) (memaddr + 4, buffer, 2, info);
-      if (status != 0)
-       {
-         infprintf (is, "micromips 0x%x", higher);
-         (*info->memory_error_func) (status, memaddr + 4, info);
-         return -1;
-       }
-      if (info->endian == BFD_ENDIAN_BIG)
-       insn = bfd_getb16 (buffer);
-      else
-       insn = bfd_getl16 (buffer);
-      infprintf (is, "0x%x%04x (48-bit insn)", higher, insn);
-
-      info->insn_type = dis_noninsn;
-      return 6;
-    }
-  else if ((insn & 0x1c00) == 0x0000 || (insn & 0x1000) == 0x1000)
+  if ((insn & 0x1c00) == 0x0000 || (insn & 0x1000) == 0x1000)
     {
       /* This is a 32-bit microMIPS instruction.  */
       higher = insn;