Thumb2 parsing and encoding for BXJ.
authorJim Grosbach <grosbach@apple.com>
Fri, 2 Sep 2011 23:43:09 +0000 (23:43 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 2 Sep 2011 23:43:09 +0000 (23:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139053 91177308-0d34-0410-b5e6-96231b3b80d8

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

index a12be96f571c25e042d2e869d1803378cfbb6a88..c6a3e5010fa73387282c62c98ad9ba1360c5cdd8 100644 (file)
@@ -3068,16 +3068,13 @@ def t2IT : Thumb2XI<(outs), (ins it_pred:$cc, it_mask:$mask),
 
 // Branch and Exchange Jazelle -- for disassembly only
 // Rm = Inst{19-16}
-def t2BXJ : T2I<(outs), (ins rGPR:$func), NoItinerary, "bxj", "\t$func",
-              [/* For disassembly only; pattern left blank */]> {
+def t2BXJ : T2I<(outs), (ins rGPR:$func), NoItinerary, "bxj", "\t$func", []> {
+  bits<4> func;
   let Inst{31-27} = 0b11110;
   let Inst{26} = 0;
   let Inst{25-20} = 0b111100;
-  let Inst{15-14} = 0b10;
-  let Inst{12} = 0;
-
-  bits<4> func;
   let Inst{19-16} = func;
+  let Inst{15-0} = 0b1000111100000000;
 }
 
 // Compare and branch on zero / non-zero
index b68d1170385afbd37b283dd69ce6ea66153a73da..3c3247f256dcf186ae88e11b8ab04bfcb347e9fc 100644 (file)
@@ -254,6 +254,18 @@ _func:
 @ CHECK: bic.w r12, r12, r6, ror #29   @ encoding: [0x2c,0xea,0x76,0x7c]
 
 
+@------------------------------------------------------------------------------
+@ BXJ
+@------------------------------------------------------------------------------
+        bxj r5
+        it ne
+        bxjne r7
+
+@ CHECK: bxj   r5                      @ encoding: [0xc5,0xf3,0x00,0x8f]
+@ CHECK: it    ne                      @ encoding: [0x18,0xbf]
+@ CHECK: bxjne r7                      @ encoding: [0xc7,0xf3,0x00,0x8f]
+
+
 @------------------------------------------------------------------------------
 @ CBZ/CBNZ
 @------------------------------------------------------------------------------
@@ -263,6 +275,7 @@ _func:
 @ CHECK: cbnz    r7, #6                  @ encoding: [0x1f,0xb9]
 @ CHECK: cbnz    r7, #12                 @ encoding: [0x37,0xb9]
 
+
 @------------------------------------------------------------------------------
 @ IT
 @------------------------------------------------------------------------------