1 |
/* Header file for targets using CGEN: Cpu tools GENerator. |
/* Header file for targets using CGEN: Cpu tools GENerator. |
2 |
|
|
3 |
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 |
4 |
|
Free Software Foundation, Inc. |
5 |
|
|
6 |
This file is part of GDB, the GNU debugger, and the GNU Binutils. |
This file is part of GDB, the GNU debugger, and the GNU Binutils. |
7 |
|
|
27 |
Perhaps the definition of bfd_vma can be moved outside of bfd.h. |
Perhaps the definition of bfd_vma can be moved outside of bfd.h. |
28 |
Or perhaps one could duplicate its definition in another file. |
Or perhaps one could duplicate its definition in another file. |
29 |
Until such time, this file conditionally compiles definitions that require |
Until such time, this file conditionally compiles definitions that require |
30 |
bfd_vma using BFD_VERSION_DATE. */ |
bfd_vma using __BFD_H_SEEN__. */ |
31 |
|
|
32 |
/* Enums must be defined before they can be used. |
/* Enums must be defined before they can be used. |
33 |
Allow them to be used in struct definitions, even though the enum must |
Allow them to be used in struct definitions, even though the enum must |
242 |
|
|
243 |
typedef struct { |
typedef struct { |
244 |
/* A pointer to the disassemble_info struct. |
/* A pointer to the disassemble_info struct. |
245 |
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. |
246 |
If NULL, BYTES is full of valid data (VALID == -1). */ |
If NULL, BYTES is full of valid data (VALID == -1). */ |
247 |
PTR dis_info; |
void *dis_info; |
248 |
/* Points to a working buffer of sufficient size. */ |
/* Points to a working buffer of sufficient size. */ |
249 |
unsigned char *insn_bytes; |
unsigned char *insn_bytes; |
250 |
/* Mask of bytes that are valid in INSN_BYTES. */ |
/* Mask of bytes that are valid in INSN_BYTES. */ |
265 |
If not it is left alone. |
If not it is left alone. |
266 |
The result is NULL if success or an error message. */ |
The result is NULL if success or an error message. */ |
267 |
typedef const char * (cgen_parse_fn) |
typedef const char * (cgen_parse_fn) |
268 |
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_, |
(CGEN_CPU_DESC, const CGEN_INSN *insn_, |
269 |
const char **strp_, CGEN_FIELDS *fields_)); |
const char **strp_, CGEN_FIELDS *fields_); |
270 |
|
|
271 |
/* Insert handler. |
/* Insert handler. |
272 |
CD is a cpu table descriptor. |
CD is a cpu table descriptor. |
277 |
PC is the pc value of the insn. |
PC is the pc value of the insn. |
278 |
The result is an error message or NULL if success. */ |
The result is an error message or NULL if success. */ |
279 |
|
|
280 |
#ifdef BFD_VERSION_DATE |
#ifdef __BFD_H_SEEN__ |
281 |
typedef const char * (cgen_insert_fn) |
typedef const char * (cgen_insert_fn) |
282 |
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_, |
(CGEN_CPU_DESC, const CGEN_INSN *insn_, |
283 |
CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_, |
CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_, |
284 |
bfd_vma pc_)); |
bfd_vma pc_); |
285 |
#else |
#else |
286 |
typedef const char * (cgen_insert_fn) (); |
typedef const char * (cgen_insert_fn) (); |
287 |
#endif |
#endif |
298 |
PC is the pc value of the insn. |
PC is the pc value of the insn. |
299 |
The result is the length of the insn in bits or zero if not recognized. */ |
The result is the length of the insn in bits or zero if not recognized. */ |
300 |
|
|
301 |
#ifdef BFD_VERSION_DATE |
#ifdef __BFD_H_SEEN__ |
302 |
typedef int (cgen_extract_fn) |
typedef int (cgen_extract_fn) |
303 |
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_, |
(CGEN_CPU_DESC, const CGEN_INSN *insn_, |
304 |
CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_, |
CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_, |
305 |
CGEN_FIELDS *fields_, bfd_vma pc_)); |
CGEN_FIELDS *fields_, bfd_vma pc_); |
306 |
#else |
#else |
307 |
typedef int (cgen_extract_fn) (); |
typedef int (cgen_extract_fn) (); |
308 |
#endif |
#endif |
317 |
PC is the pc value of the insn. |
PC is the pc value of the insn. |
318 |
LEN is the length of the insn, in bits. */ |
LEN is the length of the insn, in bits. */ |
319 |
|
|
320 |
#ifdef BFD_VERSION_DATE |
#ifdef __BFD_H_SEEN__ |
321 |
typedef void (cgen_print_fn) |
typedef void (cgen_print_fn) |
322 |
PARAMS ((CGEN_CPU_DESC, PTR info_, const CGEN_INSN *insn_, |
(CGEN_CPU_DESC, void * info_, const CGEN_INSN *insn_, |
323 |
CGEN_FIELDS *fields_, bfd_vma pc_, int len_)); |
CGEN_FIELDS *fields_, bfd_vma pc_, int len_); |
324 |
#else |
#else |
325 |
typedef void (cgen_print_fn) (); |
typedef void (cgen_print_fn) (); |
326 |
#endif |
#endif |
369 |
{ |
{ |
370 |
CGEN_PARSE_OPERAND_INIT, |
CGEN_PARSE_OPERAND_INIT, |
371 |
CGEN_PARSE_OPERAND_INTEGER, |
CGEN_PARSE_OPERAND_INTEGER, |
372 |
CGEN_PARSE_OPERAND_ADDRESS |
CGEN_PARSE_OPERAND_ADDRESS, |
373 |
|
CGEN_PARSE_OPERAND_SYMBOLIC |
374 |
}; |
}; |
375 |
|
|
376 |
/* Values for indicating what was parsed. */ |
/* Values for indicating what was parsed. */ |
383 |
CGEN_PARSE_OPERAND_RESULT_ERROR |
CGEN_PARSE_OPERAND_RESULT_ERROR |
384 |
}; |
}; |
385 |
|
|
386 |
#ifdef BFD_VERSION_DATE /* Don't require bfd.h unnecessarily. */ |
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */ |
387 |
typedef const char * (cgen_parse_operand_fn) |
typedef const char * (cgen_parse_operand_fn) |
388 |
PARAMS ((CGEN_CPU_DESC, |
(CGEN_CPU_DESC, |
389 |
enum cgen_parse_operand_type, const char **, int, int, |
enum cgen_parse_operand_type, const char **, int, int, |
390 |
enum cgen_parse_operand_result *, bfd_vma *)); |
enum cgen_parse_operand_result *, bfd_vma *); |
391 |
#else |
#else |
392 |
typedef const char * (cgen_parse_operand_fn) (); |
typedef const char * (cgen_parse_operand_fn) (); |
393 |
#endif |
#endif |
395 |
/* Set the cgen_parse_operand_fn callback. */ |
/* Set the cgen_parse_operand_fn callback. */ |
396 |
|
|
397 |
extern void cgen_set_parse_operand_fn |
extern void cgen_set_parse_operand_fn |
398 |
PARAMS ((CGEN_CPU_DESC, cgen_parse_operand_fn)); |
(CGEN_CPU_DESC, cgen_parse_operand_fn); |
399 |
|
|
400 |
/* Called before trying to match a table entry with the insn. */ |
/* Called before trying to match a table entry with the insn. */ |
401 |
|
|
402 |
extern void cgen_init_parse_operand PARAMS ((CGEN_CPU_DESC)); |
extern void cgen_init_parse_operand (CGEN_CPU_DESC); |
403 |
|
|
404 |
/* Operand values (keywords, integers, symbols, etc.) */ |
/* Operand values (keywords, integers, symbols, etc.) */ |
405 |
|
|
423 |
/* There is currently no example where both index specs and value specs |
/* There is currently no example where both index specs and value specs |
424 |
are required, so for now both are clumped under "asm_data". */ |
are required, so for now both are clumped under "asm_data". */ |
425 |
enum cgen_asm_type asm_type; |
enum cgen_asm_type asm_type; |
426 |
PTR asm_data; |
void *asm_data; |
427 |
#ifndef CGEN_HW_NBOOL_ATTRS |
#ifndef CGEN_HW_NBOOL_ATTRS |
428 |
#define CGEN_HW_NBOOL_ATTRS 1 |
#define CGEN_HW_NBOOL_ATTRS 1 |
429 |
#endif |
#endif |
454 |
} CGEN_HW_TABLE; |
} CGEN_HW_TABLE; |
455 |
|
|
456 |
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name |
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name |
457 |
PARAMS ((CGEN_CPU_DESC, const char *)); |
(CGEN_CPU_DESC, const char *); |
458 |
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num |
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num |
459 |
PARAMS ((CGEN_CPU_DESC, unsigned int)); |
(CGEN_CPU_DESC, unsigned int); |
460 |
|
|
461 |
/* This struct is used to describe things like register names, etc. */ |
/* This struct is used to describe things like register names, etc. */ |
462 |
|
|
544 |
/* Lookup a keyword from its name. */ |
/* Lookup a keyword from its name. */ |
545 |
|
|
546 |
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_name |
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_name |
547 |
PARAMS ((CGEN_KEYWORD *, const char *)); |
(CGEN_KEYWORD *, const char *); |
548 |
|
|
549 |
/* Lookup a keyword from its value. */ |
/* Lookup a keyword from its value. */ |
550 |
|
|
551 |
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_value |
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_value |
552 |
PARAMS ((CGEN_KEYWORD *, int)); |
(CGEN_KEYWORD *, int); |
553 |
|
|
554 |
/* Add a keyword. */ |
/* Add a keyword. */ |
555 |
|
|
556 |
void cgen_keyword_add PARAMS ((CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *)); |
void cgen_keyword_add (CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *); |
557 |
|
|
558 |
/* Keyword searching. |
/* Keyword searching. |
559 |
This can be used to retrieve every keyword, or a subset. */ |
This can be used to retrieve every keyword, or a subset. */ |
560 |
|
|
561 |
CGEN_KEYWORD_SEARCH cgen_keyword_search_init |
CGEN_KEYWORD_SEARCH cgen_keyword_search_init |
562 |
PARAMS ((CGEN_KEYWORD *, const char *)); |
(CGEN_KEYWORD *, const char *); |
563 |
const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next |
const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next |
564 |
PARAMS ((CGEN_KEYWORD_SEARCH *)); |
(CGEN_KEYWORD_SEARCH *); |
565 |
|
|
566 |
/* Operand value support routines. */ |
/* Operand value support routines. */ |
567 |
|
|
568 |
extern const char *cgen_parse_keyword |
extern const char *cgen_parse_keyword |
569 |
PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *)); |
(CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *); |
570 |
#ifdef BFD_VERSION_DATE /* Don't require bfd.h unnecessarily. */ |
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */ |
571 |
extern const char *cgen_parse_signed_integer |
extern const char *cgen_parse_signed_integer |
572 |
PARAMS ((CGEN_CPU_DESC, const char **, int, long *)); |
(CGEN_CPU_DESC, const char **, int, long *); |
573 |
extern const char *cgen_parse_unsigned_integer |
extern const char *cgen_parse_unsigned_integer |
574 |
PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *)); |
(CGEN_CPU_DESC, const char **, int, unsigned long *); |
575 |
extern const char *cgen_parse_address |
extern const char *cgen_parse_address |
576 |
PARAMS ((CGEN_CPU_DESC, const char **, int, int, |
(CGEN_CPU_DESC, const char **, int, int, |
577 |
enum cgen_parse_operand_result *, bfd_vma *)); |
enum cgen_parse_operand_result *, bfd_vma *); |
578 |
extern const char *cgen_validate_signed_integer |
extern const char *cgen_validate_signed_integer |
579 |
PARAMS ((long, long, long)); |
(long, long, long); |
580 |
extern const char *cgen_validate_unsigned_integer |
extern const char *cgen_validate_unsigned_integer |
581 |
PARAMS ((unsigned long, unsigned long, unsigned long)); |
(unsigned long, unsigned long, unsigned long); |
582 |
#endif |
#endif |
583 |
|
|
584 |
/* Operand modes. */ |
/* Operand modes. */ |
622 |
n: indexed by array of more cgen_maybe_multi_ifields. */ |
n: indexed by array of more cgen_maybe_multi_ifields. */ |
623 |
union |
union |
624 |
{ |
{ |
625 |
struct cgen_maybe_multi_ifield * multi; |
const void *p; |
626 |
struct cgen_ifld * leaf; |
const struct cgen_maybe_multi_ifield * multi; |
627 |
|
const struct cgen_ifld * leaf; |
628 |
} val; |
} val; |
629 |
} |
} |
630 |
CGEN_MAYBE_MULTI_IFLD; |
CGEN_MAYBE_MULTI_IFLD; |
706 |
} CGEN_OPERAND_TABLE; |
} CGEN_OPERAND_TABLE; |
707 |
|
|
708 |
extern const CGEN_OPERAND * cgen_operand_lookup_by_name |
extern const CGEN_OPERAND * cgen_operand_lookup_by_name |
709 |
PARAMS ((CGEN_CPU_DESC, const char *)); |
(CGEN_CPU_DESC, const char *); |
710 |
extern const CGEN_OPERAND * cgen_operand_lookup_by_num |
extern const CGEN_OPERAND * cgen_operand_lookup_by_num |
711 |
PARAMS ((CGEN_CPU_DESC, int)); |
(CGEN_CPU_DESC, int); |
712 |
|
|
713 |
/* Instruction operand instances. |
/* Instruction operand instances. |
714 |
|
|
1062 |
|
|
1063 |
/* Return number of instructions. This includes any added at run-time. */ |
/* Return number of instructions. This includes any added at run-time. */ |
1064 |
|
|
1065 |
extern int cgen_insn_count PARAMS ((CGEN_CPU_DESC)); |
extern int cgen_insn_count (CGEN_CPU_DESC); |
1066 |
extern int cgen_macro_insn_count PARAMS ((CGEN_CPU_DESC)); |
extern int cgen_macro_insn_count (CGEN_CPU_DESC); |
1067 |
|
|
1068 |
/* Macros to access the other insn elements not recorded in CGEN_IBASE. */ |
/* Macros to access the other insn elements not recorded in CGEN_IBASE. */ |
1069 |
|
|
1127 |
If the expansion fails (e.g. "no match") NULL is returned. |
If the expansion fails (e.g. "no match") NULL is returned. |
1128 |
Space for the expansion is obtained with malloc. |
Space for the expansion is obtained with malloc. |
1129 |
It is up to the caller to free it. */ |
It is up to the caller to free it. */ |
1130 |
const char * (* fn) PARAMS ((const struct cgen_minsn_expansion *, |
const char * (* fn) |
1131 |
const char *, const char **, int *, |
(const struct cgen_minsn_expansion *, |
1132 |
CGEN_OPERAND **)); |
const char *, const char **, int *, |
1133 |
|
CGEN_OPERAND **); |
1134 |
#define CGEN_MIEXPN_FN(ex) ((ex)->fn) |
#define CGEN_MIEXPN_FN(ex) ((ex)->fn) |
1135 |
|
|
1136 |
/* Instruction(s) the macro expands to. |
/* Instruction(s) the macro expands to. |
1148 |
may contain further macro invocations. */ |
may contain further macro invocations. */ |
1149 |
|
|
1150 |
extern const char * cgen_expand_macro_insn |
extern const char * cgen_expand_macro_insn |
1151 |
PARAMS ((CGEN_CPU_DESC, const struct cgen_minsn_expansion *, |
(CGEN_CPU_DESC, const struct cgen_minsn_expansion *, |
1152 |
const char *, const char **, int *, CGEN_OPERAND **)); |
const char *, const char **, int *, CGEN_OPERAND **); |
1153 |
|
|
1154 |
/* 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 |
1155 |
(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 |
1156 |
examples like the first letter or a function of the entire mnemonic). */ |
examples like the first letter or a function of the entire mnemonic). */ |
1157 |
|
|
1158 |
extern CGEN_INSN_LIST * cgen_asm_lookup_insn |
extern CGEN_INSN_LIST * cgen_asm_lookup_insn |
1159 |
PARAMS ((CGEN_CPU_DESC, const char *)); |
(CGEN_CPU_DESC, const char *); |
1160 |
#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)) |
1161 |
#define CGEN_ASM_NEXT_INSN(insn) ((insn)->next) |
#define CGEN_ASM_NEXT_INSN(insn) ((insn)->next) |
1162 |
|
|
1164 |
instruction (the actually hashing done is up to the target). */ |
instruction (the actually hashing done is up to the target). */ |
1165 |
|
|
1166 |
extern CGEN_INSN_LIST * cgen_dis_lookup_insn |
extern CGEN_INSN_LIST * cgen_dis_lookup_insn |
1167 |
PARAMS ((CGEN_CPU_DESC, const char *, CGEN_INSN_INT)); |
(CGEN_CPU_DESC, const char *, CGEN_INSN_INT); |
1168 |
/* FIXME: delete these two */ |
/* FIXME: delete these two */ |
1169 |
#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)) |
1170 |
#define CGEN_DIS_NEXT_INSN(insn) ((insn)->next) |
#define CGEN_DIS_NEXT_INSN(insn) ((insn)->next) |
1248 |
int int_insn_p; |
int int_insn_p; |
1249 |
|
|
1250 |
/* Called to rebuild the tables after something has changed. */ |
/* Called to rebuild the tables after something has changed. */ |
1251 |
void (*rebuild_tables) PARAMS ((CGEN_CPU_DESC)); |
void (*rebuild_tables) (CGEN_CPU_DESC); |
1252 |
|
|
1253 |
/* Operand parser callback. */ |
/* Operand parser callback. */ |
1254 |
cgen_parse_operand_fn * parse_operand_fn; |
cgen_parse_operand_fn * parse_operand_fn; |
1255 |
|
|
1256 |
/* Parse/insert/extract/print cover fns for operands. */ |
/* Parse/insert/extract/print cover fns for operands. */ |
1257 |
const char * (*parse_operand) |
const char * (*parse_operand) |
1258 |
PARAMS ((CGEN_CPU_DESC, int opindex_, const char **, |
(CGEN_CPU_DESC, int opindex_, const char **, CGEN_FIELDS *fields_); |
1259 |
CGEN_FIELDS *fields_)); |
#ifdef __BFD_H_SEEN__ |
|
#ifdef BFD_VERSION_DATE |
|
1260 |
const char * (*insert_operand) |
const char * (*insert_operand) |
1261 |
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, |
(CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, |
1262 |
CGEN_INSN_BYTES_PTR, bfd_vma pc_)); |
CGEN_INSN_BYTES_PTR, bfd_vma pc_); |
1263 |
int (*extract_operand) |
int (*extract_operand) |
1264 |
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, |
(CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, |
1265 |
CGEN_FIELDS *fields_, bfd_vma pc_)); |
CGEN_FIELDS *fields_, bfd_vma pc_); |
1266 |
void (*print_operand) |
void (*print_operand) |
1267 |
PARAMS ((CGEN_CPU_DESC, int opindex_, PTR info_, CGEN_FIELDS * fields_, |
(CGEN_CPU_DESC, int opindex_, void * info_, CGEN_FIELDS * fields_, |
1268 |
void const *attrs_, bfd_vma pc_, int length_)); |
void const *attrs_, bfd_vma pc_, int length_); |
1269 |
#else |
#else |
1270 |
const char * (*insert_operand) (); |
const char * (*insert_operand) (); |
1271 |
int (*extract_operand) (); |
int (*extract_operand) (); |
1281 |
#define CGEN_CPU_SIZEOF_FIELDS(cd) ((cd)->sizeof_fields) |
#define CGEN_CPU_SIZEOF_FIELDS(cd) ((cd)->sizeof_fields) |
1282 |
|
|
1283 |
/* Set the bitsize field. */ |
/* Set the bitsize field. */ |
1284 |
void (*set_fields_bitsize) PARAMS ((CGEN_FIELDS *fields_, int size_)); |
void (*set_fields_bitsize) (CGEN_FIELDS *fields_, int size_); |
1285 |
#define CGEN_CPU_SET_FIELDS_BITSIZE(cd) ((cd)->set_fields_bitsize) |
#define CGEN_CPU_SET_FIELDS_BITSIZE(cd) ((cd)->set_fields_bitsize) |
1286 |
|
|
1287 |
/* CGEN_FIELDS accessors. */ |
/* CGEN_FIELDS accessors. */ |
1288 |
int (*get_int_operand) |
int (*get_int_operand) |
1289 |
PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_)); |
(CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_); |
1290 |
void (*set_int_operand) |
void (*set_int_operand) |
1291 |
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_)); |
(CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_); |
1292 |
#ifdef BFD_VERSION_DATE |
#ifdef __BFD_H_SEEN__ |
1293 |
bfd_vma (*get_vma_operand) |
bfd_vma (*get_vma_operand) |
1294 |
PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_)); |
(CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_); |
1295 |
void (*set_vma_operand) |
void (*set_vma_operand) |
1296 |
PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_)); |
(CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_); |
1297 |
#else |
#else |
1298 |
long (*get_vma_operand) (); |
long (*get_vma_operand) (); |
1299 |
void (*set_vma_operand) (); |
void (*set_vma_operand) (); |
1315 |
#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]) |
1316 |
|
|
1317 |
/* Return non-zero if insn should be added to hash table. */ |
/* Return non-zero if insn should be added to hash table. */ |
1318 |
int (* asm_hash_p) PARAMS ((const CGEN_INSN *)); |
int (* asm_hash_p) (const CGEN_INSN *); |
1319 |
|
|
1320 |
/* Assembler hash function. */ |
/* Assembler hash function. */ |
1321 |
unsigned int (* asm_hash) PARAMS ((const char *)); |
unsigned int (* asm_hash) (const char *); |
1322 |
|
|
1323 |
/* Number of entries in assembler hash table. */ |
/* Number of entries in assembler hash table. */ |
1324 |
unsigned int asm_hash_size; |
unsigned int asm_hash_size; |
1325 |
|
|
1326 |
/* Return non-zero if insn should be added to hash table. */ |
/* Return non-zero if insn should be added to hash table. */ |
1327 |
int (* dis_hash_p) PARAMS ((const CGEN_INSN *)); |
int (* dis_hash_p) (const CGEN_INSN *); |
1328 |
|
|
1329 |
/* Disassembler hash function. */ |
/* Disassembler hash function. */ |
1330 |
unsigned int (* dis_hash) PARAMS ((const char *, CGEN_INSN_INT)); |
unsigned int (* dis_hash) (const char *, CGEN_INSN_INT); |
1331 |
|
|
1332 |
/* Number of entries in disassembler hash table. */ |
/* Number of entries in disassembler hash table. */ |
1333 |
unsigned int dis_hash_size; |
unsigned int dis_hash_size; |
1382 |
|
|
1383 |
/* Cover fn to handle simple case. */ |
/* Cover fn to handle simple case. */ |
1384 |
|
|
1385 |
extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1) PARAMS ((const char *mach_name_, |
extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1) |
1386 |
enum cgen_endian endian_)); |
(const char *mach_name_, enum cgen_endian endian_); |
1387 |
|
|
1388 |
/* Close it. */ |
/* Close it. */ |
1389 |
|
|
1390 |
extern void CGEN_SYM (cpu_close) PARAMS ((CGEN_CPU_DESC)); |
extern void CGEN_SYM (cpu_close) (CGEN_CPU_DESC); |
1391 |
|
|
1392 |
/* Initialize the opcode table for use. |
/* Initialize the opcode table for use. |
1393 |
Called by init_asm/init_dis. */ |
Called by init_asm/init_dis. */ |
1394 |
|
|
1395 |
extern void CGEN_SYM (init_opcode_table) PARAMS ((CGEN_CPU_DESC cd_)); |
extern void CGEN_SYM (init_opcode_table) (CGEN_CPU_DESC cd_); |
1396 |
|
|
1397 |
/* build the insn selection regex. |
/* build the insn selection regex. |
1398 |
called by init_opcode_table */ |
called by init_opcode_table */ |
1399 |
|
|
1400 |
extern char * CGEN_SYM(build_insn_regex) PARAMS ((CGEN_INSN *insn_)); |
extern char * CGEN_SYM(build_insn_regex) (CGEN_INSN *insn_); |
1401 |
|
|
1402 |
/* Initialize the ibld table for use. |
/* Initialize the ibld table for use. |
1403 |
Called by init_asm/init_dis. */ |
Called by init_asm/init_dis. */ |
1404 |
|
|
1405 |
extern void CGEN_SYM (init_ibld_table) PARAMS ((CGEN_CPU_DESC cd_)); |
extern void CGEN_SYM (init_ibld_table) (CGEN_CPU_DESC cd_); |
1406 |
|
|
1407 |
/* Initialize an cpu table for assembler or disassembler use. |
/* Initialize an cpu table for assembler or disassembler use. |
1408 |
These must be called immediately after cpu_open. */ |
These must be called immediately after cpu_open. */ |
1409 |
|
|
1410 |
extern void CGEN_SYM (init_asm) PARAMS ((CGEN_CPU_DESC)); |
extern void CGEN_SYM (init_asm) (CGEN_CPU_DESC); |
1411 |
extern void CGEN_SYM (init_dis) PARAMS ((CGEN_CPU_DESC)); |
extern void CGEN_SYM (init_dis) (CGEN_CPU_DESC); |
1412 |
|
|
1413 |
/* Initialize the operand instance table for use. */ |
/* Initialize the operand instance table for use. */ |
1414 |
|
|
1415 |
extern void CGEN_SYM (init_opinst_table) PARAMS ((CGEN_CPU_DESC cd_)); |
extern void CGEN_SYM (init_opinst_table) (CGEN_CPU_DESC cd_); |
1416 |
|
|
1417 |
/* Assemble an instruction. */ |
/* Assemble an instruction. */ |
1418 |
|
|
1419 |
extern const CGEN_INSN * CGEN_SYM (assemble_insn) |
extern const CGEN_INSN * CGEN_SYM (assemble_insn) |
1420 |
PARAMS ((CGEN_CPU_DESC, const char *, CGEN_FIELDS *, |
(CGEN_CPU_DESC, const char *, CGEN_FIELDS *, |
1421 |
CGEN_INSN_BYTES_PTR, char **)); |
CGEN_INSN_BYTES_PTR, char **); |
1422 |
|
|
1423 |
extern const CGEN_KEYWORD CGEN_SYM (operand_mach); |
extern const CGEN_KEYWORD CGEN_SYM (operand_mach); |
1424 |
extern int CGEN_SYM (get_mach) PARAMS ((const char *)); |
extern int CGEN_SYM (get_mach) (const char *); |
1425 |
|
|
1426 |
/* Operand index computation. */ |
/* Operand index computation. */ |
1427 |
extern const CGEN_INSN * cgen_lookup_insn |
extern const CGEN_INSN * cgen_lookup_insn |
1428 |
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_, |
(CGEN_CPU_DESC, const CGEN_INSN * insn_, |
1429 |
CGEN_INSN_INT int_value_, unsigned char *bytes_value_, |
CGEN_INSN_INT int_value_, unsigned char *bytes_value_, |
1430 |
int length_, CGEN_FIELDS *fields_, int alias_p_)); |
int length_, CGEN_FIELDS *fields_, int alias_p_); |
1431 |
extern void cgen_get_insn_operands |
extern void cgen_get_insn_operands |
1432 |
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_, |
(CGEN_CPU_DESC, const CGEN_INSN * insn_, |
1433 |
const CGEN_FIELDS *fields_, int *indices_)); |
const CGEN_FIELDS *fields_, int *indices_); |
1434 |
extern const CGEN_INSN * cgen_lookup_get_insn_operands |
extern const CGEN_INSN * cgen_lookup_get_insn_operands |
1435 |
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_, |
(CGEN_CPU_DESC, const CGEN_INSN *insn_, |
1436 |
CGEN_INSN_INT int_value_, unsigned char *bytes_value_, |
CGEN_INSN_INT int_value_, unsigned char *bytes_value_, |
1437 |
int length_, int *indices_, CGEN_FIELDS *fields_)); |
int length_, int *indices_, CGEN_FIELDS *fields_); |
1438 |
|
|
1439 |
/* Cover fns to bfd_get/set. */ |
/* Cover fns to bfd_get/set. */ |
1440 |
|
|
1441 |
extern CGEN_INSN_INT cgen_get_insn_value |
extern CGEN_INSN_INT cgen_get_insn_value |
1442 |
PARAMS ((CGEN_CPU_DESC, unsigned char *, int)); |
(CGEN_CPU_DESC, unsigned char *, int); |
1443 |
extern void cgen_put_insn_value |
extern void cgen_put_insn_value |
1444 |
PARAMS ((CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT)); |
(CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT); |
1445 |
|
|
1446 |
/* Read in a cpu description file. |
/* Read in a cpu description file. |
1447 |
??? For future concerns, including adding instructions to the assembler/ |
??? For future concerns, including adding instructions to the assembler/ |
1448 |
disassembler at run-time. */ |
disassembler at run-time. */ |
1449 |
|
|
1450 |
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_)); |
|
1451 |
|
|
1452 |
/* Allow signed overflow of instruction fields. */ |
/* Allow signed overflow of instruction fields. */ |
1453 |
extern void cgen_set_signed_overflow_ok PARAMS ((CGEN_CPU_DESC)); |
extern void cgen_set_signed_overflow_ok (CGEN_CPU_DESC); |
1454 |
|
|
1455 |
/* Generate an error message if a signed field in an instruction overflows. */ |
/* Generate an error message if a signed field in an instruction overflows. */ |
1456 |
extern void cgen_clear_signed_overflow_ok PARAMS ((CGEN_CPU_DESC)); |
extern void cgen_clear_signed_overflow_ok (CGEN_CPU_DESC); |
1457 |
|
|
1458 |
/* 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 ? */ |
1459 |
extern unsigned int cgen_signed_overflow_ok_p PARAMS ((CGEN_CPU_DESC)); |
extern unsigned int cgen_signed_overflow_ok_p (CGEN_CPU_DESC); |
1460 |
|
|
1461 |
#endif /* CGEN_H */ |
#endif /* CGEN_H */ |