forked from OSchip/llvm-project
Use vmladduhm to do v8i16 multiplies which is faster and simpler than doing
even/odd halves. Thanks to Nate telling me what's what. llvm-svn: 27793
This commit is contained in:
parent
d6d82aa889
commit
96d50487c9
|
@ -1602,25 +1602,10 @@ static SDOperand LowerMUL(SDOperand Op, SelectionDAG &DAG) {
|
||||||
} else if (Op.getValueType() == MVT::v8i16) {
|
} else if (Op.getValueType() == MVT::v8i16) {
|
||||||
SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
|
SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
|
||||||
|
|
||||||
// Multiply the even 16-bit parts, producing 32-bit sums.
|
SDOperand Zero = BuildSplatI(0, 1, MVT::v8i16, DAG);
|
||||||
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.
|
return BuildIntrinsicOp(Intrinsic::ppc_altivec_vmladduhm,
|
||||||
SDOperand OddParts = BuildIntrinsicOp(Intrinsic::ppc_altivec_vmulouh,
|
LHS, RHS, Zero, DAG);
|
||||||
LHS, RHS, DAG, MVT::v4i32);
|
|
||||||
OddParts = DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, OddParts);
|
|
||||||
|
|
||||||
// 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));
|
|
||||||
} else if (Op.getValueType() == MVT::v16i8) {
|
} else if (Op.getValueType() == MVT::v16i8) {
|
||||||
SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
|
SDOperand LHS = Op.getOperand(0), RHS = Op.getOperand(1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue