Convert cgen to C-90
This commit is contained in:
parent
5c65fa0200
commit
a5ccdcb4df
|
@ -1,3 +1,13 @@
|
||||||
|
2003-08-07 Michael Meissner <gnu@the-meissners.org>
|
||||||
|
|
||||||
|
* cgen.h: Remove PARAM macro usage in all prototypes.
|
||||||
|
(CGEN_EXTRACT_INFO): Use void * instead of PTR.
|
||||||
|
(cgen_print_fn): Ditto.
|
||||||
|
(CGEN_HW_ENTRY): Ditto.
|
||||||
|
(CGEN_MAYBE_MULTI_IFLD): Ditto.
|
||||||
|
(struct cgen_insn): Ditto.
|
||||||
|
(CGEN_CPU_TABLE): Ditto.
|
||||||
|
|
||||||
2003-08-07 Alan Modra <amodra@bigpond.net.au>
|
2003-08-07 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* alpha.h: Remove PARAMS macro.
|
* alpha.h: Remove PARAMS macro.
|
||||||
|
|
|
@ -242,9 +242,9 @@ typedef struct cgen_fields CGEN_FIELDS;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* A pointer to the disassemble_info struct.
|
/* A pointer to the disassemble_info struct.
|
||||||
We don't require dis-asm.h so we use PTR for the type here.
|
We don't require dis-asm.h so we use void * for the type here.
|
||||||
If NULL, BYTES is full of valid data (VALID == -1). */
|
If NULL, BYTES is full of valid data (VALID == -1). */
|
||||||
PTR dis_info;
|
void *dis_info;
|
||||||
/* Points to a working buffer of sufficient size. */
|
/* Points to a working buffer of sufficient size. */
|
||||||
unsigned char *insn_bytes;
|
unsigned char *insn_bytes;
|
||||||
/* Mask of bytes that are valid in INSN_BYTES. */
|
/* Mask of bytes that are valid in INSN_BYTES. */
|
||||||
|
@ -265,8 +265,8 @@ typedef struct {
|
||||||
If not it is left alone.
|
If not it is left alone.
|
||||||
The result is NULL if success or an error message. */
|
The result is NULL if success or an error message. */
|
||||||
typedef const char * (cgen_parse_fn)
|
typedef const char * (cgen_parse_fn)
|
||||||
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
(CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
||||||
const char **strp_, CGEN_FIELDS *fields_));
|
const char **strp_, CGEN_FIELDS *fields_);
|
||||||
|
|
||||||
/* Insert handler.
|
/* Insert handler.
|
||||||
CD is a cpu table descriptor.
|
CD is a cpu table descriptor.
|
||||||
|
@ -279,9 +279,9 @@ typedef const char * (cgen_parse_fn)
|
||||||
|
|
||||||
#ifdef __BFD_H_SEEN__
|
#ifdef __BFD_H_SEEN__
|
||||||
typedef const char * (cgen_insert_fn)
|
typedef const char * (cgen_insert_fn)
|
||||||
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
(CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
||||||
CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
|
CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
|
||||||
bfd_vma pc_));
|
bfd_vma pc_);
|
||||||
#else
|
#else
|
||||||
typedef const char * (cgen_insert_fn) ();
|
typedef const char * (cgen_insert_fn) ();
|
||||||
#endif
|
#endif
|
||||||
|
@ -300,9 +300,9 @@ typedef const char * (cgen_insert_fn) ();
|
||||||
|
|
||||||
#ifdef __BFD_H_SEEN__
|
#ifdef __BFD_H_SEEN__
|
||||||
typedef int (cgen_extract_fn)
|
typedef int (cgen_extract_fn)
|
||||||
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
(CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
||||||
CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
|
CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
|
||||||
CGEN_FIELDS *fields_, bfd_vma pc_));
|
CGEN_FIELDS *fields_, bfd_vma pc_);
|
||||||
#else
|
#else
|
||||||
typedef int (cgen_extract_fn) ();
|
typedef int (cgen_extract_fn) ();
|
||||||
#endif
|
#endif
|
||||||
|
@ -319,8 +319,8 @@ typedef int (cgen_extract_fn) ();
|
||||||
|
|
||||||
#ifdef __BFD_H_SEEN__
|
#ifdef __BFD_H_SEEN__
|
||||||
typedef void (cgen_print_fn)
|
typedef void (cgen_print_fn)
|
||||||
PARAMS ((CGEN_CPU_DESC, PTR info_, const CGEN_INSN *insn_,
|
(CGEN_CPU_DESC, void * info_, const CGEN_INSN *insn_,
|
||||||
CGEN_FIELDS *fields_, bfd_vma pc_, int len_));
|
CGEN_FIELDS *fields_, bfd_vma pc_, int len_);
|
||||||
#else
|
#else
|
||||||
typedef void (cgen_print_fn) ();
|
typedef void (cgen_print_fn) ();
|
||||||
#endif
|
#endif
|
||||||
|
@ -384,9 +384,9 @@ enum cgen_parse_operand_result
|
||||||
|
|
||||||
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
|
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
|
||||||
typedef const char * (cgen_parse_operand_fn)
|
typedef const char * (cgen_parse_operand_fn)
|
||||||
PARAMS ((CGEN_CPU_DESC,
|
(CGEN_CPU_DESC,
|
||||||
enum cgen_parse_operand_type, const char **, int, int,
|
enum cgen_parse_operand_type, const char **, int, int,
|
||||||
enum cgen_parse_operand_result *, bfd_vma *));
|
enum cgen_parse_operand_result *, bfd_vma *);
|
||||||
#else
|
#else
|
||||||
typedef const char * (cgen_parse_operand_fn) ();
|
typedef const char * (cgen_parse_operand_fn) ();
|
||||||
#endif
|
#endif
|
||||||
|
@ -394,11 +394,11 @@ typedef const char * (cgen_parse_operand_fn) ();
|
||||||
/* Set the cgen_parse_operand_fn callback. */
|
/* Set the cgen_parse_operand_fn callback. */
|
||||||
|
|
||||||
extern void cgen_set_parse_operand_fn
|
extern void cgen_set_parse_operand_fn
|
||||||
PARAMS ((CGEN_CPU_DESC, cgen_parse_operand_fn));
|
(CGEN_CPU_DESC, cgen_parse_operand_fn);
|
||||||
|
|
||||||
/* Called before trying to match a table entry with the insn. */
|
/* Called before trying to match a table entry with the insn. */
|
||||||
|
|
||||||
extern void cgen_init_parse_operand PARAMS ((CGEN_CPU_DESC));
|
extern void cgen_init_parse_operand (CGEN_CPU_DESC);
|
||||||
|
|
||||||
/* Operand values (keywords, integers, symbols, etc.) */
|
/* Operand values (keywords, integers, symbols, etc.) */
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ typedef struct
|
||||||
/* There is currently no example where both index specs and value specs
|
/* There is currently no example where both index specs and value specs
|
||||||
are required, so for now both are clumped under "asm_data". */
|
are required, so for now both are clumped under "asm_data". */
|
||||||
enum cgen_asm_type asm_type;
|
enum cgen_asm_type asm_type;
|
||||||
PTR asm_data;
|
void *asm_data;
|
||||||
#ifndef CGEN_HW_NBOOL_ATTRS
|
#ifndef CGEN_HW_NBOOL_ATTRS
|
||||||
#define CGEN_HW_NBOOL_ATTRS 1
|
#define CGEN_HW_NBOOL_ATTRS 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -453,9 +453,9 @@ typedef struct {
|
||||||
} CGEN_HW_TABLE;
|
} CGEN_HW_TABLE;
|
||||||
|
|
||||||
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name
|
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name
|
||||||
PARAMS ((CGEN_CPU_DESC, const char *));
|
(CGEN_CPU_DESC, const char *);
|
||||||
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num
|
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num
|
||||||
PARAMS ((CGEN_CPU_DESC, unsigned int));
|
(CGEN_CPU_DESC, unsigned int);
|
||||||
|
|
||||||
/* This struct is used to describe things like register names, etc. */
|
/* This struct is used to describe things like register names, etc. */
|
||||||
|
|
||||||
|
@ -543,41 +543,41 @@ typedef struct
|
||||||
/* Lookup a keyword from its name. */
|
/* Lookup a keyword from its name. */
|
||||||
|
|
||||||
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_name
|
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_name
|
||||||
PARAMS ((CGEN_KEYWORD *, const char *));
|
(CGEN_KEYWORD *, const char *);
|
||||||
|
|
||||||
/* Lookup a keyword from its value. */
|
/* Lookup a keyword from its value. */
|
||||||
|
|
||||||
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_value
|
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_value
|
||||||
PARAMS ((CGEN_KEYWORD *, int));
|
(CGEN_KEYWORD *, int);
|
||||||
|
|
||||||
/* Add a keyword. */
|
/* Add a keyword. */
|
||||||
|
|
||||||
void cgen_keyword_add PARAMS ((CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *));
|
void cgen_keyword_add (CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *);
|
||||||
|
|
||||||
/* Keyword searching.
|
/* Keyword searching.
|
||||||
This can be used to retrieve every keyword, or a subset. */
|
This can be used to retrieve every keyword, or a subset. */
|
||||||
|
|
||||||
CGEN_KEYWORD_SEARCH cgen_keyword_search_init
|
CGEN_KEYWORD_SEARCH cgen_keyword_search_init
|
||||||
PARAMS ((CGEN_KEYWORD *, const char *));
|
(CGEN_KEYWORD *, const char *);
|
||||||
const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
|
const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
|
||||||
PARAMS ((CGEN_KEYWORD_SEARCH *));
|
(CGEN_KEYWORD_SEARCH *);
|
||||||
|
|
||||||
/* Operand value support routines. */
|
/* Operand value support routines. */
|
||||||
|
|
||||||
extern const char *cgen_parse_keyword
|
extern const char *cgen_parse_keyword
|
||||||
PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *));
|
(CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *);
|
||||||
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
|
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
|
||||||
extern const char *cgen_parse_signed_integer
|
extern const char *cgen_parse_signed_integer
|
||||||
PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
|
(CGEN_CPU_DESC, const char **, int, long *);
|
||||||
extern const char *cgen_parse_unsigned_integer
|
extern const char *cgen_parse_unsigned_integer
|
||||||
PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *));
|
(CGEN_CPU_DESC, const char **, int, unsigned long *);
|
||||||
extern const char *cgen_parse_address
|
extern const char *cgen_parse_address
|
||||||
PARAMS ((CGEN_CPU_DESC, const char **, int, int,
|
(CGEN_CPU_DESC, const char **, int, int,
|
||||||
enum cgen_parse_operand_result *, bfd_vma *));
|
enum cgen_parse_operand_result *, bfd_vma *);
|
||||||
extern const char *cgen_validate_signed_integer
|
extern const char *cgen_validate_signed_integer
|
||||||
PARAMS ((long, long, long));
|
(long, long, long);
|
||||||
extern const char *cgen_validate_unsigned_integer
|
extern const char *cgen_validate_unsigned_integer
|
||||||
PARAMS ((unsigned long, unsigned long, unsigned long));
|
(unsigned long, unsigned long, unsigned long);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Operand modes. */
|
/* Operand modes. */
|
||||||
|
@ -621,7 +621,7 @@ typedef struct cgen_maybe_multi_ifield
|
||||||
n: indexed by array of more cgen_maybe_multi_ifields. */
|
n: indexed by array of more cgen_maybe_multi_ifields. */
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
const PTR p;
|
const void *p;
|
||||||
const struct cgen_maybe_multi_ifield * multi;
|
const struct cgen_maybe_multi_ifield * multi;
|
||||||
const struct cgen_ifld * leaf;
|
const struct cgen_ifld * leaf;
|
||||||
} val;
|
} val;
|
||||||
|
@ -705,9 +705,9 @@ typedef struct {
|
||||||
} CGEN_OPERAND_TABLE;
|
} CGEN_OPERAND_TABLE;
|
||||||
|
|
||||||
extern const CGEN_OPERAND * cgen_operand_lookup_by_name
|
extern const CGEN_OPERAND * cgen_operand_lookup_by_name
|
||||||
PARAMS ((CGEN_CPU_DESC, const char *));
|
(CGEN_CPU_DESC, const char *);
|
||||||
extern const CGEN_OPERAND * cgen_operand_lookup_by_num
|
extern const CGEN_OPERAND * cgen_operand_lookup_by_num
|
||||||
PARAMS ((CGEN_CPU_DESC, int));
|
(CGEN_CPU_DESC, int);
|
||||||
|
|
||||||
/* Instruction operand instances.
|
/* Instruction operand instances.
|
||||||
|
|
||||||
|
@ -1061,8 +1061,8 @@ typedef struct
|
||||||
|
|
||||||
/* Return number of instructions. This includes any added at run-time. */
|
/* Return number of instructions. This includes any added at run-time. */
|
||||||
|
|
||||||
extern int cgen_insn_count PARAMS ((CGEN_CPU_DESC));
|
extern int cgen_insn_count (CGEN_CPU_DESC);
|
||||||
extern int cgen_macro_insn_count PARAMS ((CGEN_CPU_DESC));
|
extern int cgen_macro_insn_count (CGEN_CPU_DESC);
|
||||||
|
|
||||||
/* Macros to access the other insn elements not recorded in CGEN_IBASE. */
|
/* Macros to access the other insn elements not recorded in CGEN_IBASE. */
|
||||||
|
|
||||||
|
@ -1126,9 +1126,10 @@ typedef struct cgen_minsn_expansion {
|
||||||
If the expansion fails (e.g. "no match") NULL is returned.
|
If the expansion fails (e.g. "no match") NULL is returned.
|
||||||
Space for the expansion is obtained with malloc.
|
Space for the expansion is obtained with malloc.
|
||||||
It is up to the caller to free it. */
|
It is up to the caller to free it. */
|
||||||
const char * (* fn) PARAMS ((const struct cgen_minsn_expansion *,
|
const char * (* fn)
|
||||||
const char *, const char **, int *,
|
(const struct cgen_minsn_expansion *,
|
||||||
CGEN_OPERAND **));
|
const char *, const char **, int *,
|
||||||
|
CGEN_OPERAND **);
|
||||||
#define CGEN_MIEXPN_FN(ex) ((ex)->fn)
|
#define CGEN_MIEXPN_FN(ex) ((ex)->fn)
|
||||||
|
|
||||||
/* Instruction(s) the macro expands to.
|
/* Instruction(s) the macro expands to.
|
||||||
|
@ -1146,15 +1147,15 @@ typedef struct cgen_minsn_expansion {
|
||||||
may contain further macro invocations. */
|
may contain further macro invocations. */
|
||||||
|
|
||||||
extern const char * cgen_expand_macro_insn
|
extern const char * cgen_expand_macro_insn
|
||||||
PARAMS ((CGEN_CPU_DESC, const struct cgen_minsn_expansion *,
|
(CGEN_CPU_DESC, const struct cgen_minsn_expansion *,
|
||||||
const char *, const char **, int *, CGEN_OPERAND **));
|
const char *, const char **, int *, CGEN_OPERAND **);
|
||||||
|
|
||||||
/* The assembler insn table is hashed based on some function of the mnemonic
|
/* The assembler insn table is hashed based on some function of the mnemonic
|
||||||
(the actually hashing done is up to the target, but we provide a few
|
(the actually hashing done is up to the target, but we provide a few
|
||||||
examples like the first letter or a function of the entire mnemonic). */
|
examples like the first letter or a function of the entire mnemonic). */
|
||||||
|
|
||||||
extern CGEN_INSN_LIST * cgen_asm_lookup_insn
|
extern CGEN_INSN_LIST * cgen_asm_lookup_insn
|
||||||
PARAMS ((CGEN_CPU_DESC, const char *));
|
(CGEN_CPU_DESC, const char *);
|
||||||
#define CGEN_ASM_LOOKUP_INSN(cd, string) cgen_asm_lookup_insn ((cd), (string))
|
#define CGEN_ASM_LOOKUP_INSN(cd, string) cgen_asm_lookup_insn ((cd), (string))
|
||||||
#define CGEN_ASM_NEXT_INSN(insn) ((insn)->next)
|
#define CGEN_ASM_NEXT_INSN(insn) ((insn)->next)
|
||||||
|
|
||||||
|
@ -1162,7 +1163,7 @@ extern CGEN_INSN_LIST * cgen_asm_lookup_insn
|
||||||
instruction (the actually hashing done is up to the target). */
|
instruction (the actually hashing done is up to the target). */
|
||||||
|
|
||||||
extern CGEN_INSN_LIST * cgen_dis_lookup_insn
|
extern CGEN_INSN_LIST * cgen_dis_lookup_insn
|
||||||
PARAMS ((CGEN_CPU_DESC, const char *, CGEN_INSN_INT));
|
(CGEN_CPU_DESC, const char *, CGEN_INSN_INT);
|
||||||
/* FIXME: delete these two */
|
/* FIXME: delete these two */
|
||||||
#define CGEN_DIS_LOOKUP_INSN(cd, buf, value) cgen_dis_lookup_insn ((cd), (buf), (value))
|
#define CGEN_DIS_LOOKUP_INSN(cd, buf, value) cgen_dis_lookup_insn ((cd), (buf), (value))
|
||||||
#define CGEN_DIS_NEXT_INSN(insn) ((insn)->next)
|
#define CGEN_DIS_NEXT_INSN(insn) ((insn)->next)
|
||||||
|
@ -1246,25 +1247,24 @@ typedef struct cgen_cpu_desc
|
||||||
int int_insn_p;
|
int int_insn_p;
|
||||||
|
|
||||||
/* Called to rebuild the tables after something has changed. */
|
/* Called to rebuild the tables after something has changed. */
|
||||||
void (*rebuild_tables) PARAMS ((CGEN_CPU_DESC));
|
void (*rebuild_tables) (CGEN_CPU_DESC);
|
||||||
|
|
||||||
/* Operand parser callback. */
|
/* Operand parser callback. */
|
||||||
cgen_parse_operand_fn * parse_operand_fn;
|
cgen_parse_operand_fn * parse_operand_fn;
|
||||||
|
|
||||||
/* Parse/insert/extract/print cover fns for operands. */
|
/* Parse/insert/extract/print cover fns for operands. */
|
||||||
const char * (*parse_operand)
|
const char * (*parse_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, const char **,
|
(CGEN_CPU_DESC, int opindex_, const char **, CGEN_FIELDS *fields_);
|
||||||
CGEN_FIELDS *fields_));
|
|
||||||
#ifdef __BFD_H_SEEN__
|
#ifdef __BFD_H_SEEN__
|
||||||
const char * (*insert_operand)
|
const char * (*insert_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
|
(CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
|
||||||
CGEN_INSN_BYTES_PTR, bfd_vma pc_));
|
CGEN_INSN_BYTES_PTR, bfd_vma pc_);
|
||||||
int (*extract_operand)
|
int (*extract_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
|
(CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
|
||||||
CGEN_FIELDS *fields_, bfd_vma pc_));
|
CGEN_FIELDS *fields_, bfd_vma pc_);
|
||||||
void (*print_operand)
|
void (*print_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, PTR info_, CGEN_FIELDS * fields_,
|
(CGEN_CPU_DESC, int opindex_, void * info_, CGEN_FIELDS * fields_,
|
||||||
void const *attrs_, bfd_vma pc_, int length_));
|
void const *attrs_, bfd_vma pc_, int length_);
|
||||||
#else
|
#else
|
||||||
const char * (*insert_operand) ();
|
const char * (*insert_operand) ();
|
||||||
int (*extract_operand) ();
|
int (*extract_operand) ();
|
||||||
|
@ -1280,19 +1280,19 @@ typedef struct cgen_cpu_desc
|
||||||
#define CGEN_CPU_SIZEOF_FIELDS(cd) ((cd)->sizeof_fields)
|
#define CGEN_CPU_SIZEOF_FIELDS(cd) ((cd)->sizeof_fields)
|
||||||
|
|
||||||
/* Set the bitsize field. */
|
/* Set the bitsize field. */
|
||||||
void (*set_fields_bitsize) PARAMS ((CGEN_FIELDS *fields_, int size_));
|
void (*set_fields_bitsize) (CGEN_FIELDS *fields_, int size_);
|
||||||
#define CGEN_CPU_SET_FIELDS_BITSIZE(cd) ((cd)->set_fields_bitsize)
|
#define CGEN_CPU_SET_FIELDS_BITSIZE(cd) ((cd)->set_fields_bitsize)
|
||||||
|
|
||||||
/* CGEN_FIELDS accessors. */
|
/* CGEN_FIELDS accessors. */
|
||||||
int (*get_int_operand)
|
int (*get_int_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
|
(CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_);
|
||||||
void (*set_int_operand)
|
void (*set_int_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_));
|
(CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_);
|
||||||
#ifdef __BFD_H_SEEN__
|
#ifdef __BFD_H_SEEN__
|
||||||
bfd_vma (*get_vma_operand)
|
bfd_vma (*get_vma_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
|
(CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_);
|
||||||
void (*set_vma_operand)
|
void (*set_vma_operand)
|
||||||
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_));
|
(CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_);
|
||||||
#else
|
#else
|
||||||
long (*get_vma_operand) ();
|
long (*get_vma_operand) ();
|
||||||
void (*set_vma_operand) ();
|
void (*set_vma_operand) ();
|
||||||
|
@ -1314,19 +1314,19 @@ typedef struct cgen_cpu_desc
|
||||||
#define CGEN_PRINT_FN(cd, insn) (cd->print_handlers[(insn)->opcode->handlers.print])
|
#define CGEN_PRINT_FN(cd, insn) (cd->print_handlers[(insn)->opcode->handlers.print])
|
||||||
|
|
||||||
/* Return non-zero if insn should be added to hash table. */
|
/* Return non-zero if insn should be added to hash table. */
|
||||||
int (* asm_hash_p) PARAMS ((const CGEN_INSN *));
|
int (* asm_hash_p) (const CGEN_INSN *);
|
||||||
|
|
||||||
/* Assembler hash function. */
|
/* Assembler hash function. */
|
||||||
unsigned int (* asm_hash) PARAMS ((const char *));
|
unsigned int (* asm_hash) (const char *);
|
||||||
|
|
||||||
/* Number of entries in assembler hash table. */
|
/* Number of entries in assembler hash table. */
|
||||||
unsigned int asm_hash_size;
|
unsigned int asm_hash_size;
|
||||||
|
|
||||||
/* Return non-zero if insn should be added to hash table. */
|
/* Return non-zero if insn should be added to hash table. */
|
||||||
int (* dis_hash_p) PARAMS ((const CGEN_INSN *));
|
int (* dis_hash_p) (const CGEN_INSN *);
|
||||||
|
|
||||||
/* Disassembler hash function. */
|
/* Disassembler hash function. */
|
||||||
unsigned int (* dis_hash) PARAMS ((const char *, CGEN_INSN_INT));
|
unsigned int (* dis_hash) (const char *, CGEN_INSN_INT);
|
||||||
|
|
||||||
/* Number of entries in disassembler hash table. */
|
/* Number of entries in disassembler hash table. */
|
||||||
unsigned int dis_hash_size;
|
unsigned int dis_hash_size;
|
||||||
|
@ -1381,81 +1381,80 @@ extern CGEN_CPU_DESC CGEN_SYM (cpu_open) (enum cgen_cpu_open_arg, ...);
|
||||||
|
|
||||||
/* Cover fn to handle simple case. */
|
/* Cover fn to handle simple case. */
|
||||||
|
|
||||||
extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1) PARAMS ((const char *mach_name_,
|
extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1)
|
||||||
enum cgen_endian endian_));
|
(const char *mach_name_, enum cgen_endian endian_);
|
||||||
|
|
||||||
/* Close it. */
|
/* Close it. */
|
||||||
|
|
||||||
extern void CGEN_SYM (cpu_close) PARAMS ((CGEN_CPU_DESC));
|
extern void CGEN_SYM (cpu_close) (CGEN_CPU_DESC);
|
||||||
|
|
||||||
/* Initialize the opcode table for use.
|
/* Initialize the opcode table for use.
|
||||||
Called by init_asm/init_dis. */
|
Called by init_asm/init_dis. */
|
||||||
|
|
||||||
extern void CGEN_SYM (init_opcode_table) PARAMS ((CGEN_CPU_DESC cd_));
|
extern void CGEN_SYM (init_opcode_table) (CGEN_CPU_DESC cd_);
|
||||||
|
|
||||||
/* build the insn selection regex.
|
/* build the insn selection regex.
|
||||||
called by init_opcode_table */
|
called by init_opcode_table */
|
||||||
|
|
||||||
extern char * CGEN_SYM(build_insn_regex) PARAMS ((CGEN_INSN *insn_));
|
extern char * CGEN_SYM(build_insn_regex) (CGEN_INSN *insn_);
|
||||||
|
|
||||||
/* Initialize the ibld table for use.
|
/* Initialize the ibld table for use.
|
||||||
Called by init_asm/init_dis. */
|
Called by init_asm/init_dis. */
|
||||||
|
|
||||||
extern void CGEN_SYM (init_ibld_table) PARAMS ((CGEN_CPU_DESC cd_));
|
extern void CGEN_SYM (init_ibld_table) (CGEN_CPU_DESC cd_);
|
||||||
|
|
||||||
/* Initialize an cpu table for assembler or disassembler use.
|
/* Initialize an cpu table for assembler or disassembler use.
|
||||||
These must be called immediately after cpu_open. */
|
These must be called immediately after cpu_open. */
|
||||||
|
|
||||||
extern void CGEN_SYM (init_asm) PARAMS ((CGEN_CPU_DESC));
|
extern void CGEN_SYM (init_asm) (CGEN_CPU_DESC);
|
||||||
extern void CGEN_SYM (init_dis) PARAMS ((CGEN_CPU_DESC));
|
extern void CGEN_SYM (init_dis) (CGEN_CPU_DESC);
|
||||||
|
|
||||||
/* Initialize the operand instance table for use. */
|
/* Initialize the operand instance table for use. */
|
||||||
|
|
||||||
extern void CGEN_SYM (init_opinst_table) PARAMS ((CGEN_CPU_DESC cd_));
|
extern void CGEN_SYM (init_opinst_table) (CGEN_CPU_DESC cd_);
|
||||||
|
|
||||||
/* Assemble an instruction. */
|
/* Assemble an instruction. */
|
||||||
|
|
||||||
extern const CGEN_INSN * CGEN_SYM (assemble_insn)
|
extern const CGEN_INSN * CGEN_SYM (assemble_insn)
|
||||||
PARAMS ((CGEN_CPU_DESC, const char *, CGEN_FIELDS *,
|
(CGEN_CPU_DESC, const char *, CGEN_FIELDS *,
|
||||||
CGEN_INSN_BYTES_PTR, char **));
|
CGEN_INSN_BYTES_PTR, char **);
|
||||||
|
|
||||||
extern const CGEN_KEYWORD CGEN_SYM (operand_mach);
|
extern const CGEN_KEYWORD CGEN_SYM (operand_mach);
|
||||||
extern int CGEN_SYM (get_mach) PARAMS ((const char *));
|
extern int CGEN_SYM (get_mach) (const char *);
|
||||||
|
|
||||||
/* Operand index computation. */
|
/* Operand index computation. */
|
||||||
extern const CGEN_INSN * cgen_lookup_insn
|
extern const CGEN_INSN * cgen_lookup_insn
|
||||||
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_,
|
(CGEN_CPU_DESC, const CGEN_INSN * insn_,
|
||||||
CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
|
CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
|
||||||
int length_, CGEN_FIELDS *fields_, int alias_p_));
|
int length_, CGEN_FIELDS *fields_, int alias_p_);
|
||||||
extern void cgen_get_insn_operands
|
extern void cgen_get_insn_operands
|
||||||
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_,
|
(CGEN_CPU_DESC, const CGEN_INSN * insn_,
|
||||||
const CGEN_FIELDS *fields_, int *indices_));
|
const CGEN_FIELDS *fields_, int *indices_);
|
||||||
extern const CGEN_INSN * cgen_lookup_get_insn_operands
|
extern const CGEN_INSN * cgen_lookup_get_insn_operands
|
||||||
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
(CGEN_CPU_DESC, const CGEN_INSN *insn_,
|
||||||
CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
|
CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
|
||||||
int length_, int *indices_, CGEN_FIELDS *fields_));
|
int length_, int *indices_, CGEN_FIELDS *fields_);
|
||||||
|
|
||||||
/* Cover fns to bfd_get/set. */
|
/* Cover fns to bfd_get/set. */
|
||||||
|
|
||||||
extern CGEN_INSN_INT cgen_get_insn_value
|
extern CGEN_INSN_INT cgen_get_insn_value
|
||||||
PARAMS ((CGEN_CPU_DESC, unsigned char *, int));
|
(CGEN_CPU_DESC, unsigned char *, int);
|
||||||
extern void cgen_put_insn_value
|
extern void cgen_put_insn_value
|
||||||
PARAMS ((CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT));
|
(CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT);
|
||||||
|
|
||||||
/* Read in a cpu description file.
|
/* Read in a cpu description file.
|
||||||
??? For future concerns, including adding instructions to the assembler/
|
??? For future concerns, including adding instructions to the assembler/
|
||||||
disassembler at run-time. */
|
disassembler at run-time. */
|
||||||
|
|
||||||
extern const char * cgen_read_cpu_file
|
extern const char * cgen_read_cpu_file (CGEN_CPU_DESC, const char * filename_);
|
||||||
PARAMS ((CGEN_CPU_DESC, const char * filename_));
|
|
||||||
|
|
||||||
/* Allow signed overflow of instruction fields. */
|
/* Allow signed overflow of instruction fields. */
|
||||||
extern void cgen_set_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
|
extern void cgen_set_signed_overflow_ok (CGEN_CPU_DESC);
|
||||||
|
|
||||||
/* Generate an error message if a signed field in an instruction overflows. */
|
/* Generate an error message if a signed field in an instruction overflows. */
|
||||||
extern void cgen_clear_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
|
extern void cgen_clear_signed_overflow_ok (CGEN_CPU_DESC);
|
||||||
|
|
||||||
/* Will an error message be generated if a signed field in an instruction overflows ? */
|
/* Will an error message be generated if a signed field in an instruction overflows ? */
|
||||||
extern unsigned int cgen_signed_overflow_ok_p PARAMS ((CGEN_CPU_DESC));
|
extern unsigned int cgen_signed_overflow_ok_p (CGEN_CPU_DESC);
|
||||||
|
|
||||||
#endif /* CGEN_H */
|
#endif /* CGEN_H */
|
||||||
|
|
Loading…
Reference in New Issue