This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[AArch64 2/3 big.LITTLE] Allow tuning parameters without unique tuning targets.
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: marcus-shawcroft at arm dot com, richard dot earnshaw at arm dot com
- Date: Wed, 18 Dec 2013 12:23:04 +0000
- Subject: [AArch64 2/3 big.LITTLE] Allow tuning parameters without unique tuning targets.
- Authentication-results: sourceware.org; auth=none
- References: <1387369385-1622-1-git-send-email-james dot greenhalgh at arm dot com>
Hi,
AArch64 imports the limitation from ARM that each entry in the CORE_IDENT
column in aarch64-cores.def must be unique (as this column is used to
generate enums). We would like to have different -mcpu values map to
the same scheduler description, so remove that limitation.
One oddity this enforces, the core named by SCHEDULER_IDENT
must appear at least once in the CORE_IDENT column, so we while we
wish to use the Cortex-A15 scheduler model for the Cortex-A57,
we must set the CORE_IDENT for "cortex-a57" to cortex15.
Checked for aarch64-none-elf and built for aarch64-none-linux-gnu
with no issues.
OK?
Thanks,
James
---
2013-12-18 James Greenhalgh <james.greenhalgh@arm.com>
* 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.
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