diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index 9a32832cc4..0f99f1823a 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,3 +1,27 @@ +Mon May 5 14:11:46 1997 Mike Meissner + + * 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 + + * 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 * gen-support.c (support_c_function): Remove unnecessary memset of diff --git a/sim/igen/gen-idecode.c b/sim/igen/gen-idecode.c index 8dfe14596b..96606fa5c1 100644 --- a/sim/igen/gen-idecode.c +++ b/sim/igen/gen-idecode.c @@ -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); diff --git a/sim/igen/gen-semantics.c b/sim/igen/gen-semantics.c index 57363c9651..0ffcf789e8 100644 --- a/sim/igen/gen-semantics.c +++ b/sim/igen/gen-semantics.c @@ -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,