Index: llvm/include/llvm/Support/AArch64TargetParser.h =================================================================== --- llvm/include/llvm/Support/AArch64TargetParser.h +++ llvm/include/llvm/Support/AArch64TargetParser.h @@ -74,6 +74,7 @@ AEK_PERFMON = 1ULL << 42, // FEAT_PMUv3 AEK_SME2 = 1ULL << 43, // FEAT_SME2 AEK_SVE2p1 = 1ULL << 44, // FEAT_SVE2p1 + AEK_SME2p1 = 1ULL << 45, // FEAT_SME2p1 }; enum class ArchKind { Index: llvm/include/llvm/Support/AArch64TargetParser.def =================================================================== --- llvm/include/llvm/Support/AArch64TargetParser.def +++ llvm/include/llvm/Support/AArch64TargetParser.def @@ -148,6 +148,7 @@ AARCH64_ARCH_EXT_NAME("sme-f64f64", AArch64::AEK_SMEF64F64, "+sme-f64f64", "-sme-f64f64") AARCH64_ARCH_EXT_NAME("sme-i16i64", AArch64::AEK_SMEI16I64, "+sme-i16i64", "-sme-i16i64") AARCH64_ARCH_EXT_NAME("sme2", AArch64::AEK_SME2, "+sme2", "-sme2") +AARCH64_ARCH_EXT_NAME("sme2p1", AArch64::AEK_SME2p1, "+sme2p1", "-sme2p1") AARCH64_ARCH_EXT_NAME("hbc", AArch64::AEK_HBC, "+hbc", "-hbc") AARCH64_ARCH_EXT_NAME("mops", AArch64::AEK_MOPS, "+mops", "-mops") AARCH64_ARCH_EXT_NAME("pmuv3", AArch64::AEK_PERFMON, "+perfmon", "-perfmon") Index: llvm/lib/Target/AArch64/AArch64.td =================================================================== --- llvm/lib/Target/AArch64/AArch64.td +++ llvm/lib/Target/AArch64/AArch64.td @@ -479,6 +479,9 @@ def FeatureSME2 : SubtargetFeature<"sme2", "HasSME2", "true", "Enable Scalable Matrix Extension 2 (SME2) instructions", [FeatureSME]>; +def FeatureSME2p1 : SubtargetFeature<"sme2p1", "HasSME2p1", "true", + "Enable Scalable Matrix Extension 2.1 (FEAT_SME2p1) instructions", [FeatureSME2]>; + def FeatureAppleA7SysReg : SubtargetFeature<"apple-a7-sysreg", "HasAppleA7SysReg", "true", "Apple A7 (the CPU formerly known as Cyclone)">; Index: llvm/lib/Target/AArch64/AArch64InstrInfo.td =================================================================== --- llvm/lib/Target/AArch64/AArch64InstrInfo.td +++ llvm/lib/Target/AArch64/AArch64InstrInfo.td @@ -146,6 +146,8 @@ AssemblerPredicateWithAll<(all_of FeatureSMEI16I64), "sme-i16i64">; def HasSME2 : Predicate<"Subtarget->hasSME2()">, AssemblerPredicateWithAll<(all_of FeatureSME2), "sme2">; +def HasSME2p1 : Predicate<"Subtarget->hasSME2p1()">, + AssemblerPredicateWithAll<(all_of FeatureSME2p1), "sme2p1">; // A subset of SVE(2) instructions are legal in Streaming SVE execution mode, // they should be enabled if either has been specified. def HasSVEorSME @@ -162,6 +164,9 @@ def HasSVE2p1_or_HasSME2 : Predicate<"Subtarget->hasSVE2p1() || Subtarget->hasSME2()">, AssemblerPredicate<(any_of FeatureSME2, FeatureSVE2p1), "sme2 or sve2p1">; +def HasSVE2p1_or_HasSME2p1 + : Predicate<"Subtarget->hasSVE2p1() || Subtarget->hasSME2p1()">, + AssemblerPredicate<(any_of FeatureSME2p1, FeatureSVE2p1), "sme2p1 or sve2p1">; // A subset of NEON instructions are legal in Streaming SVE execution mode, // they should be enabled if either has been specified. def HasNEONorSME Index: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp =================================================================== --- llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -3478,6 +3478,7 @@ {"sme-f64f64", {AArch64::FeatureSMEF64F64}}, {"sme-i16i64", {AArch64::FeatureSMEI16I64}}, {"sme2", {AArch64::FeatureSME2}}, + {"sme2p1", {AArch64::FeatureSME2p1}}, {"hbc", {AArch64::FeatureHBC}}, {"mops", {AArch64::FeatureMOPS}}, // FIXME: Unsupported extensions Index: llvm/test/MC/AArch64/SME2p1/directive-arch-negative.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SME2p1/directive-arch-negative.s @@ -0,0 +1,7 @@ +// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s + +.arch armv9-a+sme2p1 +.arch armv9-a+nosme2p1 +sqcvt z0.h, {z0.s, z1.s} +// CHECK: error: instruction requires: sme2 +// CHECK: sqcvt z0.h, {z0.s, z1.s} Index: llvm/test/MC/AArch64/SME2p1/directive-arch.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SME2p1/directive-arch.s @@ -0,0 +1,8 @@ +// RUN: llvm-mc -triple aarch64 -o - %s 2>&1 | FileCheck %s + +// SME2p1 should imply SME2 +.arch armv9-a+sme2p1 +sqcvt z0.h, {z0.s, z1.s} +// CHECK: sqcvt z0.h, { z0.s, z1.s } + +.arch armv9-a+nosme2p1 Index: llvm/test/MC/AArch64/SME2p1/directive-arch_extension-negative.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SME2p1/directive-arch_extension-negative.s @@ -0,0 +1,7 @@ +// RUN: not llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s + +.arch_extension sme2p1 +.arch_extension nosme2 +sqcvt z0.h, { z0.s, z1.s } +// CHECK: error: instruction requires: sme2 +// CHECK: sqcvt z0.h Index: llvm/test/MC/AArch64/SME2p1/directive-arch_extension.s =================================================================== --- /dev/null +++ llvm/test/MC/AArch64/SME2p1/directive-arch_extension.s @@ -0,0 +1,5 @@ +// RUN: llvm-mc -triple aarch64 -filetype asm -o - %s 2>&1 | FileCheck %s + +.arch_extension sme2p1 +sqcvt z0.h, { z0.s, z1.s } +// CHECK: sqcvt z0.h, { z0.s, z1.s } Index: llvm/unittests/Support/TargetParserTest.cpp =================================================================== --- llvm/unittests/Support/TargetParserTest.cpp +++ llvm/unittests/Support/TargetParserTest.cpp @@ -1506,7 +1506,7 @@ AArch64::AEK_BRBE, AArch64::AEK_PAUTH, AArch64::AEK_FLAGM, AArch64::AEK_SME, AArch64::AEK_SMEF64F64, AArch64::AEK_SMEI16I64, AArch64::AEK_SME2, AArch64::AEK_HBC, AArch64::AEK_MOPS, - AArch64::AEK_PERFMON, AArch64::AEK_SVE2p1}; + AArch64::AEK_PERFMON, AArch64::AEK_SVE2p1, AArch64::AEK_SME2p1}; std::vector Features; @@ -1565,6 +1565,7 @@ EXPECT_TRUE(llvm::is_contained(Features, "+sme-f64f64")); EXPECT_TRUE(llvm::is_contained(Features, "+sme-i16i64")); EXPECT_TRUE(llvm::is_contained(Features, "+sme2")); + EXPECT_TRUE(llvm::is_contained(Features, "+sme2p1")); EXPECT_TRUE(llvm::is_contained(Features, "+hbc")); EXPECT_TRUE(llvm::is_contained(Features, "+mops")); EXPECT_TRUE(llvm::is_contained(Features, "+perfmon")); @@ -1645,6 +1646,7 @@ {"sme-f64f64", "nosme-f64f64", "+sme-f64f64", "-sme-f64f64"}, {"sme-i16i64", "nosme-i16i64", "+sme-i16i64", "-sme-i16i64"}, {"sme2", "nosme2", "+sme2", "-sme2"}, + {"sme2p1", "nosme2p1", "+sme2p1", "-sme2p1"}, {"hbc", "nohbc", "+hbc", "-hbc"}, {"mops", "nomops", "+mops", "-mops"}, {"pmuv3", "nopmuv3", "+perfmon", "-perfmon"},