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_handlers GTY(())
00042 {
00043 enum insn_code insn_code;
00044 rtx libfunc;
00045 };
00046
00047 struct optab GTY(())
00048 {
00049 enum rtx_code code;
00050 struct optab_handlers handlers[NUM_MACHINE_MODES];
00051 };
00052 typedef struct optab * optab;
00053
00054
00055
00056
00057 struct convert_optab GTY(())
00058 {
00059 enum rtx_code code;
00060 struct optab_handlers handlers[NUM_MACHINE_MODES][NUM_MACHINE_MODES];
00061 };
00062 typedef struct convert_optab *convert_optab;
00063
00064
00065
00066 #define GEN_FCN(CODE) (insn_data[CODE].genfun)
00067
00068
00069 enum optab_index
00070 {
00071 OTI_add,
00072 OTI_addv,
00073 OTI_sub,
00074 OTI_subv,
00075
00076
00077 OTI_smul,
00078 OTI_smulv,
00079
00080 OTI_smul_highpart,
00081 OTI_umul_highpart,
00082
00083 OTI_smul_widen,
00084 OTI_umul_widen,
00085
00086
00087 OTI_sdiv,
00088 OTI_sdivv,
00089
00090 OTI_sdivmod,
00091 OTI_udiv,
00092 OTI_udivmod,
00093
00094 OTI_smod,
00095 OTI_umod,
00096
00097 OTI_fmod,
00098 OTI_drem,
00099
00100 OTI_ftrunc,
00101
00102
00103 OTI_and,
00104
00105 OTI_ior,
00106
00107 OTI_xor,
00108
00109
00110 OTI_ashl,
00111
00112 OTI_lshr,
00113
00114 OTI_ashr,
00115
00116 OTI_rotl,
00117
00118 OTI_rotr,
00119
00120 OTI_smin,
00121
00122 OTI_smax,
00123
00124 OTI_umin,
00125
00126 OTI_umax,
00127
00128 OTI_pow,
00129
00130 OTI_atan2,
00131
00132
00133 OTI_mov,
00134
00135 OTI_movstrict,
00136
00137 OTI_movmisalign,
00138
00139
00140
00141 OTI_neg,
00142 OTI_negv,
00143
00144 OTI_abs,
00145 OTI_absv,
00146
00147 OTI_one_cmpl,
00148
00149 OTI_ffs,
00150 OTI_clz,
00151 OTI_ctz,
00152 OTI_popcount,
00153 OTI_parity,
00154
00155 OTI_sqrt,
00156
00157 OTI_sincos,
00158
00159 OTI_sin,
00160
00161 OTI_asin,
00162
00163 OTI_cos,
00164
00165 OTI_acos,
00166
00167 OTI_exp,
00168
00169 OTI_exp10,
00170
00171 OTI_exp2,
00172
00173 OTI_expm1,
00174
00175 OTI_ldexp,
00176
00177 OTI_logb,
00178 OTI_ilogb,
00179
00180 OTI_log,
00181
00182 OTI_log10,
00183
00184 OTI_log2,
00185
00186 OTI_log1p,
00187
00188 OTI_floor,
00189 OTI_ceil,
00190 OTI_btrunc,
00191 OTI_round,
00192 OTI_nearbyint,
00193 OTI_rint,
00194
00195 OTI_tan,
00196
00197 OTI_atan,
00198
00199 OTI_copysign,
00200
00201
00202 OTI_cmp,
00203
00204 OTI_ucmp,
00205
00206 OTI_tst,
00207
00208
00209 OTI_eq,
00210 OTI_ne,
00211 OTI_gt,
00212 OTI_ge,
00213 OTI_lt,
00214 OTI_le,
00215 OTI_unord,
00216
00217
00218 OTI_strlen,
00219
00220
00221 OTI_cbranch,
00222 OTI_cmov,
00223 OTI_cstore,
00224
00225
00226 OTI_push,
00227
00228
00229 OTI_addcc,
00230
00231
00232 OTI_vec_set,
00233
00234 OTI_vec_extract,
00235
00236 OTI_vec_init,
00237
00238 OTI_vec_realign_load,
00239
00240
00241 OTI_powi,
00242
00243 OTI_MAX
00244 };
00245
00246 extern GTY(()) optab optab_table[OTI_MAX];
00247
00248 #define add_optab (optab_table[OTI_add])
00249 #define sub_optab (optab_table[OTI_sub])
00250 #define smul_optab (optab_table[OTI_smul])
00251 #define addv_optab (optab_table[OTI_addv])
00252 #define subv_optab (optab_table[OTI_subv])
00253 #define smul_highpart_optab (optab_table[OTI_smul_highpart])
00254 #define umul_highpart_optab (optab_table[OTI_umul_highpart])
00255 #define smul_widen_optab (optab_table[OTI_smul_widen])
00256 #define umul_widen_optab (optab_table[OTI_umul_widen])
00257 #define sdiv_optab (optab_table[OTI_sdiv])
00258 #define smulv_optab (optab_table[OTI_smulv])
00259 #define sdivv_optab (optab_table[OTI_sdivv])
00260 #define sdivmod_optab (optab_table[OTI_sdivmod])
00261 #define udiv_optab (optab_table[OTI_udiv])
00262 #define udivmod_optab (optab_table[OTI_udivmod])
00263 #define smod_optab (optab_table[OTI_smod])
00264 #define umod_optab (optab_table[OTI_umod])
00265 #define fmod_optab (optab_table[OTI_fmod])
00266 #define drem_optab (optab_table[OTI_drem])
00267 #define ftrunc_optab (optab_table[OTI_ftrunc])
00268 #define and_optab (optab_table[OTI_and])
00269 #define ior_optab (optab_table[OTI_ior])
00270 #define xor_optab (optab_table[OTI_xor])
00271 #define ashl_optab (optab_table[OTI_ashl])
00272 #define lshr_optab (optab_table[OTI_lshr])
00273 #define ashr_optab (optab_table[OTI_ashr])
00274 #define rotl_optab (optab_table[OTI_rotl])
00275 #define rotr_optab (optab_table[OTI_rotr])
00276 #define smin_optab (optab_table[OTI_smin])
00277 #define smax_optab (optab_table[OTI_smax])
00278 #define umin_optab (optab_table[OTI_umin])
00279 #define umax_optab (optab_table[OTI_umax])
00280 #define pow_optab (optab_table[OTI_pow])
00281 #define atan2_optab (optab_table[OTI_atan2])
00282
00283 #define mov_optab (optab_table[OTI_mov])
00284 #define movstrict_optab (optab_table[OTI_movstrict])
00285 #define movmisalign_optab (optab_table[OTI_movmisalign])
00286
00287 #define neg_optab (optab_table[OTI_neg])
00288 #define negv_optab (optab_table[OTI_negv])
00289 #define abs_optab (optab_table[OTI_abs])
00290 #define absv_optab (optab_table[OTI_absv])
00291 #define one_cmpl_optab (optab_table[OTI_one_cmpl])
00292 #define ffs_optab (optab_table[OTI_ffs])
00293 #define clz_optab (optab_table[OTI_clz])
00294 #define ctz_optab (optab_table[OTI_ctz])
00295 #define popcount_optab (optab_table[OTI_popcount])
00296 #define parity_optab (optab_table[OTI_parity])
00297 #define sqrt_optab (optab_table[OTI_sqrt])
00298 #define sincos_optab (optab_table[OTI_sincos])
00299 #define sin_optab (optab_table[OTI_sin])
00300 #define asin_optab (optab_table[OTI_asin])
00301 #define cos_optab (optab_table[OTI_cos])
00302 #define acos_optab (optab_table[OTI_acos])
00303 #define exp_optab (optab_table[OTI_exp])
00304 #define exp10_optab (optab_table[OTI_exp10])
00305 #define exp2_optab (optab_table[OTI_exp2])
00306 #define expm1_optab (optab_table[OTI_expm1])
00307 #define ldexp_optab (optab_table[OTI_ldexp])
00308 #define logb_optab (optab_table[OTI_logb])
00309 #define ilogb_optab (optab_table[OTI_ilogb])
00310 #define log_optab (optab_table[OTI_log])
00311 #define log10_optab (optab_table[OTI_log10])
00312 #define log2_optab (optab_table[OTI_log2])
00313 #define log1p_optab (optab_table[OTI_log1p])
00314 #define floor_optab (optab_table[OTI_floor])
00315 #define ceil_optab (optab_table[OTI_ceil])
00316 #define btrunc_optab (optab_table[OTI_btrunc])
00317 #define round_optab (optab_table[OTI_round])
00318 #define nearbyint_optab (optab_table[OTI_nearbyint])
00319 #define rint_optab (optab_table[OTI_rint])
00320 #define tan_optab (optab_table[OTI_tan])
00321 #define atan_optab (optab_table[OTI_atan])
00322 #define copysign_optab (optab_table[OTI_copysign])
00323
00324 #define cmp_optab (optab_table[OTI_cmp])
00325 #define ucmp_optab (optab_table[OTI_ucmp])
00326 #define tst_optab (optab_table[OTI_tst])
00327
00328 #define eq_optab (optab_table[OTI_eq])
00329 #define ne_optab (optab_table[OTI_ne])
00330 #define gt_optab (optab_table[OTI_gt])
00331 #define ge_optab (optab_table[OTI_ge])
00332 #define lt_optab (optab_table[OTI_lt])
00333 #define le_optab (optab_table[OTI_le])
00334 #define unord_optab (optab_table[OTI_unord])
00335
00336 #define strlen_optab (optab_table[OTI_strlen])
00337
00338 #define cbranch_optab (optab_table[OTI_cbranch])
00339 #define cmov_optab (optab_table[OTI_cmov])
00340 #define cstore_optab (optab_table[OTI_cstore])
00341 #define push_optab (optab_table[OTI_push])
00342 #define addcc_optab (optab_table[OTI_addcc])
00343
00344 #define vec_set_optab (optab_table[OTI_vec_set])
00345 #define vec_extract_optab (optab_table[OTI_vec_extract])
00346 #define vec_init_optab (optab_table[OTI_vec_init])
00347 #define vec_realign_load_optab (optab_table[OTI_vec_realign_load])
00348
00349 #define powi_optab (optab_table[OTI_powi])
00350
00351
00352 enum convert_optab_index
00353 {
00354 CTI_sext,
00355 CTI_zext,
00356 CTI_trunc,
00357
00358 CTI_sfix,
00359 CTI_ufix,
00360
00361 CTI_sfixtrunc,
00362 CTI_ufixtrunc,
00363
00364 CTI_sfloat,
00365 CTI_ufloat,
00366
00367 CTI_MAX
00368 };
00369
00370 extern GTY(()) convert_optab convert_optab_table[CTI_MAX];
00371
00372 #define sext_optab (convert_optab_table[CTI_sext])
00373 #define zext_optab (convert_optab_table[CTI_zext])
00374 #define trunc_optab (convert_optab_table[CTI_trunc])
00375 #define sfix_optab (convert_optab_table[CTI_sfix])
00376 #define ufix_optab (convert_optab_table[CTI_ufix])
00377 #define sfixtrunc_optab (convert_optab_table[CTI_sfixtrunc])
00378 #define ufixtrunc_optab (convert_optab_table[CTI_ufixtrunc])
00379 #define sfloat_optab (convert_optab_table[CTI_sfloat])
00380 #define ufloat_optab (convert_optab_table[CTI_ufloat])
00381
00382
00383
00384
00385 extern enum insn_code reload_in_optab[NUM_MACHINE_MODES];
00386 extern enum insn_code reload_out_optab[NUM_MACHINE_MODES];
00387
00388
00389 extern GTY(()) optab code_to_optab[NUM_RTX_CODE + 1];
00390
00391
00392 typedef rtx (*rtxfun) (rtx);
00393
00394
00395
00396
00397 extern rtxfun bcc_gen_fctn[NUM_RTX_CODE];
00398
00399
00400
00401
00402
00403 extern enum insn_code setcc_gen_code[NUM_RTX_CODE];
00404
00405 #ifdef HAVE_conditional_move
00406
00407
00408
00409 extern enum insn_code movcc_gen_code[NUM_MACHINE_MODES];
00410 #endif
00411
00412
00413
00414
00415 extern enum insn_code vcond_gen_code[NUM_MACHINE_MODES];
00416 extern enum insn_code vcondu_gen_code[NUM_MACHINE_MODES];
00417
00418
00419 extern enum insn_code movmem_optab[NUM_MACHINE_MODES];
00420
00421
00422 extern enum insn_code clrmem_optab[NUM_MACHINE_MODES];
00423
00424
00425
00426 extern enum insn_code cmpstr_optab[NUM_MACHINE_MODES];
00427 extern enum insn_code cmpmem_optab[NUM_MACHINE_MODES];
00428
00429
00430
00431 extern rtx expand_ternary_op (enum machine_mode mode, optab ternary_optab,
00432 rtx op0, rtx op1, rtx op2, rtx target,
00433 int unsignedp);
00434
00435
00436 extern rtx expand_binop (enum machine_mode, optab, rtx, rtx, rtx, int,
00437 enum optab_methods);
00438
00439 extern bool force_expand_binop (enum machine_mode, optab, rtx, rtx, rtx, int,
00440 enum optab_methods);
00441
00442
00443 extern rtx sign_expand_binop (enum machine_mode, optab, optab, rtx, rtx,
00444 rtx, int, enum optab_methods);
00445
00446
00447 extern int expand_twoval_unop (optab, rtx, rtx, rtx, int);
00448
00449
00450 extern int expand_twoval_binop (optab, rtx, rtx, rtx, rtx, int);
00451
00452
00453
00454 extern bool expand_twoval_binop_libfunc (optab, rtx, rtx, rtx, rtx,
00455 enum rtx_code);
00456
00457
00458 extern rtx expand_unop (enum machine_mode, optab, rtx, rtx, int);
00459
00460
00461 extern rtx expand_abs_nojump (enum machine_mode, rtx, rtx, int);
00462 extern rtx expand_abs (enum machine_mode, rtx, rtx, int, int);
00463
00464
00465 extern rtx expand_copysign (rtx, rtx, rtx);
00466 extern rtx expand_copysign_absneg (enum machine_mode, rtx, rtx, rtx, int, bool);
00467
00468
00469
00470 extern void emit_unop_insn (int, rtx, rtx, enum rtx_code);
00471
00472
00473
00474 extern rtx emit_no_conflict_block (rtx, rtx, rtx, rtx, rtx);
00475
00476
00477 extern void emit_cmp_insn (rtx, rtx, enum rtx_code, rtx, enum machine_mode,
00478 int);
00479
00480
00481
00482 enum can_compare_purpose
00483 {
00484 ccp_jump,
00485 ccp_cmov,
00486 ccp_store_flag
00487 };
00488
00489
00490
00491 extern optab optab_for_tree_code (enum tree_code, tree);
00492
00493
00494
00495 extern int can_compare_p (enum rtx_code, enum machine_mode,
00496 enum can_compare_purpose);
00497
00498
00499 extern enum insn_code can_extend_p (enum machine_mode, enum machine_mode, int);
00500
00501
00502
00503 extern rtx gen_extend_insn (rtx, rtx, enum machine_mode,
00504 enum machine_mode, int);
00505
00506
00507 extern void set_optab_libfunc (optab, enum machine_mode, const char *);
00508 extern void set_conv_libfunc (convert_optab, enum machine_mode,
00509 enum machine_mode, const char *);
00510
00511
00512 extern void expand_float (rtx, rtx, int);
00513
00514
00515 extern void expand_fix (rtx, rtx, int);
00516
00517
00518 bool expand_vec_cond_expr_p (tree, enum machine_mode);
00519
00520
00521 extern rtx expand_vec_cond_expr (tree, rtx);
00522
00523 #endif