[PATCH, ARM] Make branch cost a tunable parameter

Julian Brown julian@codesourcery.com
Wed Jun 1 15:24:00 GMT 2011

This patch allows the BRANCH_COST macro to be altered for a given
target using the ARM backend's tuning infrastructure. It's not easy
to reduce the cost to e.g. a single integer or a set of integers (cores
may have different branch costing characteristics for ARM vs. Thumb-2
mode for instance, as in the existing BRANCH_COST definition), so I've
used a function pointer in the tuning structure for maximum flexibility.

This patch just uses the same hook for all existing cores (i.e. it
should result in unchanged behaviour). Later patches can then override
the default in specific cases.

Testing is still in progress. OK to apply, pending success with that?




    * config/arm/arm-protos.h (tune_params): Add branch_cost hook.
    * config/arm/arm.c (arm_default_branch_cost): New.
    (arm_slowmul_tune, arm_fastmul_tune, arm_xscale_tune, arm_9e_tune)
    (arm_v6t2_tune, arm_cortex_tune, arm_cortex_a9_tune)
    (arm_fa726_tune): Set branch_cost field using
    * config/arm/arm.h (BRANCH_COST): Use branch_cost hook from
    current_tune structure.
    * dojump.c (tm_p.h): Include file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: branch-cost-tunable-2.diff
Type: text/x-patch
Size: 4935 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110601/2254a753/attachment.bin>

More information about the Gcc-patches mailing list