summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-17 06:07:44 +0000
committerChris Lattner <sabre@nondot.org>2006-04-17 06:07:44 +0000
commitf8dd76df5bbeaa506df76c0aa612d84c0e36c10e (patch)
tree679bdc6344772e771ebc8b06a731da1985e98fa2
parent02440a996b522a5683ff6171da357fafc70ecdbe (diff)
downloadbcm5719-llvm-f8dd76df5bbeaa506df76c0aa612d84c0e36c10e.tar.gz
bcm5719-llvm-f8dd76df5bbeaa506df76c0aa612d84c0e36c10e.zip
Learn how to make odd splatted constants in range [17,29]. This implements
PowerPC/vec_constants.ll:test_29. llvm-svn: 27752
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index be30d7663b3..53365b17243 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud