[AArch64] clang support for Armv8.8/9.3 MOPS

This introduces clang command line support for the new Armv8.8-A and
Armv9.3-A instructions for standardising memcpy, memset and memmove
operations, which was previously introduced into LLVM in
https://reviews.llvm.org/D116157.

Patch by Lucas Prates, Tomas Matheson and Son Tuan Vu.

Differential Revision: https://reviews.llvm.org/D117271
This commit is contained in:
Lucas Prates 2021-09-23 13:34:30 +01:00 committed by tyb0807
parent 0b010ef7b6
commit c84b8be516
7 changed files with 13 additions and 0 deletions

View File

@ -544,6 +544,7 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
HasMatmulFP32 = false;
HasLSE = false;
HasHBC = false;
HasMOPS = false;
ArchKind = llvm::AArch64::ArchKind::INVALID;

View File

@ -54,6 +54,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
bool HasLSE;
bool HasFlagM;
bool HasHBC;
bool HasMOPS;
llvm::AArch64::ArchKind ArchKind;

View File

@ -0,0 +1,6 @@
// Test that target feature mops is implemented and available correctly
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.8-a+mops %s 2>&1 | FileCheck %s
// CHECK: "-target-feature" "+mops"
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.8-a+nomops %s 2>&1 | FileCheck %s --check-prefix=NO_MOPS
// NO_MOPS: "-target-feature" "-mops"

View File

@ -145,6 +145,7 @@ AARCH64_ARCH_EXT_NAME("sme", AArch64::AEK_SME, "+sme",
AARCH64_ARCH_EXT_NAME("sme-f64", AArch64::AEK_SMEF64, "+sme-f64", "-sme-f64")
AARCH64_ARCH_EXT_NAME("sme-i64", AArch64::AEK_SMEI64, "+sme-i64", "-sme-i64")
AARCH64_ARCH_EXT_NAME("hbc", AArch64::AEK_HBC, "+hbc", "-hbc")
AARCH64_ARCH_EXT_NAME("mops", AArch64::AEK_MOPS, "+mops", "-mops")
#undef AARCH64_ARCH_EXT_NAME
#ifndef AARCH64_CPU_NAME

View File

@ -70,6 +70,7 @@ enum ArchExtKind : uint64_t {
AEK_SMEF64 = 1ULL << 38,
AEK_SMEI64 = 1ULL << 39,
AEK_HBC = 1ULL << 40,
AEK_MOPS = 1ULL << 41,
};
enum class ArchKind {

View File

@ -116,6 +116,8 @@ bool AArch64::getExtensionFeatures(uint64_t Extensions,
Features.push_back("+sme-i64");
if (Extensions & AArch64::AEK_HBC)
Features.push_back("+hbc");
if (Extensions & AArch64::AEK_MOPS)
Features.push_back("+mops");
return true;
}

View File

@ -1519,6 +1519,7 @@ TEST(TargetParserTest, AArch64ArchExtFeature) {
{"sme-f64", "nosme-f64", "+sme-f64", "-sme-f64"},
{"sme-i64", "nosme-i64", "+sme-i64", "-sme-i64"},
{"hbc", "nohbc", "+hbc", "-hbc"},
{"mops", "nomops", "+mops", "-mops"},
};
for (unsigned i = 0; i < array_lengthof(ArchExt); i++) {