<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62383>62383</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
A few default FEAT_??? mismatches cortex-a78a and cortex-x1c (that should be the same for both)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
markmi
</td>
</tr>
</table>
<pre>
I found the following using:
arm_cortex_a78c_core_trm_102226_0002_03_en.pdf (the "a78c .pdf")
arm_cortex_x1c_core_trm_101968_0002_04_en.pdf (the "x1c .pdf")
DDI0487_I_a_a-profile_architecture_reference_manual.pdf
https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/TargetParser/AArch64TargetParser.h
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AArch64/AArch64.td
(The first two .pdf's indicate specific field values to look
at in the 3rd .pdf .)
Considering only cortex-a78c and cortex-x1c, I see that the
two should be the same for the relevant features I was looking
at but at least one of the 2 has the wrong default feature status
for 4 examples of FEAT_??? .
ID_AA64ISAR0_EL1 TS, bits [55:52] = 0b0001 (FEAT_FlagM)
but LLVM git main still has cortex-x1c with AArch64::AEK_FLAGM
missing in AArch64TargetParser.h --yet correctly has FeatureFlagM
in AArch64.td .
It seems -mcpu=cortex-x1c+flagm notation is best used
explicitly as things are.
ID_AA64ISAR0_EL1 FHM, bits [51:48] = 0b0000 (no FEAT_FHM/no fp16fmll)
but git main still has cortex-a78c with AArch64::AEK_FP16FML in
AArch64TargetParser.h and FeatureFP16FML in AArch64.td .
I seems -mcpu=cortex-a78c+nofp16fml notation is best used
explicitly as things are.
ID_AA64ISAR1_EL1 LRCPC, bits [23:20] = 0b0010 (FEAT_LRCPC2)
but LLVM git main still has cortex-a78c with FeatureRCPC (FEAT_LRCPC)
in AArch64.td instead of FeatureRCPC_IMMO (FEAT_LRCPC2).
No notation in AArch64TargetParser.h refers to FEAT_LRCPC2
so no -mcpu=cortex-a78c+??? can cause the FEAT_LRCPC2 status.
ID_AA64MMFR2_EL1 AT, bits [35:32] = 0b0001 (FEAT_LSE2)
but LLVM git main still has cortex-a78c with FeatureLSE2 (FEAT_LSE2)
missing in AArch64.td . Nothing in AArch64TargetParser.h refers to
FEAT_LSE2 so no -mcpu=cortex-a78c+??? can cause the FEAT_LSE2
status.
So it seems that:
-mcpu=cortex-x1c+flagm also gets FEAT_LRCPC2 and FEAT_LSE2
status but avoids getting FEAT_FHM (matching the combination of
the 3 .pdf files for the 4 FEAT_??? in question).
-mcpu=cortex-a78c+nofp16fml also gets FEAT_FLAGM
but does not get either of FEAT_LRCPC2 or FEAT_LSE2.
(Not fully matching the 3 .pdf files for 2 FAT_??? .) It does
avoid getting FEAT_FHM status.
This is relevant to, for example, the Windows Dev Kit 2023
context.
Presented another way, referencing more source code
details . . .
AArch64TargetParser.h :
(resorted for ease of matching)
ARMV8_2A has:
AArch64::AEK_CRC
| AArch64::AEK_LSE
| AArch64::AEK_RDM
| AArch64::AEK_RAS
main/llvm/include/llvm/TargetParser/AArch64TargetParser.h has:
(resorted for ease of matching across lists)
{"cortex-a78c", ARMV8_2A,
( AArch64::AEK_AES (FEAT_AES)
| AArch64::AEK_FP16 (FEAT_FP16)
| AArch64::AEK_DOTPROD (FEAT_DotProd)
| AArch64::AEK_PAUTH (FEAT_PAuth)
| AArch64::AEK_PROFILE (FEAT_SPE)
| AArch64::AEK_SSBS (FEAT_SSBS, ?FEAT_SSBS2?)
| AArch64::AEK_RCPC (FEAT_LRCPC) NOTE: (FEAT_LRCPC2) is in the a78c .pdf and x1c .pdf
NOTE: No equivalent of FEAT_LRCPC2 in AArch64TargetParser.h so see AArch64.td material below.
| AArch64::AEK_FLAGM (FEAT_FlagM) NOTE: missing in cortex-x1c list.
NOTE: No equivalent of FEAT_LSE2 in AArch64TargetParser.h so see AArch64.td material below.
(This means -mcpu=cortex-a78a+lse2 would be rejected as a means of enabling FEAT_LSE2 handling.)
| AArch64::AEK_FP16FML)}, (FEAT_FHM) NOTE: (FEAT_FHM) is not in either a78c .pdf or x1c .pdf
. . .
{"cortex-x1c", ARMV8_2A,
( AArch64::AEK_AES
| AArch64::AEK_SHA2
| AArch64::AEK_FP16
| AArch64::AEK_DOTPROD
| AArch64::AEK_PAUTH
| AArch64::AEK_PROFILE)},
| AArch64::AEK_SSBS
| AArch64::AEK_RCPC NOTE: (FEAT_LRCPC2) in the x1c .pdf and a78c .pdf
NOTE: No equivalent of FEAT_LRCPC2 in AArch64TargetParser.h so see AArch64.td material below.
NOTE: missing AArch64::AEK_FLAGM (is in the x1c .pdf and a78c .pdf)
NOTE: No equivalent of FEAT_LSE2 in AArch64TargetParser.h so see AArch64.td material below.
main/llvm/lib/Target/AArch64/AArch64.td has:
[" (FEAT_???)" and other notes added, resorted for matching ease across lists]
AArch64.td :
HasV8_2aOps has:
FeatureEL2VMSA,
FeatureEL3,
FeatureCRC (FEAT_CRC32),
FeatureLSE (FEAT_LSE),
FeatureRDM (FEAT_RDM),
FeatureRAS (FEAT_RAS, FEAT_RASv1p1),
FeatureCCPP (FEAT_DPB),
FeaturePAN (FEAT_PAN),
FeatureLOR (FEAT_LOR),
FeatureVH (FEAT_VHE),
FeaturePsUAO (FEAT_UAO),
FeaturePAN_RWV (FEAT_PAN2)
list<SubtargetFeature> A78C = [HasV8_2aOps,
FeatureCrypto (FEAT_AES, FEAT_FP, FEAT_SHA1, FEAT_SHA256, FEAT_PMULL),
FeatureFPARMv8 (FEAT_FP),
FeatureNEON (FEAT_AdvSIMD),
FeatureFullFP16 (FEAT_FP16),
FeatureDotProd (FEAT_DotProd),
FeaturePAuth (FEAT_PAuth),
FeaturePerfMon (FEAT_PMUv3),
FeatureSPE (FEAT_SPE),
FeatureSSBS (FEAT_SSBS, FEAT_SSBS2)];
FeatureRCPC (FEAT_LRCPC), NOTE: (FEAT_LRCPC2) is in the a78c .pdf and x1c .pdf
FeatureFlagM (FEAT_FlagM), NOTE: AArch64::AEK_FLAGM missing in AArch64TargetParser.h
NOTE: missing FeatureLSE2 (FEAT_LSE2) (is in the a78c .pdf and x1c .pdf)
FeatureFP16FML (FEAT_FHM), NOTE: (FEAT_FHM) not in either a78c .pdf or x1c .pdf
Note, FeatureCrypto has:
FeatureNEON (FeatureFPARMv8), FeatureSHA2 (FEAT_SHA1, FEAT_SHA256),
FeatureAES (FEAT_AES, FEAT_PMULL)
list<SubtargetFeature> X1C = [HasV8_2aOps,
FeatureCrypto,
FeatureFPARMv8,
FeatureNEON,
FeatureFullFP16,
FeatureDotProd,
FeaturePAuth,
FeaturePerfMon,
FeatureSPE,
FeatureSSBS,
FeatureRCPC_IMMO (FEAT_LRCPC2), NOTE: matches both x1c .pdf and a78c .pdf
FeatureFlagM, NOTE: AArch64::AEK_FLAGM missing in AArch64TargetParser.h
FeatureLSE2 (FEAT_LSE2)]; NOTE: matches both x1c .pdf and a78c .pdf
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8WVlz6ji3_TXOy65D2TJTHngwg2-ohoSCnPR9o2RbBt2WLdqSQ_Lvb0meBxK6v9TXfYqAkZb2XtrDksBC0FNMyMwYzY3R8gGn8syTWYSTvyL64PHgc7aGkKdxAPJMIOSM8SuNT5AKGp8M2zHMpWHmrziJjj5PJPk44snUV-_JUSbR0TIRQuOjaZroaNpHEg8uQQgGmipMAyE1GtQzAyEDPXbQPqwGmPU4nuZgwwKshvZhdcGWy7U5nE6O6yM-4l-XhIeUkSNO_DOVxJdpQo4JCUlCYp8cIxynmGmImndnKS9CeYxcA7knKs-pN_B5ZCCXsffij8L-P-JLA7ke456B3AjTuBpDY5-lAakevOLkROQOJ4IkBnIdJ_HP42H96eD8kwYw6pWrVutV7wYyqHttoOmr2niaCAnyynNmJwJoHFAfSwLiQnwaUh9CSlgA75ilRIDkwDj_K99LCTTWEWQngYaAQbk32euCx4IGJFHBxWP2Cdne_9KxgeOg-Pxh-QZawBoEISDPWCrYDEKZJ848ZQF4RK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