]> granicus.if.org Git - llvm/commitdiff
Merging r195575:
authorBill Wendling <isanbard@gmail.com>
Wed, 27 Nov 2013 19:40:19 +0000 (19:40 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 27 Nov 2013 19:40:19 +0000 (19:40 +0000)
------------------------------------------------------------------------
r195575 | venkatra | 2013-11-24 12:07:35 -0800 (Sun, 24 Nov 2013) | 2 lines

[Sparc]: Implement LEA pattern for sparcv9.

------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195869 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcInstr64Bit.td
lib/Target/Sparc/SparcInstrInfo.td

index 51397d8fb319b8395e06562b76e73c7e4ad2620a..8656de5c8ba9e6fceb7c4d4dfe0402c025d83d5e 100644 (file)
@@ -171,6 +171,12 @@ def : Pat<(SPcmpicc i64:$a, (i64 simm13:$b)), (CMPri $a, (as_i32imm $b))>;
 
 def : Pat<(ctpop i64:$src), (POPCrr $src)>;
 
+// "LEA" form of add
+def LEAX_ADDri : F3_2<2, 0b000000,
+                     (outs I64Regs:$dst), (ins MEMri:$addr),
+                     "add ${addr:arith}, $dst",
+                     [(set iPTR:$dst, ADDRri:$addr)]>;
+
 } // Predicates = [Is64Bit]
 
 
index 8dadc89fb9079b4193b7204d80e92ca674c4ba1a..ef7a11457071ae7d8d2e92546b3d56eb44c679fd 100644 (file)
@@ -502,10 +502,11 @@ defm SRA : F3_12<"sra", 0b100111, sra>;
 defm ADD   : F3_12<"add", 0b000000, add>;
 
 // "LEA" forms of add (patterns to make tblgen happy)
-def LEA_ADDri   : F3_2<2, 0b000000,
-                   (outs IntRegs:$dst), (ins MEMri:$addr),
-                   "add ${addr:arith}, $dst",
-                   [(set iPTR:$dst, ADDRri:$addr)]>;
+let Predicates = [Is32Bit] in
+  def LEA_ADDri   : F3_2<2, 0b000000,
+                     (outs IntRegs:$dst), (ins MEMri:$addr),
+                     "add ${addr:arith}, $dst",
+                     [(set iPTR:$dst, ADDRri:$addr)]>;
 
 let Defs = [ICC] in
   defm ADDCC  : F3_12<"addcc", 0b010000, addc>;