]> git.ipfire.org Git - people/ms/gcc.git/commit
AArch64: Cleanup CPU option processing code
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Wed, 18 May 2022 15:02:12 +0000 (16:02 +0100)
committerWilco Dijkstra <wdijkstr@arm.com>
Fri, 20 May 2022 14:10:37 +0000 (15:10 +0100)
commit1be715f31605976d8e4336973d3b81c5b7cea79f
tree0adb70628d3362e551d54c5edb49a5f3b08116e7
parentff171cb13df671a2a0647a68da0fdc1f9a78b8c9
AArch64: Cleanup CPU option processing code

The --with-cpu/--with-arch configure option processing not only checks valid
arguments but also sets TARGET_CPU_DEFAULT with a CPU and extension bitmask.
This isn't used however since a --with-cpu is translated into a -mcpu option
which is processed as if written on the command-line (so TARGET_CPU_DEFAULT
is never accessed).

So remove all the complex processing and bitmask, and just validate the
option. Fix a bug that always reports valid architecture extensions as invalid.
As a result the CPU processing in aarch64.c can be simplified.

gcc/
* config.gcc (aarch64*-*-*): Simplify --with-cpu and --with-arch
processing.  Add support for architectural extensions.
* config/aarch64/aarch64.h (TARGET_CPU_DEFAULT): Remove
AARCH64_CPU_DEFAULT_FLAGS.
(TARGET_CPU_NBITS): Remove.
(TARGET_CPU_MASK): Remove.
* config/aarch64/aarch64.cc (AARCH64_CPU_DEFAULT_FLAGS): Remove define.
(get_tune_cpu): Assert CPU is always valid.
(get_arch): Assert architecture is always valid.
(aarch64_override_options): Cleanup CPU selection code and simplify logic.
(aarch64_option_restore): Remove unnecessary checks on tune.
gcc/config.gcc
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/aarch64.h