23#include "insn-codes.h"
66#define MULT_COST_LESS(X,Y) ((X)->cost < (Y) \
67 || ((X)->cost == (Y) && (X)->latency < (Y)))
73#define CHEAPER_MULT_COST(X,Y) ((X)->cost < (Y)->cost \
74 || ((X)->cost == (Y)->cost \
75 && (X)->latency < (Y)->latency))
112 unsigned HOST_WIDE_INT
t;
130#if HOST_BITS_PER_WIDE_INT == 64
131#define NUM_ALG_HASH_ENTRIES 1031
133#define NUM_ALG_HASH_ENTRIES 307
136#define NUM_MODE_IP_INT (NUM_MODE_INT + NUM_MODE_PARTIAL_INT)
137#define NUM_MODE_IPV_INT (NUM_MODE_IP_INT + NUM_MODE_VECTOR_INT)
188#define this_target_expmed (&default_target_expmed)
223 return mode - MIN_MODE_INT;
224 case MODE_PARTIAL_INT:
227 if (MIN_MODE_PARTIAL_INT != VOIDmode)
228 return mode - MIN_MODE_PARTIAL_INT + NUM_MODE_INT;
230 case MODE_VECTOR_INT:
233 if (MIN_MODE_VECTOR_INT != VOIDmode)
611 int m =
mode - MIN_MODE_INT;
672 machine_mode
mode, machine_mode compare_mode,
673 int unsignedp,
rtx x,
rtx y,
int normalizep,
674 machine_mode target_mode);
693 machine_mode,
int,
int);
702 int,
unsigned HOST_WIDE_INT *,
720 machine_mode,
rtx,
bool,
bool);
722 machine_mode, machine_mode,
bool,
rtx *);
Definition machmode.h:427
union tree_node * tree
Definition coretypes.h:97
#define MAX_BITS_PER_WORD
Definition defaults.h:1003
rtx expand_divmod(int rem_flag, enum tree_code code, machine_mode mode, rtx op0, rtx op1, rtx target, int unsignedp, enum optab_methods methods)
Definition expmed.cc:4264
rtx maybe_expand_shift(enum tree_code code, machine_mode mode, rtx shifted, int amount, rtx target, int unsignedp)
Definition expmed.cc:2736
rtx expand_variable_shift(enum tree_code code, machine_mode mode, rtx shifted, tree amount, rtx target, int unsignedp)
Definition expmed.cc:2751
rtx expand_shift(enum tree_code code, machine_mode mode, rtx shifted, poly_int64 amount, rtx target, int unsignedp)
Definition expmed.cc:2725
int convert_cost(machine_mode to_mode, machine_mode from_mode, bool speed)
Definition expmed.h:664
void set_alg_hash_used_p(bool usedp)
Definition expmed.h:210
bool * sdiv_pow2_cheap_ptr(bool speed, machine_mode mode)
Definition expmed.h:268
rtx flip_storage_order(machine_mode, rtx)
Definition expmed.cc:388
int shiftsub0_cost(bool speed, machine_mode mode, int bits)
Definition expmed.h:467
#define this_target_expmed
Definition expmed.h:188
int * shiftsub1_cost_ptr(bool speed, machine_mode mode, int bits)
Definition expmed.h:475
int neg_cost(bool speed, machine_mode mode)
Definition expmed.h:387
int shift_cost(bool speed, machine_mode mode, int bits)
Definition expmed.h:413
rtx expand_and(machine_mode, rtx, rtx, rtx)
Definition expmed.cc:5514
unsigned HOST_WIDE_INT choose_multiplier(unsigned HOST_WIDE_INT, int, int, unsigned HOST_WIDE_INT *, int *)
Definition expmed.cc:3728
int mul_highpart_cost(bool speed, machine_mode mode)
Definition expmed.h:630
void set_mul_widen_cost(bool speed, machine_mode mode, int cost)
Definition expmed.h:591
int * mul_highpart_cost_ptr(bool speed, machine_mode mode)
Definition expmed.h:608
void set_udiv_cost(bool speed, machine_mode mode, int cost)
Definition expmed.h:563
int mul_widen_cost(bool speed, machine_mode mode)
Definition expmed.h:600
void set_smod_pow2_cheap(bool speed, machine_mode mode, bool cheap)
Definition expmed.h:305
int udiv_cost(bool speed, machine_mode mode)
Definition expmed.h:572
rtx negate_rtx(machine_mode, rtx)
Definition expmed.cc:339
int * sdiv_cost_ptr(bool speed, machine_mode mode)
Definition expmed.h:528
int * shiftsub0_cost_ptr(bool speed, machine_mode mode, int bits)
Definition expmed.h:448
int zero_cost(bool speed)
Definition expmed.h:338
rtx emit_store_flag_force(rtx, enum rtx_code, rtx, rtx, machine_mode, int, int)
Definition expmed.cc:6205
void set_mul_highpart_cost(bool speed, machine_mode mode, int cost)
Definition expmed.h:621
void set_zero_cost(bool speed, int cost)
Definition expmed.h:330
int * neg_cost_ptr(bool speed, machine_mode mode)
Definition expmed.h:370
void set_convert_cost(machine_mode to_mode, machine_mode from_mode, bool speed, int cost)
Definition expmed.h:654
int sdiv_cost(bool speed, machine_mode mode)
Definition expmed.h:546
void set_sdiv_cost(bool speed, machine_mode mode, int cost)
Definition expmed.h:537
rtx expmed_mult_highpart_optab(scalar_int_mode, rtx, rtx, rtx, int, int)
Definition expmed.cc:3876
int * shiftadd_cost_ptr(bool speed, machine_mode mode, int bits)
Definition expmed.h:421
void set_sdiv_pow2_cheap(bool speed, machine_mode mode, bool cheap_p)
Definition expmed.h:278
bool sdiv_pow2_cheap(bool speed, machine_mode mode)
Definition expmed.h:287
void set_mul_cost(bool speed, machine_mode mode, int cost)
Definition expmed.h:511
void set_shiftadd_cost(bool speed, machine_mode mode, int bits, int cost)
Definition expmed.h:431
int * add_cost_ptr(bool speed, machine_mode mode)
Definition expmed.h:346
int * mul_widen_cost_ptr(bool speed, machine_mode mode)
Definition expmed.h:580
rtx expand_mult_highpart_adjust(scalar_int_mode, rtx, rtx, rtx, rtx, int)
Definition expmed.cc:3836
rtx expand_mult(machine_mode, rtx, rtx, rtx, int, bool=false)
Definition expmed.cc:3487
mult_variant
Definition expmed.h:42
@ add_variant
Definition expmed.h:42
@ negate_variant
Definition expmed.h:42
@ basic_variant
Definition expmed.h:42
rtx emit_cstore(rtx target, enum insn_code icode, enum rtx_code code, machine_mode mode, machine_mode compare_mode, int unsignedp, rtx x, rtx y, int normalizep, machine_mode target_mode)
Definition expmed.cc:5532
void store_bit_field(rtx, poly_uint64, poly_uint64, poly_uint64, poly_uint64, machine_mode, rtx, bool, bool)
Definition expmed.cc:1144
#define NUM_ALG_HASH_ENTRIES
Definition expmed.h:133
#define NUM_MODE_IP_INT
Definition expmed.h:136
int * zero_cost_ptr(bool speed)
Definition expmed.h:322
int * mul_cost_ptr(bool speed, machine_mode mode)
Definition expmed.h:502
bool * smod_pow2_cheap_ptr(bool speed, machine_mode mode)
Definition expmed.h:295
int expmed_mode_index(machine_mode mode)
Definition expmed.h:218
int add_cost(bool speed, machine_mode mode)
Definition expmed.h:362
void set_shift_cost(bool speed, machine_mode mode, int bits, int cost)
Definition expmed.h:404
struct target_expmed default_target_expmed
Definition expmed.cc:48
alg_code
Definition expmed.h:25
@ alg_add_t_m2
Definition expmed.h:29
@ alg_sub_factor
Definition expmed.h:32
@ alg_zero
Definition expmed.h:27
@ alg_unknown
Definition expmed.h:26
@ alg_impossible
Definition expmed.h:35
@ alg_sub_t_m2
Definition expmed.h:30
@ alg_shift
Definition expmed.h:28
@ alg_add_factor
Definition expmed.h:31
@ alg_m
Definition expmed.h:28
@ alg_sub_t2_m
Definition expmed.h:34
@ alg_add_t2_m
Definition expmed.h:33
int * convert_cost_ptr(machine_mode to_mode, machine_mode from_mode, bool speed)
Definition expmed.h:638
int shiftsub1_cost(bool speed, machine_mode mode, int bits)
Definition expmed.h:494
rtx extract_low_bits(machine_mode, machine_mode, rtx)
Definition expmed.cc:2429
void set_neg_cost(bool speed, machine_mode mode, int cost)
Definition expmed.h:378
int mult_by_coeff_cost(HOST_WIDE_INT, machine_mode, bool)
Definition expmed.cc:3641
void set_add_cost(bool speed, machine_mode mode, int cost)
Definition expmed.h:354
bool choose_mult_variant(machine_mode, HOST_WIDE_INT, struct algorithm *, enum mult_variant *, int)
Definition expmed.cc:3247
int mul_cost(bool speed, machine_mode mode)
Definition expmed.h:520
void set_shiftsub1_cost(bool speed, machine_mode mode, int bits, int cost)
Definition expmed.h:485
void set_shiftsub0_cost(bool speed, machine_mode mode, int bits, int cost)
Definition expmed.h:458
int * shift_cost_ptr(bool speed, machine_mode mode, int bits)
Definition expmed.h:395
int shiftadd_cost(bool speed, machine_mode mode, int bits)
Definition expmed.h:440
#define NUM_MODE_IPV_INT
Definition expmed.h:137
bool smod_pow2_cheap(bool speed, machine_mode mode)
Definition expmed.h:314
rtx emit_store_flag(rtx, enum rtx_code, rtx, rtx, machine_mode, int, int)
Definition expmed.cc:6057
void canonicalize_comparison(machine_mode, enum rtx_code *, rtx *)
Definition expmed.cc:6337
int * udiv_cost_ptr(bool speed, machine_mode mode)
Definition expmed.h:554
struct alg_hash_entry * alg_hash_entry_ptr(int idx)
Definition expmed.h:194
rtx extract_bit_field(rtx, poly_uint64, poly_uint64, int, rtx, machine_mode, machine_mode, bool, rtx *)
Definition expmed.cc:2130
int * expmed_op_cost_ptr(struct expmed_op_costs *costs, bool speed, machine_mode mode)
Definition expmed.h:258
bool * expmed_op_cheap_ptr(struct expmed_op_cheap *eoc, bool speed, machine_mode mode)
Definition expmed.h:247
bool alg_hash_used_p(void)
Definition expmed.h:202
tree_code
Definition genmatch.cc:347
#define GET_MODE_CLASS(MODE)
Definition machmode.h:105
optab_methods
Definition optabs.h:177
@ OPTAB_LIB_WIDEN
Definition optabs.h:181
rtx_code
Definition rtl.h:48
unsigned HOST_WIDE_INT t
Definition expmed.h:112
machine_mode mode
Definition expmed.h:115
struct mult_cost cost
Definition expmed.h:123
enum alg_code alg
Definition expmed.h:118
bool speed
Definition expmed.h:126
short ops
Definition expmed.h:99
enum alg_code op[MAX_BITS_PER_WORD]
Definition expmed.h:105
struct mult_cost cost
Definition expmed.h:98
char log[MAX_BITS_PER_WORD]
Definition expmed.h:106
Definition ira-costs.cc:54
int cost[1]
Definition ira-costs.cc:58
bool cheap[2][NUM_MODE_IPV_INT]
Definition expmed.h:140
int cost[2][NUM_MODE_IPV_INT]
Definition expmed.h:144
short cost
Definition expmed.h:59
short latency
Definition expmed.h:60
int x_shift_cost[2][NUM_MODE_IPV_INT][MAX_BITS_PER_WORD]
Definition expmed.h:168
struct alg_hash_entry x_alg_hash[NUM_ALG_HASH_ENTRIES]
Definition expmed.h:152
int x_convert_cost[2][NUM_MODE_IP_INT][NUM_MODE_IP_INT]
Definition expmed.h:181
struct expmed_op_costs x_sdiv_cost
Definition expmed.h:173
struct expmed_op_cheap x_sdiv_pow2_cheap
Definition expmed.h:161
int x_shiftadd_cost[2][NUM_MODE_IPV_INT][MAX_BITS_PER_WORD]
Definition expmed.h:169
int x_mul_highpart_cost[2][NUM_MODE_INT]
Definition expmed.h:176
int x_zero_cost[2]
Definition expmed.h:165
struct expmed_op_costs x_add_cost
Definition expmed.h:166
bool x_alg_hash_used_p
Definition expmed.h:155
int x_shiftsub1_cost[2][NUM_MODE_IPV_INT][MAX_BITS_PER_WORD]
Definition expmed.h:171
struct expmed_op_costs x_mul_cost
Definition expmed.h:172
struct expmed_op_cheap x_smod_pow2_cheap
Definition expmed.h:162
struct expmed_op_costs x_neg_cost
Definition expmed.h:167
int x_mul_widen_cost[2][NUM_MODE_INT]
Definition expmed.h:175
int x_shiftsub0_cost[2][NUM_MODE_IPV_INT][MAX_BITS_PER_WORD]
Definition expmed.h:170
struct expmed_op_costs x_udiv_cost
Definition expmed.h:174
#define gcc_assert(EXPR)
Definition system.h:821
#define gcc_unreachable()
Definition system.h:848
#define IN_RANGE(VALUE, LOWER, UPPER)
Definition system.h:320
const T2 & y
Definition wide-int.h:3870