[llvm-commits] [llvm] r75585 - in /llvm/trunk/lib/Target/ARM: ARMInstrInfo.td ARMInstrThumb.td

Evan Cheng evan.cheng at apple.com
Mon Jul 13 18:49:27 PDT 2009


Author: evancheng
Date: Mon Jul 13 20:49:27 2009
New Revision: 75585

URL: http://llvm.org/viewvc/llvm-project?rev=75585&view=rev
Log:
1. In Thumb mode, select tBx instead of ARM variants.
2. BX does not "use" the link register, it defines it.
3. Fix a couple more places in thumb td file that still uses pre-UAL syntax.

Modified:
    llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
    llvm/trunk/lib/Target/ARM/ARMInstrThumb.td

Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=75585&r1=75584&r2=75585&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Jul 13 20:49:27 2009
@@ -617,15 +617,13 @@
     let Inst{27-20} = 0b00010010;
   }
 
-  let Uses = [LR] in {
-    // ARMv4T
-    def BX : ABXIx2<(outs), (ins GPR:$func, variable_ops),
-                     "mov lr, pc\n\tbx $func",
-                    [(ARMcall_nolink GPR:$func)]>, Requires<[IsNotDarwin]> {
-      let Inst{7-4}   = 0b0001;
-      let Inst{19-8}  = 0b111111111111;
-      let Inst{27-20} = 0b00010010;
-    }
+  // ARMv4T
+  def BX : ABXIx2<(outs), (ins GPR:$func, variable_ops),
+                   "mov lr, pc\n\tbx $func",
+                  [(ARMcall_nolink GPR:$func)]>, Requires<[IsNotDarwin]> {
+    let Inst{7-4}   = 0b0001;
+    let Inst{19-8}  = 0b111111111111;
+    let Inst{27-20} = 0b00010010;
   }
 }
 
@@ -650,15 +648,13 @@
     let Inst{27-20} = 0b00010010;
   }
 
-  let Uses = [LR] in {
-    // ARMv4T
-    def BXr9 : ABXIx2<(outs), (ins GPR:$func, variable_ops),
-                     "mov lr, pc\n\tbx $func",
-                    [(ARMcall_nolink GPR:$func)]>, Requires<[IsDarwin]> {
-      let Inst{7-4}   = 0b0001;
-      let Inst{19-8}  = 0b111111111111;
-      let Inst{27-20} = 0b00010010;
-    }
+  // ARMv4T
+  def BXr9 : ABXIx2<(outs), (ins GPR:$func, variable_ops),
+                   "mov lr, pc\n\tbx $func",
+                  [(ARMcall_nolink GPR:$func)]>, Requires<[IsARM, IsDarwin]> {
+    let Inst{7-4}   = 0b0001;
+    let Inst{19-8}  = 0b111111111111;
+    let Inst{27-20} = 0b00010010;
   }
 }
 

Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb.td?rev=75585&r1=75584&r2=75585&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb.td Mon Jul 13 20:49:27 2009
@@ -180,7 +180,7 @@
                   [(ARMtcall tGPR:$func)]>, Requires<[HasV5T]>;
   // ARMv4T
   def tBX : T1Ix2<(outs), (ins tGPR:$func, variable_ops),
-                  "cpy lr, pc\n\tbx $func",
+                  "mov lr, pc\n\tbx $func",
                   [(ARMcall_nolink tGPR:$func)]>;
 }
 
@@ -196,7 +196,7 @@
 
   def tBR_JTr : T1JTI<(outs),
                       (ins tGPR:$target, jtblock_operand:$jt, i32imm:$id),
-                      "cpy pc, $target \n\t.align\t2\n$jt",
+                      "mov pc, $target \n\t.align\t2\n$jt",
                       [(ARMbrjt tGPR:$target, tjumptable:$jt, imm:$id)]>;
   }
 }





More information about the llvm-commits mailing list