SDOperand Chain, SDOperand Ptr, const Value *SV,
int SVOffset, MVT::ValueType EVT, bool isVolatile=false);
SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
- SDOperand Offset, ISD::MemOpAddrMode AM);
+ SDOperand Offset, ISD::MemIndexedMode AM);
SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain,
SDOperand Ptr, SDOperand SV);
const Value *SV, int SVOffset, MVT::ValueType TVT,
bool isVolatile=false);
SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
- SDOperand Offset, ISD::MemOpAddrMode AM);
+ SDOperand Offset, ISD::MemIndexedMode AM);
// getSrcValue - construct a node to track a Value* through the backend
SDOperand getSrcValue(const Value* I, int offset = 0);
bool isBuildVectorAllZeros(const SDNode *N);
//===--------------------------------------------------------------------===//
- /// MemOpAddrMode enum - This enum defines the three load / store addressing
- /// modes.
+ /// MemIndexedMode enum - This enum defines the load / store indexed
+ /// addressing modes.
///
/// UNINDEXED "Normal" load / store. The effective address is already
/// computed and is available in the base pointer. The offset
/// computation); a post-indexed store produces one value (the
/// the result of the base +/- offset computation).
///
- enum MemOpAddrMode {
+ enum MemIndexedMode {
UNINDEXED = 0,
PRE_INC,
PRE_DEC,
POST_INC,
- POST_DEC
+ POST_DEC,
+ LAST_INDEXED_MODE
};
//===--------------------------------------------------------------------===//
/// getOperationName - Return the opcode of this operation for printing.
///
const char* getOperationName(const SelectionDAG *G = 0) const;
- static const char* getAddressingModeName(ISD::MemOpAddrMode AM);
+ static const char* getIndexedModeName(ISD::MemIndexedMode AM);
void dump() const;
void dump(const SelectionDAG *G) const;
///
class LoadSDNode : public SDNode {
// AddrMode - unindexed, pre-indexed, post-indexed.
- ISD::MemOpAddrMode AddrMode;
+ ISD::MemIndexedMode AddrMode;
// ExtType - non-ext, anyext, sext, zext.
ISD::LoadExtType ExtType;
protected:
friend class SelectionDAG;
LoadSDNode(SDOperand Chain, SDOperand Ptr, SDOperand Off,
- ISD::MemOpAddrMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
+ ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
const Value *SV, int O=0, unsigned Align=1, bool Vol=false)
: SDNode(ISD::LOAD, Chain, Ptr, Off),
AddrMode(AM), ExtType(ETy), LoadedVT(LVT), SrcValue(SV), SVOffset(O),
const SDOperand getChain() const { return getOperand(0); }
const SDOperand getBasePtr() const { return getOperand(1); }
const SDOperand getOffset() const { return getOperand(2); }
- ISD::MemOpAddrMode getAddressingMode() const { return AddrMode; }
+ ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
ISD::LoadExtType getExtensionType() const { return ExtType; }
MVT::ValueType getLoadedVT() const { return LoadedVT; }
const Value *getSrcValue() const { return SrcValue; }
///
class StoreSDNode : public SDNode {
// AddrMode - unindexed, pre-indexed, post-indexed.
- ISD::MemOpAddrMode AddrMode;
+ ISD::MemIndexedMode AddrMode;
// IsTruncStore - True is the op does a truncation before store.
bool IsTruncStore;
protected:
friend class SelectionDAG;
StoreSDNode(SDOperand Chain, SDOperand Value, SDOperand Ptr, SDOperand Off,
- ISD::MemOpAddrMode AM, bool isTrunc, MVT::ValueType SVT,
+ ISD::MemIndexedMode AM, bool isTrunc, MVT::ValueType SVT,
const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
: SDNode(ISD::STORE, Chain, Value, Ptr, Off),
AddrMode(AM), IsTruncStore(isTrunc), StoredVT(SVT), SrcValue(SV),
const SDOperand getValue() const { return getOperand(1); }
const SDOperand getBasePtr() const { return getOperand(2); }
const SDOperand getOffset() const { return getOperand(3); }
- ISD::MemOpAddrMode getAddressingMode() const { return AddrMode; }
+ ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
bool isTruncatingStore() const { return IsTruncStore; }
MVT::ValueType getStoredVT() const { return StoredVT; }
const Value *getSrcValue() const { return SrcValue; }
/// can be legally represented as pre-indexed load / store address.
virtual bool getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
SDOperand &Offset,
- ISD::MemOpAddrMode &AM,
+ ISD::MemIndexedMode &AM,
SelectionDAG &DAG) {
return false;
}
/// combined with a load / store to form a post-indexed load / store.
virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op,
SDOperand &Base, SDOperand &Offset,
- ISD::MemOpAddrMode &AM,
+ ISD::MemIndexedMode &AM,
SelectionDAG &DAG) {
return false;
}
/// LegalizeAction that indicates how instruction selection should deal with
/// the store.
uint64_t StoreXActions;
-
+
ValueTypeActionImpl ValueTypeActions;
std::vector<double> LegalFPImmediates;
Ptr.Val->use_size() > 1) {
SDOperand BasePtr;
SDOperand Offset;
- ISD::MemOpAddrMode AM = ISD::UNINDEXED;
+ ISD::MemIndexedMode AM = ISD::UNINDEXED;
if (TLI.getPreIndexedAddressParts(N, BasePtr, Offset, AM, DAG)) {
// Try turning it into a pre-indexed load / store except when
// 1) Another use of base ptr is a predecessor of N. If ptr is folded
SDOperand BasePtr;
SDOperand Offset;
- ISD::MemOpAddrMode AM = ISD::UNINDEXED;
+ ISD::MemIndexedMode AM = ISD::UNINDEXED;
if (TLI.getPostIndexedAddressParts(N, Op, BasePtr, Offset, AM,DAG)) {
if (Ptr == Offset)
std::swap(BasePtr, Offset);
return SDOperand(N, 0);
}
-SDOperand SelectionDAG::getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
- SDOperand Offset, ISD::MemOpAddrMode AM){
+SDOperand
+SelectionDAG::getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
+ SDOperand Offset, ISD::MemIndexedMode AM) {
LoadSDNode *LD = cast<LoadSDNode>(OrigLoad);
assert(LD->getOffset().getOpcode() == ISD::UNDEF &&
"Load is already a indexed load!");
return SDOperand(N, 0);
}
-SDOperand SelectionDAG::getIndexedStore(SDOperand OrigStore, SDOperand Base,
- SDOperand Offset, ISD::MemOpAddrMode AM){
+SDOperand
+SelectionDAG::getIndexedStore(SDOperand OrigStore, SDOperand Base,
+ SDOperand Offset, ISD::MemIndexedMode AM) {
StoreSDNode *ST = cast<StoreSDNode>(OrigStore);
assert(ST->getOffset().getOpcode() == ISD::UNDEF &&
"Store is already a indexed store!");
}
}
-const char *SDNode::getAddressingModeName(ISD::MemOpAddrMode AM) {
+const char *SDNode::getIndexedModeName(ISD::MemIndexedMode AM) {
switch (AM) {
default:
return "";
if (doExt)
std::cerr << MVT::getValueTypeString(LD->getLoadedVT()) << ">";
- const char *AM = getAddressingModeName(LD->getAddressingMode());
+ const char *AM = getIndexedModeName(LD->getAddressingMode());
if (AM != "")
std::cerr << " " << AM;
} else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(this)) {
std::cerr << " <trunc "
<< MVT::getValueTypeString(ST->getStoredVT()) << ">";
- const char *AM = getAddressingModeName(ST->getAddressingMode());
+ const char *AM = getIndexedModeName(ST->getAddressingMode());
if (AM != "")
std::cerr << " " << AM;
}
/// can be legally represented as pre-indexed load / store address.
bool PPCTargetLowering::getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
SDOperand &Offset,
- ISD::MemOpAddrMode &AM,
+ ISD::MemIndexedMode &AM,
SelectionDAG &DAG) {
return false;
/// can be legally represented as pre-indexed load / store address.
virtual bool getPreIndexedAddressParts(SDNode *N, SDOperand &Base,
SDOperand &Offset,
- ISD::MemOpAddrMode &AM,
+ ISD::MemIndexedMode &AM,
SelectionDAG &DAG);
/// SelectAddressRegReg - Given the specified addressed, check to see if it