diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-17 06:07:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-17 06:07:44 +0000 |
commit | c408382ecade09f66343b084fa0ab437781de593 (patch) | |
tree | 699e795efa36b2c3f5b3a25953941ee76945d9f3 | |
parent | 33f24a9b179261d27b49f8e856214e9f9f5b5d36 (diff) |
Learn how to make odd splatted constants in range [17,29]. This implements
PowerPC/vec_constants.ll:test_29.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27752 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index be30d7663b..53365b1724 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1105,6 +1105,13 @@ static SDOperand LowerBUILD_VECTOR(SDOperand Op, SelectionDAG &DAG) { Op = BuildSplatI(SextVal >> 1, SplatSize, Op.getValueType(), DAG); return DAG.getNode(ISD::ADD, Op.getValueType(), Op, Op); } + // Otherwise, in range [17,29]: (vsplti 15) + (vsplti C). + if (SextVal >= 0 && SextVal <= 29) { + SDOperand LHS = BuildSplatI(15, SplatSize, Op.getValueType(), DAG); + SDOperand RHS = BuildSplatI(SextVal-15, SplatSize, Op.getValueType(),DAG); + return DAG.getNode(ISD::ADD, Op.getValueType(), LHS, RHS); + + } // If this is 0x8000_0000 x 4, turn into vspltisw + vslw. If it is |