Fix problems -Wall found
authorMichael Meissner <gnu@the-meissners.org>
Mon, 5 May 1997 18:16:10 +0000 (18:16 +0000)
committerMichael Meissner <gnu@the-meissners.org>
Mon, 5 May 1997 18:16:10 +0000 (18:16 +0000)
sim/igen/ChangeLog
sim/igen/gen-idecode.c
sim/igen/gen-semantics.c

index 9a32832..0f99f18 100644 (file)
@@ -1,3 +1,27 @@
+Mon May  5 14:11:46 1997  Mike Meissner  <meissner@cygnus.com>
+
+       * gen-engine.c (engine_switch_leaf): Remove extra %s.
+       (print_engine_floating_point_unavailable): Wrap in #ifdef
+       UNUSED/#endif, until somebody uses it.
+
+       * gen-idecode.c (error_leaf_contains_multiple_insn): Remove unused
+       variable.
+       (print_jump_until_stop_body): Wrap in #ifdef UNUSED/#endif, until
+       somebody uses it.
+       (print_idecode_validate): Use long formats to print long values.
+
+       * gen-semantics.c (print_idecode_invalid): Set name to "unknown"
+       if we get an unexpected type.
+
+Fri May  2 13:28:06 1997  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * igen.c (print_itrace): Pass SD as well as CPU to calls to
+       trace_printf.
+
+       * gen-support.c (gen_support_h): Always pass sim_cia cia to
+       support functions.
+       (print_support_function_name): Ditto.
+
 Wed Apr 30 17:35:51 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * gen-support.c (support_c_function): Remove unnecessary memset of
index 8dfe145..96606fa 100644 (file)
@@ -59,7 +59,6 @@ void
 error_leaf_contains_multiple_insn(insn_table *entry)
 {
   insn *i;
-  insn *first;
   ASSERT(entry->opcode == NULL && entry->nr_insn > 1);
   for (i = entry->insns; i != NULL; i = i->next) {
     fprintf(stderr, "%s:%d: %s %s\n",
@@ -732,7 +731,7 @@ print_idecode_issue_function_body(lf *file,
 {
   lf_printf(file, "{\n");
   lf_indent(file, +2);
-  lf_printf(file, "instruction_address nia;\n");
+  lf_printf(file, "%sinstruction_address nia;\n", global_name_prefix);
   if (!(code & generate_with_icache)) {
     print_idecode_body(file, table, "nia =");;
   }
@@ -978,7 +977,6 @@ print_jump_definition(insn_table *entry,
   }
 }
 
-
 static void
 print_jump_internal_function(insn_table *table,
                             lf *file,
@@ -1008,6 +1006,7 @@ print_jump_internal_function(insn_table *table,
   }
 }
 
+#ifdef UNUSED
 static void
 print_jump_until_stop_body(lf *file,
                           insn_table *table,
@@ -1103,7 +1102,7 @@ print_jump_until_stop_body(lf *file,
   lf_indent(file, -2);
   lf_printf(file, "}\n");
 }
-
+#endif
 
 /****************************************************************/
 
@@ -1165,14 +1164,14 @@ print_idecode_validate(lf *file,
                instruction->file_entry->fields[insn_format]);
       lf_printf(file, "if (WITH_RESERVED_BITS\n");
       if (insn_bit_size > 32) {
-       lf_printf(file, "    && (instruction & 0x%08x%08xLL) != 0x%08x%08xLL) {\n",
+       lf_printf(file, "    && (instruction & 0x%08lx%08lxLL) != 0x%08lx%08lxLL) {\n",
                  (unsigned long)(check_mask >> 32),
                  (unsigned long)(check_mask),
                  (unsigned long)(check_val >> 32),
                  (unsigned long)(check_val));
       }
       else {
-       lf_printf(file, "    && (instruction & 0x%08x) != 0x%08x) {\n",
+       lf_printf(file, "    && (instruction & 0x%08lx) != 0x%08lx) {\n",
                  (unsigned long)(check_mask),
                  (unsigned long)(check_val));
       }
@@ -1290,16 +1289,20 @@ gen_idecode_h (lf *file,
 {
   lf_printf(file, "typedef unsigned%d %sinstruction_word;\n",
            insn_bit_size, global_name_prefix);
+  
   if ((code & generate_with_semantic_delayed_branch))
     {
-      lf_printf (file, "typedef struct _instruction_address {\n");
+      lf_printf (file, "typedef struct _%sinstruction_address {\n",
+                global_name_prefix);
       lf_printf (file, "  address_word ip; /* instruction pointer */\n");
       lf_printf (file, "  address_word dp; /* delayed-slot pointer */\n");
-      lf_printf (file, "} instruction_address;\n");
+      lf_printf (file, "} %sinstruction_address;\n", global_name_prefix);
     }
   else
     {
-      lf_printf (file, "typedef address_word instruction_address;\n");
+      lf_printf (file, "typedef address_word %sinstruction_address;\n",
+                global_name_prefix);
+
     }
   lf_printf(file, "\n");
   print_icache_struct(table, cache_rules, file);
index 57363c9..0ffcf78 100644 (file)
@@ -98,6 +98,7 @@ print_idecode_invalid(lf *file,
 {
   const char *name;
   switch (type) {
+  default: name = "unknown"; break;
   case invalid_illegal: name = "illegal"; break;
   case invalid_fp_unavailable: name = "fp_unavailable"; break;
   case invalid_wrong_slot: name = "wrong_slot"; break;
@@ -155,7 +156,7 @@ print_semantic_body(lf *file,
     lf_printf(file, "nia = -1;\n");
   else if ((code & generate_with_semantic_delayed_branch)) {
     lf_printf(file, "nia.ip = cia.dp; /* instruction pointer */\n");
-    lf_printf(file, "nia.dp = cia.dp + %d; /* delayed-slot pointer\n",
+    lf_printf(file, "nia.dp = cia.dp + %d; /* delayed-slot pointer */\n",
              insn_bit_size / 8);
   }
   else
@@ -191,10 +192,14 @@ print_semantic_body(lf *file,
   else {
     /* abort so it is implemented now */
     table_entry_print_cpp_line_nr(file, instruction->file_entry);
-    lf_printf(file, "engine_error(system, \"%s:%d:0x%%08lx:%%s unimplemented\\n\",\n",
+    lf_printf(file, "engine_error (SD, CPU, cia, \"%s:%d:0x%%08lx:%%s unimplemented\\n\",\n",
              filter_filename(instruction->file_entry->file_name),
              instruction->file_entry->line_nr);
-    lf_printf(file, "             (long)cia, itable[MY_INDEX].name);\n");
+    if ((code & generate_with_semantic_delayed_branch))
+      lf_printf(file, "              (long)cia.ip,\n");
+    else
+      lf_printf(file, "              (long)cia,\n");
+    lf_printf(file, "              itable[MY_INDEX].name);\n");
     lf_print__internal_reference(file);
   }
 
@@ -230,7 +235,7 @@ print_c_semantic(lf *file,
                     ? get_values_from_icache
                     : do_not_use_icache));
 
-  lf_printf(file, "instruction_address nia;\n");
+  lf_printf(file, "%sinstruction_address nia;\n", global_name_prefix);
   print_semantic_body(file,
                      instruction,
                      expanded_bits,