diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2015-04-24 14:52:47 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2015-04-24 14:52:47 +0000 |
commit | 7e1bcce3711f5646ffc98652c20e988d55689041 (patch) | |
tree | b4ffc12d1036577eda1baec7f5d6bbe152b867f1 /gcc/config/aarch64/aarch64.h | |
parent | f8815f7a483ba1fa81d5d07b7a519cd3931fa701 (diff) | |
download | gcc-7e1bcce3711f5646ffc98652c20e988d55689041.tar.gz |
[AArch64] Implement -m{cpu,tune,arch}=native using only /proc/cpuinfo
* config.host (case ${host}): Add aarch64*-*-linux case.
* config/aarch64/aarch64-cores.def: Add IMPLEMENTER_ID and PART_NUMBER
fields to all the cores.
* config/aarch64/aarch64-elf.h (DRIVER_SELF_SPECS):
Add MCPU_MTUNE_NATIVE_SPECS.
* config/aarch64/aarch64-option-extensions.def: Add FEATURE_STRING
field to all extensions.
* config/aarch64/aarch64-opts.h: Adjust definition of AARCH64_CORE.
* config/aarch64/aarch64.c: Adjust definition of AARCH64_CORE.
Adjust definition of AARCH64_OPT_EXTENSION.
* config/aarch64/aarch64.h: Adjust definition of AARCH64_CORE.
(MCPU_MTUNE_NATIVE_SPECS): Define.
* config/aarch64/driver-aarch64.c: New file.
* config/aarch64/x-arch64: New file.
* doc/invoke.texi (AArch64 Options): Document native value for -mcpu,
-mtune and -march.
From-SVN: r222415
Diffstat (limited to 'gcc/config/aarch64/aarch64.h')
-rw-r--r-- | gcc/config/aarch64/aarch64.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index bf59e40a644..1f7187bab9b 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -506,7 +506,7 @@ enum reg_class enum target_cpus { -#define AARCH64_CORE(NAME, INTERNAL_IDENT, SCHED, ARCH, FLAGS, COSTS) \ +#define AARCH64_CORE(NAME, INTERNAL_IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, PART) \ TARGET_CPU_##INTERNAL_IDENT, #include "aarch64-cores.def" #undef AARCH64_CORE @@ -929,11 +929,24 @@ extern const char *aarch64_rewrite_mcpu (int argc, const char **argv); #define BIG_LITTLE_CPU_SPEC_FUNCTIONS \ { "rewrite_mcpu", aarch64_rewrite_mcpu }, +#if defined(__aarch64__) +extern const char *host_detect_local_cpu (int argc, const char **argv); +# define EXTRA_SPEC_FUNCTIONS \ + { "local_cpu_detect", host_detect_local_cpu }, \ + BIG_LITTLE_CPU_SPEC_FUNCTIONS + +# define MCPU_MTUNE_NATIVE_SPECS \ + " %{march=native:%<march=native %:local_cpu_detect(arch)}" \ + " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ + " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" +#else +# define MCPU_MTUNE_NATIVE_SPECS "" +# define EXTRA_SPEC_FUNCTIONS BIG_LITTLE_CPU_SPEC_FUNCTIONS +#endif + #define ASM_CPU_SPEC \ BIG_LITTLE_SPEC -#define EXTRA_SPEC_FUNCTIONS BIG_LITTLE_CPU_SPEC_FUNCTIONS - #define EXTRA_SPECS \ { "asm_cpu_spec", ASM_CPU_SPEC } |