]> granicus.if.org Git - llvm/commitdiff
[ARM] Enable the use of SVC anywhere in an IT block
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Mon, 11 Sep 2017 11:11:17 +0000 (11:11 +0000)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Mon, 11 Sep 2017 11:11:17 +0000 (11:11 +0000)
Differential Revision: https://reviews.llvm.org/D37374

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312908 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/basic-thumb2-instructions.s

index 5e5931dcf21de5ddabd6d62006e75956cf3f1ff6..43135ad2103e670aa308c2771c68de2fd4cc0328 100644 (file)
@@ -8717,9 +8717,10 @@ template <> inline bool IsCPSRDead<MCInst>(const MCInst *Instr) {
 bool ARMAsmParser::isITBlockTerminator(MCInst &Inst) const {
   const MCInstrDesc &MCID = MII.get(Inst.getOpcode());
 
-  // All branch & call instructions terminate IT blocks.
-  if (MCID.isTerminator() || MCID.isCall() || MCID.isReturn() ||
-      MCID.isBranch() || MCID.isIndirectBranch())
+  // All branch & call instructions terminate IT blocks with the exception of
+  // SVC.
+  if (MCID.isTerminator() || (MCID.isCall() && Inst.getOpcode() != ARM::tSVC) ||
+      MCID.isReturn() || MCID.isBranch() || MCID.isIndirectBranch())
     return true;
 
   // Any arithmetic instruction which writes to the PC also terminates the IT
index b1cb53cdace7dc06cd58709500298f45734457f9..6f81f00350d8c89eebac53fd6a381325d58b2264 100644 (file)
@@ -3113,12 +3113,18 @@ _func:
         svceq #255
         it ne
         swine #33
+        itt eq
+        svceq #0
+        svceq #1
 
 @ CHECK: svc   #0                      @ encoding: [0x00,0xdf]
 @ CHECK: it    eq                      @ encoding: [0x08,0xbf]
 @ CHECK: svceq #255                    @ encoding: [0xff,0xdf]
 @ CHECK: it    ne                      @ encoding: [0x18,0xbf]
 @ CHECK: svcne #33                     @ encoding: [0x21,0xdf]
+@ CHECK: itt    eq                      @ encoding: [0x04,0xbf]
+@ CHECK: svceq  #0                      @ encoding: [0x00,0xdf]
+@ CHECK: svceq  #1                      @ encoding: [0x01,0xdf]
 
 
 @------------------------------------------------------------------------------