[llvm] r326696 - [ARM][Asm] VMOVSRR and VMOVRRS need sequential S registers

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 5 05:27:26 PST 2018


Author: olista01
Date: Mon Mar  5 05:27:26 2018
New Revision: 326696

URL: http://llvm.org/viewvc/llvm-project?rev=326696&view=rev
Log:
[ARM][Asm] VMOVSRR and VMOVRRS need sequential S registers

These instructions require that the two S registers are adjacent (but not the R
registers), because only the first register is included in the encoding, but we
were not checking this in the assembler.

Differential revision: https://reviews.llvm.org/D44084


Added:
    llvm/trunk/test/MC/ARM/vmov-pair-diags.s
Modified:
    llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=326696&r1=326695&r2=326696&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Mon Mar  5 05:27:26 2018
@@ -6631,6 +6631,24 @@ bool ARMAsmParser::validateInstruction(M
                                                "code specified");
     break;
   }
+  case ARM::VMOVRRS: {
+    // Source registers must be sequential.
+    const unsigned Sm = MRI->getEncodingValue(Inst.getOperand(2).getReg());
+    const unsigned Sm1 = MRI->getEncodingValue(Inst.getOperand(3).getReg());
+    if (Sm1 != Sm + 1)
+      return Error(Operands[5]->getStartLoc(),
+                   "source operands must be sequential");
+    break;
+  }
+  case ARM::VMOVSRR: {
+    // Destination registers must be sequential.
+    const unsigned Sm = MRI->getEncodingValue(Inst.getOperand(0).getReg());
+    const unsigned Sm1 = MRI->getEncodingValue(Inst.getOperand(1).getReg());
+    if (Sm1 != Sm + 1)
+      return Error(Operands[3]->getStartLoc(),
+                   "destination operands must be sequential");
+    break;
+  }
   }
 
   return false;

Added: llvm/trunk/test/MC/ARM/vmov-pair-diags.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/vmov-pair-diags.s?rev=326696&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/vmov-pair-diags.s (added)
+++ llvm/trunk/test/MC/ARM/vmov-pair-diags.s Mon Mar  5 05:27:26 2018
@@ -0,0 +1,6 @@
+@ RUN: not llvm-mc -triple armv7-eabi < %s 2>&1 | FileCheck %s
+
+vmov	r0, r1, s0, s2
+// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: source operands must be sequential
+vmov	s0, s2, r0, r1
+// CHECK: :[[@LINE-1]]:{{[0-9]+}}: error: destination operands must be sequential




More information about the llvm-commits mailing list