If a vr is already marked alive in a bb, then it has PHI uses that are visited earlie...
[oota-llvm.git] / test / CodeGen / PowerPC / eqv-andc-orc-nor.ll
index 620f2e4b919dc07a2fd3c1d38665af58d3662e49..30bd0b4d0b9958dbae64a42509e5b58ec1bf8704 100644 (file)
@@ -1,7 +1,13 @@
-; RUN: llvm-as < %s | llc -march=ppc32 | grep eqv | wc -l  | grep 3 &&
-; RUN: llvm-as < %s | llc -march=ppc32 | grep andc | wc -l | grep 2 &&
-; RUN: llvm-as < %s | llc -march=ppc32 | grep orc | wc -l  | grep 2 &&
-; RUN: llvm-as < %s | llc -march=ppc32 | grep nor | wc -l  | grep 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN:   grep eqv | count 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \
+; RUN:   grep andc | count 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN:   grep orc | count 2
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mcpu=g5 | \
+; RUN:   grep nor | count 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
+; RUN:   grep nand | count 1
 
 int %EQV1(int %X, int %Y) {
        %A = xor int %X, %Y
@@ -56,3 +62,33 @@ int %NOR2(int %X, int %Y) {
         ret int %R
 }
 
+int %NAND1(int %X, int %Y) {
+       %Z = and int %X, %Y
+       %W = xor int %Z, -1
+       ret int %W
+}
+
+void %VNOR(<4 x float>* %P, <4 x float>* %Q) {
+        %tmp = load <4 x float>* %P
+        %tmp = cast <4 x float> %tmp to <4 x int>
+        %tmp2 = load <4 x float>* %Q
+        %tmp2 = cast <4 x float> %tmp2 to <4 x int>
+        %tmp3 = or <4 x int> %tmp, %tmp2
+        %tmp4 = xor <4 x int> %tmp3, < int -1, int -1, int -1, int -1 >
+        %tmp4 = cast <4 x int> %tmp4 to <4 x float>
+        store <4 x float> %tmp4, <4 x float>* %P
+        ret void
+}
+
+void %VANDC(<4 x float>* %P, <4 x float>* %Q) {
+        %tmp = load <4 x float>* %P
+        %tmp = cast <4 x float> %tmp to <4 x int>
+        %tmp2 = load <4 x float>* %Q
+        %tmp2 = cast <4 x float> %tmp2 to <4 x int>
+        %tmp4 = xor <4 x int> %tmp2, < int -1, int -1, int -1, int -1 >
+        %tmp3 = and <4 x int> %tmp, %tmp4
+        %tmp4 = cast <4 x int> %tmp3 to <4 x float>
+        store <4 x float> %tmp4, <4 x float>* %P
+        ret void
+}
+