Use ADDC if it is valid at any smaller size. Do it right this time

llvm-svn: 57248
This commit is contained in:
Andrew Lenharth 2008-10-07 17:09:16 +00:00
parent 6606f17e50
commit 6d409f08be
1 changed files with 6 additions and 3 deletions

View File

@ -6445,14 +6445,17 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){
unsigned OpV = Node->getOpcode() == ISD::ADD ? ISD::ADDC : ISD::SUBC;
bool hasCarry = false;
if (NVT == MVT::i64)
hasCarry |= TLI.isOperationLegal(OpV, MVT::i32)
hasCarry |= TLI.isOperationLegal(OpV, MVT::i64)
| TLI.isOperationLegal(OpV, MVT::i32)
| TLI.isOperationLegal(OpV, MVT::i16)
| TLI.isOperationLegal(OpV, MVT::i8);
if (NVT == MVT::i32)
hasCarry |= TLI.isOperationLegal(OpV, MVT::i16)
hasCarry |= TLI.isOperationLegal(OpV, MVT::i32)
| TLI.isOperationLegal(OpV, MVT::i16)
| TLI.isOperationLegal(OpV, MVT::i8);
if (NVT == MVT::i16)
hasCarry |= TLI.isOperationLegal(OpV, MVT::i8);
hasCarry |= TLI.isOperationLegal(OpV, MVT::i16)
| TLI.isOperationLegal(OpV, MVT::i8);
if(hasCarry) {
if (Node->getOpcode() == ISD::ADD) {