00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GCC_OPTABS_H
00022 #define GCC_OPTABS_H
00023
00024 #include "insn-codes.h"
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 struct optab GTY(())
00042 {
00043 enum rtx_code code;
00044 struct optab_handlers {
00045 enum insn_code insn_code;
00046 rtx libfunc;
00047 } handlers [NUM_MACHINE_MODES];
00048 };
00049 typedef struct optab * optab;
00050
00051
00052
00053 #define GEN_FCN(CODE) (*insn_data[(int) (CODE)].genfun)
00054
00055
00056 enum optab_index
00057 {
00058 OTI_add,
00059 OTI_addv,
00060 OTI_sub,
00061 OTI_subv,
00062
00063
00064 OTI_smul,
00065 OTI_smulv,
00066
00067 OTI_smul_highpart,
00068 OTI_umul_highpart,
00069
00070 OTI_smul_widen,
00071 OTI_umul_widen,
00072
00073
00074 OTI_sdiv,
00075 OTI_sdivv,
00076
00077 OTI_sdivmod,
00078 OTI_udiv,
00079 OTI_udivmod,
00080
00081 OTI_smod,
00082 OTI_umod,
00083
00084 OTI_ftrunc,
00085
00086
00087 OTI_and,
00088
00089 OTI_ior,
00090
00091 OTI_xor,
00092
00093
00094 OTI_ashl,
00095
00096 OTI_lshr,
00097
00098 OTI_ashr,
00099
00100 OTI_rotl,
00101
00102 OTI_rotr,
00103
00104 OTI_smin,
00105
00106 OTI_smax,
00107
00108 OTI_umin,
00109
00110 OTI_umax,
00111
00112
00113 OTI_mov,
00114
00115 OTI_movstrict,
00116
00117
00118
00119 OTI_neg,
00120 OTI_negv,
00121
00122 OTI_abs,
00123 OTI_absv,
00124
00125 OTI_one_cmpl,
00126
00127 OTI_ffs,
00128
00129 OTI_sqrt,
00130
00131 OTI_sin,
00132
00133 OTI_cos,
00134
00135 OTI_exp,
00136
00137 OTI_log,
00138
00139
00140 OTI_cmp,
00141
00142 OTI_ucmp,
00143
00144 OTI_tst,
00145
00146
00147 OTI_strlen,
00148
00149
00150 OTI_cbranch,
00151 OTI_cmov,
00152 OTI_cstore,
00153
00154
00155 OTI_push,
00156
00157 OTI_MAX
00158 };
00159
00160 extern GTY(()) optab optab_table[OTI_MAX];
00161
00162 #define add_optab (optab_table[OTI_add])
00163 #define sub_optab (optab_table[OTI_sub])
00164 #define smul_optab (optab_table[OTI_smul])
00165 #define addv_optab (optab_table[OTI_addv])
00166 #define subv_optab (optab_table[OTI_subv])
00167 #define smul_highpart_optab (optab_table[OTI_smul_highpart])
00168 #define umul_highpart_optab (optab_table[OTI_umul_highpart])
00169 #define smul_widen_optab (optab_table[OTI_smul_widen])
00170 #define umul_widen_optab (optab_table[OTI_umul_widen])
00171 #define sdiv_optab (optab_table[OTI_sdiv])
00172 #define smulv_optab (optab_table[OTI_smulv])
00173 #define sdivv_optab (optab_table[OTI_sdivv])
00174 #define sdivmod_optab (optab_table[OTI_sdivmod])
00175 #define udiv_optab (optab_table[OTI_udiv])
00176 #define udivmod_optab (optab_table[OTI_udivmod])
00177 #define smod_optab (optab_table[OTI_smod])
00178 #define umod_optab (optab_table[OTI_umod])
00179 #define ftrunc_optab (optab_table[OTI_ftrunc])
00180 #define and_optab (optab_table[OTI_and])
00181 #define ior_optab (optab_table[OTI_ior])
00182 #define xor_optab (optab_table[OTI_xor])
00183 #define ashl_optab (optab_table[OTI_ashl])
00184 #define lshr_optab (optab_table[OTI_lshr])
00185 #define ashr_optab (optab_table[OTI_ashr])
00186 #define rotl_optab (optab_table[OTI_rotl])
00187 #define rotr_optab (optab_table[OTI_rotr])
00188 #define smin_optab (optab_table[OTI_smin])
00189 #define smax_optab (optab_table[OTI_smax])
00190 #define umin_optab (optab_table[OTI_umin])
00191 #define umax_optab (optab_table[OTI_umax])
00192
00193 #define mov_optab (optab_table[OTI_mov])
00194 #define movstrict_optab (optab_table[OTI_movstrict])
00195
00196 #define neg_optab (optab_table[OTI_neg])
00197 #define negv_optab (optab_table[OTI_negv])
00198 #define abs_optab (optab_table[OTI_abs])
00199 #define absv_optab (optab_table[OTI_absv])
00200 #define one_cmpl_optab (optab_table[OTI_one_cmpl])
00201 #define ffs_optab (optab_table[OTI_ffs])
00202 #define sqrt_optab (optab_table[OTI_sqrt])
00203 #define sin_optab (optab_table[OTI_sin])
00204 #define cos_optab (optab_table[OTI_cos])
00205 #define exp_optab (optab_table[OTI_exp])
00206 #define log_optab (optab_table[OTI_log])
00207
00208 #define cmp_optab (optab_table[OTI_cmp])
00209 #define ucmp_optab (optab_table[OTI_ucmp])
00210 #define tst_optab (optab_table[OTI_tst])
00211
00212 #define strlen_optab (optab_table[OTI_strlen])
00213
00214 #define cbranch_optab (optab_table[OTI_cbranch])
00215 #define cmov_optab (optab_table[OTI_cmov])
00216 #define cstore_optab (optab_table[OTI_cstore])
00217 #define push_optab (optab_table[OTI_push])
00218
00219
00220 extern enum insn_code extendtab[MAX_MACHINE_MODE][MAX_MACHINE_MODE][2];
00221
00222
00223 extern enum insn_code fixtab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
00224 extern enum insn_code fixtrunctab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
00225 extern enum insn_code floattab[NUM_MACHINE_MODES][NUM_MACHINE_MODES][2];
00226
00227
00228
00229
00230 extern enum insn_code reload_in_optab[NUM_MACHINE_MODES];
00231 extern enum insn_code reload_out_optab[NUM_MACHINE_MODES];
00232
00233
00234 extern optab code_to_optab[NUM_RTX_CODE + 1];
00235
00236
00237 typedef rtx (*rtxfun) PARAMS ((rtx));
00238
00239
00240
00241
00242 extern rtxfun bcc_gen_fctn[NUM_RTX_CODE];
00243
00244
00245
00246
00247
00248 extern enum insn_code setcc_gen_code[NUM_RTX_CODE];
00249
00250 #ifdef HAVE_conditional_move
00251
00252
00253
00254 extern enum insn_code movcc_gen_code[NUM_MACHINE_MODES];
00255 #endif
00256
00257
00258 extern enum insn_code movstr_optab[NUM_MACHINE_MODES];
00259
00260
00261 extern enum insn_code clrstr_optab[NUM_MACHINE_MODES];
00262
00263
00264
00265
00266 extern rtx expand_binop PARAMS ((enum machine_mode, optab, rtx, rtx, rtx,
00267 int, enum optab_methods));
00268
00269
00270 extern rtx sign_expand_binop PARAMS ((enum machine_mode, optab, optab, rtx,
00271 rtx, rtx, int, enum optab_methods));
00272
00273
00274 extern int expand_twoval_binop PARAMS ((optab, rtx, rtx, rtx, rtx, int));
00275
00276
00277 extern rtx expand_unop PARAMS ((enum machine_mode, optab, rtx, rtx, int));
00278
00279
00280 extern rtx expand_abs PARAMS ((enum machine_mode, rtx, rtx, int, int));
00281
00282
00283 extern rtx expand_complex_abs PARAMS ((enum machine_mode, rtx, rtx, int));
00284
00285
00286
00287 extern void emit_unop_insn PARAMS ((int, rtx, rtx, enum rtx_code));
00288
00289
00290
00291 extern rtx emit_no_conflict_block PARAMS ((rtx, rtx, rtx, rtx, rtx));
00292
00293
00294 extern void emit_clr_insn PARAMS ((rtx));
00295
00296
00297 extern void emit_0_to_1_insn PARAMS ((rtx));
00298
00299
00300 extern void emit_cmp_insn PARAMS ((rtx, rtx, enum rtx_code, rtx,
00301 enum machine_mode, int));
00302
00303
00304
00305 enum can_compare_purpose
00306 {
00307 ccp_jump,
00308 ccp_cmov,
00309 ccp_store_flag
00310 };
00311
00312
00313
00314 extern int can_compare_p PARAMS ((enum rtx_code, enum machine_mode,
00315 enum can_compare_purpose));
00316
00317 extern rtx prepare_operand PARAMS ((int, rtx, int, enum machine_mode,
00318 enum machine_mode, int));
00319
00320
00321 extern enum insn_code can_extend_p PARAMS ((enum machine_mode,
00322 enum machine_mode, int));
00323
00324
00325
00326 extern rtx gen_extend_insn PARAMS ((rtx, rtx, enum machine_mode,
00327 enum machine_mode, int));
00328
00329
00330
00331 extern void init_fixtab PARAMS ((void));
00332 extern void init_floattab PARAMS ((void));
00333
00334
00335 extern void expand_float PARAMS ((rtx, rtx, int));
00336
00337
00338 extern void expand_fix PARAMS ((rtx, rtx, int));
00339
00340 #endif