[Lldb-commits] [lldb] [llvm] [AArch64][llvm] Tighten SYSP parsing; don't disassemble invalid encodings (PR #182410)
Jonathan Thackray via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 9 03:57:02 PDT 2026
================
@@ -90,12 +90,27 @@ void AArch64InstPrinter::printInst(const MCInst *MI, uint64_t Address,
return;
}
- if (Opcode == AArch64::SYSPxt || Opcode == AArch64::SYSPxt_XZR)
+ if (Opcode == AArch64::SYSPxt) {
if (printSyspAlias(MI, STI, O)) {
printAnnotation(O, Annot);
return;
}
+ // Preserve the historic SYSP short form for the XZR/XZR encoding, but
+ // only when aliases are enabled. In no-alias mode we must print the full
+ // canonical operand list.
+ if (PrintAliases && MI->getOperand(4).getReg() == AArch64::XZR) {
----------------
jthackray wrote:
Yes:
```
% printf '0x1f 0x80 0x48 0xd5\n' | rel/bin/llvm-mc -triple=aarch64 -disassemble -M no-aliases
sysp #0, c8, c0, #0, xzr, xzr
% printf '0x1f 0x80 0x48 0xd5\n' | rel/bin/llvm-mc -triple=aarch64 -disassemble
sysp #0, c8, c0, #0
```
I could remove the `if()` statement, and then we'd always print the short version, which is tested for in `armv9a-sysp.s`. I don't know who uses `-M no-aliases` but I assume that option has been there for some time, so I don't want to break it.
https://github.com/llvm/llvm-project/pull/182410
More information about the lldb-commits
mailing list