Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.349 -> 1.350 --- Log message: Implement the Expand action for binary vector operations to break the binop into elements and operate on each piece. This allows generic vector integer multiplies to work on PPC, though the generated code is horrible. --- Diffs of the changes: (+18 -1) LegalizeDAG.cpp | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.349 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.350 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.349 Sat Apr 1 21:07:27 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Apr 1 21:57:31 2006 @@ -1916,12 +1916,29 @@ Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp2); switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) { - default: assert(0 && "Operation not supported"); + default: assert(0 && "BinOp legalize operation not supported"); case TargetLowering::Legal: break; case TargetLowering::Custom: Tmp1 = TLI.LowerOperation(Result, DAG); if (Tmp1.Val) Result = Tmp1; break; + case TargetLowering::Expand: { + assert(MVT::isVector(Node->getValueType(0)) && + "Cannot expand this binary operator!"); + // Expand the operation into a bunch of nasty scalar code. + std::vector<SDOperand> Ops; + MVT::ValueType EltVT = MVT::getVectorBaseType(Node->getValueType(0)); + MVT::ValueType PtrVT = TLI.getPointerTy(); + for (unsigned i = 0, e = MVT::getVectorNumElements(Node->getValueType(0)); + i != e; ++i) { + SDOperand Idx = DAG.getConstant(i, PtrVT); + SDOperand LHS = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, EltVT, Tmp1, Idx); + SDOperand RHS = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, EltVT, Tmp2, Idx); + Ops.push_back(DAG.getNode(Node->getOpcode(), EltVT, LHS, RHS)); + } + Result = DAG.getNode(ISD::BUILD_VECTOR, Node->getValueType(0), Ops); + break; + } } break; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits