00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #define MAX_RECOG_ALTERNATIVES 30
00024
00025
00026 enum op_type {
00027 OP_IN,
00028 OP_OUT,
00029 OP_INOUT
00030 };
00031
00032 struct operand_alternative
00033 {
00034
00035
00036 const char *constraint;
00037
00038
00039 enum reg_class cl;
00040
00041
00042
00043 unsigned int reject;
00044
00045
00046 int matches;
00047
00048
00049
00050 int matched;
00051
00052
00053 unsigned int earlyclobber:1;
00054
00055 unsigned int memory_ok:1;
00056
00057 unsigned int offmem_ok:1;
00058
00059 unsigned int nonoffmem_ok:1;
00060
00061 unsigned int decmem_ok:1;
00062
00063 unsigned int incmem_ok:1;
00064
00065 unsigned int is_address:1;
00066
00067
00068 unsigned int anything_ok:1;
00069 };
00070
00071
00072 extern void init_recog (void);
00073 extern void init_recog_no_volatile (void);
00074 extern int check_asm_operands (rtx);
00075 extern int asm_operand_ok (rtx, const char *);
00076 extern int validate_change (rtx, rtx *, rtx, int);
00077 extern int insn_invalid_p (rtx);
00078 extern int verify_changes (int);
00079 extern void confirm_change_group (void);
00080 extern int apply_change_group (void);
00081 extern int num_validated_changes (void);
00082 extern void cancel_changes (int);
00083 extern int constrain_operands (int);
00084 extern int constrain_operands_cached (int);
00085 extern int memory_address_p (enum machine_mode, rtx);
00086 extern int strict_memory_address_p (enum machine_mode, rtx);
00087 extern int validate_replace_rtx (rtx, rtx, rtx);
00088 extern void validate_replace_rtx_group (rtx, rtx, rtx);
00089 extern void validate_replace_src_group (rtx, rtx, rtx);
00090 extern bool validate_simplify_insn (rtx insn);
00091 extern int num_changes_pending (void);
00092 #ifdef HAVE_cc0
00093 extern int next_insn_tests_no_inequality (rtx);
00094 #endif
00095 extern int reg_fits_class_p (rtx, enum reg_class, int, enum machine_mode);
00096 extern rtx *find_single_use (rtx, rtx, rtx *);
00097
00098 extern int offsettable_memref_p (rtx);
00099 extern int offsettable_nonstrict_memref_p (rtx);
00100 extern int offsettable_address_p (int, enum machine_mode, rtx);
00101 extern int mode_dependent_address_p (rtx);
00102
00103 extern int recog (rtx, rtx, int *);
00104 #ifndef GENERATOR_FILE
00105 static inline int recog_memoized (rtx insn);
00106 #endif
00107 extern void add_clobbers (rtx, int);
00108 extern int added_clobbers_hard_reg_p (int);
00109 extern void insn_extract (rtx);
00110 extern void extract_insn (rtx);
00111 extern void extract_constrain_insn_cached (rtx);
00112 extern void extract_insn_cached (rtx);
00113 extern void preprocess_constraints (void);
00114 extern rtx peep2_next_insn (int);
00115 extern int peep2_regno_dead_p (int, int);
00116 extern int peep2_reg_dead_p (int, rtx);
00117 #ifdef CLEAR_HARD_REG_SET
00118 extern rtx peep2_find_free_register (int, int, const char *,
00119 enum machine_mode, HARD_REG_SET *);
00120 #endif
00121 extern rtx peephole2_insns (rtx, rtx, int *);
00122
00123 extern int store_data_bypass_p (rtx, rtx);
00124 extern int if_test_bypass_p (rtx, rtx);
00125
00126 #ifndef GENERATOR_FILE
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 static inline int
00137 recog_memoized (rtx insn)
00138 {
00139 if (INSN_CODE (insn) < 0)
00140 INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
00141 return INSN_CODE (insn);
00142 }
00143 #endif
00144
00145
00146 extern int volatile_ok;
00147
00148
00149
00150 extern int which_alternative;
00151
00152
00153
00154 struct recog_data
00155 {
00156
00157
00158
00159
00160
00161
00162
00163 rtx operand[MAX_RECOG_OPERANDS];
00164
00165
00166 rtx *operand_loc[MAX_RECOG_OPERANDS];
00167
00168
00169 const char *constraints[MAX_RECOG_OPERANDS];
00170
00171
00172 enum machine_mode operand_mode[MAX_RECOG_OPERANDS];
00173
00174
00175 enum op_type operand_type[MAX_RECOG_OPERANDS];
00176
00177
00178
00179 rtx *dup_loc[MAX_DUP_OPERANDS];
00180
00181
00182
00183 char dup_num[MAX_DUP_OPERANDS];
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196 char n_operands;
00197
00198
00199 char n_dups;
00200
00201
00202 char n_alternatives;
00203
00204
00205 rtx insn;
00206 };
00207
00208 extern struct recog_data recog_data;
00209
00210
00211
00212 extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES];
00213
00214
00215
00216
00217 typedef int (*insn_operand_predicate_fn) (rtx, enum machine_mode);
00218 typedef const char * (*insn_output_fn) (rtx *, rtx);
00219 typedef rtx (*insn_gen_fn) (rtx, ...);
00220
00221 struct insn_operand_data
00222 {
00223 const insn_operand_predicate_fn predicate;
00224
00225 const char *const constraint;
00226
00227 ENUM_BITFIELD(machine_mode) const mode : 16;
00228
00229 const char strict_low;
00230
00231 const char eliminable;
00232 };
00233
00234
00235
00236 #define INSN_OUTPUT_FORMAT_NONE 0
00237 #define INSN_OUTPUT_FORMAT_SINGLE 1
00238 #define INSN_OUTPUT_FORMAT_MULTI 2
00239 #define INSN_OUTPUT_FORMAT_FUNCTION 3
00240
00241 struct insn_data
00242 {
00243 const char *const name;
00244 #if HAVE_DESIGNATED_INITIALIZERS
00245 union {
00246 const char *single;
00247 const char *const *multi;
00248 insn_output_fn function;
00249 } output;
00250 #else
00251 struct {
00252 const char *single;
00253 const char *const *multi;
00254 insn_output_fn function;
00255 } output;
00256 #endif
00257 const insn_gen_fn genfun;
00258 const struct insn_operand_data *const operand;
00259
00260 const char n_operands;
00261 const char n_dups;
00262 const char n_alternatives;
00263 const char output_format;
00264 };
00265
00266 extern const struct insn_data insn_data[];
00267 extern int peep2_current_count;