[llvm] a499d67 - [AArch64] Make .arch without extra features actually take effect

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 01:50:30 PDT 2023


Author: Martin Storsjö
Date: 2023-06-06T11:50:04+03:00
New Revision: a499d675ae163429adff0bc3dc4f8215c12441c7

URL: https://github.com/llvm/llvm-project/commit/a499d675ae163429adff0bc3dc4f8215c12441c7
DIFF: https://github.com/llvm/llvm-project/commit/a499d675ae163429adff0bc3dc4f8215c12441c7.diff

LOG: [AArch64] Make .arch without extra features actually take effect

This fixes PR32873 / https://github.com/llvm/llvm-project/issues/32220.

Differential Revision: https://reviews.llvm.org/D151982

Added: 
    

Modified: 
    llvm/docs/ReleaseNotes.rst
    llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    llvm/test/MC/AArch64/directive-arch-negative.s
    llvm/test/MC/AArch64/directive-arch.s

Removed: 
    


################################################################################
diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 1c4f3274806d3..99f3a5c8ed6da 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -95,6 +95,12 @@ Changes to the AArch64 Backend
 * Support for preserve_all calling convention is added.
 * Added support for missing arch extensions in the assembly directives
   ``.arch <level>+<ext>`` and ``.arch_extension``.
+* Fixed handling of ``.arch <level>`` in assembly, without using any ``+<ext>``
+  suffix. Previously this had no effect at all if no extensions were supplied.
+  Now ``.arch <level>`` can be used to enable all the extensions that are
+  included in a higher level than what is specified on the command line,
+  or for disabling unwanted extensions if setting it to a lower level.
+  This fixes `PR32873 <https://github.com/llvm/llvm-project/issues/32220>`.
 
 Changes to the AMDGPU Backend
 -----------------------------

diff  --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
index 3703cd03e10e7..1b54e2cb2b292 100644
--- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -6920,6 +6920,7 @@ bool AArch64AsmParser::parseDirectiveArch(SMLoc L) {
   ExpandCryptoAEK(*ArchInfo, RequestedExtensions);
 
   FeatureBitset Features = STI.getFeatureBits();
+  setAvailableFeatures(ComputeAvailableFeatures(Features));
   for (auto Name : RequestedExtensions) {
     bool EnableFeature = true;
 

diff  --git a/llvm/test/MC/AArch64/directive-arch-negative.s b/llvm/test/MC/AArch64/directive-arch-negative.s
index 29df7510b700e..f4044bbd49f2e 100644
--- a/llvm/test/MC/AArch64/directive-arch-negative.s
+++ b/llvm/test/MC/AArch64/directive-arch-negative.s
@@ -36,9 +36,7 @@
 # CHECK: error: instruction requires: ras
 # CHECK-NEXT:   esb
 
-// PR32873: without extra features, '.arch' is currently ignored.
-// Add an unrelated feature to accept the directive.
-	.arch armv8+crc
+	.arch armv8
         casa  w5, w7, [x19]
 
 # CHECK: error: instruction requires: lse

diff  --git a/llvm/test/MC/AArch64/directive-arch.s b/llvm/test/MC/AArch64/directive-arch.s
index 2aa2bcbf5665e..b6719f513ae20 100644
--- a/llvm/test/MC/AArch64/directive-arch.s
+++ b/llvm/test/MC/AArch64/directive-arch.s
@@ -8,9 +8,7 @@
 # CHECK: 	aesd	v0.16b, v2.16b
 # CHECK:        eor     v0.16b, v0.16b, v2.16b
 
-// PR32873: without extra features, '.arch' is currently ignored.
-// Add an unrelated feature to accept the directive.
-	.arch armv8.1-a+crypto
+	.arch armv8.1-a
         casa  w5, w7, [x20]
 # CHECK:        casa    w5, w7, [x20]
 


        


More information about the llvm-commits mailing list