This is an archive of the discontinued LLVM Phabricator instance.

AArch64: add definitions for recent Apple CPUs
ClosedPublic

Authored by t.p.northover on Sep 21 2022, 5:11 AM.

Details

Reviewers
ab
Summary

This adds support for Apple CPUs released since the last batch: apple-a15, apple-a16 and apple-m2.

They're roughly ARMv8.6. This works in the .td file, but in AArch64TargetParser.def, marking them v8.6 brings in support for the SM4 cryptographic hash and we don't actually have that. So TargetParser side they're marked as v8.5, with the extra features (BF16 and I8MM added manually).

Finally, A16 supports the HCX extension in addition to v8.6. This has no TargetParser implications.

Diff Detail

Event Timeline

t.p.northover created this revision.Sep 21 2022, 5:11 AM
t.p.northover requested review of this revision.Sep 21 2022, 5:11 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 21 2022, 5:11 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Accidentally clang-formatted the ampere1 test. Undo that.

Harbormaster completed remote builds in B187942: Diff 461858.
ab accepted this revision.Sep 21 2022, 10:53 AM

but in AArch64TargetParser.def, marking them v8.6 brings in support for the SM4 cryptographic hash and we don't actually have that

Huh, I don't understand why, does that ring a bell? Looks like it's been there since v8.6a was added here; I asked in D76062.

Other than that, LGTM; we can go back and change this if we change V8_6A

This revision is now accepted and ready to land.Sep 21 2022, 10:55 AM
t.p.northover closed this revision.Sep 22 2022, 3:59 AM

Thanks, committed as 677da09d0259.

What do you mean by we do not have SM4? Apple CPU or clang?

tigermoth added a subscriber: tigermoth.EditedJun 21 2023, 8:29 AM

Now that AES, SHA2, SHA3 and SM4 features have been removed from armv8.6-a, these Apple CPUs can be changed again from 8.5-a to more correctly specified as armv8.6-a

Fix was here: (AES, SHA2, SHA3 and SM4 Removed)
https://reviews.llvm.org/D141606?id=488968

Change required here:
/llvm/include/llvm/TargetParser/AArch64TargetParser.h
/llvm/unittests/TargetParser/TargetParserTest.cpp