diff options
author | Dan Gohman <gohman@apple.com> | 2009-12-11 21:31:27 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-12-11 21:31:27 +0000 |
commit | 1d459e49370bd922c5dd40ea1129c0f5ac7a6706 (patch) | |
tree | 6c9fea486a431fac51e15178f07fdda23f6386cd /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | 8811885366340e70eacbab949703baa16346b4f7 (diff) | |
download | bcm5719-llvm-1d459e49370bd922c5dd40ea1129c0f5ac7a6706.tar.gz bcm5719-llvm-1d459e49370bd922c5dd40ea1129c0f5ac7a6706.zip |
Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
llvm-svn: 91158
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 3e2ab2c4ab0..31b2a47f8f2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2294,9 +2294,16 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node, // NOTE: we could fall back on load/store here too for targets without // SAR. However, it is doubtful that any exist. EVT ExtraVT = cast<VTSDNode>(Node->getOperand(1))->getVT(); - unsigned BitsDiff = Node->getValueType(0).getSizeInBits() - + EVT VT = Node->getValueType(0); + EVT ShiftAmountTy = TLI.getShiftAmountTy(); + if (ExtraVT.isVector()) ExtraVT = ExtraVT.getVectorElementType(); + if (VT.isVector()) { + ShiftAmountTy = VT; + VT = VT.getVectorElementType(); + } + unsigned BitsDiff = VT.getSizeInBits() - ExtraVT.getSizeInBits(); - SDValue ShiftCst = DAG.getConstant(BitsDiff, TLI.getShiftAmountTy()); + SDValue ShiftCst = DAG.getConstant(BitsDiff, ShiftAmountTy); Tmp1 = DAG.getNode(ISD::SHL, dl, Node->getValueType(0), Node->getOperand(0), ShiftCst); Tmp1 = DAG.getNode(ISD::SRA, dl, Node->getValueType(0), Tmp1, ShiftCst); |