Skip to content

Conversation

@folkertdev
Copy link
Contributor

fixes #146866

The issue discusses that it is unfortunate that command line flag parsing and assembly parsing don't share the infrastructure for recognizing features, which can lead to inconsistencies like here. I don't really see how I can combine them though, so for now this change will fix the immediate problem.

@llvmbot
Copy link
Member

llvmbot commented Nov 29, 2025

@llvm/pr-subscribers-backend-aarch64

Author: Folkert de Vries (folkertdev)

Changes

fixes #146866

The issue discusses that it is unfortunate that command line flag parsing and assembly parsing don't share the infrastructure for recognizing features, which can lead to inconsistencies like here. I don't really see how I can combine them though, so for now this change will fix the immediate problem.


Full diff: https://github.com/llvm/llvm-project/pull/169999.diff

2 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (+1)
  • (modified) llvm/test/MC/AArch64/directive-arch_extension.s (+4)
diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index 433cb0387c470..7116fd0ea3b6f 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -3954,6 +3954,7 @@ static const struct Extension {
     {"poe2", {AArch64::FeatureS1POE2}},
     {"tev", {AArch64::FeatureTEV}},
     {"btie", {AArch64::FeatureBTIE}},
+    {"dit", {AArch64::FeatureDIT}},
 };
 
 static void setRequiredFeatureString(FeatureBitset FBS, std::string &Str) {
diff --git a/llvm/test/MC/AArch64/directive-arch_extension.s b/llvm/test/MC/AArch64/directive-arch_extension.s
index 3c754077572a1..f174e9d4d187e 100644
--- a/llvm/test/MC/AArch64/directive-arch_extension.s
+++ b/llvm/test/MC/AArch64/directive-arch_extension.s
@@ -197,3 +197,7 @@ fmmla v1.8h, v2.16b, v3.16b
 .arch_extension f8f32mm
 fmmla v1.4s, v2.16b, v3.16b
 // CHECK: fmmla v1.4s, v2.16b, v3.16b
+
+.arch_extension dit
+msr DIT, #1
+// CHECK: msr DIT, #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aarch64: dit target feature cannot be reliably en/disabled from assembly

2 participants