From 192ed1dd46005bdd9c3a858645ef0b3cc282946d Mon Sep 17 00:00:00 2001 From: James Greenhalgh Date: Wed, 18 Dec 2013 19:25:45 +0000 Subject: [PATCH] [AArch64 2/3 big.LITTLE] Allow tuning parameters without unique tuning targets. gcc/ * config/aarch64/aarch64-cores.def: Add new column for SCHEDULER_IDENT. * config/aarch64/aarch64-opts.h (AARCH64_CORE): Handle SCHEDULER_IDENT. * config/aarch64/aarch64.c (AARCH64_CORE): Handle SCHEDULER_IDENT. (aarch64_parse_cpu): mcpu implies a default value for mtune. * config/aarch64/aarch64.h (AARCH64_CORE): Handle SCHEDULER_IDENT. From-SVN: r206099 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/aarch64/aarch64-cores.def | 12 ++++++------ gcc/config/aarch64/aarch64-opts.h | 4 ++-- gcc/config/aarch64/aarch64.c | 3 ++- gcc/config/aarch64/aarch64.h | 4 ++-- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ad5ec8..d8e6b99 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,17 @@ 2013-12-18 James Greenhalgh + * config/aarch64/aarch64-cores.def: Add new column for + SCHEDULER_IDENT. + * config/aarch64/aarch64-opts.h (AARCH64_CORE): Handle + SCHEDULER_IDENT. + * config/aarch64/aarch64.c (AARCH64_CORE): Handle + SCHEDULER_IDENT. + (aarch64_parse_cpu): mcpu implies a default value for mtune. + * config/aarch64/aarch64.h (AARCH64_CORE): Handle + SCHEDULER_IDENT. + +2013-12-18 James Greenhalgh + * common/config/aarch64/aarch64-common.c (aarch64_rewrite_selected_cpu): New. (aarch64_rewrite_mcpu): New. diff --git a/gcc/config/aarch64/aarch64-cores.def b/gcc/config/aarch64/aarch64-cores.def index b631dbe..1b4a49f 100644 --- a/gcc/config/aarch64/aarch64-cores.def +++ b/gcc/config/aarch64/aarch64-cores.def @@ -21,18 +21,18 @@ Before using #include to read this file, define a macro: - AARCH64_CORE(CORE_NAME, CORE_IDENT, ARCH, FLAGS, COSTS) + AARCH64_CORE(CORE_NAME, CORE_IDENT, SCHEDULER_IDENT, ARCH, FLAGS, COSTS) The CORE_NAME is the name of the core, represented as a string constant. The CORE_IDENT is the name of the core, represented as an identifier. + The SCHEDULER_IDENT is the name of the core for which scheduling decisions + will be made, represented as an identifier. ARCH is the architecture revision implemented by the chip. FLAGS are the bitwise-or of the traits that apply to that core. This need not include flags implied by the architecture. COSTS is the name of the rtx_costs routine to use. */ -/* V8 Architecture Processors. - This list currently contains example CPUs that implement AArch64, and - therefore serves as a template for adding more CPUs in the future. */ +/* V8 Architecture Processors. */ -AARCH64_CORE("cortex-a53", cortexa53, 8, AARCH64_FL_FPSIMD, cortexa53) -AARCH64_CORE("cortex-a57", cortexa15, 8, AARCH64_FL_FPSIMD, generic) +AARCH64_CORE("cortex-a53", cortexa53, cortexa53, 8, AARCH64_FL_FPSIMD, cortexa53) +AARCH64_CORE("cortex-a57", cortexa15, cortexa15, 8, AARCH64_FL_FPSIMD, generic) diff --git a/gcc/config/aarch64/aarch64-opts.h b/gcc/config/aarch64/aarch64-opts.h index 31e105f..6275112 100644 --- a/gcc/config/aarch64/aarch64-opts.h +++ b/gcc/config/aarch64/aarch64-opts.h @@ -25,8 +25,8 @@ /* The various cores that implement AArch64. */ enum aarch64_processor { -#define AARCH64_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ - IDENT, +#define AARCH64_CORE(NAME, INTERNAL_IDENT, IDENT, ARCH, FLAGS, COSTS) \ + INTERNAL_IDENT, #include "aarch64-cores.def" #undef AARCH64_CORE /* Used to indicate that no processor has been specified. */ diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 0c53e64..e668088 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -246,7 +246,7 @@ struct processor /* Processor cores implementing AArch64. */ static const struct processor all_cores[] = { -#define AARCH64_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ +#define AARCH64_CORE(NAME, X, IDENT, ARCH, FLAGS, COSTS) \ {NAME, IDENT, #ARCH, FLAGS | AARCH64_FL_FOR_ARCH##ARCH, &COSTS##_tunings}, #include "aarch64-cores.def" #undef AARCH64_CORE @@ -5119,6 +5119,7 @@ aarch64_parse_cpu (void) if (strlen (cpu->name) == len && strncmp (cpu->name, str, len) == 0) { selected_cpu = cpu; + selected_tune = cpu; aarch64_isa_flags = selected_cpu->flags; if (ext != NULL) diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index d89c09b..e3e4846 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -461,8 +461,8 @@ enum reg_class enum target_cpus { -#define AARCH64_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \ - TARGET_CPU_##IDENT, +#define AARCH64_CORE(NAME, INTERNAL_IDENT, IDENT, ARCH, FLAGS, COSTS) \ + TARGET_CPU_##INTERNAL_IDENT, #include "aarch64-cores.def" #undef AARCH64_CORE TARGET_CPU_generic -- 2.7.4