[aarch64] Introduce flags for SVE2.
authorMatthew Malcomson <matthew.malcomson@arm.com>
Wed, 22 May 2019 16:09:59 +0000 (16:09 +0000)
committerMatthew Malcomson <matmal01@gcc.gnu.org>
Wed, 22 May 2019 16:09:59 +0000 (16:09 +0000)
commit28108a5341653568e9ebc49ea755ff93cc1e1711
tree9ca112acb2ac02b30f6a2915b2e521941130003a
parentee49c5a4513c99c8013c5cd1598559c5e4c2810c
[aarch64] Introduce flags for SVE2.

This patch adds support in the compiler for the architecture feature
flags that binutils will use to enable/disable the new "Future
Architecture Technologies" feature Scalable Vector Extension V2 (SVE2)
announced at Linaro Connect this week.

The "sve2" extension that enables the core sve2 instructions.
This also enables the sve extension, since sve is a requirement of sve2.

Extra optional sve2 features are the bitperm, sm4, aes, and sha3 extensions.
These are all given extra feature flags, "bitperm", "sve2-sm4",
"sve2-aes", and "sve2-sha3" respectively.
The sm4, aes, and sha3 extensions are explicitly marked as sve2
extensions to distinguish them from the corresponding NEON extensions.

When introducing macros to denote these new features we have gone past
what a 32 bit value can represent which means we need to change the type
of those variables working with these feature flags to ensure they use
64 bit quantities.

Tested with bootstrap on aarch64-none-linux-gnu and manually seeing that
-march=armv8-a+typo prints out the expected flags while using the new
feature flags does not complain about a missing flag (until reaching the
assembler).

gcc/ChangeLog:

2019-05-22  Matthew Malcomson  <matthew.malcomson@arm.com>

* common/config/aarch64/aarch64-common.c
(struct aarch64_option_extension, struct processor_name_to_arch,
struct arch_to_arch_name, aarch64_parse_extension, opt_ext_cmp,
aarch64_contains_opt,
aarch64_get_extension_string_for_isa_flags): Change type of
variables storing flags to uint64_t.
* config/aarch64/aarch64-option-extensions.def (sve2, sve2-sm4,
sve2-aes, sve2-sha3, bitperm): New optional SVE2 extension flags.
* config/aarch64/aarch64.c (struct processor,
aarch64_parse_arch, aarch64_parse_cpu, aarch64_validate_mcpu,
aarch64_validate_march, aarch64_override_options,
aarch64_option_print, aarch64_handle_attr_isa_flags,
aarch64_declare_function_name, aarch64_start_file): Make flag
variables uint64_t.
* config/aarch64/aarch64.h (AARCH64_FL_SVE2, AARCH64_FL_SVE2_AES,
AARCH64_FL_SVE2_SM4, AARCH64_FL_SVE2_SHA3,
AARCH64_FL_SVE2_BITPERM): New macro feature flags.
* config/aarch64/aarch64.opt (aarch64_isa_flags): Make uint64_t.
* config/aarch64/driver-aarch64.c
(struct aarch64_arch_extension, struct aarch64_core_data,
struct aarch64_arch_driver_info, host_detect_local_cpu): Make
flag variables uint64_t.
* doc/invoke.texi: Add documentation for new arguments.

From-SVN: r271514
gcc/ChangeLog
gcc/common/config/aarch64/aarch64-common.c
gcc/config/aarch64/aarch64-option-extensions.def
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.h
gcc/config/aarch64/aarch64.opt
gcc/config/aarch64/driver-aarch64.c
gcc/doc/invoke.texi