Fix the encoding and parsing of clrex instruction
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 20 Jan 2011 19:18:32 +0000 (19:18 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Thu, 20 Jan 2011 19:18:32 +0000 (19:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123936 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMInstrThumb2.td
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/arm_instructions.s
test/MC/ARM/thumb2.s

index 777389181a8d4f5ca32bdecfb2e62b2582257aa1..de30bbb699586feecabe358219803c9042beba1f 100644 (file)
@@ -2912,13 +2912,16 @@ def t2STREXD : T2I_strex<0b11, (outs rGPR:$Rd),
 }
 
 // Clear-Exclusive is for disassembly only.
-def t2CLREX : T2I<(outs), (ins), NoItinerary, "clrex", "",
-                  [/* For disassembly only; pattern left blank */]>,
-            Requires<[IsARM, HasV7]>  {
-  let Inst{31-20} = 0xf3b;
+def t2CLREX : T2XI<(outs), (ins), NoItinerary, "clrex",
+                   [/* For disassembly only; pattern left blank */]>,
+            Requires<[IsThumb2, HasV7]>  {
+  let Inst{31-16} = 0xf3bf;
   let Inst{15-14} = 0b10;
+  let Inst{13} = 0;
   let Inst{12} = 0;
+  let Inst{11-8} = 0b1111;
   let Inst{7-4} = 0b0010;
+  let Inst{3-0} = 0b1111;
 }
 
 //===----------------------------------------------------------------------===//
index ee6ef2b81922bc131d5fa30a19be4895613ba1ec..b388dced0129b1f79d29fbe83370afd0af0f686b 100644 (file)
@@ -1194,7 +1194,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 == "movs" || Mnemonic == "isb") {
+      Mnemonic == "dsb" || Mnemonic == "movs" || Mnemonic == "isb" ||
+      Mnemonic == "clrex") {
     CanAcceptPredicationCode = false;
   } else {
     CanAcceptPredicationCode = true;
index 9c2a4d5abc7316daccbb1f4e2536fdea4c63324d..a26db1b4eb3516cf4b68c8f03e701e4602172bd0 100644 (file)
 @ CHECK: cdp2  p7, #1, c1, c1, c1, #4 @ encoding: [0x81,0x17,0x11,0xfe]
         cdp2  p7, #1, c1, c1, c1, #4
 
+@ CHECK: clrex @ encoding: [0x1f,0xf0,0x7f,0xf5]
+        clrex
index 46bd37fbab03c80a3453ff6e64c3d7ce31a9cefe..146d674c3eb195248b12fa3f0b85077066b81a49 100644 (file)
 @ CHECK: cdp2  p7, #1, c1, c1, c1, #4 @ encoding: [0x11,0xfe,0x81,0x17]
         cdp2  p7, #1, c1, c1, c1, #4
 
+@ CHECK: clrex @ encoding: [0xbf,0xf3,0x2f,0x8f]
+        clrex