Thumb2 parsing and encoding for CLREX.
authorJim Grosbach <grosbach@apple.com>
Tue, 6 Sep 2011 20:27:04 +0000 (20:27 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 6 Sep 2011 20:27:04 +0000 (20:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139172 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 1bdc0decefb0e4857d02f12eaa3d3c3ddfdea1e4..d2ee466d7ae665e117d1a7f7084b93167b646d25 100644 (file)
@@ -2897,9 +2897,7 @@ def t2STREXD : T2I_strex<0b11, (outs rGPR:$Rd),
   let Inst{11-8} = Rt2;
 }
 
-// Clear-Exclusive is for disassembly only.
-def t2CLREX : T2XI<(outs), (ins), NoItinerary, "clrex",
-                   [/* For disassembly only; pattern left blank */]>,
+def t2CLREX : T2I<(outs), (ins), NoItinerary, "clrex", "", []>,
             Requires<[IsThumb2, HasV7]>  {
   let Inst{31-16} = 0xf3bf;
   let Inst{15-14} = 0b10;
index 6668fc9f557eb36b071ae9c1deffa96bf62acc3b..b468d9fe476222732c7ce8b734fdb944bd375447 100644 (file)
@@ -3022,8 +3022,8 @@ getMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
       Mnemonic == "cps" || Mnemonic == "mcr2" || Mnemonic == "it" ||
       Mnemonic == "mcrr2" || Mnemonic == "cbz" || Mnemonic == "cdp2" ||
       Mnemonic == "trap" || Mnemonic == "mrc2" || Mnemonic == "mrrc2" ||
-      Mnemonic == "dsb" || Mnemonic == "isb" || Mnemonic == "clrex" ||
-      Mnemonic == "setend" ||
+      Mnemonic == "dsb" || Mnemonic == "isb" || Mnemonic == "setend" ||
+      (Mnemonic == "clrex" && !isThumb()) ||
       (Mnemonic == "nop" && isThumbOne()) ||
       ((Mnemonic == "pld" || Mnemonic == "pli" || Mnemonic == "pldw") &&
        !isThumb()) ||
index 1d4ba2cf513a049287f699dd87ce2ffad1352607..926af984bc198cec5518a6008150d6ec41750298 100644 (file)
@@ -292,6 +292,18 @@ _func:
 @ CHECK: cdp2  p7, #1, c1, c1, c1, #4  @ encoding: [0x11,0xfe,0x81,0x17]
 
 
+@------------------------------------------------------------------------------
+@ CLREX
+@------------------------------------------------------------------------------
+        clrex
+        it ne
+        clrexne
+
+@ CHECK: clrex                           @ encoding: [0xbf,0xf3,0x2f,0x8f]
+@ CHECK: it    ne                       @ encoding: [0x18,0xbf]
+@ CHECK: clrexne                         @ encoding: [0xbf,0xf3,0x2f,0x8f]
+
+
 @------------------------------------------------------------------------------
 @ IT
 @------------------------------------------------------------------------------