From 13eaae2fd07512516eec601d4a3ab78bf9af34ec Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 14 Apr 1998 04:24:47 +0000 Subject: [PATCH] Broke parsing of !! when adding support for =. Fix. Add support for the -S option. --- sim/igen/ChangeLog | 7 +++++++ sim/igen/igen.c | 36 +++++++++++++++++++++++++++++------- sim/igen/ld-insn.c | 13 +++++++------ 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index 537c7864e7a..fae78c1b6d7 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,3 +1,10 @@ +Tue Apr 14 10:57:26 1998 Andrew Cagney + + * ld-insn.c (parse_insn_word): Treat `!' and `=' as valid + separator tokens when parsing a conditional. + + * igen.h (main): Add option -S so that suffix can be specified. + Tue Apr 14 08:44:53 1998 Andrew Cagney * igen.h (struct igen_trace_options): Add members insn_expansion diff --git a/sim/igen/igen.c b/sim/igen/igen.c index 4a95f2fbb63..8f10a39f8be 100644 --- a/sim/igen/igen.c +++ b/sim/igen/igen.c @@ -592,8 +592,6 @@ print_includes (lf *file) lf_printf (file, "\n"); lf_printf (file, "#include \"sim-inline.c\"\n"); lf_printf (file, "\n"); - lf_printf (file, "#include \"sim-main.h\"\n"); - lf_printf (file, "\n"); print_include_inline (file, options.module.itable); print_include_inline (file, options.module.idecode); print_include_inline (file, options.module.support); @@ -1061,7 +1059,11 @@ main (int argc, printf ("\n"); printf (" -P \n"); printf ("\t Prepend global names (except itable) with the string .\n"); - printf ("\t Specify -P = to set the prefix.\n"); + printf ("\t Specify -P = to set a specific 's prefix.\n"); + printf ("\n"); + printf (" -S \n"); + printf ("\t Replace a global name (suffix) (except itable) with the string .\n"); + printf ("\t Specify -S = to change a specific 's name (suffix).\n"); printf ("\n"); printf (" -Werror\n"); printf ("\t Make warnings errors\n"); @@ -1206,8 +1208,10 @@ main (int argc, break; case 'P': + case 'S': { igen_module *names; + igen_name *name; char *chp; chp = strchr (optarg, '='); if (chp == NULL) @@ -1252,15 +1256,24 @@ main (int argc, error (NULL, "Prefix `%s' unreconized\n", optarg); } } - names->prefix.u = strdup (chp); - names->prefix.l = strdup (chp); - chp = names->prefix.u; + switch (ch) + { + case 'P': + name = &names->prefix; + break; + case 'S': + name = &names->suffix; + break; + } + name->u = strdup (chp); + name->l = strdup (chp); + chp = name->u; while (*chp) { if (islower(*chp)) *chp = toupper(*chp); chp++; } - if (names == &options.module.global) + if (name == &options.module.global.prefix) { options.module.engine.prefix = options.module.global.prefix; options.module.icache.prefix = options.module.global.prefix; @@ -1269,6 +1282,15 @@ main (int argc, options.module.semantics.prefix = options.module.global.prefix; options.module.support.prefix = options.module.global.prefix; } + if (name == &options.module.global.suffix) + { + options.module.engine.suffix = options.module.global.suffix; + options.module.icache.suffix = options.module.global.suffix; + options.module.idecode.suffix = options.module.global.suffix; + /* options.module.itable.suffix = options.module.global.suffix; */ + options.module.semantics.suffix = options.module.global.suffix; + options.module.support.suffix = options.module.global.suffix; + } break; } diff --git a/sim/igen/ld-insn.c b/sim/igen/ld-insn.c index 2fc6cf3187f..7fc0e37f33c 100644 --- a/sim/igen/ld-insn.c +++ b/sim/igen/ld-insn.c @@ -125,7 +125,6 @@ parse_insn_word (line_ref *line, char *end; int len; insn_field_cond *new_cond = ZALLOC (insn_field_cond); - insn_field_cond **last; /* determine the conditional test */ switch (*chp) @@ -144,7 +143,7 @@ parse_insn_word (line_ref *line, chp++; chp = skip_spaces (chp); start = chp; - chp = skip_to_separator (chp, "+,:"); + chp = skip_to_separator (chp, "+,:!="); end = back_spaces (start, chp); len = end - start; if (len == 0) @@ -174,10 +173,12 @@ parse_insn_word (line_ref *line, error (line, "Only single conditional when `=' allowed\n"); /* insert it */ - last = &new_field->conditions; - while (*last != NULL) - last = &(*last)->next; - *last = new_cond; + { + insn_field_cond **last = &new_field->conditions; + while (*last != NULL) + last = &(*last)->next; + *last = new_cond; + } } /* NOW verify that the field was finished */ -- 2.30.2