[arm] Allow CPU and architecture extensions to be

Programming / Compilers / GCC - rearnsha [138bc75d-0d04-0410-961f-82ee72b054a4] - 16 June 2017 17:03 EDT

A follow up patch to this one will start to canonicalize options to simplify generating multilib fragments. This patch is enabling work for that. If we have extension options that duplicate other options (done principally for back-wards compatibility purposes) we need to ensure that just one of them will be used consistently when generating a canonical form of the user-specified options. We do this by explicitly noting when an option is defined as an alias of another.

Another aspect of canonicalization is to enforce a strict order in which the options are inspected, we do this by ensuring that no later option examined can be a subset of an earlier option (add and remove options are treated separtely).

It's practically impossible to check all this in parsecpu.awk since that premits use of C macros in the ISA features list, so instead we enforce the ordering with a selftest function in the compiler, which is only run when self tests are enabled (it's not something that will change every day, so this should be sufficient).

- config/arm/arm-protos.h (cpu_arch_extension): Add field to record when an option is an alias of another.
- config/arm/parsecpu.awk (optalias): New parser token. (gen_comm_data): Mark non-alias options as such. Emit entries for extension aliases.
- config/arm/arm-cpus.in (armv5e): Make vfpv2 an alias. (armv5te, armv5tej, armv6, armv6j, armv6k, armv6z): Likewise. (armv6kz, armv6zk, armv6t2): Likewise. (armv7): Make vfpv3-d16 an alias. (armv7-a): Make vfpv3-d16, neon and neon-vfpv3 aliases. Sort in canonical order. (armv7ve): Make vfpv4-d16, neon-vfpv3 and neon-vfpv4 aliases. Sort in canonical order. (armv8-a): Sort in canonical order. (armv8.1-a, armv8.2-a): Likewise. (generic-armv7-a): Make neon and neon-vfpv3 aliases. Sort in canonical order. (cortex-a9): Sort in canonical order.
- config/arm/arm.c (selftests.h): Include it. (arm_test_cpu_arch_data): New function. (arm_run_self_tests): New function. (TARGET_RUN_TARGET_SELFTESTS): Redefine. (targetm): Move declaration to the end of the file.
- arm-cpu-cdata.h: Regenerated.

5773027 [arm] Allow CPU and architecture extensions to be
gcc/ChangeLog | 27 +++
gcc/config/arm/arm-cpu-cdata.h | 510 ++++++++++++++++++++---------------------
gcc/config/arm/arm-cpus.in | 77 ++++---
gcc/config/arm/arm-protos.h | 6 +
gcc/config/arm/arm.c | 82 ++++++-
gcc/config/arm/parsecpu.awk | 57 ++++-
6 files changed, 462 insertions(+), 297 deletions(-)

Upstream: gcc.gnu.org

  • Share