[llvm-commits] [llvm] r75980 - in /llvm/trunk: lib/Target/SystemZ/SystemZInstrInfo.td test/CodeGen/SystemZ/02-RetNeg.ll test/CodeGen/SystemZ/03-RetNegImmSubreg.ll

Anton Korobeynikov asl at math.spbu.ru
Thu Jul 16 07:06:28 PDT 2009


Author: asl
Date: Thu Jul 16 09:06:27 2009
New Revision: 75980

URL: http://llvm.org/viewvc/llvm-project?rev=75980&view=rev
Log:
Add patterns for integer negate

Added:
    llvm/trunk/test/CodeGen/SystemZ/02-RetNeg.ll
    llvm/trunk/test/CodeGen/SystemZ/03-RetNegImmSubreg.ll
Modified:
    llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td

Modified: llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td?rev=75980&r1=75979&r2=75980&view=diff

==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td Thu Jul 16 09:06:27 2009
@@ -340,6 +340,21 @@
 //===----------------------------------------------------------------------===//
 // Arithmetic Instructions
 
+let Defs = [PSW] in {
+def NEG32rr : Pseudo<(outs GR32:$dst), (ins GR32:$src),
+                     "lcr\t{$dst, $src}",
+                     [(set GR32:$dst, (ineg GR32:$src)),
+                      (implicit PSW)]>;
+def NEG64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src),
+                     "lcgr\t{$dst, $src}",
+                     [(set GR64:$dst, (ineg GR64:$src)),
+                      (implicit PSW)]>;
+def NEG64rr32 : Pseudo<(outs GR64:$dst), (ins GR32:$src),
+                       "lcgfr\t{$dst, $src}",
+                       [(set GR64:$dst, (ineg (sext GR32:$src))),
+                        (implicit PSW)]>;
+}
+
 let isTwoAddress = 1 in {
 
 let Defs = [PSW] in {

Added: llvm/trunk/test/CodeGen/SystemZ/02-RetNeg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SystemZ/02-RetNeg.ll?rev=75980&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/SystemZ/02-RetNeg.ll (added)
+++ llvm/trunk/test/CodeGen/SystemZ/02-RetNeg.ll Thu Jul 16 09:06:27 2009
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc -march=systemz | grep lcgr | count 1
+
+define i64 @foo(i64 %a) {
+entry:
+    %c = sub i64 0, %a
+    ret i64 %c
+}
\ No newline at end of file

Added: llvm/trunk/test/CodeGen/SystemZ/03-RetNegImmSubreg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SystemZ/03-RetNegImmSubreg.ll?rev=75980&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/SystemZ/03-RetNegImmSubreg.ll (added)
+++ llvm/trunk/test/CodeGen/SystemZ/03-RetNegImmSubreg.ll Thu Jul 16 09:06:27 2009
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc -march=systemz | grep lcr | count 1
+
+define i32 @foo(i32 %a) {
+entry:
+    %c = sub i32 0, %a
+    ret i32 %c
+}
+





More information about the llvm-commits mailing list