SignBit = DAG.getNode(ISD::SRL, SrcNVT, SignBit,
DAG.getConstant(SizeDiff, TLI.getShiftAmountTy()));
SignBit = DAG.getNode(ISD::TRUNCATE, NVT, SignBit);
- } else if (SizeDiff < 0)
- SignBit = DAG.getNode(ISD::SIGN_EXTEND, NVT, SignBit);
+ } else if (SizeDiff < 0) {
+ SignBit = DAG.getNode(ISD::ZERO_EXTEND, NVT, SignBit);
+ SignBit = DAG.getNode(ISD::SHL, NVT, SignBit,
+ DAG.getConstant(-SizeDiff, TLI.getShiftAmountTy()));
+ }
// Clear the sign bit of first operand.
SDOperand Mask2 = (VT == MVT::f64)
MVT PtrVT = TLI.getPointerTy();
SDOperand StackPtr = DAG.CreateStackTemporary(VT);
- FrameIndexSDNode *StackPtrFI = cast<FrameIndexSDNode>(StackPtr.Val);
- int SPFI = StackPtrFI->getIndex();
+ int SPFI = cast<FrameIndexSDNode>(StackPtr.Val)->getIndex();
// Store the vector.
SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Tmp1, StackPtr,
- PseudoSourceValue::getFixedStack(),
- SPFI);
+ PseudoSourceValue::getFixedStack(SPFI), 0);
// Truncate or zero extend offset to target pointer type.
unsigned CastOpc = IdxVT.bitsGT(PtrVT) ? ISD::TRUNCATE : ISD::ZERO_EXTEND;
SDOperand StackPtr2 = DAG.getNode(ISD::ADD, IdxVT, Tmp3, StackPtr);
// Store the scalar value.
Ch = DAG.getTruncStore(Ch, Tmp2, StackPtr2,
- PseudoSourceValue::getFixedStack(), SPFI, EltVT);
+ PseudoSourceValue::getFixedStack(SPFI), 0, EltVT);
// Load the updated vector.
- return DAG.getLoad(VT, Ch, StackPtr, PseudoSourceValue::getFixedStack(),SPFI);
+ return DAG.getLoad(VT, Ch, StackPtr,
+ PseudoSourceValue::getFixedStack(SPFI), 0);
}
/// LegalizeOp - We know that the specified value has a legal type, and
if (SrcSize > SlotSize)
Store = DAG.getTruncStore(DAG.getEntryNode(), SrcOp, FIPtr,
- PseudoSourceValue::getFixedStack(), SPFI, SlotVT,
- false, SrcAlign);
+ PseudoSourceValue::getFixedStack(SPFI), 0,
+ SlotVT, false, SrcAlign);
else {
assert(SrcSize == SlotSize && "Invalid store");
Store = DAG.getStore(DAG.getEntryNode(), SrcOp, FIPtr,
- PseudoSourceValue::getFixedStack(), SPFI,
+ PseudoSourceValue::getFixedStack(SPFI), 0,
false, SrcAlign);
}
int SPFI = StackPtrFI->getIndex();
SDOperand Ch = DAG.getStore(DAG.getEntryNode(), Node->getOperand(0), StackPtr,
- PseudoSourceValue::getFixedStack(), SPFI);
+ PseudoSourceValue::getFixedStack(SPFI), 0);
return DAG.getLoad(Node->getValueType(0), Ch, StackPtr,
- PseudoSourceValue::getFixedStack(), SPFI);
+ PseudoSourceValue::getFixedStack(SPFI), 0);
}
// The input is a scalar or single-element vector.
// Lower to a store/load so that it can be split.
// FIXME: this could be improved probably.
- SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType());
- FrameIndexSDNode *FI = cast<FrameIndexSDNode>(Ptr.Val);
+ unsigned LdAlign = TLI.getTargetData()->getPrefTypeAlignment(
+ Op.getValueType().getTypeForMVT());
+ SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType(), LdAlign);
+ int FI = cast<FrameIndexSDNode>(Ptr.Val)->getIndex();
SDOperand St = DAG.getStore(DAG.getEntryNode(),
InOp, Ptr,
- PseudoSourceValue::getFixedStack(),
- FI->getIndex());
+ PseudoSourceValue::getFixedStack(FI), 0);
InOp = DAG.getLoad(Op.getValueType(), St, Ptr,
- PseudoSourceValue::getFixedStack(),
- FI->getIndex());
+ PseudoSourceValue::getFixedStack(FI), 0);
}
// Split the vector and convert each of the pieces now.
SplitVectorOp(InOp, Lo, Hi);