diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-10-09 08:35:33 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-10-09 08:35:33 +0000 |
commit | 8782bfcfc466158aeb9433586b6d885641b507df (patch) | |
tree | 46f6641193765201492d953c76b439e8c475cb4a /sim/igen/igen.h | |
parent | 8d2e72a1c8919c8e54bfe4d5b508c382586ed4cd (diff) | |
download | gdb-8782bfcfc466158aeb9433586b6d885641b507df.zip gdb-8782bfcfc466158aeb9433586b6d885641b507df.tar.gz gdb-8782bfcfc466158aeb9433586b6d885641b507df.tar.bz2 |
Add -Wnodiscard option so that warning about discarded instructions
can be suppressed.
Allow ``<insn-spec> { <nmemonic> | <model> }'' in instruction file.
Diffstat (limited to 'sim/igen/igen.h')
-rw-r--r-- | sim/igen/igen.h | 217 |
1 files changed, 135 insertions, 82 deletions
diff --git a/sim/igen/igen.h b/sim/igen/igen.h index 3d894bf..188e3e4 100644 --- a/sim/igen/igen.h +++ b/sim/igen/igen.h @@ -18,127 +18,180 @@ */ - -/* What does the instruction look like - bit ordering, size, widths or offesets */ -extern int hi_bit_nr; -extern int insn_bit_size; -extern int insn_specifying_widths; - - -/* what should global names be prefixed with? */ -extern const char *global_name_prefix; -extern const char *global_uname_prefix; - - -/* generation options: */ - - -enum { - generate_with_direct_access = 0x1, - generate_with_icache = 0x2, - generate_with_semantic_icache = 0x4, - generate_with_insn_in_icache = 0x8, - - generate_with_semantic_returning_modified_nia_only = 0x010, - generate_with_semantic_conditional_issue = 0x020, - generate_with_idecode_slot_verification = 0x040, - generate_with_semantic_delayed_branch = 0x080, - generate_with_semantic_zero_r0 = 0x100 -}; - +/* code-generation options: */ typedef enum { /* Transfer control to an instructions semantic code using the the standard call/return mechanism */ - generate_calls = 0x1000, - + generate_calls, /* Transfer control to an instructions semantic code using (computed) goto's instead of the more conventional call/return mechanism */ - generate_jumps = 0x2000, - + generate_jumps, } igen_code; -extern int code; - - - +typedef enum { + nia_is_cia_plus_one, + nia_is_void, + nia_is_invalid, +} igen_nia; -extern int icache_size; -/* Instruction expansion? +typedef struct _igen_gen_options igen_gen_options; +struct _igen_gen_options { + int direct_access; + int semantic_icache; + int insn_in_icache; + int conditional_issue; + int slot_verification; + int delayed_branch; - Should the semantic code for each instruction, when the oportunity - arrises, be expanded according to the variable opcode files that - the instruction decode process renders constant */ + /* If zeroing a register, which one? */ + int zero_reg; + int zero_reg_nr; -extern int generate_expanded_instructions; + /* should multiple simulators be generated? */ + int multi_sim; + /* should the simulator support multi word instructions and if so, + what is the max nr of words. */ + int multi_word; -/* SMP? + /* SMP? Should the generated code include SMP support (>0) and if + so, for how many processors? */ + int smp; - Should the generated code include SMP support (>0) and if so, for - how many processors? */ + /* how should the next instruction address be computed? */ + igen_nia nia; -extern int generate_smp; + /* nr of instructions in the decoded instruction cache */ + int icache; + int icache_size; + /* see above */ + igen_code code; +}; +typedef struct _igen_trace_options igen_trace_options; +struct _igen_trace_options { + int rule_selection; + int rule_rejection; + int entries; + int combine; +}; -/* Misc junk */ +typedef struct _igen_prefix_name { + char *name; + char *uname; +} igen_prefix_name; + +typedef struct _igen_prefix_options { + igen_prefix_name global; + igen_prefix_name engine; + igen_prefix_name icache; + igen_prefix_name idecode; + igen_prefix_name itable; + igen_prefix_name semantics; + igen_prefix_name support; +} igen_prefix_options; + +typedef struct _igen_decode_options igen_decode_options ; +struct _igen_decode_options { + + /* Combine tables? Should the generator make a second pass through + each generated table looking for any sub-entries that contain the + same instructions. Those entries being merged into a single + table */ + int combine; + + /* Instruction expansion? Should the semantic code for each + instruction, when the oportunity arrises, be expanded according + to the variable opcode files that the instruction decode process + renders constant */ + int duplicate; + + /* Treat reserved fields as constant (zero) instead of ignoring + their value when determining decode tables */ + int zero_reserved; + + /* Convert any padded switch rules into goto_switch */ + int switch_as_goto; + + /* Force all tables to be generated with this lookup mechanism */ + char *overriding_gen; +}; +typedef struct _igen_warn_options igen_warn_options; +struct _igen_warn_options { + int discard; +}; -/* Function header definitions */ +typedef struct _igen_options igen_options; +struct _igen_options { -/* Cache functions: */ + /* What does the instruction look like - bit ordering, size, widths or + offesets */ + int hi_bit_nr; + int insn_bit_size; + int insn_specifying_widths; -extern int print_icache_function_formal -(lf *file); + /* what should global names be prefixed with? */ + igen_prefix_options prefix; -extern int print_icache_function_actual -(lf *file); + /* See above for options and flags */ + igen_gen_options gen; -extern int print_icache_function_type -(lf *file); + /* See above for trace options */ + igen_trace_options trace; -extern int print_semantic_function_formal -(lf *file); + /* See above for decode options */ + igen_decode_options decode; -extern int print_semantic_function_actual -(lf *file); + /* Filter set to be used on the flag field of the instruction table */ + filter *flags_filter; -extern int print_semantic_function_type -(lf *file); + /* See above for warn options */ + igen_warn_options warn; -extern void print_my_defines -(lf *file, - insn_bits *expanded_bits, - table_entry *file_entry); + /* Be more picky about the input */ + error_func (*warning); -extern void print_itrace -(lf *file, - table_entry *file_entry, - int idecode); + /* Model (processor) set - like flags_filter. Used to select the + specific ISA within a processor family. */ + filter *model_filter; + /* Format name set */ + filter *format_name_filter; +}; -typedef enum { - function_name_prefix_semantics, - function_name_prefix_idecode, - function_name_prefix_itable, - function_name_prefix_icache, - function_name_prefix_none -} lf_function_name_prefixes; - -extern int print_function_name -(lf *file, - const char *basename, - insn_bits *expanded_bits, - lf_function_name_prefixes prefix); +extern igen_options options; + +/* default options - hopefully backward compatible */ \ +#define INIT_OPTIONS(OPTIONS) \ +do { \ + memset (&(OPTIONS), 0, sizeof (OPTIONS)); \ + memset (&(OPTIONS).warn, -1, sizeof ((OPTIONS).warn)); \ + (OPTIONS).hi_bit_nr = 0; \ + (OPTIONS).insn_bit_size = default_insn_bit_size; \ + (OPTIONS).insn_specifying_widths = 0; \ + (OPTIONS).prefix.global.name = ""; \ + (OPTIONS).prefix.global.uname = ""; \ + (OPTIONS).prefix.engine = (OPTIONS).prefix.global; \ + (OPTIONS).prefix.icache = (OPTIONS).prefix.global; \ + (OPTIONS).prefix.idecode = (OPTIONS).prefix.global; \ + (OPTIONS).prefix.itable = (OPTIONS).prefix.global; \ + (OPTIONS).prefix.semantics = (OPTIONS).prefix.global; \ + (OPTIONS).prefix.support = (OPTIONS).prefix.global; \ + (OPTIONS).gen.code = generate_calls; \ + (OPTIONS).gen.icache_size = 1024; \ + (OPTIONS).warning = warning; \ +} while (0) |