diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2011-08-18 12:37:27 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-08-18 12:37:27 +0000 |
commit | 5e8f01f434e547d21e6be3f44b2f5d9090fdc9db (patch) | |
tree | be86e26d9b32f132c267f39e263298c225c62ae9 /gcc/config/mips/mips.c | |
parent | d51102f3e780e69e19c6d7eeb987647e4a8aff15 (diff) | |
download | gcc-5e8f01f434e547d21e6be3f44b2f5d9090fdc9db.zip gcc-5e8f01f434e547d21e6be3f44b2f5d9090fdc9db.tar.gz gcc-5e8f01f434e547d21e6be3f44b2f5d9090fdc9db.tar.bz2 |
rtl.h (set_src_cost, [...]): New functions.
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.
From-SVN: r177851
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r-- | gcc/config/mips/mips.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 8937173..88988b6 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3333,7 +3333,7 @@ mips_binary_cost (rtx x, int single_cost, int double_cost, bool speed) else cost = single_cost; return (cost - + rtx_cost (XEXP (x, 0), SET, speed) + + set_src_cost (XEXP (x, 0), speed) + rtx_cost (XEXP (x, 1), GET_CODE (x), speed)); } @@ -3550,7 +3550,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed) && UINTVAL (XEXP (x, 1)) == 0xffffffff) { *total = (mips_zero_extend_cost (mode, XEXP (x, 0)) - + rtx_cost (XEXP (x, 0), SET, speed)); + + set_src_cost (XEXP (x, 0), speed)); return true; } /* Fall through. */ @@ -3585,7 +3585,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed) case LO_SUM: /* Low-part immediates need an extended MIPS16 instruction. */ *total = (COSTS_N_INSNS (TARGET_MIPS16 ? 2 : 1) - + rtx_cost (XEXP (x, 0), SET, speed)); + + set_src_cost (XEXP (x, 0), speed)); return true; case LT: @@ -3626,17 +3626,17 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed) if (GET_CODE (op0) == MULT && GET_CODE (XEXP (op0, 0)) == NEG) { *total = (mips_fp_mult_cost (mode) - + rtx_cost (XEXP (XEXP (op0, 0), 0), SET, speed) - + rtx_cost (XEXP (op0, 1), SET, speed) - + rtx_cost (op1, SET, speed)); + + set_src_cost (XEXP (XEXP (op0, 0), 0), speed) + + set_src_cost (XEXP (op0, 1), speed) + + set_src_cost (op1, speed)); return true; } if (GET_CODE (op1) == MULT) { *total = (mips_fp_mult_cost (mode) - + rtx_cost (op0, SET, speed) - + rtx_cost (XEXP (op1, 0), SET, speed) - + rtx_cost (XEXP (op1, 1), SET, speed)); + + set_src_cost (op0, speed) + + set_src_cost (XEXP (op1, 0), speed) + + set_src_cost (XEXP (op1, 1), speed)); return true; } } @@ -3678,9 +3678,9 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed) && GET_CODE (XEXP (op, 0)) == MULT) { *total = (mips_fp_mult_cost (mode) - + rtx_cost (XEXP (XEXP (op, 0), 0), SET, speed) - + rtx_cost (XEXP (XEXP (op, 0), 1), SET, speed) - + rtx_cost (XEXP (op, 1), SET, speed)); + + set_src_cost (XEXP (XEXP (op, 0), 0), speed) + + set_src_cost (XEXP (XEXP (op, 0), 1), speed) + + set_src_cost (XEXP (op, 1), speed)); return true; } } @@ -3718,10 +3718,10 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed) if (outer_code == SQRT || GET_CODE (XEXP (x, 1)) == SQRT) /* An rsqrt<mode>a or rsqrt<mode>b pattern. Count the division as being free. */ - *total = rtx_cost (XEXP (x, 1), SET, speed); + *total = set_src_cost (XEXP (x, 1), speed); else *total = (mips_fp_div_cost (mode) - + rtx_cost (XEXP (x, 1), SET, speed)); + + set_src_cost (XEXP (x, 1), speed)); return true; } /* Fall through. */ @@ -3749,7 +3749,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, bool speed) && CONST_INT_P (XEXP (x, 1)) && exact_log2 (INTVAL (XEXP (x, 1))) >= 0) { - *total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), SET, speed); + *total = COSTS_N_INSNS (2) + set_src_cost (XEXP (x, 0), speed); return true; } *total = COSTS_N_INSNS (mips_idiv_insns ()); |