[ARM][AArch64] Require appropriate features for crypto algorithms
authorDavid Candler <david.candler@arm.com>
Wed, 28 Apr 2021 14:16:01 +0000 (15:16 +0100)
committerDavid Candler <david.candler@arm.com>
Wed, 28 Apr 2021 15:26:18 +0000 (16:26 +0100)
commitb8baa2a9132498ea286dbb0d03f005760ecc6fdb
treeda0cd9b28c4185a11af7621c260afe3141552134
parent511ffe17edec6010de9c4a6e1ccc6a8d66e043d3
[ARM][AArch64] Require appropriate features for crypto algorithms

This patch changes the AArch32 crypto instructions (sha2 and aes) to
require the specific sha2 or aes features. These features have
already been implemented and can be controlled through the command
line, but do not have the expected result (i.e. `+noaes` will not
disable aes instructions). The crypto feature retains its existing
meaning of both sha2 and aes.

Several small changes are included due to the knock-on effect this has:

- The AArch32 driver has been modified to ensure sha2/aes is correctly
  set based on arch/cpu/fpu selection and feature ordering.
- Crypto extensions are permitted for AArch32 v8-R profile, but not
  enabled by default.
- ACLE feature macros have been updated with the fine grained crypto
  algorithms. These are also used by AArch64.
- Various tests updated due to the change in feature lists and macros.

Reviewed By: lenary

Differential Revision: https://reviews.llvm.org/D99079
27 files changed:
clang/include/clang/Basic/arm_neon.td
clang/lib/Basic/Targets/AArch64.cpp
clang/lib/Basic/Targets/AArch64.h
clang/lib/Basic/Targets/ARM.cpp
clang/lib/Basic/Targets/ARM.h
clang/lib/Driver/ToolChains/Arch/ARM.cpp
clang/test/CodeGen/aarch64-neon-range-checks.c
clang/test/CodeGen/aarch64-neon-sha3.c
clang/test/CodeGen/aarch64-neon-sm4-sm3.c
clang/test/CodeGen/arm-target-features.c
clang/test/CodeGen/arm64_crypto.c
clang/test/CodeGen/neon-crypto.c
clang/test/Driver/aarch64-cpus.c
clang/test/Driver/arm-cortex-cpus.c
clang/test/Driver/arm-features.c
clang/test/Driver/arm-mfpu.c
clang/test/Driver/armv8.1m.main.c
clang/test/Preprocessor/aarch64-target-features.c
clang/test/Preprocessor/arm-target-features.c
llvm/include/llvm/Support/ARMTargetParser.def
llvm/lib/Support/ARMTargetParser.cpp
llvm/lib/Target/ARM/ARMInstrNEON.td
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/test/Bindings/llvm-c/ARM/disassemble.test
llvm/test/MC/ARM/directive-arch_extension-aes-sha2.s [new file with mode: 0644]
llvm/test/MC/ARM/directive-arch_extension-crypto.s
llvm/test/MC/ARM/neon-crypto.s