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

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 02:53:45 PDT 2023


mstorsjo created this revision.
mstorsjo added reviewers: ab, c-rhodes, SjoerdMeijer, DavidSpickett, lenary.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLVM.

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

@ab mentioned in that bug report that he would send a patch for the issue
soon, but that apparently didn't land at least, and I don't find any
from quickly browsing the mailing list archives after that time.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151982

Files:
  llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  llvm/test/MC/AArch64/directive-arch-negative.s
  llvm/test/MC/AArch64/directive-arch.s


Index: llvm/test/MC/AArch64/directive-arch.s
===================================================================
--- llvm/test/MC/AArch64/directive-arch.s
+++ 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]
 
Index: llvm/test/MC/AArch64/directive-arch-negative.s
===================================================================
--- llvm/test/MC/AArch64/directive-arch-negative.s
+++ 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
Index: llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
===================================================================
--- llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -6916,6 +6916,7 @@
   ExpandCryptoAEK(*ArchInfo, RequestedExtensions);
 
   FeatureBitset Features = STI.getFeatureBits();
+  setAvailableFeatures(ComputeAvailableFeatures(Features));
   for (auto Name : RequestedExtensions) {
     bool EnableFeature = true;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151982.527790.patch
Type: text/x-patch
Size: 1575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230602/8cb7d13d/attachment.bin>


More information about the llvm-commits mailing list