diff options
author | David Ung <davidu@mips.com> | 2006-11-07 14:28:08 +0000 |
---|---|---|
committer | David Ung <davidu@gcc.gnu.org> | 2006-11-07 14:28:08 +0000 |
commit | d81ecf52ff643ec879350503f0393d361162cf64 (patch) | |
tree | 3a3b4ff53a714a1a5394ac1a1f6f30b795235e77 /gcc/config/mips | |
parent | 010b2043b094449c1d89d07da6e20bbfafd0f0e7 (diff) | |
download | gcc-d81ecf52ff643ec879350503f0393d361162cf64.zip gcc-d81ecf52ff643ec879350503f0393d361162cf64.tar.gz gcc-d81ecf52ff643ec879350503f0393d361162cf64.tar.bz2 |
mips.c (mips_rtx_cost_optimize_size): New table of costs when optimizing for size.
* config/mips/mips.c (mips_rtx_cost_optimize_size): New table of
costs when optimizing for size.
(override_options): Use mips_rtx_cost_optimize_size table for cost
calculations.
From-SVN: r118550
Diffstat (limited to 'gcc/config/mips')
-rw-r--r-- | gcc/config/mips/mips.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 6706b83..52e2aab 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -796,6 +796,21 @@ const struct mips_cpu_info mips_cpu_info_table[] = { COSTS_N_INSNS (256), /* fp_div_sf */ \ COSTS_N_INSNS (256) /* fp_div_df */ +static struct mips_rtx_cost_data const mips_rtx_cost_optimize_size = + { + COSTS_N_INSNS (1), /* fp_add */ + COSTS_N_INSNS (1), /* fp_mult_sf */ + COSTS_N_INSNS (1), /* fp_mult_df */ + COSTS_N_INSNS (1), /* fp_div_sf */ + COSTS_N_INSNS (1), /* fp_div_df */ + COSTS_N_INSNS (1), /* int_mult_si */ + COSTS_N_INSNS (1), /* int_mult_di */ + COSTS_N_INSNS (1), /* int_div_si */ + COSTS_N_INSNS (1), /* int_div_di */ + 2, /* branch_cost */ + 4 /* memory_latency */ + }; + static struct mips_rtx_cost_data const mips_rtx_cost_data[PROCESSOR_MAX] = { { /* R3000 */ @@ -4756,7 +4771,10 @@ override_options (void) mips_set_tune (mips_arch_info); /* Set cost structure for the processor. */ - mips_cost = &mips_rtx_cost_data[mips_tune]; + if (optimize_size) + mips_cost = &mips_rtx_cost_optimize_size; + else + mips_cost = &mips_rtx_cost_data[mips_tune]; if ((target_flags_explicit & MASK_64BIT) != 0) { |