* itbl-parse.y: Fix indentation mistakes from indent program.
[external/binutils.git] / gas / itbl-ops.h
1
2 /* itbl-ops.h
3
4    Copyright (C) 1997  Free Software Foundation, Inc.
5
6    This file is part of GAS, the GNU Assembler.
7
8    GAS is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2, or (at your option)
11    any later version.
12
13    GAS is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with GAS; see the file COPYING.  If not, write to the Free
20    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
21    02111-1307, USA.  */
22
23 /* External functions, constants and defines for itbl support */
24
25 #include "ansidecl.h"
26 #include "itbl-cpu.h"
27
28 /* Defaults for definitions required by generic code */
29 #ifndef ITBL_NUMBER_OF_PROCESSORS
30 #define ITBL_NUMBER_OF_PROCESSORS 1
31 #endif
32
33 #ifndef ITBL_MAX_BITPOS
34 #define ITBL_MAX_BITPOS 31
35 #endif
36
37 #ifndef ITBL_TYPE
38 #define ITBL_TYPE unsigned long
39 #endif
40
41 #ifndef ITBL_IS_INSN
42 #define ITBL_IS_INSN(insn) 1
43 #endif
44
45 #ifndef ITBL_DECODE_PNUM
46 #define ITBL_DECODE_PNUM(insn) 0
47 #endif
48
49 #ifndef ITBL_ENCODE_PNUM
50 #define ITBL_ENCODE_PNUM(pnum) 0
51 #endif
52
53 typedef ITBL_TYPE t_insn;
54
55 /* types of entries */
56 typedef enum
57   {
58     e_insn,
59     e_dreg,
60     e_regtype0 = e_dreg,
61     e_creg,
62     e_greg,
63     e_addr,
64     e_nregtypes = e_greg + 1,
65     e_immed,
66     e_ntypes,
67     e_invtype                   /* invalid type */
68   } e_type;
69
70 typedef enum
71   {
72     e_p0,
73     e_nprocs = NUMBER_OF_PROCESSORS,
74     e_invproc                   /* invalid processor */
75   } e_processor;
76
77 /* 0 means an instruction table was not specified. */
78 extern int itbl_have_entries;
79
80 /* These routines are visible to the main part of the assembler */
81
82 int itbl_parse PARAMS ((char *insntbl));
83 void itbl_init PARAMS ((void));
84 char *itbl_get_field PARAMS ((char **s));
85 unsigned long itbl_assemble PARAMS ((char *name, char *operands));
86 int itbl_disassemble PARAMS ((char *str, unsigned long insn));
87 int itbl_parse PARAMS ((char *tbl));    /* parses insn tbl */
88 unsigned long itbl_get_reg_val PARAMS ((char *name));
89 unsigned long itbl_get_val PARAMS ((e_processor processor, e_type type,
90                                     char *name));
91 char *itbl_get_name PARAMS ((e_processor processor, e_type type,
92                              unsigned long val));
93
94 /* These routines are called by the table parser used to build the
95    dynamic list of new processor instructions and registers. */
96
97 struct itbl_entry *itbl_add_reg PARAMS ((int yyproc, int yytype,
98                                          char *regname, int regnum));
99 struct itbl_entry *itbl_add_insn PARAMS ((int yyproc, char *name,
100              unsigned long value, int sbit, int ebit, unsigned long flags));
101 struct itbl_field *itbl_add_operand PARAMS ((struct itbl_entry * e, int yytype,
102                                   int sbit, int ebit, unsigned long flags));