[llvm] [llvm][arm] add T1 and T2 assembly options for vlldm and vlstm (PR #83116)

Tomas Matheson via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 03:20:58 PST 2024


================
@@ -7596,6 +7601,38 @@ bool ARMAsmParser::validateInstruction(MCInst &Inst,
 
   const unsigned Opcode = Inst.getOpcode();
   switch (Opcode) {
+  case ARM::VLLDM:
+    [[fallthrough]];
+  case ARM::VLLDM_T2:
+    [[fallthrough]];
+  case ARM::VLSTM:
+    [[fallthrough]];
+  case ARM::VLSTM_T2: {
+    // Since in some cases both T1 and T2 are valid, tablegen can not always
+    // pick the correct instruction.
+    if (Operands.size() == 4) { // a register list has been provided
+      ARMOperand &Op = static_cast<ARMOperand &>(
+          *Operands[3]); // the register list, a dpr_reglist
+      if (Op.isDPRRegList()) {
+        auto &RegList = Op.getRegList();
+        // T2 requires v8.1-M.Main (cannot be handled by tablegen)
+        if (RegList.size() == 32 && !hasV8_1MMainline()) {
+          return Error(Op.getEndLoc(), "T2 version requires v8.1-M.Main");
+        }
+        // When target has 32 D registers, T1 is undefined.
+        if (hasD32() && RegList.size() != 32) {
+          return Error(Op.getEndLoc(), "operand must be exactly {d0-d31}");
+        }
+        // When target has 16 D registers, both T1 and T2 are valid.
----------------
tmatheson-arm wrote:

Might be worth clarifying that T2 is a NOP in this case.

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


More information about the llvm-commits mailing list