2002-11-21 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Update copyright. IGEN contributed to the FSF.
* filter.c, filter.h, filter_host.c, filter_host.h: Ditto.
* gen-engine.c, gen-engine.h, gen-icache.c, gen-icache.h: Ditto.
* gen-idecode.c, gen-idecode.h, gen-itable.c: Ditto.
* gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h, gen.c: Ditto.
* gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:09:40 +00:00
|
|
|
/* The IGEN simulator generator for GDB, the GNU Debugger.
|
|
|
|
|
2009-01-14 10:53:10 +00:00
|
|
|
Copyright 2002, 2007, 2008, 2009 Free Software Foundation, Inc.
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Update copyright. IGEN contributed to the FSF.
* filter.c, filter.h, filter_host.c, filter_host.h: Ditto.
* gen-engine.c, gen-engine.h, gen-icache.c, gen-icache.h: Ditto.
* gen-idecode.c, gen-idecode.h, gen-itable.c: Ditto.
* gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h, gen.c: Ditto.
* gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:09:40 +00:00
|
|
|
|
|
|
|
Contributed by Andrew Cagney.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
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
|
2007-08-24 14:30:15 +00:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* Makefile.in: Update copyright. IGEN contributed to the FSF.
* filter.c, filter.h, filter_host.c, filter_host.h: Ditto.
* gen-engine.c, gen-engine.h, gen-icache.c, gen-icache.h: Ditto.
* gen-idecode.c, gen-idecode.h, gen-itable.c: Ditto.
* gen-itable.h, gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h, gen.c: Ditto.
* gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:09:40 +00:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-08-24 14:30:15 +00:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef unsigned64 insn_uint;
|
|
|
|
|
|
|
|
|
|
|
|
/* Common among most entries:
|
|
|
|
|
|
|
|
All non instruction records have the format:
|
|
|
|
|
|
|
|
<...> ::=
|
|
|
|
":" <record-name>
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
":" ...
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
record_type_field = 1,
|
|
|
|
old_record_type_field = 2,
|
|
|
|
record_filter_flags_field = 2,
|
|
|
|
record_filter_models_field = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Include:
|
|
|
|
|
|
|
|
Include the specified file.
|
|
|
|
|
|
|
|
<include> ::=
|
|
|
|
":" "include"
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
":" <filename>
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
include_filename_field = 4,
|
|
|
|
nr_include_fields,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Options:
|
|
|
|
|
|
|
|
Valid options are: hi-bit-nr (default 0), insn-bit-size (default
|
|
|
|
32), insn-specifying-widths (default true), multi-sim (default false).
|
|
|
|
|
|
|
|
<option> ::=
|
|
|
|
":" "option"
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
":" <option-name>
|
|
|
|
":" <option-value>
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
<option-name> ::=
|
|
|
|
"insn-bit-size"
|
|
|
|
| "insn-specifying-widths"
|
|
|
|
| "hi-bit-nr"
|
|
|
|
| "flags-filter"
|
|
|
|
| "model-filter"
|
|
|
|
| "multi-sim"
|
|
|
|
| "format-names"
|
|
|
|
;
|
|
|
|
|
|
|
|
<option-value> ::=
|
|
|
|
"true"
|
|
|
|
| "false"
|
|
|
|
| <integer>
|
|
|
|
| <list>
|
|
|
|
;
|
|
|
|
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
These update the global options structure. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
option_name_field = 4,
|
|
|
|
option_value_field,
|
|
|
|
nr_option_fields,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Macro definitions:
|
|
|
|
|
|
|
|
<insn-macro> ::=
|
|
|
|
":" "define"
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
":" <name>
|
|
|
|
":" <arg-list>
|
|
|
|
":" <expression>
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
<arg-list> ::=
|
|
|
|
[ <name> { "," <arg-list> } ]
|
|
|
|
;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
macro_name_field = 4,
|
|
|
|
macro_args_field,
|
|
|
|
macro_expr_field,
|
|
|
|
nr_macro_fields,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Functions and internal routins:
|
|
|
|
|
|
|
|
NB: <filter-models> and <function-models> are equivalent.
|
|
|
|
|
|
|
|
|
|
|
|
<function> ::=
|
|
|
|
":" "function"
|
|
|
|
<function-spec>
|
|
|
|
;
|
|
|
|
|
|
|
|
<internal> ::=
|
|
|
|
":" "internal"
|
|
|
|
<function-spec>
|
|
|
|
;
|
|
|
|
|
|
|
|
<format> ::=
|
|
|
|
":" ( "%s" | ... )
|
|
|
|
<function-spec>
|
|
|
|
;
|
|
|
|
|
|
|
|
<function-model> ::=
|
|
|
|
"*" [ <processor-list> ]
|
|
|
|
":"
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
<function-spec> ::=
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
":" <typedef>
|
|
|
|
":" <name>
|
|
|
|
[ ":" <parameter-list> ]
|
|
|
|
<nl>
|
|
|
|
[ <function-model> ]
|
|
|
|
<code-block>
|
|
|
|
;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
function_typedef_field = 4,
|
|
|
|
function_name_field,
|
|
|
|
function_param_field,
|
|
|
|
nr_function_fields,
|
|
|
|
};
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
function_model_name_field = 0,
|
|
|
|
nr_function_model_fields = 1,
|
|
|
|
};
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
old_function_typedef_field = 0,
|
|
|
|
old_function_type_field = 2,
|
|
|
|
old_function_name_field = 4,
|
|
|
|
old_function_param_field = 5,
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
nr_old_function_fields = 5, /* parameter-list is optional */
|
1999-04-16 01:35:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _function_entry function_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _function_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
line_ref *line;
|
|
|
|
filter *flags;
|
|
|
|
filter *models;
|
|
|
|
char *type;
|
|
|
|
char *name;
|
|
|
|
char *param;
|
|
|
|
table_entry *code;
|
|
|
|
int is_internal;
|
|
|
|
function_entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef void function_entry_handler
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
(lf *file, function_entry * function, void *data);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
extern void function_entry_traverse
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
(lf *file,
|
|
|
|
function_entry * functions, function_entry_handler * handler, void *data);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* cache-macro:
|
|
|
|
|
|
|
|
<cache-macro> ::=
|
|
|
|
":" <macro-type>
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
":" <typedef>
|
|
|
|
":" <name>
|
|
|
|
":" <field-name> { "," <field-name> }
|
|
|
|
":" <expression>
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
<cache-macro-type> ::=
|
|
|
|
"scratch"
|
|
|
|
| "cache"
|
|
|
|
| "compute"
|
|
|
|
;
|
|
|
|
|
|
|
|
<name> ::=
|
|
|
|
<ident>
|
|
|
|
| <ident> "_is_" <integer>
|
|
|
|
;
|
|
|
|
|
|
|
|
A cache entry is defined (for an instruction) when all
|
|
|
|
<field-name>s are present as named opcode fields within the
|
|
|
|
instructions format.
|
|
|
|
|
|
|
|
SCRATCH and CACHE macros are defined during the cache fill stage
|
|
|
|
while CACHE and COMPUTE macros are defined during the instruction
|
|
|
|
execution stage.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
cache_typedef_field = 4,
|
|
|
|
cache_name_field,
|
|
|
|
cache_original_fields_field,
|
|
|
|
cache_expression_field,
|
|
|
|
nr_cache_fields,
|
|
|
|
};
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
scratch_value,
|
|
|
|
cache_value,
|
|
|
|
compute_value,
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
}
|
|
|
|
cache_entry_type;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
typedef struct _cache_entry cache_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _cache_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
line_ref *line;
|
|
|
|
filter *flags;
|
|
|
|
filter *models;
|
|
|
|
cache_entry_type entry_type;
|
|
|
|
char *name;
|
|
|
|
filter *original_fields;
|
|
|
|
char *type;
|
|
|
|
char *expression;
|
|
|
|
cache_entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Model specs:
|
|
|
|
|
|
|
|
<model-processor> ::=
|
|
|
|
":" "model"
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
":" <processor>
|
|
|
|
":" <BFD-processor>
|
|
|
|
":" <function-unit-data>
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
<model-macro> ::=
|
|
|
|
":" "model-macro"
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
<nl>
|
|
|
|
<code-block>
|
|
|
|
;
|
|
|
|
|
|
|
|
<model-data> ::=
|
|
|
|
":" "model-data"
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <filter-models>
|
|
|
|
<nl>
|
|
|
|
<code-block>
|
|
|
|
;
|
|
|
|
|
|
|
|
<model-static> ::=
|
|
|
|
":" "model-static"
|
|
|
|
<function-spec>
|
|
|
|
;
|
|
|
|
|
|
|
|
<model-internal> ::=
|
|
|
|
":" "model-internal"
|
|
|
|
<function-spec>
|
|
|
|
;
|
|
|
|
|
|
|
|
<model-function> ::=
|
|
|
|
":" "model-internal"
|
|
|
|
<function-spec>
|
|
|
|
;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
nr_model_macro_fields = 4,
|
|
|
|
nr_model_data_fields = 4,
|
|
|
|
nr_model_static_fields = nr_function_fields,
|
|
|
|
nr_model_internal_fields = nr_function_fields,
|
|
|
|
nr_model_function_fields = nr_function_fields,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _model_data model_data;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _model_data
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
line_ref *line;
|
|
|
|
filter *flags;
|
|
|
|
table_entry *entry;
|
|
|
|
table_entry *code;
|
|
|
|
model_data *next;
|
|
|
|
};
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
model_name_field = 4,
|
|
|
|
model_full_name_field,
|
|
|
|
model_unit_data_field,
|
|
|
|
nr_model_processor_fields,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _model_entry model_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _model_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
line_ref *line;
|
|
|
|
filter *flags;
|
|
|
|
char *name;
|
|
|
|
char *full_name;
|
|
|
|
char *unit_data;
|
|
|
|
model_entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _model_table model_table;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _model_table
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
filter *processors;
|
|
|
|
int nr_models;
|
|
|
|
model_entry *models;
|
|
|
|
model_data *macros;
|
|
|
|
model_data *data;
|
|
|
|
function_entry *statics;
|
|
|
|
function_entry *internals;
|
|
|
|
function_entry *functions;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Instruction format:
|
|
|
|
|
|
|
|
An instruction is composed of a sequence of N bit instruction
|
|
|
|
words. Each word broken into a number of instruction fields.
|
|
|
|
Those fields being constant (ex. an opcode) or variable (register
|
|
|
|
spec).
|
|
|
|
|
|
|
|
<insn-word> ::=
|
|
|
|
<insn-field> { "," <insn-field> } ;
|
|
|
|
|
|
|
|
<insn-field> ::=
|
|
|
|
( <binary-value-implying-width>
|
|
|
|
| <field-name-implying-width>
|
|
|
|
| [ <start-or-width> "." ] <field>
|
|
|
|
)
|
|
|
|
{ [ "!" | "=" ] [ <value> | <field-name> ] }
|
|
|
|
;
|
|
|
|
|
|
|
|
<field> ::=
|
|
|
|
{ "*" }+
|
|
|
|
| { "/" }+
|
|
|
|
| <field-name>
|
|
|
|
| "0x" <hex-value>
|
|
|
|
| "0b" <binary-value>
|
|
|
|
| "0" <octal-value>
|
|
|
|
| <integer-value> ;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
typedef enum _insn_field_cond_type
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
insn_field_cond_value,
|
|
|
|
insn_field_cond_field,
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
}
|
|
|
|
insn_field_cond_type;
|
|
|
|
typedef enum _insn_field_cond_test
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
insn_field_cond_eq,
|
|
|
|
insn_field_cond_ne,
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
}
|
|
|
|
insn_field_cond_test;
|
1999-04-16 01:35:26 +00:00
|
|
|
typedef struct _insn_field_cond insn_field_cond;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_field_cond
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
insn_field_cond_type type;
|
|
|
|
insn_field_cond_test test;
|
|
|
|
insn_uint value;
|
|
|
|
struct _insn_field_entry *field;
|
|
|
|
char *string;
|
|
|
|
insn_field_cond *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
typedef enum _insn_field_type
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
insn_field_invalid,
|
|
|
|
insn_field_int,
|
|
|
|
insn_field_reserved,
|
|
|
|
insn_field_wild,
|
|
|
|
insn_field_string,
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
}
|
|
|
|
insn_field_type;
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
typedef struct _insn_field_entry insn_field_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_field_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
int first;
|
|
|
|
int last;
|
|
|
|
int width;
|
|
|
|
int word_nr;
|
|
|
|
insn_field_type type;
|
|
|
|
insn_uint val_int;
|
|
|
|
char *pos_string;
|
|
|
|
char *val_string;
|
|
|
|
insn_field_cond *conditions;
|
|
|
|
insn_field_entry *next;
|
|
|
|
insn_field_entry *prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _insn_bit_entry insn_bit_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_bit_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
int value;
|
|
|
|
int mask;
|
|
|
|
insn_field_entry *field;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
typedef struct _insn_entry insn_entry; /* forward */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
typedef struct _insn_word_entry insn_word_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_word_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
/* list of sub-fields making up the instruction. bit provides
|
|
|
|
faster access to the field data for bit N. */
|
|
|
|
insn_field_entry *first;
|
|
|
|
insn_field_entry *last;
|
|
|
|
insn_bit_entry *bit[max_insn_bit_size];
|
|
|
|
/* set of all the string fields */
|
|
|
|
filter *field_names;
|
|
|
|
/* For multi-word instructions, The Nth word (from zero). */
|
|
|
|
insn_word_entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Instruction model:
|
|
|
|
|
|
|
|
Provides scheduling and other data for the code modeling the
|
|
|
|
instruction unit.
|
|
|
|
|
|
|
|
<insn-model> ::=
|
|
|
|
"*" [ <processor-list> ]
|
|
|
|
":" [ <function-unit-data> ]
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
<processor-list> ::=
|
|
|
|
<processor> { "," <processor>" }
|
|
|
|
;
|
|
|
|
|
|
|
|
If the <processor-list> is empty, the model is made the default for
|
|
|
|
this instruction.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
insn_model_name_field = 0,
|
|
|
|
insn_model_unit_data_field = 1,
|
|
|
|
nr_insn_model_fields = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _insn_model_entry insn_model_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_model_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
line_ref *line;
|
|
|
|
insn_entry *insn;
|
|
|
|
filter *names;
|
|
|
|
char *full_name;
|
|
|
|
char *unit_data;
|
|
|
|
insn_model_entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Instruction mnemonic:
|
|
|
|
|
|
|
|
List of assembler mnemonics for the instruction.
|
|
|
|
|
|
|
|
<insn-mnenonic> ::=
|
|
|
|
"\"" <assembler-mnemonic> "\""
|
|
|
|
[ ":" <conditional-expression> ]
|
|
|
|
<nl>
|
|
|
|
;
|
|
|
|
|
|
|
|
An assembler mnemonic string has the syntax:
|
|
|
|
|
|
|
|
<assembler-mnemonic> ::=
|
|
|
|
( [ "%" <format-spec> ] "<" <func> [ "#" <param-list> ] ">"
|
|
|
|
| "%%"
|
|
|
|
| <other-letter>
|
|
|
|
)+
|
|
|
|
|
|
|
|
Where, for instance, the text is translated into a printf format
|
|
|
|
and argument pair:
|
|
|
|
|
|
|
|
"<FUNC>" : "%ld", (long) FUNC
|
|
|
|
"%<FUNC>..." : "%...", FUNC
|
|
|
|
"%s<FUNC>" : "%s", <%s>FUNC (SD_, FUNC)
|
|
|
|
"%s<FUNC#P1,P2>" : "%s", <%s>FUNC (SD_, P1,P2)
|
|
|
|
"%lx<FUNC>" : "%lx", (unsigned long) FUNC
|
|
|
|
"%08lx<FUNC>" : "%08lx", (unsigned long) FUNC
|
|
|
|
|
|
|
|
And "<%s>FUNC" denotes a function declared using the "%s" record
|
|
|
|
specifier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
insn_mnemonic_format_field = 0,
|
|
|
|
insn_mnemonic_condition_field = 1,
|
|
|
|
nr_insn_mnemonic_fields = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _insn_mnemonic_entry insn_mnemonic_entry;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_mnemonic_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
line_ref *line;
|
|
|
|
insn_entry *insn;
|
|
|
|
char *format;
|
|
|
|
char *condition;
|
|
|
|
insn_mnemonic_entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Instruction:
|
|
|
|
|
|
|
|
<insn> ::=
|
|
|
|
<insn-word> { "+" <insn-word> }
|
|
|
|
":" <format-name>
|
|
|
|
":" <filter-flags>
|
|
|
|
":" <options>
|
|
|
|
":" <name>
|
|
|
|
<nl>
|
|
|
|
{ <insn-model> }
|
|
|
|
{ <insn-mnemonic> }
|
|
|
|
<code-block>
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
enum
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
insn_word_field = 0,
|
|
|
|
insn_format_name_field = 1,
|
|
|
|
insn_filter_flags_field = 2,
|
|
|
|
insn_options_field = 3,
|
|
|
|
insn_name_field = 4,
|
|
|
|
nr_insn_fields = 5,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* typedef struct _insn_entry insn_entry; */
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_entry
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
line_ref *line;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
filter *flags; /* filtered by options.filters */
|
1999-04-16 01:35:26 +00:00
|
|
|
char *format_name;
|
|
|
|
filter *options;
|
|
|
|
char *name;
|
|
|
|
/* the words that make up the instruction. Word provides direct
|
|
|
|
access to word N. Pseudo instructions can be identified by
|
|
|
|
nr_words == 0. */
|
|
|
|
int nr_words;
|
|
|
|
insn_word_entry *words;
|
|
|
|
insn_word_entry **word;
|
|
|
|
/* a set of all the fields from all the words */
|
|
|
|
filter *field_names;
|
|
|
|
/* an array of processor models, missing models are NULL! */
|
|
|
|
int nr_models;
|
|
|
|
insn_model_entry *models;
|
|
|
|
insn_model_entry **model;
|
|
|
|
filter *processors;
|
|
|
|
/* list of assember formats */
|
|
|
|
int nr_mnemonics;
|
|
|
|
insn_mnemonic_entry *mnemonics;
|
|
|
|
/* code body */
|
|
|
|
table_entry *code;
|
|
|
|
insn_entry *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Instruction table:
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _insn_table insn_table;
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
struct _insn_table
|
|
|
|
{
|
1999-04-16 01:35:26 +00:00
|
|
|
cache_entry *caches;
|
|
|
|
int max_nr_words;
|
|
|
|
int nr_insns;
|
|
|
|
insn_entry *insns;
|
|
|
|
function_entry *functions;
|
|
|
|
insn_entry *illegal_insn;
|
|
|
|
model_table *model;
|
|
|
|
filter *options;
|
|
|
|
filter *flags;
|
|
|
|
};
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
extern insn_table *load_insn_table (char *file_name, cache_entry *cache);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
typedef void insn_entry_handler
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
(lf *file, insn_table *isa, insn_entry * insn, void *data);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
extern void insn_table_traverse_insn
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
(lf *file, insn_table *isa, insn_entry_handler * handler, void *data);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Printing */
|
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
extern void print_insn_words (lf *file, insn_entry * insn);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Debugging */
|
|
|
|
|
|
|
|
void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
dump_insn_field
|
|
|
|
(lf *file, char *prefix, insn_field_entry *field, char *suffix);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
dump_insn_word_entry
|
|
|
|
(lf *file, char *prefix, insn_word_entry *word, char *suffix);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
dump_insn_entry (lf *file, char *prefix, insn_entry * insn, char *suffix);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
void
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
dump_cache_entries
|
|
|
|
(lf *file, char *prefix, cache_entry *entry, char *suffix);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2002-11-21 Andrew Cagney <ac131313@redhat.com>
* filter.c: Re-indent.
* filter.h, filter_host.h, gen-engine.c, gen-engine.h: Ditto.
* gen-icache.c, gen-icache.h, gen-idecode.c: Ditto.
* gen-idecode.h, gen-itable.c, gen-itable.h: Ditto.
* gen-model.c, gen-model.h, gen-semantics.c: Ditto.
* gen-semantics.h, gen-support.c, gen-support.h: Ditto.
* gen.c, gen.h, igen.c, igen.h, ld-cache.c, ld-cache.h: Ditto.
* ld-decode.c, ld-decode.h, ld-insn.c, ld-insn.h, lf.c: Ditto.
* lf.h, misc.c, misc.h, table.c, table.h: Ditto.
2002-11-22 04:20:49 +00:00
|
|
|
void dump_insn_table (lf *file, char *prefix, insn_table *isa, char *suffix);
|