Checkpoint Thumb2 Instr info work. Generalized base code so that it can be shared between ARM and Thumb2. Not yet activated because register information must be generalized first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75010 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td
index 47aca18..65d90b6 100644
--- a/lib/Target/ARM/ARMInstrThumb2.td
+++ b/lib/Target/ARM/ARMInstrThumb2.td
@@ -1048,9 +1048,50 @@
                    RegConstraint<"$false = $dst">;
 
 //===----------------------------------------------------------------------===//
+// TLS Instructions
+//
+
+// __aeabi_read_tp preserves the registers r1-r3.
+let isCall = 1,
+  Defs = [R0, R12, LR, CPSR] in {
+  def t2TPsoft : T2XI<(outs), (ins),
+                     "bl __aeabi_read_tp",
+                     [(set R0, ARMthread_pointer)]>;
+}
+
+//===----------------------------------------------------------------------===//
 // Control-Flow Instructions
 //
 
+//let isReturn = 1, isTerminator = 1 in
+//  def t2BX_RET : T2XI<(outs), (ins), "bx lr", [(ARMretflag)]>;
+//
+// On non-Darwin platforms R9 is callee-saved.
+//let isCall = 1,
+//  Defs = [R0, R1, R2, R3, R12, LR,
+//          D0, D1, D2, D3, D4, D5, D6, D7, CPSR] in {
+//def t2BL  : T2XI<(outs), (ins i32imm:$func, variable_ops),
+//                 "bl ${func:call}",
+//                  [(ARMcall tglobaladdr:$func)]>, Requires<[IsNotDarwin]>;
+//
+//def t2BLX : T2XI<(outs), (ins GPR:$func, variable_ops),
+//                "blx $func",
+//                [(ARMcall GPR:$func)]>, Requires<[IsNotDarwin]>;
+//}
+
+// On Darwin R9 is call-clobbered.
+//let isCall = 1,
+//  Defs = [R0, R1, R2, R3, R9, R12, LR,
+//          D0, D1, D2, D3, D4, D5, D6, D7, CPSR] in {
+//def t2BLr9  : T2XI<(outs), (ins i32imm:$func, variable_ops),
+//                  "bl ${func:call}",
+//                  [(ARMcall tglobaladdr:$func)]>, Requires<[IsDarwin]>;
+//
+//def t2BLXr9 : T2XI<(outs), (ins GPR:$func, variable_ops),
+//                  "blx $func",
+//                  [(ARMcall GPR:$func)]>, Requires<[IsDarwin]>;
+//}
+
 let isBranch = 1, isTerminator = 1, isBarrier = 1 in {
 let isPredicable = 1 in
 def t2B   : T2XI<(outs), (ins brtarget:$target),