[PATCH 11/30] [arm] Allow CPU and architecture extensions to be defined as aliases

Richard Earnshaw Richard.Earnshaw@arm.com
Fri Jun 9 12:55:00 GMT 2017


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.
---
 gcc/config/arm/arm-cpu-cdata.h | 518 ++++++++++++++++++++---------------------
 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 ++++-
 5 files changed, 439 insertions(+), 301 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0011-arm-Allow-CPU-and-architecture-extensions-to-be-defi.patch
Type: text/x-patch
Size: 37488 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170609/5c2bd1bb/attachment.bin>


More information about the Gcc-patches mailing list