Skip to content

Commit 9575ab2

Browse files
LukacmajthackraySpencerAbson
authored
[AArch64] Update feature dep. for Armv9.6 extensions (#113466)
Co-authored-by: Jonathan Thackray <[email protected]> Co-authored-by: SpencerAbson <[email protected]>
1 parent c07abf7 commit 9575ab2

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed

llvm/lib/Target/AArch64/AArch64Features.td

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,23 +526,23 @@ def FeatureCMPBR : ExtensionWithMArch<"cmpbr", "CMPBR", "FEAT_CMPBR",
526526
"Enable Armv9.6-A base compare and branch instructions">;
527527

528528
def FeatureF8F32MM: ExtensionWithMArch<"f8f32mm", "F8F32MM", "FEAT_F8F32MM",
529-
"Enable Armv9.6-A FP8 to Single-Precision Matrix Multiplication">;
529+
"Enable Armv9.6-A FP8 to Single-Precision Matrix Multiplication", [FeatureNEON, FeatureFP8]>;
530530

531531
def FeatureF8F16MM: ExtensionWithMArch<"f8f16mm", "F8F16MM", "FEAT_F8F16MM",
532-
"Enable Armv9.6-A FP8 to Half-Precision Matrix Multiplication">;
532+
"Enable Armv9.6-A FP8 to Half-Precision Matrix Multiplication", [FeatureNEON, FeatureFP8]>;
533533

534534
def FeatureFPRCVT: ExtensionWithMArch<"fprcvt", "FPRCVT", "FEAT_FPRCVT",
535535
"Enable Armv9.6-A base convert instructions for SIMD&FP scalar register operands of"
536-
" different input and output sizes">;
536+
" different input and output sizes", [FeatureFPARMv8]>;
537537

538538
def FeatureLSFE : ExtensionWithMArch<"lsfe", "LSFE", "FEAT_LSFE",
539-
"Enable Armv9.6-A base Atomic floating-point in-memory instructions">;
539+
"Enable Armv9.6-A base Atomic floating-point in-memory instructions", [FeatureFPARMv8]>;
540540

541541
def FeatureSME2p2: ExtensionWithMArch<"sme2p2", "SME2p2", "FEAT_SME2p2",
542542
"Enable Armv9.6-A Scalable Matrix Extension 2.2 instructions", [FeatureSME2p1]>;
543543

544544
def FeatureSSVE_AES : ExtensionWithMArch<"ssve-aes", "SSVE_AES", "FEAT_SSVE_AES",
545-
"Enable Armv9.6-A SVE2 AES support in streaming SVE mode">;
545+
"Enable Armv9.6-A SVE2 AES support in streaming SVE mode", [FeatureSME2, FeatureSVE2AES]>;
546546

547547
def FeatureSVE2p2 : ExtensionWithMArch<"sve2p2", "SVE2p2", "FEAT_SVE2p2",
548548
"Enable Armv9.6-A Scalable Vector Extension 2.2 instructions", [FeatureSVE2p1]>;
@@ -554,7 +554,8 @@ def FeatureSVEBFSCALE: ExtensionWithMArch<"sve-bfscale", "SVE_BFSCALE", "FEAT_SV
554554
"Enable Armv9.6-A SVE BFloat16 scaling instructions">;
555555

556556
def FeatureSVE_F16F32MM: ExtensionWithMArch<"sve-f16f32mm", "SVE_F16F32MM", "FEAT_SVE_F16F32MM",
557-
"Enable Armv9.6-A FP16 to FP32 Matrix Multiply instructions">;
557+
"Enable Armv9.6-A FP16 to FP32 Matrix Multiply instructions", [FeatureSVE]>;
558+
558559
def FeatureLSUI: ExtensionWithMArch<"lsui", "LSUI", "FEAT_LSUI",
559560
"Enable Armv9.6-A unprivileged load/store instructions">;
560561

llvm/unittests/TargetParser/TargetParserTest.cpp

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,7 +1782,15 @@ AArch64ExtensionDependenciesBaseArchTestParams
17821782
{AArch64::ARMV8A, {"nofp", "jscvt"}, {"fp-armv8", "jsconv"}, {}},
17831783
{AArch64::ARMV8A, {"jscvt", "nofp"}, {}, {"fp-armv8", "jsconv"}},
17841784

1785-
// simd -> {aes, sha2, sha3, sm4}
1785+
// fp -> lsfe
1786+
{AArch64::ARMV9_6A, {"nofp", "lsfe"}, {"fp-armv8", "lsfe"}, {}},
1787+
{AArch64::ARMV9_6A, {"lsfe", "nofp"}, {}, {"fp-armv8", "lsfe"}},
1788+
1789+
// fp -> fprcvt
1790+
{AArch64::ARMV9_6A, {"nofp", "fprcvt"}, {"fp-armv8", "fprcvt"}, {}},
1791+
{AArch64::ARMV9_6A, {"fprcvt", "nofp"}, {}, {"fp-armv8", "fprcvt"}},
1792+
1793+
// simd -> {aes, sha2, sha3, sm4, f8f16mm, f8f32mm}
17861794
{AArch64::ARMV8A, {"nosimd", "aes"}, {"neon", "aes"}, {}},
17871795
{AArch64::ARMV8A, {"aes", "nosimd"}, {}, {"neon", "aes"}},
17881796
{AArch64::ARMV8A, {"nosimd", "sha2"}, {"neon", "sha2"}, {}},
@@ -1791,6 +1799,10 @@ AArch64ExtensionDependenciesBaseArchTestParams
17911799
{AArch64::ARMV8A, {"sha3", "nosimd"}, {}, {"neon", "sha3"}},
17921800
{AArch64::ARMV8A, {"nosimd", "sm4"}, {"neon", "sm4"}, {}},
17931801
{AArch64::ARMV8A, {"sm4", "nosimd"}, {}, {"neon", "sm4"}},
1802+
{AArch64::ARMV9_6A, {"nosimd", "f8f16mm"}, {"neon", "f8f16mm"}, {}},
1803+
{AArch64::ARMV9_6A, {"f8f16mm", "nosimd"}, {}, {"neon", "f8f16mm"}},
1804+
{AArch64::ARMV9_6A, {"nosimd", "f8f32mm"}, {"neon", "f8f32mm"}, {}},
1805+
{AArch64::ARMV9_6A, {"f8f32mm", "nosimd"}, {}, {"neon", "f8f32mm"}},
17941806

17951807
// simd -> {rdm, dotprod, fcma}
17961808
{AArch64::ARMV8A, {"nosimd", "rdm"}, {"neon", "rdm"}, {}},
@@ -1810,13 +1822,21 @@ AArch64ExtensionDependenciesBaseArchTestParams
18101822
{AArch64::ARMV8A, {"nobf16", "sme"}, {"bf16", "sme"}, {}},
18111823
{AArch64::ARMV8A, {"sme", "nobf16"}, {}, {"bf16", "sme"}},
18121824

1813-
// sve -> {sve2, f32mm, f64mm}
1825+
// sve -> {sve2, f32mm, f64mm, sve-f16f32mm}
18141826
{AArch64::ARMV8A, {"nosve", "sve2"}, {"sve", "sve2"}, {}},
18151827
{AArch64::ARMV8A, {"sve2", "nosve"}, {}, {"sve", "sve2"}},
18161828
{AArch64::ARMV8A, {"nosve", "f32mm"}, {"sve", "f32mm"}, {}},
18171829
{AArch64::ARMV8A, {"f32mm", "nosve"}, {}, {"sve", "f32mm"}},
18181830
{AArch64::ARMV8A, {"nosve", "f64mm"}, {"sve", "f64mm"}, {}},
18191831
{AArch64::ARMV8A, {"f64mm", "nosve"}, {}, {"sve", "f64mm"}},
1832+
{AArch64::ARMV9_6A,
1833+
{"nosve", "sve-f16f32mm"},
1834+
{"sve", "sve-f16f32mm"},
1835+
{}},
1836+
{AArch64::ARMV9_6A,
1837+
{"sve-f16f32mm", "nosve"},
1838+
{},
1839+
{"sve", "sve-f16f32mm"}},
18201840

18211841
// sve2 -> {sve2p1, sve2-bitperm, sve2-sha3, sve2-sm4}
18221842
{AArch64::ARMV8A, {"nosve2", "sve2p1"}, {"sve2", "sve2p1"}, {}},
@@ -1861,7 +1881,7 @@ AArch64ExtensionDependenciesBaseArchTestParams
18611881
{AArch64::ARMV8A, {"sme-fa64", "nosme"}, {}, {"sme", "sme-fa64"}},
18621882

18631883
// sme2 -> {sme2p1, ssve-fp8fma, ssve-fp8dot2, ssve-fp8dot4, sme-f8f16,
1864-
// sme-f8f32, sme-b16b16}
1884+
// sme-f8f32, sme-b16b16, ssve-aes}
18651885
{AArch64::ARMV8A, {"nosme2", "sme2p1"}, {"sme2", "sme2p1"}, {}},
18661886
{AArch64::ARMV8A, {"sme2p1", "nosme2"}, {}, {"sme2", "sme2p1"}},
18671887
{AArch64::ARMV8A,
@@ -1894,16 +1914,22 @@ AArch64ExtensionDependenciesBaseArchTestParams
18941914
{AArch64::ARMV8A, {"sme-f8f32", "nosme2"}, {}, {"sme2", "sme-f8f32"}},
18951915
{AArch64::ARMV8A, {"nosme2", "sme-b16b16"}, {"sme2", "sme-b16b16"}, {}},
18961916
{AArch64::ARMV8A, {"sme-b16b16", "nosme2"}, {}, {"sme2", "sme-b16b16"}},
1917+
{AArch64::ARMV9_6A, {"nosme2", "ssve-aes"}, {"sme2", "ssve-aes"}, {}},
1918+
{AArch64::ARMV9_6A, {"ssve-aes", "nosme2"}, {}, {"ssve-aes", "sme2"}},
18971919

18981920
// sme2p1 -> {sme2p2}
18991921
{AArch64::ARMV9_6A, {"nosme2p1", "sme2p2"}, {"sme2p2", "sme2p1"}, {}},
19001922
{AArch64::ARMV9_6A, {"sme2p2", "nosme2p1"}, {}, {"sme2p1", "sme2p2"}},
19011923

1902-
// fp8 -> {sme-f8f16, sme-f8f32}
1924+
// fp8 -> {sme-f8f16, sme-f8f32, f8f16mm, f8f32mm}
19031925
{AArch64::ARMV8A, {"nofp8", "sme-f8f16"}, {"fp8", "sme-f8f16"}, {}},
19041926
{AArch64::ARMV8A, {"sme-f8f16", "nofp8"}, {}, {"fp8", "sme-f8f16"}},
19051927
{AArch64::ARMV8A, {"nofp8", "sme-f8f32"}, {"fp8", "sme-f8f32"}, {}},
19061928
{AArch64::ARMV8A, {"sme-f8f32", "nofp8"}, {}, {"fp8", "sme-f8f32"}},
1929+
{AArch64::ARMV9_6A, {"nofp8", "f8f16mm"}, {"fp8", "f8f16mm"}, {}},
1930+
{AArch64::ARMV9_6A, {"f8f16mm", "nofp8"}, {}, {"fp8", "f8f16mm"}},
1931+
{AArch64::ARMV9_6A, {"nofp8", "f8f32mm"}, {"fp8", "f8f32mm"}, {}},
1932+
{AArch64::ARMV9_6A, {"f8f32mm", "nofp8"}, {}, {"fp8", "f8f32mm"}},
19071933

19081934
// lse -> lse128
19091935
{AArch64::ARMV8A, {"nolse", "lse128"}, {"lse", "lse128"}, {}},
@@ -1926,6 +1952,16 @@ AArch64ExtensionDependenciesBaseArchTestParams
19261952
// rcpc -> rcpc3
19271953
{AArch64::ARMV8A, {"norcpc", "rcpc3"}, {"rcpc", "rcpc3"}, {}},
19281954
{AArch64::ARMV8A, {"rcpc3", "norcpc"}, {}, {"rcpc", "rcpc3"}},
1955+
1956+
// sve2-aes -> ssve-aes
1957+
{AArch64::ARMV9_6A,
1958+
{"nosve2-aes", "ssve-aes"},
1959+
{"sve2-aes", "ssve-aes"},
1960+
{}},
1961+
{AArch64::ARMV9_6A,
1962+
{"ssve-aes", "nosve2-aes"},
1963+
{},
1964+
{"ssve-aes", "sve2-aes"}},
19291965
};
19301966

19311967
INSTANTIATE_TEST_SUITE_P(

0 commit comments

Comments
 (0)