* doc/c-xtensa.texi (Literal Directive): Spelling correction.
[deliverable/binutils-gdb.git] / opcodes / mips-dis.c
index 20d95ab89d5d8005e3f8343df02396c87b107343..281c8cf707f627303d505dac04994c29a15d4034 100644 (file)
@@ -1,6 +1,6 @@
 /* Print mips instructions for GDB, the GNU debugger, or for objdump.
    Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2005
    Free Software Foundation, Inc.
    Contributed by Nobuyuki Hikichi(hikichi@sra.co.jp).
 
@@ -347,6 +347,10 @@ const struct mips_arch_choice mips_arch_choices[] = {
     mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
   { "r6000",   1, bfd_mach_mips6000, CPU_R6000, ISA_MIPS2,
     mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
+  { "rm7000",  1, bfd_mach_mips7000, CPU_RM7000, ISA_MIPS4,
+    mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
+  { "rm9000",  1, bfd_mach_mips7000, CPU_RM7000, ISA_MIPS4,
+    mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
   { "r8000",   1, bfd_mach_mips8000, CPU_R8000, ISA_MIPS4,
     mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric },
   { "r10000",  1, bfd_mach_mips10000, CPU_R10000, ISA_MIPS4,
@@ -380,6 +384,12 @@ const struct mips_arch_choice mips_arch_choices[] = {
     mips_cp0sel_names_mips3264, ARRAY_SIZE (mips_cp0sel_names_mips3264),
     mips_hwr_names_numeric },
 
+  { "mips64r2",        1, bfd_mach_mipsisa64r2, CPU_MIPS64R2,
+    ISA_MIPS64R2 | INSN_MIPS16 | INSN_MIPS3D | INSN_MDMX,
+    mips_cp0_names_mips3264r2,
+    mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
+    mips_hwr_names_mips3264r2 },
+
   { "sb1",     1, bfd_mach_mips_sb1, CPU_SB1,
     ISA_MIPS64 | INSN_MIPS3D | INSN_SB1,
     mips_cp0_names_sb1,
@@ -404,6 +414,9 @@ static const struct mips_cp0sel_name *mips_cp0sel_names;
 static int mips_cp0sel_names_len;
 static const char * const *mips_hwr_names;
 
+/* Other options */
+static int no_aliases; /* If set disassemble as most general inst. */
+
 static const struct mips_abi_choice *choose_abi_by_name
   PARAMS ((const char *, unsigned int));
 static const struct mips_arch_choice *choose_arch_by_name
@@ -493,6 +506,7 @@ set_default_mips_dis_options (info)
   mips_cp0sel_names = NULL;
   mips_cp0sel_names_len = 0;
   mips_hwr_names = mips_hwr_names_numeric;
+  no_aliases = 0;
 
   /* If an ELF "newabi" binary, use the n32/(n)64 GPR names.  */
   if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
@@ -534,6 +548,13 @@ parse_mips_dis_option (option, len)
   const struct mips_abi_choice *chosen_abi;
   const struct mips_arch_choice *chosen_arch;
 
+  /* Try to match options that are simple flags */
+  if (strncmp (option, "no-aliases", 10) == 0)
+    {
+      no_aliases = 1;
+      return;
+    }
+  
   /* Look for the = that delimits the end of the option name.  */
   for (i = 0; i < len; i++)
     {
@@ -710,6 +731,7 @@ print_insn_args (d, l, pc, info)
              break;
 
            case 'C':
+           case 'H':
              msbd = (l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD;
              (*info->fprintf_func) (info->stream, "0x%x", msbd + 1);
              break;
@@ -736,6 +758,21 @@ print_insn_args (d, l, pc, info)
                break;
              }
 
+           case 'E':
+             lsb = ((l >> OP_SH_SHAMT) & OP_MASK_SHAMT) + 32;
+             (*info->fprintf_func) (info->stream, "0x%x", lsb);
+             break;
+       
+           case 'F':
+             msb = ((l >> OP_SH_INSMSB) & OP_MASK_INSMSB) + 32;
+             (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1);
+             break;
+
+           case 'G':
+             msbd = ((l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD) + 32;
+             (*info->fprintf_func) (info->stream, "0x%x", msbd + 1);
+             break;
+
            default:
              /* xgettext:c-format */
              (*info->fprintf_func) (info->stream,
@@ -1045,7 +1082,8 @@ print_insn_mips (memaddr, word, info)
        {
          for (op = mips_opcodes; op < &mips_opcodes[NUMOPCODES]; op++)
            {
-             if (op->pinfo == INSN_MACRO)
+             if (op->pinfo == INSN_MACRO
+                 || (no_aliases && (op->pinfo2 & INSN2_ALIAS)))
                continue;
              if (i == ((op->match >> OP_SH_OP) & OP_MASK_OP))
                {
@@ -1072,7 +1110,9 @@ print_insn_mips (memaddr, word, info)
     {
       for (; op < &mips_opcodes[NUMOPCODES]; op++)
        {
-         if (op->pinfo != INSN_MACRO && (word & op->mask) == op->match)
+         if (op->pinfo != INSN_MACRO 
+             && !(no_aliases && (op->pinfo2 & INSN2_ALIAS))
+             && (word & op->mask) == op->match)
            {
              register const char *d;
 
@@ -1270,7 +1310,9 @@ print_insn_mips16 (memaddr, info)
   opend = mips16_opcodes + bfd_mips16_num_opcodes;
   for (op = mips16_opcodes; op < opend; op++)
     {
-      if (op->pinfo != INSN_MACRO && (insn & op->mask) == op->match)
+      if (op->pinfo != INSN_MACRO
+         && !(no_aliases && (op->pinfo2 & INSN2_ALIAS))
+         && (insn & op->mask) == op->match)
        {
          const char *s;
 
This page took 0.025113 seconds and 4 git commands to generate.