* itbl-ops.c: New file. Add support for dynamically read
[deliverable/binutils-gdb.git] / gas / itbl-ops.h
CommitLineData
8e5c905e
DP
1
2/* External functions, constants and defines for itbl support */
3
4#include "itbl-cpu.h"
5
6/* Defaults for definitions required by generic code */
7#ifndef ITBL_NUMBER_OF_PROCESSORS
8#define ITBL_NUMBER_OF_PROCESSORS 1
9#endif
10
11#ifndef ITBL_MAX_BITPOS
12#define ITBL_MAX_BITPOS 31
13#endif
14
15#ifndef ITBL_TYPE
16#define ITBL_TYPE unsigned long
17#endif
18
19#ifndef ITBL_IS_INSN
20#define ITBL_IS_INSN(insn) 1
21#endif
22
23#ifndef ITBL_DECODE_PNUM
24#define ITBL_DECODE_PNUM(insn) 0
25#endif
26
27#ifndef ITBL_ENCODE_PNUM
28#define ITBL_ENCODE_PNUM(pnum) 0
29#endif
30
31typedef ITBL_TYPE t_insn;
32
33/* types of entries */
34typedef enum
35{
36 e_insn,
37 e_dreg,
38 e_regtype0 = e_dreg,
39 e_creg,
40 e_greg,
41 e_addr,
42 e_nregtypes = e_greg+1,
43 e_immed,
44 e_ntypes,
45 e_invtype /* invalid type */
46} e_type;
47
48typedef enum
49{
50 e_p0,
51 e_nprocs=NUMBER_OF_PROCESSORS,
52 e_invproc /* invalid processor */
53} e_processor;
54
55/* These routines are visible to the main part of the assembler */
56
57int itbl_parse(char* insntbl);
58void itbl_init(void);
59char *itbl_get_field(char **s);
60unsigned long itbl_assemble(char *name, char *operands);
61int itbl_disassemble(char *str, unsigned long insn);
62int itbl_parse(char *tbl); /* parses insn tbl */
63unsigned long itbl_get_reg_val(char *name);
64unsigned long itbl_get_val(e_processor processor, e_type type, char *name);
65char *itbl_get_name(e_processor processor, e_type type, unsigned long val);
66
67/* These routines are called by the table parser used to build the
68 * dynamic list of new processor instructions and registers. */
69
70struct itbl_entry *itbl_add_reg(int yyproc, int yytype, char *regname, int regnum);
71struct itbl_entry *itbl_add_insn(int yyproc, char *name, unsigned long value,
72 int sbit, int ebit, unsigned long flags);
73struct itbl_field *itbl_add_operand(struct itbl_entry *e, int yytype,
74 int sbit, int ebit, unsigned long flags);
75
This page took 0.025114 seconds and 4 git commands to generate.