[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
Fri Mar 6 09:05:29 PST 2026


================
@@ -2096,6 +2096,30 @@ def sys_cr_op : Operand<i32> {
   let OperandType = "OPERAND_IMMEDIATE";
 }
 
+// SYSP operands are more restricted than generic system CR/imm fields.
+def sysp_op1 : Operand<i64>, ImmLeaf<i64, [{
+  return Imm >= 0 && Imm <= 6;
+}]> {
+  let ParserMatchClass = Imm0_7Operand;
+  let OperandType = "OPERAND_IMMEDIATE";
+}
+
+def sysp_crn_op : Operand<i32>, ImmLeaf<i32, [{
+  return Imm == 8 || Imm == 9;
+}]> {
+  let PrintMethod = "printSysCROperand";
+  let ParserMatchClass = SysCRAsmOperand;
----------------
jthackray wrote:

Ok. I've added a templated `isSysCRinRange()` method, and then defined new classes in the tablegen, where we pass <low, high> to them. I've also updated the sysp diagnostic tests. Leaving this as unresolved, since there might be more to do here.

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


More information about the llvm-commits mailing list