This is an archive of the discontinued LLVM Phabricator instance.

[ARM][AArch64] Armv8.4-A enablement
ClosedPublic

Authored by SjoerdMeijer on Jun 27 2018, 3:02 AM.

Details

Summary

Initial patch adding assembly support for Armv8.4-A.

Besides adding v8.4 as a supported architecture to the usual places, this also
adds target features for the different crypto algorithms. Armv8.4-A introduced
new crypto algorithms, made them optional, and allows different combinations:

  • none of the v8.4 crypto functions are supported, which is independent of the implementation of the Armv8.0 SHA1 and SHA2 instructions.
  • the v8.4 SHA512 and SHA3 support is implemented, in this case the Armv8.0 SHA1 and SHA2 instructions must also be implemented.
  • the v8.4 SM3 and SM4 support is implemented, which is independent of the implementation of the Armv8.0 SHA1 and SHA2 instructions.
  • all of the v8.4 crypto functions are supported, in this case the Armv8.0 SHA1 and SHA2 instructions must also be implemented.

The v8.4 crypto instructions are added to AArch64 only, and not AArch32,
and are made optional extensions to Armv8.2-A.

The user-facing Clang options will map on these new target features, their
naming will be compatible with GCC and added in follow-up patches.

The Armv8.4-A instruction sets can be downloaded here:
https://developer.arm.com/products/architecture/a-profile/exploration-tools

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Jun 27 2018, 3:02 AM
olista01 added inline comments.Jun 28 2018, 2:27 AM
include/llvm/Support/ARMTargetParser.def
137

Why are these needed, if the sha3 and sm4 instructions are AArch64-only?

include/llvm/Support/TargetParser.h
89

Same here, are these needed?

lib/Target/AArch64/AArch64.td
35

I think SHA3 should also depend on SHA2. From the architecture manual:

Implementation of ARMv8.2-SHA requires implementation of the ARMv8.0 Cryptographic Extension SHA-1 and SHA256 functionality.

49

Typo: "appropriate".

SjoerdMeijer added inline comments.Jun 28 2018, 7:31 AM
include/llvm/Support/ARMTargetParser.def
137

Think I just initially added these here, incorrectly, but then just forgot to remove them. Thanks, fixing this now!

Addressed comments.

This revision is now accepted and ready to land.Jun 28 2018, 8:08 AM
This revision was automatically updated to reflect the committed changes.