diff options
author | Oleg Endo <olegendo@gcc.gnu.org> | 2011-12-29 15:11:47 +0000 |
---|---|---|
committer | Oleg Endo <olegendo@gcc.gnu.org> | 2011-12-29 15:11:47 +0000 |
commit | 91afd29bd7824ff07ffe61f327af86f189c59188 (patch) | |
tree | 152af211039307c483688cc0c0cdb9a5a2718e50 /gcc | |
parent | 81ed42d3192f06bd5986c88542497854f123fcb3 (diff) | |
download | gcc-91afd29bd7824ff07ffe61f327af86f189c59188.zip gcc-91afd29bd7824ff07ffe61f327af86f189c59188.tar.gz gcc-91afd29bd7824ff07ffe61f327af86f189c59188.tar.bz2 |
sh.h (BRANCH_COST): Use sh_branch_cost variable.
* config/sh/sh.h (BRANCH_COST): Use sh_branch_cost variable.
* config/sh/sh.c (sh_option_override): Simplify sh_branch_cost
expression.
From-SVN: r182723
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 11 | ||||
-rw-r--r-- | gcc/config/sh/sh.h | 8 |
3 files changed, 17 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e31912..4c8ff34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-12-29 Oleg Endo <olegendo@gcc.gnu.org> + + * config/sh/sh.h (BRANCH_COST): Use sh_branch_cost variable. + * config/sh/sh.c (sh_option_override): Simplify sh_branch_cost + expression. + 2011-12-28 Ian Lance Taylor <iant@google.com> * dwarf2out.c (gen_compile_unit_die): Use DW_LANG_Go for Go. diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 1b289ad..744c49a 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -724,8 +724,15 @@ sh_option_override (void) else sh_divsi3_libfunc = "__sdivsi3"; if (sh_branch_cost == -1) - sh_branch_cost - = TARGET_SH5 ? 1 : ! TARGET_SH2 || TARGET_HARD_SH4 ? 2 : 1; + { + sh_branch_cost = 1; + + /* The SH1 does not have delay slots, hence we get a pipeline stall + at every branch. The SH4 is superscalar, so the single delay slot + is not sufficient to keep both pipelines filled. */ + if (! TARGET_SH2 || TARGET_HARD_SH4) + sh_branch_cost = 2; + } for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (! VALID_REGISTER_P (regno)) diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index f873b9d..0f06fb8 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -2088,12 +2088,8 @@ struct sh_args { different code that does fewer memory accesses. */ /* A C expression for the cost of a branch instruction. A value of 1 - is the default; other values are interpreted relative to that. - The SH1 does not have delay slots, hence we get a pipeline stall - at every branch. The SH4 is superscalar, so the single delay slot - is not sufficient to keep both pipelines filled. */ -#define BRANCH_COST(speed_p, predictable_p) \ - (TARGET_SH5 ? 1 : ! TARGET_SH2 || TARGET_HARD_SH4 ? 2 : 1) + is the default; other values are interpreted relative to that. */ +#define BRANCH_COST(speed_p, predictable_p) sh_branch_cost /* Assembler output control. */ |