Skip to content

Commit a499d67

Browse files
committed
[AArch64] Make .arch without extra features actually take effect
This fixes PR32873 / #32220. Differential Revision: https://reviews.llvm.org/D151982
1 parent 4b8d9ab commit a499d67

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

llvm/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ Changes to the AArch64 Backend
9595
* Support for preserve_all calling convention is added.
9696
* Added support for missing arch extensions in the assembly directives
9797
``.arch <level>+<ext>`` and ``.arch_extension``.
98+
* Fixed handling of ``.arch <level>`` in assembly, without using any ``+<ext>``
99+
suffix. Previously this had no effect at all if no extensions were supplied.
100+
Now ``.arch <level>`` can be used to enable all the extensions that are
101+
included in a higher level than what is specified on the command line,
102+
or for disabling unwanted extensions if setting it to a lower level.
103+
This fixes `PR32873 <https://github.com/llvm/llvm-project/issues/32220>`.
98104

99105
Changes to the AMDGPU Backend
100106
-----------------------------

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6920,6 +6920,7 @@ bool AArch64AsmParser::parseDirectiveArch(SMLoc L) {
69206920
ExpandCryptoAEK(*ArchInfo, RequestedExtensions);
69216921

69226922
FeatureBitset Features = STI.getFeatureBits();
6923+
setAvailableFeatures(ComputeAvailableFeatures(Features));
69236924
for (auto Name : RequestedExtensions) {
69246925
bool EnableFeature = true;
69256926

llvm/test/MC/AArch64/directive-arch-negative.s

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
# CHECK: error: instruction requires: ras
3737
# CHECK-NEXT: esb
3838

39-
// PR32873: without extra features, '.arch' is currently ignored.
40-
// Add an unrelated feature to accept the directive.
41-
.arch armv8+crc
39+
.arch armv8
4240
casa w5, w7, [x19]
4341

4442
# CHECK: error: instruction requires: lse

llvm/test/MC/AArch64/directive-arch.s

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
# CHECK: aesd v0.16b, v2.16b
99
# CHECK: eor v0.16b, v0.16b, v2.16b
1010

11-
// PR32873: without extra features, '.arch' is currently ignored.
12-
// Add an unrelated feature to accept the directive.
13-
.arch armv8.1-a+crypto
11+
.arch armv8.1-a
1412
casa w5, w7, [x20]
1513
# CHECK: casa w5, w7, [x20]
1614

0 commit comments

Comments
 (0)