-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AArch64] set AppleA14 architecture version to v8.4-a #92600
Conversation
@llvm/pr-subscribers-debuginfo @llvm/pr-subscribers-backend-aarch64 Author: Tomas Matheson (tmatheson-arm) ChangesPutting this up for review to double check, because Wikipedia claims it is v8.5-a but I noticed the citation is... TargetParser. Full diff: https://github.com/llvm/llvm-project/pull/92600.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64Processors.td b/llvm/lib/Target/AArch64/AArch64Processors.td
index f2286ae17dba5..96422758bc618 100644
--- a/llvm/lib/Target/AArch64/AArch64Processors.td
+++ b/llvm/lib/Target/AArch64/AArch64Processors.td
@@ -718,7 +718,7 @@ def ProcessorFeatures {
list<SubtargetFeature> AppleA13 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
FeatureNEON, FeaturePerfMon, FeatureFullFP16,
FeatureFP16FML, FeatureSHA3];
- list<SubtargetFeature> AppleA14 = [HasV8_4aOps, FeatureCrypto, FeatureFPARMv8,
+ list<SubtargetFeature> AppleA14 = [HasV8_5aOps, FeatureCrypto, FeatureFPARMv8,
FeatureNEON, FeaturePerfMon, FeatureFRInt3264,
FeatureSpecRestrict, FeatureSSBS, FeatureSB,
FeaturePredRes, FeatureCacheDeepPersist,
|
Apple's Apple Silicon Optimization Guide indeed says it is 8.5 |
@tmatheson-arm can you verify that the information in the guide matches what information is here regarding the chipset? https://developer.apple.com/file/?file=applesiliconcpuoptimizationguide&agree=true |
Said document also says M1 and A14 don't have the BTI feature that guards against execution of instructions that are not the intended target of a branch |
Just checked. This is called: FeatureBranchTargetId, so we need to exclude it from A14, as it is the only thing from the 8.5 spec it doesn't support. |
Thanks @AtariDreams for pointing that out. They do both seem to be "8.5 without BTI". I had a look at what current versions of clang/llvm do in this regard: Current builds of clang set
They will also disassemble BTI instructions (rather than outputting "hint"):
I don't think either of those is correct. Unfortunately in the backend we can't model negative features, so the best thing to do might be to model them as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, apple-m1 does not have BTI, but BTI is required for v8.5. My mistake.
Not sure if you are involved in writing the optimization guide itself at Apple, but the way the chip is described as having 8.5 minus BTI is a bit confusing since that would technically make the chip not v8.5 @jroelofs |
Any updates on this? |
Sure, it makes the chip "v8.5 (excluding FEAT_BTI)", which is what's written in the guide ;) The guide is intended as a human-readable guide for high-performance software writers, not as much as the almost-only-machine-readable specifications we're used to reading. The alternative would have been "v8.4a + all these features from v8.5" which is worse. |
@jroelofs on a slight tangent, when do we get to add information on the M4 chip? |
Is this ready to merge? |
@jroelofs Can we please merge this? |
It's up to @tmatheson-arm, it's their patch. I've already given an 'LGTM'. |
According to the Apple Silicon Optimization Guide, these are 8.4 with all features of 8.5 except BTI.
Putting this up for review to double check, because Wikipedia claims it is v8.5-a but I noticed the citation is... TargetParser.