diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-18 04:28:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-18 04:28:57 +0000 |
commit | cea2aa77eb815d41ad59ecdd110ec42bc5b567c8 (patch) | |
tree | a0bc34e0e48431005da85cebc38c354154a59792 | |
parent | 19a815238e55458e95f99b4dad31ed053c9f635c (diff) |
Use vmladduhm to do v8i16 multiplies which is faster and simpler than doing
even/odd halves. Thanks to Nate telling me what's what.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27793 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index b70b3cccd8..1c6fcd7360 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1602,25 +1602,10 @@ static SDOperand LowerMUL(SDOperand Op, SelectionDAG &DAG) { } else if (Op.getValueType() == MVT::v8i16) { SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1); - // Multiply the even 16-bit parts, producing 32-bit sums. - SDOperand EvenParts = BuildIntrinsicOp(Intrinsic::ppc_altivec_vmuleuh, - LHS, RHS, DAG, MVT::v4i32); - EvenParts = DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, EvenParts); - - // Multiply the odd 16-bit parts, producing 32-bit sums. - SDOperand OddParts = BuildIntrinsicOp(Intrinsic::ppc_altivec_vmulouh, - LHS, RHS, DAG, MVT::v4i32); - OddParts = DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, OddParts); + SDOperand Zero = BuildSplatI(0, 1, MVT::v8i16, DAG); - // Merge the results together. - std::vector<SDOperand> Ops; - for (unsigned i = 0; i != 4; ++i) { - Ops.push_back(DAG.getConstant(2*i+1, MVT::i16)); - Ops.push_back(DAG.getConstant(2*i+1+8, MVT::i16)); - } - - return DAG.getNode(ISD::VECTOR_SHUFFLE, MVT::v8i16, EvenParts, OddParts, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v8i16, Ops)); + return BuildIntrinsicOp(Intrinsic::ppc_altivec_vmladduhm, + LHS, RHS, Zero, DAG); } else if (Op.getValueType() == MVT::v16i8) { SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1); |