class Type;
struct MVT { // MVT = Machine Value Type
+ public:
enum SimpleValueType {
// If you change this numbering, you must change the values in
/// | | Vector element |
///
+ private:
+
static const int SimpleTypeBits = 8;
static const int PrecisionBits = 8;
static const int VectorBits = 32 - SimpleTypeBits - PrecisionBits;
uint32_t V;
+ public:
+
MVT() {}
MVT(SimpleValueType S) { V = S; }
inline bool operator== (const MVT VT) const { return V == VT.V; }
if (NumElements == 2) return v2f64;
break;
}
- // Set the length with the top bit forced to zero (needed by the verifier).
MVT Result;
- Result.V = VT.V | (((NumElements + 1) << (33 - VectorBits)) >> 1);
+ Result.V = VT.V | ((NumElements + 1) << (32 - VectorBits));
assert(Result.getVectorElementType() == VT &&
"Bad vector element type!");
assert(Result.getVectorNumElements() == NumElements &&
/// This returns all pointers as iPTR. If HandleUnknown is true, unknown
/// types are returned as Other, otherwise they are invalid.
static MVT getMVT(const Type *Ty, bool HandleUnknown = false);
+
+ /// getRawBits - Represent the type as a bunch of bits.
+ uint32_t getRawBits() const { return V; }
};
} // End llvm namespace
LoadSDNode *LD = cast<LoadSDNode>(N);
ID.AddInteger(LD->getAddressingMode());
ID.AddInteger(LD->getExtensionType());
- ID.AddInteger(LD->getMemoryVT().V);
+ ID.AddInteger(LD->getMemoryVT().getRawBits());
ID.AddInteger(LD->getAlignment());
ID.AddInteger(LD->isVolatile());
break;
StoreSDNode *ST = cast<StoreSDNode>(N);
ID.AddInteger(ST->getAddressingMode());
ID.AddInteger(ST->isTruncatingStore());
- ID.AddInteger(ST->getMemoryVT().V);
+ ID.AddInteger(ST->getMemoryVT().getRawBits());
ID.AddInteger(ST->getAlignment());
ID.AddInteger(ST->isVolatile());
break;
if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(N)) {
ID.AddInteger(LD->getAddressingMode());
ID.AddInteger(LD->getExtensionType());
- ID.AddInteger(LD->getMemoryVT().V);
+ ID.AddInteger(LD->getMemoryVT().getRawBits());
ID.AddInteger(LD->getAlignment());
ID.AddInteger(LD->isVolatile());
} else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(N)) {
ID.AddInteger(ST->getAddressingMode());
ID.AddInteger(ST->isTruncatingStore());
- ID.AddInteger(ST->getMemoryVT().V);
+ ID.AddInteger(ST->getMemoryVT().getRawBits());
ID.AddInteger(ST->getAlignment());
ID.AddInteger(ST->isVolatile());
}
FoldingSetNodeID ID;
SDOperand Ops[] = {Chain, Ptr, Cmp, Swp};
AddNodeIDNode(ID, Opcode, VTs, Ops, 4);
- ID.AddInteger(VT.V);
+ ID.AddInteger(VT.getRawBits());
void* IP = 0;
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
return SDOperand(E, 0);
FoldingSetNodeID ID;
SDOperand Ops[] = {Chain, Ptr, Val};
AddNodeIDNode(ID, Opcode, VTs, Ops, 3);
- ID.AddInteger(VT.V);
+ ID.AddInteger(VT.getRawBits());
void* IP = 0;
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
return SDOperand(E, 0);
AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3);
ID.AddInteger(AM);
ID.AddInteger(ExtType);
- ID.AddInteger(EVT.V);
+ ID.AddInteger(EVT.getRawBits());
ID.AddInteger(Alignment);
ID.AddInteger(isVolatile);
void *IP = 0;
AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
ID.AddInteger(ISD::UNINDEXED);
ID.AddInteger(false);
- ID.AddInteger(VT.V);
+ ID.AddInteger(VT.getRawBits());
ID.AddInteger(Alignment);
ID.AddInteger(isVolatile);
void *IP = 0;
AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
ID.AddInteger(ISD::UNINDEXED);
ID.AddInteger(1);
- ID.AddInteger(SVT.V);
+ ID.AddInteger(SVT.getRawBits());
ID.AddInteger(Alignment);
ID.AddInteger(isVolatile);
void *IP = 0;
AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
ID.AddInteger(AM);
ID.AddInteger(ST->isTruncatingStore());
- ID.AddInteger(ST->getMemoryVT().V);
+ ID.AddInteger(ST->getMemoryVT().getRawBits());
ID.AddInteger(ST->getAlignment());
ID.AddInteger(ST->isVolatile());
void *IP = 0;