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 #define recog_memoized(I) (INSN_CODE (I) >= 0 \
00025 ? INSN_CODE (I) : recog_memoized_1 (I))
00026
00027
00028 enum op_type {
00029 OP_IN,
00030 OP_OUT,
00031 OP_INOUT
00032 };
00033
00034 struct operand_alternative
00035 {
00036
00037
00038 const char *constraint;
00039
00040
00041 enum reg_class class;
00042
00043
00044
00045 unsigned int reject;
00046
00047
00048 int matches;
00049
00050
00051
00052 int matched;
00053
00054
00055 unsigned int earlyclobber:1;
00056
00057 unsigned int memory_ok:1;
00058
00059 unsigned int offmem_ok:1;
00060
00061 unsigned int nonoffmem_ok:1;
00062
00063 unsigned int decmem_ok:1;
00064
00065 unsigned int incmem_ok:1;
00066
00067 unsigned int is_address:1;
00068
00069
00070 unsigned int anything_ok:1;
00071 };
00072
00073
00074 extern void init_recog PARAMS ((void));
00075 extern void init_recog_no_volatile PARAMS ((void));
00076 extern int recog_memoized_1 PARAMS ((rtx));
00077 extern int check_asm_operands PARAMS ((rtx));
00078 extern int asm_operand_ok PARAMS ((rtx, const char *));
00079 extern int validate_change PARAMS ((rtx, rtx *, rtx, int));
00080 extern int insn_invalid_p PARAMS ((rtx));
00081 extern int apply_change_group PARAMS ((void));
00082 extern int num_validated_changes PARAMS ((void));
00083 extern void cancel_changes PARAMS ((int));
00084 extern int constrain_operands PARAMS ((int));
00085 extern int constrain_operands_cached PARAMS ((int));
00086 extern int memory_address_p PARAMS ((enum machine_mode, rtx));
00087 extern int strict_memory_address_p PARAMS ((enum machine_mode, rtx));
00088 extern int validate_replace_rtx_subexp PARAMS ((rtx, rtx, rtx, rtx *));
00089 extern int validate_replace_rtx PARAMS ((rtx, rtx, rtx));
00090 extern void validate_replace_rtx_group PARAMS ((rtx, rtx, rtx));
00091 extern int validate_replace_src PARAMS ((rtx, rtx, rtx));
00092 extern void validate_replace_src_group PARAMS ((rtx, rtx, rtx));
00093 extern int num_changes_pending PARAMS ((void));
00094 #ifdef HAVE_cc0
00095 extern int next_insn_tests_no_inequality PARAMS ((rtx));
00096 #endif
00097 extern int reg_fits_class_p PARAMS ((rtx, enum reg_class, int,
00098 enum machine_mode));
00099 extern rtx *find_single_use PARAMS ((rtx, rtx, rtx *));
00100
00101 extern int general_operand PARAMS ((rtx, enum machine_mode));
00102 extern int address_operand PARAMS ((rtx, enum machine_mode));
00103 extern int register_operand PARAMS ((rtx, enum machine_mode));
00104 extern int pmode_register_operand PARAMS ((rtx, enum machine_mode));
00105 extern int scratch_operand PARAMS ((rtx, enum machine_mode));
00106 extern int immediate_operand PARAMS ((rtx, enum machine_mode));
00107 extern int const_int_operand PARAMS ((rtx, enum machine_mode));
00108 extern int const_double_operand PARAMS ((rtx, enum machine_mode));
00109 extern int nonimmediate_operand PARAMS ((rtx, enum machine_mode));
00110 extern int nonmemory_operand PARAMS ((rtx, enum machine_mode));
00111 extern int push_operand PARAMS ((rtx, enum machine_mode));
00112 extern int pop_operand PARAMS ((rtx, enum machine_mode));
00113 extern int memory_operand PARAMS ((rtx, enum machine_mode));
00114 extern int indirect_operand PARAMS ((rtx, enum machine_mode));
00115 extern int mode_independent_operand PARAMS ((rtx, enum machine_mode));
00116 extern int comparison_operator PARAMS ((rtx, enum machine_mode));
00117
00118 extern int offsettable_memref_p PARAMS ((rtx));
00119 extern int offsettable_nonstrict_memref_p PARAMS ((rtx));
00120 extern int offsettable_address_p PARAMS ((int, enum machine_mode, rtx));
00121 extern int mode_dependent_address_p PARAMS ((rtx));
00122
00123 extern int recog PARAMS ((rtx, rtx, int *));
00124 extern void add_clobbers PARAMS ((rtx, int));
00125 extern int added_clobbers_hard_reg_p PARAMS ((int));
00126 extern void insn_extract PARAMS ((rtx));
00127 extern void extract_insn PARAMS ((rtx));
00128 extern void extract_constrain_insn_cached PARAMS ((rtx));
00129 extern void extract_insn_cached PARAMS ((rtx));
00130 extern void preprocess_constraints PARAMS ((void));
00131 extern rtx peep2_next_insn PARAMS ((int));
00132 extern int peep2_regno_dead_p PARAMS ((int, int));
00133 extern int peep2_reg_dead_p PARAMS ((int, rtx));
00134 #ifdef CLEAR_HARD_REG_SET
00135 extern rtx peep2_find_free_register PARAMS ((int, int, const char *,
00136 enum machine_mode,
00137 HARD_REG_SET *));
00138 #endif
00139 extern void peephole2_optimize PARAMS ((FILE *));
00140 extern rtx peephole2_insns PARAMS ((rtx, rtx, int *));
00141
00142 extern int store_data_bypass_p PARAMS ((rtx, rtx));
00143 extern int if_test_bypass_p PARAMS ((rtx, rtx));
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) PARAMS ((rtx, enum machine_mode));
00218 typedef const char * (*insn_output_fn) PARAMS ((rtx *, rtx));
00219 typedef rtx (*insn_gen_fn) PARAMS ((rtx, ...));
00220
00221 struct insn_operand_data
00222 {
00223 const insn_operand_predicate_fn predicate;
00224
00225 const char *const constraint;
00226
00227 const ENUM_BITFIELD(machine_mode) 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 const PTR output;
00245 const insn_gen_fn genfun;
00246 const struct insn_operand_data *const operand;
00247
00248 const char n_operands;
00249 const char n_dups;
00250 const char n_alternatives;
00251 const char output_format;
00252 };
00253
00254 extern const struct insn_data insn_data[];