diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -92,6 +92,12 @@ * Support for preserve_all calling convention is added. * Added support for missing arch extensions in the assembly directives ``.arch +`` and ``.arch_extension``. +* Fixed handling of ``.arch `` in assembly, without using any ``+`` + suffix. Previously this had no effect at all if no extensions were supplied. + Now ``.arch `` 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 `. Changes to the AMDGPU Backend ----------------------------- diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp --- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -6920,6 +6920,7 @@ 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 --- 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 --- 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]