Skip to content

Commit f9f60fb

Browse files
committed
[AArch64] Merge duplicate extension information.
When we moved the extension information into tablegen in #90987, some features (FEAT_DPB, FEAT_DPB2, FEAT_FLAGM2, FEAT_FRINTTS, FEAT_RCPC2) were defined as FMVOnlyExtension despite already having an equivalent SubtargetFeature in place. This patch is fusing these duplications.
1 parent c7c5666 commit f9f60fb

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

llvm/include/llvm/TargetParser/AArch64TargetParser.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ inline constexpr ExtensionDependency ExtensionDependencies[] = {
229229
{AEK_LSE, AEK_LSE128},
230230
{AEK_PREDRES, AEK_SPECRES2},
231231
{AEK_RAS, AEK_RASV2},
232-
{AEK_RCPC, AEK_RCPC3},
232+
{AEK_RCPC, AEK_RCPC2},
233+
{AEK_RCPC2, AEK_RCPC3},
234+
{AEK_FLAGM, AEK_FLAGM2},
235+
{AEK_DPB, AEK_DPB2},
233236
};
234237
// clang-format on
235238

llvm/lib/Target/AArch64/AArch64Features.td

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,12 @@ class FMVOnlyExtension<string FMVBit, string Name, string Deps, int Priority>
7575
}
7676

7777
def : FMVOnlyExtension<"FEAT_DGH", "dgh", "", 260>;
78-
def : FMVOnlyExtension<"FEAT_DPB", "dpb", "+ccpp", 190>;
79-
def : FMVOnlyExtension<"FEAT_DPB2", "dpb2", "+ccpp,+ccdp", 200>;
8078
def : FMVOnlyExtension<"FEAT_EBF16", "ebf16", "+bf16", 290>;
81-
def : FMVOnlyExtension<"FEAT_FLAGM2", "flagm2", "+flagm,+altnzcv", 30>;
82-
def : FMVOnlyExtension<"FEAT_FRINTTS", "frintts", "+fptoint", 250>;
8379
def : FMVOnlyExtension<"FEAT_LS64_ACCDATA", "ls64_accdata", "+ls64", 540>;
8480
def : FMVOnlyExtension<"FEAT_LS64_V", "ls64_v", "", 530>;
8581
def : FMVOnlyExtension<"FEAT_MEMTAG2", "memtag2", "+mte", 450>;
8682
def : FMVOnlyExtension<"FEAT_MEMTAG3", "memtag3", "+mte", 460>;
8783
def : FMVOnlyExtension<"FEAT_PMULL", "pmull", "+aes,+fp-armv8,+neon", 160>;
88-
def : FMVOnlyExtension<"FEAT_RCPC2", "rcpc2", "+rcpc", 240>;
8984
def : FMVOnlyExtension<"FEAT_RPRES", "rpres", "", 300>;
9085
def : FMVOnlyExtension<"FEAT_SHA1", "sha1", "+fp-armv8,+neon", 120>;
9186
def : FMVOnlyExtension<"FEAT_SSBS2", "ssbs2", "+ssbs", 500>;
@@ -216,8 +211,10 @@ def FeaturePAN_RWV : SubtargetFeature<
216211
def FeaturePsUAO : SubtargetFeature< "uaops", "HasPsUAO", "true",
217212
"Enable v8.2 UAO PState (FEAT_UAO)">;
218213

219-
def FeatureCCPP : SubtargetFeature<"ccpp", "HasCCPP",
220-
"true", "Enable v8.2 data Cache Clean to Point of Persistence (FEAT_DPB)" >;
214+
let ArchExtKindSpelling = "AEK_DPB", MArchName = "dpb" in
215+
def FeatureCCPP : Extension<"ccpp", "CCPP",
216+
"Enable v8.2 data Cache Clean to Point of Persistence (FEAT_DPB)", [],
217+
"FEAT_DPB", "+ccpp", 190>;
221218

222219
def FeatureSVE : Extension<"sve", "SVE",
223220
"Enable Scalable Vector Extension (SVE) instructions (FEAT_SVE)", [FeatureFullFP16],
@@ -491,9 +488,10 @@ def FeatureFlagM : Extension<
491488
"FEAT_FLAGM", "+flagm", 20>;
492489

493490
// 8.4 RCPC enchancements: LDAPR & STLR instructions with Immediate Offset
494-
def FeatureRCPC_IMMO : SubtargetFeature<"rcpc-immo", "HasRCPC_IMMO", "true",
491+
let ArchExtKindSpelling = "AEK_RCPC2", MArchName = "rcpc2" in
492+
def FeatureRCPC_IMMO : Extension<"rcpc-immo", "RCPC_IMMO",
495493
"Enable v8.4-A RCPC instructions with Immediate Offsets (FEAT_LRCPC2)",
496-
[FeatureRCPC]>;
494+
[FeatureRCPC], "FEAT_RCPC2", "+rcpc", 240>;
497495

498496
def FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates",
499497
"NegativeImmediates", "false",
@@ -525,12 +523,16 @@ def FeatureAggressiveFMA :
525523
"true",
526524
"Enable Aggressive FMA for floating-point.">;
527525

528-
def FeatureAltFPCmp : SubtargetFeature<"altnzcv", "HasAlternativeNZCV", "true",
529-
"Enable alternative NZCV format for floating point comparisons (FEAT_FlagM2)">;
526+
let ArchExtKindSpelling = "AEK_FLAGM2", MArchName = "flagm2" in
527+
def FeatureAltFPCmp : Extension<"altnzcv", "AlternativeNZCV",
528+
"Enable alternative NZCV format for floating point comparisons (FEAT_FlagM2)",
529+
[FeatureFlagM], "FEAT_FLAGM2", "+flagm,+altnzcv", 30>;
530530

531-
def FeatureFRInt3264 : SubtargetFeature<"fptoint", "HasFRInt3264", "true",
531+
let ArchExtKindSpelling = "AEK_FRINTTS", MArchName = "frintts" in
532+
def FeatureFRInt3264 : Extension<"fptoint", "FRInt3264",
532533
"Enable FRInt[32|64][Z|X] instructions that round a floating-point number to "
533-
"an integer (in FP format) forcing it to fit into a 32- or 64-bit int (FEAT_FRINTTS)" >;
534+
"an integer (in FP format) forcing it to fit into a 32- or 64-bit int (FEAT_FRINTTS)",
535+
[], "FEAT_FRINTTS", "+fptoint", 250>;
534536

535537
def FeatureSpecRestrict : SubtargetFeature<"specrestrict", "HasSpecRestrict",
536538
"true", "Enable architectural speculation restriction (FEAT_CSV2_2)">;
@@ -547,8 +549,10 @@ def FeaturePredRes : Extension<"predres", "PredRes",
547549
"Enable v8.5a execution and data prediction invalidation instructions (FEAT_SPECRES)", [],
548550
"FEAT_PREDRES", "+predres", 480>;
549551

550-
def FeatureCacheDeepPersist : SubtargetFeature<"ccdp", "CCDP", "true",
551-
"Enable v8.5 Cache Clean to Point of Deep Persistence (FEAT_DPB2)" >;
552+
let ArchExtKindSpelling = "AEK_DPB2", MArchName = "dpb2" in
553+
def FeatureCacheDeepPersist : Extension<"ccdp", "CCDP",
554+
"Enable v8.5 Cache Clean to Point of Deep Persistence (FEAT_DPB2)",
555+
[FeatureCCPP], "FEAT_DPB2", "+ccpp,+ccdp", 200>;
552556

553557
let ArchExtKindSpelling = "AEK_NONE" in
554558
def FeatureBranchTargetId : Extension<"bti", "BTI",

0 commit comments

Comments
 (0)