diff options
author | Alexandros Lamprineas <alexandros.lamprineas@arm.com> | 2024-11-12 16:01:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 16:01:35 +0000 |
commit | 3cc852ece438a63e7b09d1c84a81d21598454e1a (patch) | |
tree | e2c52338e905819b52965700f4cafd6fa1e9f6af /llvm/lib | |
parent | 99f44c8fed5b538ab37c4227d9059a65450b68de (diff) | |
download | llvm-3cc852ece438a63e7b09d1c84a81d21598454e1a.zip llvm-3cc852ece438a63e7b09d1c84a81d21598454e1a.tar.gz llvm-3cc852ece438a63e7b09d1c84a81d21598454e1a.tar.bz2 |
[FMV][AArch64] Expand feature dependencies using AArch64::ExtensionSet. (#113281)
Currently we maintain a hand written list of subtarget features which we
are implied for a given FMV feature. It is more robust to expand such
dependencies using ExtensionDependency from TargetParser, since that is
generated by tablegen. For this to work each FMV feature must have a
corresponding SubtargetFeature in place. FMV features which didn't
satisfy this criteria have been removed from the ACLE specification
(https://github.com/ARM-software/acle/pull/315). However, I deliberately
marked the ArchExtKind in FMVInfo structure as std::optional in case we
decide to break this rule in the future.
I have also added the missing dependencies:
* FEAT_DPB2 -> FEAT_DPB
* FEAT_FlagM2 -> FEAT_FlagM
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64FMV.td | 98 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64Features.td | 4 |
2 files changed, 51 insertions, 51 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64FMV.td b/llvm/lib/Target/AArch64/AArch64FMV.td index 61cb4f7..fc7a94a 100644 --- a/llvm/lib/Target/AArch64/AArch64FMV.td +++ b/llvm/lib/Target/AArch64/AArch64FMV.td @@ -22,7 +22,7 @@ // Something you can add to target_version or target_clones. -class FMVExtension<string n, string b, string f, int p> { +class FMVExtension<string n, string b, int p> { // Name, as spelled in target_version or target_clones. e.g. "memtag". string Name = n; @@ -30,56 +30,56 @@ class FMVExtension<string n, string b, string f, int p> { // Currently this is given as a value from the enum "CPUFeatures". string Bit = b; - // SubtargetFeatures enabled for codegen when this FMV feature is present. - string BackendFeatures = f; + // SubtargetFeature enabled for codegen when this FMV feature is present. + string BackendFeature = n; // The FMV priority. int Priority = p; } -def : FMVExtension<"aes", "FEAT_PMULL", "+aes,+fp-armv8,+neon", 150>; -def : FMVExtension<"bf16", "FEAT_BF16", "+bf16", 280>; -def : FMVExtension<"bti", "FEAT_BTI", "+bti", 510>; -def : FMVExtension<"crc", "FEAT_CRC", "+crc", 110>; -def : FMVExtension<"dit", "FEAT_DIT", "+dit", 180>; -def : FMVExtension<"dotprod", "FEAT_DOTPROD", "+dotprod,+fp-armv8,+neon", 104>; -def : FMVExtension<"dpb", "FEAT_DPB", "+ccpp", 190>; -def : FMVExtension<"dpb2", "FEAT_DPB2", "+ccpp,+ccdp", 200>; -def : FMVExtension<"f32mm", "FEAT_SVE_F32MM", "+sve,+f32mm,+fullfp16,+fp-armv8,+neon", 350>; -def : FMVExtension<"f64mm", "FEAT_SVE_F64MM", "+sve,+f64mm,+fullfp16,+fp-armv8,+neon", 360>; -def : FMVExtension<"fcma", "FEAT_FCMA", "+fp-armv8,+neon,+complxnum", 220>; -def : FMVExtension<"flagm", "FEAT_FLAGM", "+flagm", 20>; -def : FMVExtension<"flagm2", "FEAT_FLAGM2", "+flagm,+altnzcv", 30>; -def : FMVExtension<"fp", "FEAT_FP", "+fp-armv8,+neon", 90>; -def : FMVExtension<"fp16", "FEAT_FP16", "+fullfp16,+fp-armv8,+neon", 170>; -def : FMVExtension<"fp16fml", "FEAT_FP16FML", "+fp16fml,+fullfp16,+fp-armv8,+neon", 175>; -def : FMVExtension<"frintts", "FEAT_FRINTTS", "+fptoint", 250>; -def : FMVExtension<"i8mm", "FEAT_I8MM", "+i8mm", 270>; -def : FMVExtension<"jscvt", "FEAT_JSCVT", "+fp-armv8,+neon,+jsconv", 210>; -def : FMVExtension<"ls64", "FEAT_LS64_ACCDATA", "+ls64", 520>; -def : FMVExtension<"lse", "FEAT_LSE", "+lse", 80>; -def : FMVExtension<"memtag", "FEAT_MEMTAG2", "+mte", 440>; -def : FMVExtension<"mops", "FEAT_MOPS", "+mops", 650>; -def : FMVExtension<"predres", "FEAT_PREDRES", "+predres", 480>; -def : FMVExtension<"rcpc", "FEAT_RCPC", "+rcpc", 230>; -def : FMVExtension<"rcpc2", "FEAT_RCPC2", "+rcpc", 240>; -def : FMVExtension<"rcpc3", "FEAT_RCPC3", "+rcpc,+rcpc3", 241>; -def : FMVExtension<"rdm", "FEAT_RDM", "+rdm,+fp-armv8,+neon", 108>; -def : FMVExtension<"rng", "FEAT_RNG", "+rand", 10>; -def : FMVExtension<"sb", "FEAT_SB", "+sb", 470>; -def : FMVExtension<"sha2", "FEAT_SHA2", "+sha2,+fp-armv8,+neon", 130>; -def : FMVExtension<"sha3", "FEAT_SHA3", "+sha3,+sha2,+fp-armv8,+neon", 140>; -def : FMVExtension<"simd", "FEAT_SIMD", "+fp-armv8,+neon", 100>; -def : FMVExtension<"sm4", "FEAT_SM4", "+sm4,+fp-armv8,+neon", 106>; -def : FMVExtension<"sme", "FEAT_SME", "+sme,+bf16", 430>; -def : FMVExtension<"sme-f64f64", "FEAT_SME_F64", "+sme,+sme-f64f64,+bf16", 560>; -def : FMVExtension<"sme-i16i64", "FEAT_SME_I64", "+sme,+sme-i16i64,+bf16", 570>; -def : FMVExtension<"sme2", "FEAT_SME2", "+sme2,+sme,+bf16", 580>; -def : FMVExtension<"ssbs", "FEAT_SSBS2", "+ssbs", 490>; -def : FMVExtension<"sve", "FEAT_SVE", "+sve,+fullfp16,+fp-armv8,+neon", 310>; -def : FMVExtension<"sve2", "FEAT_SVE2", "+sve2,+sve,+fullfp16,+fp-armv8,+neon", 370>; -def : FMVExtension<"sve2-aes", "FEAT_SVE_PMULL128", "+sve2,+sve,+aes,+sve2-aes,+fullfp16,+fp-armv8,+neon", 380>; -def : FMVExtension<"sve2-bitperm", "FEAT_SVE_BITPERM", "+sve2,+sve,+sve2-bitperm,+fullfp16,+fp-armv8,+neon", 400>; -def : FMVExtension<"sve2-sha3", "FEAT_SVE_SHA3", "+sve2,+sve,+sve2-sha3,+fullfp16,+fp-armv8,+neon", 410>; -def : FMVExtension<"sve2-sm4", "FEAT_SVE_SM4", "+sve2,+sve,+sve2-sm4,+fullfp16,+fp-armv8,+neon", 420>; -def : FMVExtension<"wfxt", "FEAT_WFXT", "+wfxt", 550>; +def : FMVExtension<"aes", "FEAT_PMULL", 150>; +def : FMVExtension<"bf16", "FEAT_BF16", 280>; +def : FMVExtension<"bti", "FEAT_BTI", 510>; +def : FMVExtension<"crc", "FEAT_CRC", 110>; +def : FMVExtension<"dit", "FEAT_DIT", 180>; +def : FMVExtension<"dotprod", "FEAT_DOTPROD", 104>; +let BackendFeature = "ccpp" in def : FMVExtension<"dpb", "FEAT_DPB", 190>; +let BackendFeature = "ccdp" in def : FMVExtension<"dpb2", "FEAT_DPB2", 200>; +def : FMVExtension<"f32mm", "FEAT_SVE_F32MM", 350>; +def : FMVExtension<"f64mm", "FEAT_SVE_F64MM", 360>; +def : FMVExtension<"fcma", "FEAT_FCMA", 220>; +def : FMVExtension<"flagm", "FEAT_FLAGM", 20>; +let BackendFeature = "altnzcv" in def : FMVExtension<"flagm2", "FEAT_FLAGM2", 30>; +def : FMVExtension<"fp", "FEAT_FP", 90>; +def : FMVExtension<"fp16", "FEAT_FP16", 170>; +def : FMVExtension<"fp16fml", "FEAT_FP16FML", 175>; +let BackendFeature = "fptoint" in def : FMVExtension<"frintts", "FEAT_FRINTTS", 250>; +def : FMVExtension<"i8mm", "FEAT_I8MM", 270>; +def : FMVExtension<"jscvt", "FEAT_JSCVT", 210>; +def : FMVExtension<"ls64", "FEAT_LS64_ACCDATA", 520>; +def : FMVExtension<"lse", "FEAT_LSE", 80>; +def : FMVExtension<"memtag", "FEAT_MEMTAG2", 440>; +def : FMVExtension<"mops", "FEAT_MOPS", 650>; +def : FMVExtension<"predres", "FEAT_PREDRES", 480>; +def : FMVExtension<"rcpc", "FEAT_RCPC", 230>; +let BackendFeature = "rcpc-immo" in def : FMVExtension<"rcpc2", "FEAT_RCPC2", 240>; +def : FMVExtension<"rcpc3", "FEAT_RCPC3", 241>; +def : FMVExtension<"rdm", "FEAT_RDM", 108>; +def : FMVExtension<"rng", "FEAT_RNG", 10>; +def : FMVExtension<"sb", "FEAT_SB", 470>; +def : FMVExtension<"sha2", "FEAT_SHA2", 130>; +def : FMVExtension<"sha3", "FEAT_SHA3", 140>; +def : FMVExtension<"simd", "FEAT_SIMD", 100>; +def : FMVExtension<"sm4", "FEAT_SM4", 106>; +def : FMVExtension<"sme", "FEAT_SME", 430>; +def : FMVExtension<"sme-f64f64", "FEAT_SME_F64", 560>; +def : FMVExtension<"sme-i16i64", "FEAT_SME_I64", 570>; +def : FMVExtension<"sme2", "FEAT_SME2", 580>; +def : FMVExtension<"ssbs", "FEAT_SSBS2", 490>; +def : FMVExtension<"sve", "FEAT_SVE", 310>; +def : FMVExtension<"sve2", "FEAT_SVE2", 370>; +def : FMVExtension<"sve2-aes", "FEAT_SVE_PMULL128", 380>; +def : FMVExtension<"sve2-bitperm", "FEAT_SVE_BITPERM", 400>; +def : FMVExtension<"sve2-sha3", "FEAT_SVE_SHA3", 410>; +def : FMVExtension<"sve2-sm4", "FEAT_SVE_SM4", 420>; +def : FMVExtension<"wfxt", "FEAT_WFXT", 550>; diff --git a/llvm/lib/Target/AArch64/AArch64Features.td b/llvm/lib/Target/AArch64/AArch64Features.td index a234907..95a3421 100644 --- a/llvm/lib/Target/AArch64/AArch64Features.td +++ b/llvm/lib/Target/AArch64/AArch64Features.td @@ -243,7 +243,7 @@ def FeatureRCPC_IMMO : Extension<"rcpc-immo", "RCPC_IMMO", "FEAT_LRCPC2", //===----------------------------------------------------------------------===// def FeatureAltFPCmp : Extension<"altnzcv", "AlternativeNZCV", "FEAT_FlagM2", - "Enable alternative NZCV format for floating point comparisons">; + "Enable alternative NZCV format for floating point comparisons", [FeatureFlagM]>; def FeatureFRInt3264 : Extension<"fptoint", "FRInt3264", "FEAT_FRINTTS", "Enable FRInt[32|64][Z|X] instructions that round a floating-point number to " @@ -259,7 +259,7 @@ def FeaturePredRes : ExtensionWithMArch<"predres", "PredRes", "FEAT_SPECRES", "Enable Armv8.5-A execution and data prediction invalidation instructions">; def FeatureCacheDeepPersist : Extension<"ccdp", "CCDP", "FEAT_DPB2", - "Enable Armv8.5-A Cache Clean to Point of Deep Persistence">; + "Enable Armv8.5-A Cache Clean to Point of Deep Persistence", [FeatureCCPP]>; def FeatureBranchTargetId : ExtensionWithMArch<"bti", "BTI", "FEAT_BTI", "Enable Branch Target Identification">; |