[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Apr 17 21:29:09 PDT 2006
Changes in directory llvm/lib/Target/PowerPC:
PPCISelLowering.cpp updated: 1.163 -> 1.164
---
Log message:
Use vmladduhm to do v8i16 multiplies which is faster and simpler than doing
even/odd halves. Thanks to Nate telling me what's what.
---
Diffs of the changes: (+3 -18)
PPCISelLowering.cpp | 21 +++------------------
1 files changed, 3 insertions(+), 18 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.163 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.164
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.163 Mon Apr 17 22:57:35 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Apr 17 23:28:57 2006
@@ -1602,25 +1602,10 @@
} 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);
More information about the llvm-commits
mailing list