AArch64: Have -mcpu=native and -march=native enable extensions when CPU is unknown
authorTamar Christina <tamar.christina@arm.com>
Mon, 17 May 2021 14:22:39 +0000 (15:22 +0100)
committerTamar Christina <tamar.christina@arm.com>
Mon, 17 May 2021 14:26:11 +0000 (15:26 +0100)
commite91a17fe39c39e98cebe6e1cbc8064ee6846a3a7
tree067f3390f86a0545c9ec90eff79d8caa15559fa1
parentf6a060800d3998c8a55eea65b02693cbbfee3e14
AArch64: Have -mcpu=native and -march=native enable extensions when CPU is unknown

Currently when using -mcpu=native or -march=native on a CPU that is unknown to
the compiler the compiler currently just used -march=armv8-a and enables none
of the extensions.

To make this a bit more useful this patch changes it to still use -march=armv8.a
but to enable the extensions.  We still cannot do tuning but at least if using
this on a future SVE core the compiler will at the very least enable SVE etc.

gcc/ChangeLog:

* config/aarch64/driver-aarch64.c (DEFAULT_ARCH): New.
(host_detect_local_cpu): Use it.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/cpunative/info_16: New test.
* gcc.target/aarch64/cpunative/info_17: New test.
* gcc.target/aarch64/cpunative/native_cpu_16.c: New test.
* gcc.target/aarch64/cpunative/native_cpu_17.c: New test.
gcc/config/aarch64/driver-aarch64.c
gcc/testsuite/gcc.target/aarch64/cpunative/info_16 [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/cpunative/info_17 [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_17.c [new file with mode: 0644]