bfd
[deliverable/binutils-gdb.git] / opcodes / ia64-gen.c
index a68c54c1b6f4744495bb8984e499c9ac62002e30..eefa81c6ac25f6037b6927669850e45efced0cd3 100644 (file)
@@ -1,5 +1,5 @@
 /* ia64-gen.c -- Generate a shrunk set of opcode tables
-   Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007
+   Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Written by Bob Manson, Cygnus Solutions, <manson@cygnus.com>
 
@@ -694,11 +694,8 @@ load_insn_classes (void)
 
 /* Extract the insn classes from the given line.  */
 static void
-parse_resource_users (ref, usersp, nusersp, notesp)
-  const char *ref;
-  int **usersp;
-  int *nusersp;
-  int **notesp;
+parse_resource_users (const char *ref, int **usersp, int *nusersp,
+                      int **notesp)
 {
   int c;
   char *line = xstrdup (ref);
@@ -1296,6 +1293,8 @@ lookup_regindex (const char *name, int specifier)
         return 32;
       else if (strstr (name, "[ITC]"))
         return 44;
+      else if (strstr (name, "[RUC]"))
+        return 45;
       else if (strstr (name, "[PFS]"))
         return 64;
       else if (strstr (name, "[LC]"))
@@ -1435,6 +1434,8 @@ lookup_specifier (const char *name)
         return IA64_RS_ARb;
       if (strstr (name, "BR%") != NULL)
         return IA64_RS_BR;
+      if (strstr (name, "CR[IIB%]") != NULL)
+        return IA64_RS_CR_IIB;
       if (strstr (name, "CR[IRR%]") != NULL)
         return IA64_RS_CR_IRR;
       if (strstr (name, "CR[LRR%]") != NULL)
@@ -1500,7 +1501,7 @@ lookup_specifier (const char *name)
 }
 
 static void
-print_dependency_table ()
+print_dependency_table (void)
 {
   int i, j;
 
@@ -1722,11 +1723,8 @@ make_bittree_entry (void)
  
 \f
 static struct disent *
-add_dis_table_ent (which, insn, order, completer_index)
-     struct disent *which;
-     int insn;
-     int order;
-     int completer_index;
+add_dis_table_ent (struct disent *which, int insn, int order,
+                   int completer_index)
 {
   int ci = 0;
   struct disent *ent;
@@ -1763,7 +1761,7 @@ add_dis_table_ent (which, insn, order, completer_index)
 }
 \f
 static void
-finish_distable ()
+finish_distable (void)
 {
   struct disent *ent = disinsntable;
   struct disent *prev = ent;
@@ -1777,15 +1775,9 @@ finish_distable ()
 }
 \f
 static void
-insert_bit_table_ent (curr_ent, bit, opcode, mask, 
-                      opcodenum, order, completer_index)
-     struct bittree *curr_ent;
-     int bit;
-     ia64_insn opcode; 
-     ia64_insn mask;
-     int opcodenum;
-     int order;
-     int completer_index;
+insert_bit_table_ent (struct bittree *curr_ent, int bit, ia64_insn opcode,
+                      ia64_insn mask, int opcodenum, int order,
+                      int completer_index)
 {
   ia64_insn m;
   int b;
@@ -1818,13 +1810,8 @@ insert_bit_table_ent (curr_ent, bit, opcode, mask,
 }
 \f
 static void
-add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index)
-     struct bittree *first;
-     ia64_insn opcode;
-     ia64_insn mask;
-     int opcodenum;
-     struct completer_entry *ent;
-     int completer_index;
+add_dis_entry (struct bittree *first, ia64_insn opcode, ia64_insn mask,
+               int opcodenum, struct completer_entry *ent, int completer_index)
 {
   if (completer_index & (1 << 20))
     abort ();
@@ -1848,8 +1835,7 @@ add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index)
 \f
 /* This optimization pass combines multiple "don't care" nodes.  */
 static void
-compact_distree (ent)
-     struct bittree *ent;
+compact_distree (struct bittree *ent)
 {
 #define IS_SKIP(ent) \
     ((ent->bits[2] !=NULL) \
@@ -1900,8 +1886,7 @@ static int tot_insn_list_len = 0;
 /* Generate the disassembler state machine corresponding to the tree
    in ENT.  */
 static void
-gen_dis_table (ent)
-     struct bittree *ent;
+gen_dis_table (struct bittree *ent)
 {
   int x;
   int our_offset = insn_list_len;
@@ -2225,8 +2210,8 @@ static int glisttotlen = 0;
 /* If the completer trees ENT1 and ENT2 are equal, return 1.  */
 
 static int
-completer_entries_eq (ent1, ent2)
-     struct completer_entry *ent1, *ent2;
+completer_entries_eq (struct completer_entry *ent1,
+                      struct completer_entry *ent2)
 {
   while (ent1 != NULL && ent2 != NULL)
     {
@@ -2343,8 +2328,7 @@ insert_gclist (struct completer_entry *ent)
 }
 \f
 static int
-get_prefix_len (name)
-     const char *name;
+get_prefix_len (const char *name)
 {
   char *c;
 
@@ -2359,9 +2343,7 @@ get_prefix_len (name)
 }
 \f
 static void
-compute_completer_bits (ment, ent)
-     struct main_entry *ment;
-     struct completer_entry *ent;
+compute_completer_bits (struct main_entry *ment, struct completer_entry *ent)
 {
   while (ent != NULL)
     {
@@ -2434,9 +2416,8 @@ collapse_redundant_completers (void)
    2) all resources which must be marked in use when this opcode is used
    (regs).  */
 static int
-insert_opcode_dependencies (opc, cmp)
-     struct ia64_opcode *opc;
-     struct completer_entry *cmp ATTRIBUTE_UNUSED;
+insert_opcode_dependencies (struct ia64_opcode *opc,
+                            struct completer_entry *cmp ATTRIBUTE_UNUSED)
 {
   /* Note all resources which point to this opcode.  rfi has the most chks
      (79) and cmpxchng has the most regs (54) so 100 here should be enough.  */
@@ -2521,10 +2502,8 @@ insert_opcode_dependencies (opc, cmp)
 }
 \f
 static void
-insert_completer_entry (opc, tabent, order)
-     struct ia64_opcode *opc;
-     struct main_entry *tabent;
-     int order;
+insert_completer_entry (struct ia64_opcode *opc, struct main_entry *tabent,
+                        int order)
 {
   struct completer_entry **ptr = &tabent->completers;
   struct completer_entry *parent = NULL;
@@ -2595,8 +2574,7 @@ insert_completer_entry (opc, tabent, order)
 }
 \f
 static void
-print_completer_entry (ent)
-     struct completer_entry *ent;
+print_completer_entry (struct completer_entry *ent)
 {
   int moffset = 0;
   ia64_insn mask = ent->mask, bits = ent->bits;
@@ -2626,7 +2604,7 @@ print_completer_entry (ent)
 }
 \f
 static void
-print_completer_table ()
+print_completer_table (void)
 {
   int x;
 
@@ -2637,9 +2615,7 @@ print_completer_table ()
 }
 \f
 static int
-opcodes_eq (opc1, opc2)
-     struct ia64_opcode *opc1;
-     struct ia64_opcode *opc2;
+opcodes_eq (struct ia64_opcode *opc1, struct ia64_opcode *opc2)
 {
   int x;
   int plen1, plen2;
@@ -2663,8 +2639,7 @@ opcodes_eq (opc1, opc2)
 }
 \f
 static void
-add_opcode_entry (opc)
-     struct ia64_opcode *opc;
+add_opcode_entry (struct ia64_opcode *opc)
 {
   struct main_entry **place;
   struct string_entry *name;
@@ -2722,7 +2697,7 @@ static void
 print_main_table (void)
 {
   struct main_entry *ptr = maintable;
-  int index = 0;
+  int tindex = 0;
 
   printf ("static const struct ia64_main_table\nmain_table[] = {\n");
   while (ptr != NULL)
@@ -2743,7 +2718,7 @@ print_main_table (void)
              ptr->opcode->flags,
              ptr->completers->num);
 
-      ptr->main_index = index++;
+      ptr->main_index = tindex++;
 
       ptr = ptr->next;
     }
@@ -2751,8 +2726,7 @@ print_main_table (void)
 }
 \f
 static void
-shrink (table)
-     struct ia64_opcode *table;
+shrink (struct ia64_opcode *table)
 {
   int curr_opcode;
 
This page took 0.045656 seconds and 4 git commands to generate.