]> gcc.gnu.org Git - gcc.git/blame - gcc/recog.h
* recog.h (recog_op_alt): Declare extern.
[gcc.git] / gcc / recog.h
CommitLineData
64a93ac5 1/* Declarations for interface to insn recognizer and insn-output.c.
27d0138b 2 Copyright (C) 1987, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
64a93ac5
CH
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING. If not, write to
e99215a3
RK
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
64a93ac5 20
f62a15e3
BS
21/* Random number that should be large enough for all purposes. */
22#define MAX_RECOG_ALTERNATIVES 30
23
0eadeb15
BS
24/* Types of operands. */
25enum op_type {
26 OP_IN,
27 OP_OUT,
28 OP_INOUT
29};
30
f62a15e3
BS
31struct operand_alternative
32{
33 /* Pointer to the beginning of the constraint string for this alternative,
34 for easier access by alternative number. */
35 char *constraint;
36
37 /* The register class valid for this alternative (possibly NO_REGS). */
38 enum reg_class class;
39
40 /* "Badness" of this alternative, computed from number of '?' and '!'
41 characters in the constraint string. */
42 unsigned int reject;
43
44 /* -1 if no matching constraint was found, or an operand number. */
45 int matches;
46 /* The same information, but reversed: -1 if this operand is not
47 matched by any other, or the operand number of the operand that
48 matches this one. */
49 int matched;
50
51 /* Nonzero if '&' was found in the constraint string. */
52 unsigned int earlyclobber:1;
53 /* Nonzero if 'm' was found in the constraint string. */
54 unsigned int memory_ok:1;
55 /* Nonzero if 'o' was found in the constraint string. */
56 unsigned int offmem_ok:1;
57 /* Nonzero if 'V' was found in the constraint string. */
58 unsigned int nonoffmem_ok:1;
59 /* Nonzero if '<' was found in the constraint string. */
60 unsigned int decmem_ok:1;
61 /* Nonzero if '>' was found in the constraint string. */
62 unsigned int incmem_ok:1;
63 /* Nonzero if 'X' was found in the constraint string, or if the constraint
64 string for this alternative was empty. */
65 unsigned int anything_ok:1;
66};
67
68
31031edd
JL
69extern void init_recog PROTO((void));
70extern void init_recog_no_volatile PROTO((void));
71extern int recog_memoized PROTO((rtx));
72extern int check_asm_operands PROTO((rtx));
73extern int validate_change PROTO((rtx, rtx *, rtx, int));
74extern int apply_change_group PROTO((void));
75extern int num_validated_changes PROTO((void));
76extern void cancel_changes PROTO((int));
0eadeb15 77extern int constrain_operands PROTO((int));
31031edd
JL
78extern int memory_address_p PROTO((enum machine_mode, rtx));
79extern int strict_memory_address_p PROTO((enum machine_mode, rtx));
80extern int validate_replace_rtx PROTO((rtx, rtx, rtx));
e757da5e 81extern void validate_replace_rtx_group PROTO((rtx, rtx, rtx));
50b2596f 82extern int validate_replace_src PROTO((rtx, rtx, rtx));
523bb0ba
AS
83#ifdef HAVE_cc0
84extern int next_insn_tests_no_inequality PROTO ((rtx));
85#endif
31031edd
JL
86extern int reg_fits_class_p PROTO((rtx, enum reg_class, int,
87 enum machine_mode));
88extern rtx *find_single_use PROTO((rtx, rtx, rtx *));
89
90extern int general_operand PROTO((rtx, enum machine_mode));
91extern int address_operand PROTO((rtx, enum machine_mode));
92extern int register_operand PROTO((rtx, enum machine_mode));
93extern int scratch_operand PROTO((rtx, enum machine_mode));
94extern int immediate_operand PROTO((rtx, enum machine_mode));
95extern int const_int_operand PROTO((rtx, enum machine_mode));
79c9824e 96extern int const_double_operand PROTO((rtx, enum machine_mode));
31031edd
JL
97extern int nonimmediate_operand PROTO((rtx, enum machine_mode));
98extern int nonmemory_operand PROTO((rtx, enum machine_mode));
99extern int push_operand PROTO((rtx, enum machine_mode));
100extern int memory_operand PROTO((rtx, enum machine_mode));
101extern int indirect_operand PROTO((rtx, enum machine_mode));
102extern int mode_independent_operand PROTO((rtx, enum machine_mode));
103extern int comparison_operator PROTO((rtx, enum machine_mode));
104
105extern int offsettable_memref_p PROTO((rtx));
106extern int offsettable_nonstrict_memref_p PROTO((rtx));
107extern int offsettable_address_p PROTO((int, enum machine_mode, rtx));
108extern int mode_dependent_address_p PROTO((rtx));
109
110extern int recog PROTO((rtx, rtx, int *));
111extern void add_clobbers PROTO((rtx, int));
112extern void insn_extract PROTO((rtx));
0a578fee 113extern void extract_insn PROTO((rtx));
f62a15e3 114extern void preprocess_constraints PROTO((void));
64a93ac5
CH
115
116/* Nonzero means volatile operands are recognized. */
64a93ac5
CH
117extern int volatile_ok;
118
0a578fee
BS
119/* Set by constrain_operands to the number of the alternative that
120 matched. */
121extern int which_alternative;
122
64a93ac5
CH
123/* The following vectors hold the results from insn_extract. */
124
125/* Indexed by N, gives value of operand N. */
126extern rtx recog_operand[];
127
128/* Indexed by N, gives location where operand N was found. */
129extern rtx *recog_operand_loc[];
130
131/* Indexed by N, gives location where the Nth duplicate-appearance of
132 an operand was found. This is something that matched MATCH_DUP. */
133extern rtx *recog_dup_loc[];
134
135/* Indexed by N, gives the operand number that was duplicated in the
136 Nth duplicate-appearance of an operand. */
137extern char recog_dup_num[];
138
0a578fee
BS
139/* The next variables are set up by extract_insn. */
140
141/* The number of operands of the insn. */
142extern int recog_n_operands;
143
144/* The number of MATCH_DUPs in the insn. */
145extern int recog_n_dups;
146
147/* The number of alternatives in the constraints for the insn. */
148extern int recog_n_alternatives;
149
150/* Indexed by N, gives the mode of operand N. */
151extern enum machine_mode recog_operand_mode[];
152
153/* Indexed by N, gives the constraint string for operand N. */
154extern char *recog_constraints[];
155
0eadeb15
BS
156/* Indexed by N, gives the type (in, out, inout) for operand N. */
157extern enum op_type recog_op_type[];
158
0a578fee
BS
159#ifndef REGISTER_CONSTRAINTS
160/* Indexed by N, nonzero if operand N should be an address. */
161extern char recog_operand_address_p[];
162#endif
163
f62a15e3
BS
164/* Contains a vector of operand_alternative structures for every operand.
165 Set up by preprocess_constraints. */
b0983bb9 166extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES];
f62a15e3 167
64a93ac5
CH
168/* Access the output function for CODE. */
169
170#define OUT_FCN(CODE) (*insn_outfun[(int) (CODE)])
171
172/* Tables defined in insn-output.c that give information about
173 each insn-code value. */
174
175/* These are vectors indexed by insn-code. Details in genoutput.c. */
176
177extern char *const insn_template[];
178
179extern char *(*const insn_outfun[]) ();
180
181extern const int insn_n_operands[];
182
183extern const int insn_n_dups[];
184
185/* Indexed by insn code number, gives # of constraint alternatives. */
186
187extern const int insn_n_alternatives[];
188
189/* These are two-dimensional arrays indexed first by the insn-code
190 and second by the operand number. Details in genoutput.c. */
191
192#ifdef REGISTER_CONSTRAINTS /* Avoid undef sym in certain broken linkers. */
193extern char *const insn_operand_constraint[][MAX_RECOG_OPERANDS];
194#endif
195
196#ifndef REGISTER_CONSTRAINTS /* Avoid undef sym in certain broken linkers. */
197extern const char insn_operand_address_p[][MAX_RECOG_OPERANDS];
198#endif
199
200extern const enum machine_mode insn_operand_mode[][MAX_RECOG_OPERANDS];
201
202extern const char insn_operand_strict_low[][MAX_RECOG_OPERANDS];
203
204extern int (*const insn_operand_predicate[][MAX_RECOG_OPERANDS]) ();
205
206extern char * insn_name[];
This page took 0.64763 seconds and 5 git commands to generate.