Skip to content

Commit 237cd22

Browse files
committed
[AArch64][TargetParser] Add field for FEAT_* feature names to ExtensionInfo
This introduces a new textual field for the Architecture Feature names to the AArch64 extensions in TableGen and TargetParser. So far, any cross references between the extensions in the implementation and the ones from the ISA has been covered only by the free text in ther 'Description' field. The new field adds a reliable and explicit mapping between them, and enables enhancements in testability that will be implemented in an upcoming patch.
1 parent 443721c commit 237cd22

File tree

6 files changed

+229
-221
lines changed

6 files changed

+229
-221
lines changed

clang/test/Driver/print-supported-extensions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// RUN: %if aarch64-registered-target %{ %clang --target=aarch64-linux-gnu \
55
// RUN: --print-supported-extensions 2>&1 | FileCheck %s --check-prefix AARCH64 %}
66
// AARCH64: All available -march extensions for AArch64
7-
// AARCH64: Name Description
8-
// AARCH64: aes Enable AES support (FEAT_AES, FEAT_PMULL)
7+
// AARCH64: Name Architecture Feature(s) Description
8+
// AARCH64: aes FEAT_AES, FEAT_PMULL Enable AES support
99

1010
// RUN: %if riscv-registered-target %{ %clang --target=riscv64-linux-gnu \
1111
// RUN: --print-supported-extensions 2>&1 | FileCheck %s --check-prefix RISCV %}

llvm/include/llvm/TargetParser/AArch64TargetParser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct ExtensionInfo {
118118
std::optional<StringRef> Alias; // An alias for this extension, if one exists.
119119
ArchExtKind ID; // Corresponding to the ArchExtKind, this
120120
// extensions representation in the bitfield.
121+
StringRef ArchFeatureName; // The feature name defined by the Architecture
121122
StringRef Description; // The textual description of the extension
122123
StringRef TargetFeature; // -target-feature/-mattr enable string, e.g. "+spe"
123124
StringRef NegTargetFeature; // -target-feature/-mattr disable string, e.g. "-spe"

0 commit comments

Comments
 (0)