Skip to content

Commit b637940

Browse files
committed
imply sve2, reorder enums
1 parent 9831991 commit b637940

File tree

10 files changed

+23
-15
lines changed

10 files changed

+23
-15
lines changed

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,10 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
808808
HasFullFP16 = true;
809809
}
810810
if (Feature == "+sme-fa64") {
811+
FPU |= NeonMode;
812+
FPU |= SveMode;
811813
HasSME = true;
814+
HasSVE2 = true;
812815
HasSMEFA64 = true;
813816
}
814817
if (Feature == "+sb")

clang/test/CodeGen/attr-target-version.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ int hoo(void) {
211211
// CHECK-NEXT: ret ptr @fmv._MlseMsha2
212212
// CHECK: resolver_else12:
213213
// CHECK-NEXT: [[TMP28:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
214-
// CHECK-NEXT: [[TMP29:%.*]] = and i64 [[TMP28]], 288230376151711744
215-
// CHECK-NEXT: [[TMP30:%.*]] = icmp eq i64 [[TMP29]], 288230376151711744
214+
// CHECK-NEXT: [[TMP29:%.*]] = and i64 [[TMP28]], 144115188075855872
215+
// CHECK-NEXT: [[TMP30:%.*]] = icmp eq i64 [[TMP29]], 144115188075855872
216216
// CHECK-NEXT: [[TMP31:%.*]] = and i1 true, [[TMP30]]
217217
// CHECK-NEXT: br i1 [[TMP31]], label [[RESOLVER_RETURN13:%.*]], label [[RESOLVER_ELSE14:%.*]]
218218
// CHECK: resolver_return13:
@@ -289,8 +289,8 @@ int hoo(void) {
289289
// CHECK-NEXT: ret ptr @fmv_inline._Msha3Mi8mmMf32mm
290290
// CHECK: resolver_else6:
291291
// CHECK-NEXT: [[TMP16:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
292-
// CHECK-NEXT: [[TMP17:%.*]] = and i64 [[TMP16]], 576495936675512320
293-
// CHECK-NEXT: [[TMP18:%.*]] = icmp eq i64 [[TMP17]], 576495936675512320
292+
// CHECK-NEXT: [[TMP17:%.*]] = and i64 [[TMP16]], 288265560523800576
293+
// CHECK-NEXT: [[TMP18:%.*]] = icmp eq i64 [[TMP17]], 288265560523800576
294294
// CHECK-NEXT: [[TMP19:%.*]] = and i1 true, [[TMP18]]
295295
// CHECK-NEXT: br i1 [[TMP19]], label [[RESOLVER_RETURN7:%.*]], label [[RESOLVER_ELSE8:%.*]]
296296
// CHECK: resolver_return7:

compiler-rt/lib/builtins/cpu_model.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,9 +1247,9 @@ enum CPUFeatures {
12471247
FEAT_WFXT,
12481248
FEAT_SME_F64,
12491249
FEAT_SME_I64,
1250-
FEAT_SME_FA64,
12511250
FEAT_SME2,
12521251
FEAT_RCPC3,
1252+
FEAT_SME_FA64,
12531253
FEAT_MAX,
12541254
FEAT_EXT = 62, // Reserved to indicate presence of additional features field
12551255
// in __aarch64_cpu_features

llvm/include/llvm/TargetParser/AArch64TargetParser.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ enum CPUFeatures {
8888
FEAT_WFXT,
8989
FEAT_SME_F64,
9090
FEAT_SME_I64,
91-
FEAT_SME_FA64,
9291
FEAT_SME2,
9392
FEAT_RCPC3,
9493
FEAT_MAX,
94+
FEAT_SME_FA64,
9595
FEAT_EXT = 62,
9696
FEAT_INIT
9797
};
@@ -173,7 +173,7 @@ enum ArchExtKind : unsigned {
173173
AEK_SME_LUTv2 = 68, // FEAT_SME_LUTv2
174174
AEK_SMEF8F16 = 69, // FEAT_SME_F8F16
175175
AEK_SMEF8F32 = 70, // FEAT_SME_F8F32
176-
AEK_SMEFA64 = 61, // FEAT_SMEFA64
176+
AEK_SMEFA64 = 71, // FEAT_SME_FA64
177177
AEK_NUM_EXTENSIONS
178178
};
179179
using ExtensionBitset = Bitset<AEK_NUM_EXTENSIONS>;
@@ -260,9 +260,8 @@ inline constexpr ExtensionInfo Extensions[] = {
260260
{"simd", AArch64::AEK_SIMD, "+neon", "-neon", FEAT_SIMD, "+fp-armv8,+neon", 100},
261261
{"sm4", AArch64::AEK_SM4, "+sm4", "-sm4", FEAT_SM4, "+sm4,+fp-armv8,+neon", 60},
262262
{"sme-f16f16", AArch64::AEK_SMEF16F16, "+sme-f16f16", "-sme-f16f16", FEAT_INIT, "", 0},
263-
{"sme-f64f64", AArch64::AEK_SMEF64F64, "+sme-f64f64", "-sme-f64f64", FEAT_SME_F64, "+sme,+sme-f64f64,+bf16", 560},
264-
{"sme-i16i64", AArch64::AEK_SMEI16I64, "+sme-i16i64", "-sme-i16i64", FEAT_SME_I64, "+sme,+sme-i16i64,+bf16", 570},
265-
{"sme-fa64", AArch64::AEK_SMEFA64, "+sme-fa64", "-sme-fa64", FEAT_SME_FA64, "+sve2", 580},
263+
{"sme-f64f64", AArch64::AEK_SMEF64F64, "+sme-f64f64", "-sme-f64f64", FEAT_SME_F64, "+sme,+sme-f64f64,+bf16", 560},
264+
{"sme-i16i64", AArch64::AEK_SMEI16I64, "+sme-i16i64", "-sme-i16i64", FEAT_SME_I64, "+sme,+sme-i16i64,+bf16", 570},
266265
{"sme", AArch64::AEK_SME, "+sme", "-sme", FEAT_SME, "+sme,+bf16", 430},
267266
{"sme2", AArch64::AEK_SME2, "+sme2", "-sme2", FEAT_SME2, "+sme2,+sme,+bf16", 580},
268267
{"sme2p1", AArch64::AEK_SME2p1, "+sme2p1", "-sme2p1", FEAT_INIT, "", 0},
@@ -296,6 +295,7 @@ inline constexpr ExtensionInfo Extensions[] = {
296295
{"sme-lutv2", AArch64::AEK_SME_LUTv2, "+sme-lutv2", "-sme-lutv2", FEAT_INIT, "", 0},
297296
{"sme-f8f16", AArch64::AEK_SMEF8F16, "+sme-f8f16", "-sme-f8f16", FEAT_INIT, "+sme2,+fp8", 0},
298297
{"sme-f8f32", AArch64::AEK_SMEF8F32, "+sme-f8f32", "-sme-f8f32", FEAT_INIT, "+sme2,+fp8", 0},
298+
{"sme-fa64", AArch64::AEK_SMEFA64, "+sme-fa64", "-sme-fa64", FEAT_INIT, "+sme,+sve2,+simd", 0},
299299
// Special cases
300300
{"none", AArch64::AEK_NONE, {}, {}, FEAT_INIT, "", ExtensionInfo::MaxFMVPriority},
301301
};

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ def FeatureSMEF16F16 : SubtargetFeature<"sme-f16f16", "HasSMEF16F16", "true",
509509
"Enable SME2.1 non-widening Float16 instructions (FEAT_SME_F16F16)", []>;
510510

511511
def FeatureSMEFA64 : SubtargetFeature<"sme-fa64", "HasSMEFA64", "true",
512-
"Enable the full A64 instruction set in streaming SVE mode (FEAT_SME_FA64)", []>;
512+
"Enable the full A64 instruction set in streaming SVE mode (FEAT_SME_FA64)", [FeatureSME, FeatureSVE2, FeatureNEON]>;
513513

514514
def FeatureSME2 : SubtargetFeature<"sme2", "HasSME2", "true",
515515
"Enable Scalable Matrix Extension 2 (SME2) instructions", [FeatureSME]>;

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3616,7 +3616,6 @@ static const struct Extension {
36163616
{"flagm", {AArch64::FeatureFlagM}},
36173617
{"rme", {AArch64::FeatureRME}},
36183618
{"sme", {AArch64::FeatureSME}},
3619-
{"sme-fa64", {AArch64::FeatureSMEFA64}},
36203619
{"sme-f64f64", {AArch64::FeatureSMEF64F64}},
36213620
{"sme-f16f16", {AArch64::FeatureSMEF16F16}},
36223621
{"sme-i16i64", {AArch64::FeatureSMEI16I64}},
@@ -3663,6 +3662,7 @@ static const struct Extension {
36633662
{"sme-lutv2", {AArch64::FeatureSME_LUTv2}},
36643663
{"sme-f8f16", {AArch64::FeatureSMEF8F16}},
36653664
{"sme-f8f32", {AArch64::FeatureSMEF8F32}},
3665+
{"sme-fa64", {AArch64::FeatureSMEFA64}},
36663666
};
36673667

36683668
static void setRequiredFeatureString(FeatureBitset FBS, std::string &Str) {

llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-fp-reduce-fa64.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mattr=+sve -mattr=+sme-fa64 -force-streaming-compatible-sve < %s | FileCheck %s -check-prefix=FA64
2+
; RUN: llc -mattr=+sme-fa64 -force-streaming-compatible-sve < %s | FileCheck %s -check-prefix=FA64
33
; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s -check-prefix=NO-FA64
44

55

llvm/test/CodeGen/AArch64/sve-streaming-mode-fixed-length-int-mla-neon-fa64.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mattr=+sve -mattr=+sme-fa64 -force-streaming-compatible-sve < %s | FileCheck %s -check-prefix=FA64
2+
; RUN: llc -mattr=+sme-fa64 -force-streaming-compatible-sve < %s | FileCheck %s -check-prefix=FA64
33
; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s -check-prefix=NO-FA64
44

55
target triple = "aarch64-unknown-linux-gnu"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+sme-fa64 < %s | FileCheck %s
2+
3+
// Verify sme-fa64 implies SVE2
4+
ldnt1sh z0.s, p0/z, [z1.s]
5+
// CHECK: ldnt1sh { z0.s }, p0/z, [z1.s]

llvm/unittests/TargetParser/TargetParserTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,6 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
18031803
EXPECT_TRUE(llvm::is_contained(Features, "+pauth"));
18041804
EXPECT_TRUE(llvm::is_contained(Features, "+flagm"));
18051805
EXPECT_TRUE(llvm::is_contained(Features, "+sme"));
1806-
EXPECT_TRUE(llvm::is_contained(Features, "+sme-fa64"));
18071806
EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64"));
18081807
EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64"));
18091808
EXPECT_TRUE(llvm::is_contained(Features, "+sme-f16f16"));
@@ -1833,6 +1832,7 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
18331832
EXPECT_TRUE(llvm::is_contained(Features, "+sme-lutv2"));
18341833
EXPECT_TRUE(llvm::is_contained(Features, "+sme-f8f16"));
18351834
EXPECT_TRUE(llvm::is_contained(Features, "+sme-f8f32"));
1835+
EXPECT_TRUE(llvm::is_contained(Features, "+sme-fa64"));
18361836

18371837
// Assuming we listed every extension above, this should produce the same
18381838
// result. (note that AEK_NONE doesn't have a name so it won't be in the

0 commit comments

Comments
 (0)