[lldb] [llvm] [AArch64][llvm] Tighten SYSP parsing; don't disassemble invalid encodings (PR #182410)

Jonathan Thackray via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 09:06:29 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:

e.g. the last test in `llvm/test/MC/AArch64/armv9a-sysp.s` has:
```
sysp #0, c2, c0, #0
// CHECK-INST: sysp #0, c2, c0, #0
// CHECK-ENCODING: encoding: [0x1f,0x20,0x48,0xd5]
```

https://github.com/llvm/llvm-project/pull/182410


More information about the llvm-commits mailing list