Learn how to make odd splatted constants in range [17,29]. This implements

PowerPC/vec_constants.ll:test_29.

llvm-svn: 27752
This commit is contained in:
Chris Lattner 2006-04-17 06:07:44 +00:00
parent 02440a996b
commit f8dd76df5b
1 changed files with 7 additions and 0 deletions

View File

@ -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