Skip to content

Commit 0231a90

Browse files
committed
[lldb][AArch64] Automatically add all extensions to disassembler
This means we don't have to remember to update this code as much. This is all tested in lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s which I added previously. We don't have a way to get the latest base architecture yet so that remains manual. Having all the extensions specified will probably be equivalent to the latest architecture version in any case. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D123582
1 parent c33770d commit 0231a90

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "llvm-c/Disassembler.h"
1212
#include "llvm/ADT/SmallString.h"
13+
#include "llvm/ADT/StringExtras.h"
1314
#include "llvm/MC/MCAsmInfo.h"
1415
#include "llvm/MC/MCContext.h"
1516
#include "llvm/MC/MCDisassembler/MCDisassembler.h"
@@ -22,6 +23,7 @@
2223
#include "llvm/MC/MCSubtargetInfo.h"
2324
#include "llvm/MC/MCTargetOptions.h"
2425
#include "llvm/MC/TargetRegistry.h"
26+
#include "llvm/Support/AArch64TargetParser.h"
2527
#include "llvm/Support/ErrorHandling.h"
2628
#include "llvm/Support/ScopedPrinter.h"
2729
#include "llvm/Support/TargetSelect.h"
@@ -1177,12 +1179,13 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
11771179
features_str += "+dspr2,";
11781180
}
11791181

1180-
// If any AArch64 variant, enable latest ISA with any optional
1181-
// extensions like MTE.
1182+
// If any AArch64 variant, enable latest ISA with all extensions.
11821183
if (triple.isAArch64()) {
1183-
features_str += "+v9.3a,+mte,+sm4,+sha2,+sha3,+aes,+fp16fml,+sve2-aes,+"
1184-
"sve2-sm4,+sve2-sha3,+sve2-bitperm,+f32mm,+f64mm,+tme,+"
1185-
"ls64,+sme,+sme-f64,+sme-i64,+spe,+rand,+brbe";
1184+
features_str += "+v9.3a,";
1185+
std::vector<llvm::StringRef> features;
1186+
// Get all possible features
1187+
llvm::AArch64::getExtensionFeatures(-1, features);
1188+
features_str += llvm::join(features, ",");
11861189

11871190
if (triple.getVendor() == llvm::Triple::Apple)
11881191
cpu = "apple-latest";

0 commit comments

Comments
 (0)