OSDN Git Service

* recog.h (enum op_type): Define.
[pf3gnuchains/gcc-fork.git] / gcc / recog.h
1 /* Declarations for interface to insn recognizer and insn-output.c.
2    Copyright (C) 1987, 1996, 1997 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 #include "gansidecl.h"
22
23 /* Types of operands.  */
24 enum op_type {
25   OP_IN,
26   OP_OUT,
27   OP_INOUT
28 };
29
30 extern void init_recog                  PROTO((void));
31 extern void init_recog_no_volatile      PROTO((void));
32 extern int recog_memoized               PROTO((rtx));
33 extern int check_asm_operands           PROTO((rtx));
34 extern int validate_change              PROTO((rtx, rtx *, rtx, int));
35 extern int apply_change_group           PROTO((void));
36 extern int num_validated_changes        PROTO((void));
37 extern void cancel_changes              PROTO((int));
38 extern int constrain_operands           PROTO((int));
39 extern int memory_address_p             PROTO((enum machine_mode, rtx));
40 extern int strict_memory_address_p      PROTO((enum machine_mode, rtx));
41 extern int validate_replace_rtx         PROTO((rtx, rtx, rtx));
42 extern void validate_replace_rtx_group  PROTO((rtx, rtx, rtx));
43 extern int validate_replace_src         PROTO((rtx, rtx, rtx));
44 extern int reg_fits_class_p             PROTO((rtx, enum reg_class, int,
45                                                enum machine_mode));
46 extern rtx *find_single_use             PROTO((rtx, rtx, rtx *));
47
48 extern int general_operand              PROTO((rtx, enum machine_mode));
49 extern int address_operand              PROTO((rtx, enum machine_mode));
50 extern int register_operand             PROTO((rtx, enum machine_mode));
51 extern int scratch_operand              PROTO((rtx, enum machine_mode));
52 extern int immediate_operand            PROTO((rtx, enum machine_mode));
53 extern int const_int_operand            PROTO((rtx, enum machine_mode));
54 extern int const_double_operand         PROTO((rtx, enum machine_mode));
55 extern int nonimmediate_operand         PROTO((rtx, enum machine_mode));
56 extern int nonmemory_operand            PROTO((rtx, enum machine_mode));
57 extern int push_operand                 PROTO((rtx, enum machine_mode));
58 extern int memory_operand               PROTO((rtx, enum machine_mode));
59 extern int indirect_operand             PROTO((rtx, enum machine_mode));
60 extern int mode_independent_operand     PROTO((rtx, enum machine_mode));
61 extern int comparison_operator          PROTO((rtx, enum machine_mode));
62
63 extern int offsettable_memref_p         PROTO((rtx));
64 extern int offsettable_nonstrict_memref_p       PROTO((rtx));
65 extern int offsettable_address_p        PROTO((int, enum machine_mode, rtx));
66 extern int mode_dependent_address_p     PROTO((rtx));
67
68 extern int recog                        PROTO((rtx, rtx, int *));
69 extern void add_clobbers                PROTO((rtx, int));
70 extern void insn_extract                PROTO((rtx));
71 extern void extract_insn                PROTO((rtx));
72
73 /* Nonzero means volatile operands are recognized.  */
74 extern int volatile_ok;
75
76 /* Set by constrain_operands to the number of the alternative that
77    matched.  */
78 extern int which_alternative;
79
80 /* The following vectors hold the results from insn_extract.  */
81
82 /* Indexed by N, gives value of operand N.  */
83 extern rtx recog_operand[];
84
85 /* Indexed by N, gives location where operand N was found.  */
86 extern rtx *recog_operand_loc[];
87
88 /* Indexed by N, gives location where the Nth duplicate-appearance of
89    an operand was found.  This is something that matched MATCH_DUP.  */
90 extern rtx *recog_dup_loc[];
91
92 /* Indexed by N, gives the operand number that was duplicated in the
93    Nth duplicate-appearance of an operand.  */
94 extern char recog_dup_num[];
95
96 /* The next variables are set up by extract_insn.  */
97
98 /* The number of operands of the insn.  */
99 extern int recog_n_operands;
100
101 /* The number of MATCH_DUPs in the insn.  */
102 extern int recog_n_dups;
103
104 /* The number of alternatives in the constraints for the insn.  */
105 extern int recog_n_alternatives;
106
107 /* Indexed by N, gives the mode of operand N.  */
108 extern enum machine_mode recog_operand_mode[];
109
110 /* Indexed by N, gives the constraint string for operand N.  */
111 extern char *recog_constraints[];
112
113 /* Indexed by N, gives the type (in, out, inout) for operand N.  */
114 extern enum op_type recog_op_type[];
115
116 #ifndef REGISTER_CONSTRAINTS
117 /* Indexed by N, nonzero if operand N should be an address.  */
118 extern char recog_operand_address_p[];
119 #endif
120
121 /* Access the output function for CODE.  */
122
123 #define OUT_FCN(CODE) (*insn_outfun[(int) (CODE)])
124
125 /* Tables defined in insn-output.c that give information about
126    each insn-code value.  */
127
128 /* These are vectors indexed by insn-code.  Details in genoutput.c.  */
129
130 extern char *const insn_template[];
131
132 extern char *(*const insn_outfun[]) ();
133
134 extern const int insn_n_operands[];
135
136 extern const int insn_n_dups[];
137
138 /* Indexed by insn code number, gives # of constraint alternatives.  */
139
140 extern const int insn_n_alternatives[];
141
142 /* These are two-dimensional arrays indexed first by the insn-code
143    and second by the operand number.  Details in genoutput.c.  */
144
145 #ifdef REGISTER_CONSTRAINTS  /* Avoid undef sym in certain broken linkers.  */
146 extern char *const insn_operand_constraint[][MAX_RECOG_OPERANDS];
147 #endif
148
149 #ifndef REGISTER_CONSTRAINTS  /* Avoid undef sym in certain broken linkers.  */
150 extern const char insn_operand_address_p[][MAX_RECOG_OPERANDS];
151 #endif
152
153 extern const enum machine_mode insn_operand_mode[][MAX_RECOG_OPERANDS];
154
155 extern const char insn_operand_strict_low[][MAX_RECOG_OPERANDS];
156
157 extern int (*const insn_operand_predicate[][MAX_RECOG_OPERANDS]) ();
158
159 extern char * insn_name[];