Implement PowerPC/eqv-andc-orc-nor.ll:EQV3
authorChris Lattner <sabre@nondot.org>
Wed, 28 Sep 2005 18:04:52 +0000 (18:04 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 28 Sep 2005 18:04:52 +0000 (18:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23494 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelDAGToDAG.cpp

index 4827b0082f5efdb151ed3cf06583ee04c7b078d5..c2a57ddfa57e270369242e206b6b354a9c5511a0 100644 (file)
@@ -1012,12 +1012,16 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) {
       N = I;
       return SDOperand(N, 0);
     }
-    // Finally, check for the case where we are being asked to select
+    // Check for the case where we are being asked to select
     // xor (not(a), b) which is equivalent to not(xor a, b), which is eqv
     if (isOprNot(N->getOperand(0).Val))
       CurDAG->SelectNodeTo(N, PPC::EQV, MVT::i32, 
                            Select(N->getOperand(0).getOperand(0)),
                            Select(N->getOperand(1)));
+    else if (isOprNot(N->getOperand(1).Val))
+      CurDAG->SelectNodeTo(N, PPC::EQV, MVT::i32, 
+                           Select(N->getOperand(1).getOperand(0)),
+                           Select(N->getOperand(0)));
     else
       CurDAG->SelectNodeTo(N, PPC::XOR, MVT::i32, Select(N->getOperand(0)),
                            Select(N->getOperand(1)));