diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-18 12:37:27 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-08-18 12:37:27 +0000 |
commit | 7013e87c514a70ba6ea24d9d7e16165730752543 (patch) | |
tree | be86e26d9b32f132c267f39e263298c225c62ae9 /gcc/expmed.c | |
parent | b72d459f396af780bd6506f992b421663c4bb676 (diff) | |
download | gcc-7013e87c514a70ba6ea24d9d7e16165730752543.tar.gz |
gcc/
* rtl.h (set_src_cost, get_full_set_src_cost): New functions.
* auto-inc-dec.c (attempt_change): Use set_src_cost instead of
rtx_cost.
* calls.c (precompute_register_parameters): Likewise.
* combine.c (expand_compound_operation, make_extraction): Likewise.
(force_to_mode, distribute_and_simplify_rtx): Likewise.
* dse.c (find_shift_sequence): Likewise.
* expmed.c (init_expmed, expand_mult, expand_smod_pow2): Likewise.
* expr.c (compress_float_constant): Likewise.
* fwprop.c (should_replace_address, try_fwprop_subst): Likewise.
* gcse.c (want_to_gcse_p): Likewise.
* ifcvt.c (noce_try_sign_mask): Likewise.
* loop-doloop.c (doloop_optimize): Likewise.
* loop-invariant.c (create_new_invariant): Likewise.
* optabs.c (avoid_expensive_constant): Likewise.
* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands)
(try_replace_in_use, reload_cse_move2add): Likewise.
* reload1.c (calculate_elim_costs_all_insns): Likewise.
(note_reg_elim_costly): Likewise.
* rtlanal.c (insn_rtx_cost): Likewise.
* simplify-rtx.c (simplify_binary_operation_1): Likewise.
* stmt.c (lshift_cheap_p): Likewise.
* tree-ssa-loop-ivopts.c (seq_cost, computation_cost): Likewise.
* config/avr/avr.c (final_prescan_insn): Likewise.
* config/bfin/bfin.c (bfin_rtx_costs): Likewise.
* config/mips/mips.c (mips_binary_cost, mips_rtx_costs): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177851 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index 92167f148ab..f75ea7acd61 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -196,7 +196,7 @@ init_expmed (void) for (speed = 0; speed < 2; speed++) { crtl->maybe_hot_insn_p = speed; - zero_cost[speed] = rtx_cost (const0_rtx, SET, speed); + zero_cost[speed] = set_src_cost (const0_rtx, speed); for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode; @@ -217,15 +217,15 @@ init_expmed (void) PUT_MODE (&all.shift_sub0, mode); PUT_MODE (&all.shift_sub1, mode); - add_cost[speed][mode] = rtx_cost (&all.plus, SET, speed); - neg_cost[speed][mode] = rtx_cost (&all.neg, SET, speed); - mul_cost[speed][mode] = rtx_cost (&all.mult, SET, speed); - sdiv_cost[speed][mode] = rtx_cost (&all.sdiv, SET, speed); - udiv_cost[speed][mode] = rtx_cost (&all.udiv, SET, speed); + add_cost[speed][mode] = set_src_cost (&all.plus, speed); + neg_cost[speed][mode] = set_src_cost (&all.neg, speed); + mul_cost[speed][mode] = set_src_cost (&all.mult, speed); + sdiv_cost[speed][mode] = set_src_cost (&all.sdiv, speed); + udiv_cost[speed][mode] = set_src_cost (&all.udiv, speed); - sdiv_pow2_cheap[speed][mode] = (rtx_cost (&all.sdiv_32, SET, speed) + sdiv_pow2_cheap[speed][mode] = (set_src_cost (&all.sdiv_32, speed) <= 2 * add_cost[speed][mode]); - smod_pow2_cheap[speed][mode] = (rtx_cost (&all.smod_32, SET, speed) + smod_pow2_cheap[speed][mode] = (set_src_cost (&all.smod_32, speed) <= 4 * add_cost[speed][mode]); wider_mode = GET_MODE_WIDER_MODE (mode); @@ -237,9 +237,9 @@ init_expmed (void) XEXP (&all.wide_lshr, 1) = GEN_INT (GET_MODE_BITSIZE (mode)); mul_widen_cost[speed][wider_mode] - = rtx_cost (&all.wide_mult, SET, speed); + = set_src_cost (&all.wide_mult, speed); mul_highpart_cost[speed][mode] - = rtx_cost (&all.wide_trunc, SET, speed); + = set_src_cost (&all.wide_trunc, speed); } shift_cost[speed][mode][0] = 0; @@ -252,10 +252,13 @@ init_expmed (void) XEXP (&all.shift, 1) = cint[m]; XEXP (&all.shift_mult, 1) = pow2[m]; - shift_cost[speed][mode][m] = rtx_cost (&all.shift, SET, speed); - shiftadd_cost[speed][mode][m] = rtx_cost (&all.shift_add, SET, speed); - shiftsub0_cost[speed][mode][m] = rtx_cost (&all.shift_sub0, SET, speed); - shiftsub1_cost[speed][mode][m] = rtx_cost (&all.shift_sub1, SET, speed); + shift_cost[speed][mode][m] = set_src_cost (&all.shift, speed); + shiftadd_cost[speed][mode][m] = set_src_cost (&all.shift_add, + speed); + shiftsub0_cost[speed][mode][m] = set_src_cost (&all.shift_sub0, + speed); + shiftsub1_cost[speed][mode][m] = set_src_cost (&all.shift_sub1, + speed); } } } @@ -3077,8 +3080,9 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target, result is interpreted as an unsigned coefficient. Exclude cost of op0 from max_cost to match the cost calculation of the synth_mult. */ - max_cost = rtx_cost (gen_rtx_MULT (mode, fake_reg, op1), SET, speed) - - neg_cost[speed][mode]; + max_cost = (set_src_cost (gen_rtx_MULT (mode, fake_reg, op1), + speed) + - neg_cost[speed][mode]); if (max_cost > 0 && choose_mult_variant (mode, -INTVAL (op1), &algorithm, &variant, max_cost)) @@ -3121,7 +3125,7 @@ expand_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target, /* Exclude cost of op0 from max_cost to match the cost calculation of the synth_mult. */ - max_cost = rtx_cost (gen_rtx_MULT (mode, fake_reg, op1), SET, speed); + max_cost = set_src_cost (gen_rtx_MULT (mode, fake_reg, op1), speed); if (choose_mult_variant (mode, coeff, &algorithm, &variant, max_cost)) return expand_mult_const (mode, op0, coeff, target, @@ -3610,7 +3614,8 @@ expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d) temp = gen_rtx_LSHIFTRT (mode, result, shift); if (optab_handler (lshr_optab, mode) == CODE_FOR_nothing - || rtx_cost (temp, SET, optimize_insn_for_speed_p ()) > COSTS_N_INSNS (2)) + || (set_src_cost (temp, optimize_insn_for_speed_p ()) + > COSTS_N_INSNS (2))) { temp = expand_binop (mode, xor_optab, op0, signmask, NULL_RTX, 1, OPTAB_LIB_WIDEN); |