Thumb conditional branch binary encodings. rdar://8745367
llvm-svn: 121493
diff --git a/llvm/lib/Target/ARM/ARMInstrThumb.td b/llvm/lib/Target/ARM/ARMInstrThumb.td
index 9c12833..6c4a8fc 100644
--- a/llvm/lib/Target/ARM/ARMInstrThumb.td
+++ b/llvm/lib/Target/ARM/ARMInstrThumb.td
@@ -74,6 +74,10 @@
// Define Thumb specific addressing modes.
+def t_bcctarget : Operand<i32> {
+ let EncoderMethod = "getThumbBCCTargetOpValue";
+}
+
def t_cbtarget : Operand<i32> {
let EncoderMethod = "getThumbCBTargetOpValue";
}
@@ -508,12 +512,14 @@
// FIXME: should be able to write a pattern for ARMBrcond, but can't use
// a two-value operand where a dag node expects two operands. :(
let isBranch = 1, isTerminator = 1 in
- def tBcc : T1I<(outs), (ins brtarget:$target, pred:$p), IIC_Br,
+ def tBcc : T1I<(outs), (ins t_bcctarget:$target, pred:$p), IIC_Br,
"b${p}\t$target",
[/*(ARMbrcond bb:$target, imm:$cc)*/]>,
T1Encoding<{1,1,0,1,?,?}> {
bits<4> p;
+ bits<8> target;
let Inst{11-8} = p;
+ let Inst{7-0} = target;
}
// Compare and branch on zero / non-zero