From 82eb231e2f81df1d8bd1fc70c39df1c00e853a1f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 28 Sep 2005 18:04:52 +0000 Subject: [PATCH] Implement PowerPC/eqv-andc-orc-nor.ll:EQV3 llvm-svn: 23494 --- lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index 4827b0082f5..c2a57ddfa57 100644 --- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -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)));