gas: run the hwcaps-bump tests with 64-bit sparc objects only.
[deliverable/binutils-gdb.git] / sim / igen / gen-itable.c
index dea71a2ca8a872a4f08893e880d0fa7c3c4eee0c..611b626558df70bd559fc1af8fbe3ee9069b7452 100644 (file)
@@ -1,6 +1,6 @@
 /* The IGEN simulator generator for GDB, the GNU Debugger.
 
 /* The IGEN simulator generator for GDB, the GNU Debugger.
 
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002-2016 Free Software Foundation, Inc.
 
    Contributed by Andrew Cagney.
 
 
    Contributed by Andrew Cagney.
 
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,9 +17,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
 
 
 
 
 
 
 
 
 
 
-typedef struct _itable_info {
+typedef struct _itable_info
+{
   int sizeof_form;
   int sizeof_name;
   int sizeof_file;
   int sizeof_form;
   int sizeof_name;
   int sizeof_file;
-} itable_info;
+}
+itable_info;
 
 
 static void
 itable_h_insn (lf *file,
 
 
 static void
 itable_h_insn (lf *file,
-              insn_table *entry,
-              insn_entry *instruction,
-              void *data)
+              insn_table *entry, insn_entry * instruction, void *data)
 {
   int len;
   itable_info *info = data;
 {
   int len;
   itable_info *info = data;
@@ -62,9 +60,7 @@ itable_h_insn (lf *file,
   print_function_name (file,
                       instruction->name,
                       instruction->format_name,
   print_function_name (file,
                       instruction->name,
                       instruction->format_name,
-                      NULL,
-                      NULL,
-                      function_name_prefix_itable);
+                      NULL, NULL, function_name_prefix_itable);
   lf_printf (file, ",\n");
   /* update summary info */
   len = strlen (instruction->format_name);
   lf_printf (file, ",\n");
   /* update summary info */
   len = strlen (instruction->format_name);
@@ -82,16 +78,13 @@ itable_h_insn (lf *file,
 /* print the list of all the different options */
 
 static void
 /* print the list of all the different options */
 
 static void
-itable_print_enum (lf *file,
-                  filter *set,
-                  char *name)
+itable_print_enum (lf *file, filter *set, char *name)
 {
   char *elem;
   lf_printf (file, "typedef enum {\n");
   lf_indent (file, +2);
   for (elem = filter_next (set, "");
 {
   char *elem;
   lf_printf (file, "typedef enum {\n");
   lf_indent (file, +2);
   for (elem = filter_next (set, "");
-       elem != NULL;
-       elem = filter_next (set, elem))
+       elem != NULL; elem = filter_next (set, elem))
     {
       lf_printf (file, "%sitable_%s_%s,\n",
                 options.module.itable.prefix.l, name, elem);
     {
       lf_printf (file, "%sitable_%s_%s,\n",
                 options.module.itable.prefix.l, name, elem);
@@ -102,8 +95,9 @@ itable_print_enum (lf *file,
                     name, elem, options.module.itable.prefix.l, name, elem);
        }
     }
                     name, elem, options.module.itable.prefix.l, name, elem);
        }
     }
-  lf_printf (file, "nr_%sitable_%ss,\n", options.module.itable.prefix.l, name);
-  
+  lf_printf (file, "nr_%sitable_%ss,\n", options.module.itable.prefix.l,
+            name);
+
   lf_indent (file, -2);
   lf_printf (file, "} %sitable_%ss;\n", options.module.itable.prefix.l, name);
   if (strlen (options.module.itable.prefix.l) > 0)
   lf_indent (file, -2);
   lf_printf (file, "} %sitable_%ss;\n", options.module.itable.prefix.l, name);
   if (strlen (options.module.itable.prefix.l) > 0)
@@ -120,9 +114,7 @@ itable_print_enum (lf *file,
 /* print an array of the option names as strings */
 
 static void
 /* print an array of the option names as strings */
 
 static void
-itable_print_names (lf *file,
-                   filter *set,
-                   char *name)
+itable_print_names (lf *file, filter *set, char *name)
 {
   char *elem;
   lf_printf (file, "const char *%sitable_%s_names[nr_%sitable_%ss + 1] = {\n",
 {
   char *elem;
   lf_printf (file, "const char *%sitable_%s_names[nr_%sitable_%ss + 1] = {\n",
@@ -130,8 +122,7 @@ itable_print_names (lf *file,
             options.module.itable.prefix.l, name);
   lf_indent (file, +2);
   for (elem = filter_next (set, "");
             options.module.itable.prefix.l, name);
   lf_indent (file, +2);
   for (elem = filter_next (set, "");
-       elem != NULL;
-       elem = filter_next (set, elem))
+       elem != NULL; elem = filter_next (set, elem))
     {
       lf_printf (file, "\"%s\",\n", elem);
     }
     {
       lf_printf (file, "\"%s\",\n", elem);
     }
@@ -140,16 +131,16 @@ itable_print_names (lf *file,
   lf_printf (file, "};\n");
 }
 
   lf_printf (file, "};\n");
 }
 
-extern void 
-gen_itable_h (lf *file,
-             insn_table *isa)
+extern void
+gen_itable_h (lf *file, insn_table *isa)
 {
   itable_info *info = ZALLOC (itable_info);
 
   /* output an enumerated type for each instruction */
   lf_printf (file, "typedef enum {\n");
   insn_table_traverse_insn (file, isa, itable_h_insn, info);
 {
   itable_info *info = ZALLOC (itable_info);
 
   /* output an enumerated type for each instruction */
   lf_printf (file, "typedef enum {\n");
   insn_table_traverse_insn (file, isa, itable_h_insn, info);
-  lf_printf (file, "  nr_%sitable_entries,\n", options.module.itable.prefix.l);
+  lf_printf (file, "  nr_%sitable_entries,\n",
+            options.module.itable.prefix.l);
   lf_printf (file, "} %sitable_index;\n", options.module.itable.prefix.l);
   lf_printf (file, "\n");
 
   lf_printf (file, "} %sitable_index;\n", options.module.itable.prefix.l);
   lf_printf (file, "\n");
 
@@ -158,7 +149,7 @@ gen_itable_h (lf *file,
   lf_printf (file, "extern const char *%sitable_flag_names[];\n",
             options.module.itable.prefix.l);
   lf_printf (file, "\n");
   lf_printf (file, "extern const char *%sitable_flag_names[];\n",
             options.module.itable.prefix.l);
   lf_printf (file, "\n");
-    
+
   /* output an enumeration of all the possible options */
   itable_print_enum (file, isa->options, "option");
   lf_printf (file, "extern const char *%sitable_option_names[];\n",
   /* output an enumeration of all the possible options */
   itable_print_enum (file, isa->options, "option");
   lf_printf (file, "extern const char *%sitable_option_names[];\n",
@@ -220,9 +211,7 @@ gen_itable_h (lf *file,
 /****************************************************************/
 
 static void
 /****************************************************************/
 
 static void
-itable_print_set (lf *file,
-                 filter *set,
-                 filter *members)
+itable_print_set (lf *file, filter *set, filter *members)
 {
   char *elem;
   lf_printf (file, "\"");
 {
   char *elem;
   lf_printf (file, "\"");
@@ -240,10 +229,9 @@ itable_print_set (lf *file,
     }
   lf_printf (file, "\",\n");
 
     }
   lf_printf (file, "\",\n");
 
-  lf_printf(file, "{");
+  lf_printf (file, "{");
   for (elem = filter_next (set, "");
   for (elem = filter_next (set, "");
-       elem != NULL;
-       elem = filter_next (set, elem))
+       elem != NULL; elem = filter_next (set, elem))
     {
       if (filter_is_member (members, elem))
        {
     {
       if (filter_is_member (members, elem))
        {
@@ -253,27 +241,23 @@ itable_print_set (lf *file,
        {
          lf_printf (file, " 0,");
        }
        {
          lf_printf (file, " 0,");
        }
-      
+
     }
   /* always print a dummy element, to avoid empty initializers. */
     }
   /* always print a dummy element, to avoid empty initializers. */
-  lf_printf(file, " 99 },\n");
+  lf_printf (file, " 99 },\n");
 }
 
 
 static void
 itable_c_insn (lf *file,
 }
 
 
 static void
 itable_c_insn (lf *file,
-              insn_table *isa,
-              insn_entry *instruction,
-              void *data)
+              insn_table *isa, insn_entry * instruction, void *data)
 {
   lf_printf (file, "{ ");
   lf_indent (file, +2);
   print_function_name (file,
                       instruction->name,
                       instruction->format_name,
 {
   lf_printf (file, "{ ");
   lf_indent (file, +2);
   print_function_name (file,
                       instruction->name,
                       instruction->format_name,
-                      NULL,
-                      NULL,
-                      function_name_prefix_itable);
+                      NULL, NULL, function_name_prefix_itable);
   lf_printf (file, ",\n");
   lf_printf (file, "\"");
   print_insn_words (file, instruction);
   lf_printf (file, ",\n");
   lf_printf (file, "\"");
   print_insn_words (file, instruction);
@@ -284,22 +268,22 @@ itable_c_insn (lf *file,
   itable_print_set (file, isa->options, instruction->options);
   itable_print_set (file, isa->model->processors, instruction->processors);
 
   itable_print_set (file, isa->options, instruction->options);
   itable_print_set (file, isa->model->processors, instruction->processors);
 
-  lf_printf(file, "\"%s\",\n", instruction->name);
-  lf_printf(file, "\"%s\",\n",
-           filter_filename (instruction->line->file_name));
-  lf_printf(file, "%d,\n", instruction->line->line_nr);
-  lf_printf(file, "},\n");
+  lf_printf (file, "\"%s\",\n", instruction->name);
+  lf_printf (file, "\"%s\",\n",
+            filter_filename (instruction->line->file_name));
+  lf_printf (file, "%d,\n", instruction->line->line_nr);
+  lf_printf (file, "},\n");
   lf_indent (file, -2);
 }
 
 
   lf_indent (file, -2);
 }
 
 
-extern void 
-gen_itable_c (lf *file,
-             insn_table *isa)
+extern void
+gen_itable_c (lf *file, insn_table *isa)
 {
   /* leader */
 {
   /* leader */
-  lf_printf(file, "#include \"%sitable.h\"\n", options.module.itable.prefix.l);
-  lf_printf(file, "\n");
+  lf_printf (file, "#include \"%sitable.h\"\n",
+            options.module.itable.prefix.l);
+  lf_printf (file, "\n");
 
   /* FIXME - output model data??? */
   /* FIXME - output assembler data??? */
 
   /* FIXME - output model data??? */
   /* FIXME - output assembler data??? */
@@ -312,9 +296,8 @@ gen_itable_c (lf *file,
   /* output the table that contains the actual instruction info */
   lf_printf (file, "%sitable_info %sitable[nr_%sitable_entries] = {\n",
             options.module.itable.prefix.l,
   /* output the table that contains the actual instruction info */
   lf_printf (file, "%sitable_info %sitable[nr_%sitable_entries] = {\n",
             options.module.itable.prefix.l,
-            options.module.itable.prefix.l,
-            options.module.itable.prefix.l);
+            options.module.itable.prefix.l, options.module.itable.prefix.l);
   insn_table_traverse_insn (file, isa, itable_c_insn, NULL);
 
   insn_table_traverse_insn (file, isa, itable_c_insn, NULL);
 
-  lf_printf(file, "};\n");
+  lf_printf (file, "};\n");
 }
 }
This page took 0.035347 seconds and 4 git commands to generate.