diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td index a12be96f571..c6a3e5010fa 100644 --- a/lib/Target/ARM/ARMInstrThumb2.td +++ b/lib/Target/ARM/ARMInstrThumb2.td @@ -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 diff --git a/test/MC/ARM/basic-thumb2-instructions.s b/test/MC/ARM/basic-thumb2-instructions.s index b68d1170385..3c3247f256d 100644 --- a/test/MC/ARM/basic-thumb2-instructions.s +++ b/test/MC/ARM/basic-thumb2-instructions.s @@ -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 @------------------------------------------------------------------------------