Message ID | B5E67142681B53468FAF6B7C31356562441B05F4@hhmail02.hh.imgtec.org |
---|---|
State | New |
Headers | show |
Robert Suchanek <Robert.Suchanek@imgtec.com> writes: > The patch below disables generation of the branch likely instructions for -Os > but only for generic architecture. The branch likely may result in some > code size reduction but the cost of running the code on R6 core is significant. How about instead splitting PTF_AVOID_BRANCHLIKELY into PTF_AVOID_BRANCHLIKELY_SPEED and PTF_AVOID_BRANCHLIKELY_SIZE? We could have PTF_AVOID_BRANCHLIKELY_ALWAYS as an OR of the two. Anything that does string ops on the architecture is suspicious :-) Thanks, Richard
Richard Sandiford <rdsandiford@googlemail.com> writes: > Robert Suchanek <Robert.Suchanek@imgtec.com> writes: > > The patch below disables generation of the branch likely instructions for -Os > > but only for generic architecture. The branch likely may result in some > > code size reduction but the cost of running the code on R6 core is significant. > > How about instead splitting PTF_AVOID_BRANCHLIKELY into > PTF_AVOID_BRANCHLIKELY_SPEED and PTF_AVOID_BRANCHLIKELY_SIZE? > We could have PTF_AVOID_BRANCHLIKELY_ALWAYS as an OR of the two. This sounds OK and is nicer. > Anything that does string ops on the architecture is suspicious :-) You can blame me for this. I advocated the string comparison approach as I had to do the same thing in gas IIRC for some feature and couldn't think of anything better to suggest. Thanks, Matthew
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index a9829bd..68def06 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -19564,7 +19564,7 @@ mips_option_override (void) if ((target_flags_explicit & MASK_BRANCHLIKELY) == 0) { if (ISA_HAS_BRANCHLIKELY - && (optimize_size + && ((optimize_size && strncmp (mips_arch_info->name, "mips", 4) != 0) || (mips_tune_info->tune_flags & PTF_AVOID_BRANCHLIKELY) == 0)) target_flags |= MASK_BRANCHLIKELY; else