This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][ARM] add Armv8.9-a/Armv9.4-a identifier support
ClosedPublic

Authored by stuij on Nov 15 2022, 1:45 AM.

Details

Summary

For both ARM and AArch64 add support for specifying -march=armv8.9a/armv9.4a to
clang. Add backend plumbing like target parser and predicate support.

For a summary of Amv8.9/Armv9.4 features, see:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-2022

For detailed information, consult the Arm Architecture Reference Manual for
A-profile architecture:
https://developer.arm.com/documentation/ddi0487/latest/

People who contributed to this patch:

  • Keith Walker
  • Ties Stuij

Diff Detail

Event Timeline

stuij created this revision.Nov 15 2022, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 1:45 AM
stuij requested review of this revision.Nov 15 2022, 1:45 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 15 2022, 1:45 AM
pratlucas added inline comments.
llvm/include/llvm/Support/AArch64TargetParser.def
70–76

The new entries need to be updated, as D137924 has recently landed removing a couple of unused fields from AARCH64_ARCH.

tmatheson added inline comments.Nov 15 2022, 2:05 AM
llvm/include/llvm/Support/ARMTargetParser.def
127

No ARM::AEK_SHA2 | ARM::AEK_AES? Or does 8.8 need updated?

stuij updated this revision to Diff 475454.Nov 15 2022, 6:31 AM

make work with recent TargetParser changes (D137924)

stuij marked an inline comment as done.Nov 15 2022, 6:37 AM
stuij added inline comments.
llvm/include/llvm/Support/ARMTargetParser.def
127

Yes, I think 8.8 needs update, and some other arches as well.

In the A profile armarm, section A2.3, it is stated that from 8.2 SME(2) and EAS aren't by default included in the cryptographic extension as the Cryptographic Extension in an implementation is subject to export license controls. Inclusion of the extension can be either/or or none, so we should default to none.

I think this should be handled by separate patch.

pratlucas added inline comments.Nov 15 2022, 6:59 AM
llvm/include/llvm/Support/ARMTargetParser.def
127

The v8.9-a entry on AArch64TargetParser.def includes both AEK_SHA2 and AEK_AES. Can you also update it to make sure they are consistent?

pratlucas added inline comments.Nov 15 2022, 7:18 AM
llvm/unittests/Support/TargetParserTest.cpp
531

Should this be testing for ARMBuildAttrs::CPUArch::v9_A instead?

stuij updated this revision to Diff 475489.Nov 15 2022, 8:07 AM

addressed review comments

stuij marked an inline comment as done.Nov 15 2022, 8:09 AM
stuij added inline comments.
llvm/include/llvm/Support/ARMTargetParser.def
127

Ai, I was mistaken. For v8 we have them enabled by default for historic reasons. For v9 we had the opportunity to disable them. So I will actually update v8.9 to add them here :)

stuij marked 2 inline comments as done.Nov 15 2022, 8:11 AM
This revision is now accepted and ready to land.Nov 16 2022, 1:33 AM
This revision was landed with ongoing or failed builds.Nov 16 2022, 2:24 AM
This revision was automatically updated to reflect the committed changes.