[llvm] 8246ace - [AArch64] Add command line support for v9.4-A's Instrumentation Extension
Lucas Prates via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 23 08:40:01 PST 2023
Author: Lucas Prates
Date: 2023-01-23T16:39:53Z
New Revision: 8246aceb90c28d27e644fe74e4ad5e2c9e9d85e1
URL: https://github.com/llvm/llvm-project/commit/8246aceb90c28d27e644fe74e4ad5e2c9e9d85e1
DIFF: https://github.com/llvm/llvm-project/commit/8246aceb90c28d27e644fe74e4ad5e2c9e9d85e1.diff
LOG: [AArch64] Add command line support for v9.4-A's Instrumentation Extension
This introduces command line support (`+ite`) for the v9.4-A's
Instrumentation Extension (FEAT_ITE).
Patch by Son Tuan Vu.
Reviewed By: lenary, tmatheson
Differential Revision: https://reviews.llvm.org/D141403
Added:
clang/test/Driver/aarch64-ite.c
Modified:
llvm/include/llvm/TargetParser/AArch64TargetParser.h
llvm/unittests/TargetParser/TargetParserTest.cpp
Removed:
################################################################################
diff --git a/clang/test/Driver/aarch64-ite.c b/clang/test/Driver/aarch64-ite.c
new file mode 100644
index 0000000000000..d77196e372930
--- /dev/null
+++ b/clang/test/Driver/aarch64-ite.c
@@ -0,0 +1,17 @@
+// Test that target feature ite is implemented and available correctly
+
+// FEAT_ITE is optional (off by default) for v8.9a/9.4a and older, and can be enabled using +ite
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.8-a %s 2>&1 | FileCheck %s --check-prefix=NOT_ENABLED
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.8-a+ite %s 2>&1 | FileCheck %s --check-prefix=ENABLED
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.8-a+noite %s 2>&1 | FileCheck %s --check-prefix=DISABLED
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.3-a %s 2>&1 | FileCheck %s --check-prefix=NOT_ENABLED
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.3-a+ite %s 2>&1 | FileCheck %s --check-prefix=ENABLED
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.3-a+noite %s 2>&1 | FileCheck %s --check-prefix=DISABLED
+
+// FEAT_ITE is invalid before v8
+// RUN: %clang -### -target arm-none-none-eabi -march=armv7-a+ite %s 2>&1 | FileCheck %s --check-prefix=INVALID
+
+// INVALID: error: unsupported argument 'armv7-a+ite' to option '-march='
+// ENABLED: "-target-feature" "+ite"
+// NOT_ENABLED-NOT: "-target-feature" "+ite"
+// DISABLED: "-target-feature" "-ite"
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index ff6a629c8faa0..71a085f21eb2e 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -147,6 +147,7 @@ enum ArchExtKind : uint64_t {
AEK_LSE128 = 1ULL << 52, // FEAT_LSE128
AEK_SPECRES2 = 1ULL << 53, // FEAT_SPECRES2
AEK_RASv2 = 1ULL << 54, // FEAT_RASv2
+ AEK_ITE = 1ULL << 55, // FEAT_ITE
};
// clang-format on
@@ -196,6 +197,7 @@ inline constexpr ExtensionInfo Extensions[] = {
{"frintts", AArch64::AEK_NONE, {}, {}, FEAT_FRINTTS, "+fptoint", 250},
{"hbc", AArch64::AEK_HBC, "+hbc", "-hbc", FEAT_MAX, "", 0},
{"i8mm", AArch64::AEK_I8MM, "+i8mm", "-i8mm", FEAT_I8MM, "+i8mm", 270},
+ {"ite", AArch64::AEK_ITE, "+ite", "-ite", FEAT_MAX, "", 0},
{"jscvt", AArch64::AEK_NONE, {}, {}, FEAT_JSCVT, "+fp-armv8,+neon,+jsconv", 210},
{"ls64_accdata", AArch64::AEK_NONE, {}, {}, FEAT_LS64_ACCDATA, "+ls64", 540},
{"ls64_v", AArch64::AEK_NONE, {}, {}, FEAT_LS64_V, "", 530},
diff --git a/llvm/unittests/TargetParser/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp
index 39de9e25c8cca..92756972fcd49 100644
--- a/llvm/unittests/TargetParser/TargetParserTest.cpp
+++ b/llvm/unittests/TargetParser/TargetParserTest.cpp
@@ -1553,6 +1553,7 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
AArch64::AEK_B16B16, AArch64::AEK_SMEF16F16, AArch64::AEK_CSSC,
AArch64::AEK_RCPC3, AArch64::AEK_THE, AArch64::AEK_D128,
AArch64::AEK_LSE128, AArch64::AEK_SPECRES2, AArch64::AEK_RASv2,
+ AArch64::AEK_ITE,
};
std::vector<StringRef> Features;
@@ -1624,6 +1625,7 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
EXPECT_TRUE(llvm::is_contained(Features, "+d128"));
EXPECT_TRUE(llvm::is_contained(Features, "+lse128"));
EXPECT_TRUE(llvm::is_contained(Features, "+specres2"));
+ EXPECT_TRUE(llvm::is_contained(Features, "+ite"));
// Assuming we listed every extension above, this should produce the same
// result. (note that AEK_NONE doesn't have a name so it won't be in the
More information about the llvm-commits
mailing list