[llvm-commits] [llvm] r75917 - in /llvm/trunk: lib/Target/SystemZ/SystemZInstrInfo.td test/CodeGen/SystemZ/02-RetAnd.ll test/CodeGen/SystemZ/02-RetAndImm.ll

Anton Korobeynikov asl at math.spbu.ru
Thu Jul 16 06:32:51 PDT 2009


Author: asl
Date: Thu Jul 16 08:32:49 2009
New Revision: 75917

URL: http://llvm.org/viewvc/llvm-project?rev=75917&view=rev
Log:
Add reg-reg and pattern

Added:
    llvm/trunk/test/CodeGen/SystemZ/02-RetAnd.ll
    llvm/trunk/test/CodeGen/SystemZ/02-RetAndImm.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=75917&r1=75916&r2=75917&view=diff

==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZInstrInfo.td Thu Jul 16 08:32:49 2009
@@ -69,6 +69,14 @@
                      [(set GR64:$dst, (add GR64:$src1, imm:$src2)),
                       (implicit PSW)]>;
 
+let isCommutable = 1 in { // X = AND Y, Z  == X = AND Z, Y
+// FIXME: Provide proper encoding!
+def AND64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),
+                     "ngr\t{$dst, $src2}",
+                     [(set GR64:$dst, (and GR64:$src1, GR64:$src2))]>;
+}
+// FIXME: provide patterns for masked and-with-imm
+
 let isCommutable = 1 in { // X = OR Y, Z  == X = OR Z, Y
 // FIXME: Provide proper encoding!
 def OR64rr : Pseudo<(outs GR64:$dst), (ins GR64:$src1, GR64:$src2),

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

==============================================================================
--- llvm/trunk/test/CodeGen/SystemZ/02-RetAnd.ll (added)
+++ llvm/trunk/test/CodeGen/SystemZ/02-RetAnd.ll Thu Jul 16 08:32:49 2009
@@ -0,0 +1,7 @@
+; RUN: llvm-as < %s | llc
+
+define i64 @foo(i64 %a, i64 %b) {
+entry:
+    %c = and i64 %a, %b
+    ret i64 %c
+}
\ No newline at end of file

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

==============================================================================
--- llvm/trunk/test/CodeGen/SystemZ/02-RetAndImm.ll (added)
+++ llvm/trunk/test/CodeGen/SystemZ/02-RetAndImm.ll Thu Jul 16 08:32:49 2009
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | llc
+define i64 @foo(i64 %a, i64 %b) {
+entry:
+    %c = and i64 %a, 1
+    ret i64 %c
+}
+
+; FIXME: SystemZ has 4 and reg-imm instructions depending on imm,
+; we need to support them someday.
\ No newline at end of file





More information about the llvm-commits mailing list