16 #ifndef LLVM_CODEGEN_VALUETYPES_H
17 #define LLVM_CODEGEN_VALUETYPES_H
42 return !(*
this != VT);
48 return LLVMTy != VT.LLVMTy;
65 return getExtendedIntegerVT(Context, BitWidth);
74 return getExtendedVectorVT(Context, VT, NumElements);
82 return changeExtendedVectorElementTypeToInteger();
88 "Simple vector VT not representable by simple integer vector VT!");
167 return BitSize >= 8 && !(BitSize & (BitSize - 1));
172 if (EVT::operator==(VT))
return true;
178 if (EVT::operator==(VT))
return false;
184 if (EVT::operator==(VT))
return true;
190 if (EVT::operator==(VT))
return false;
196 if (EVT::operator==(VT))
return true;
204 assert(
isSimple() &&
"Expected a SimpleValueType!");
217 assert(
isVector() &&
"Invalid vector type!");
220 return getExtendedVectorElementType();
226 assert(
isVector() &&
"Invalid vector type!");
229 return getExtendedVectorNumElements();
236 return getExtendedSizeInBits();
293 return !(NElts & (NElts - 1));
335 return L.LLVMTy < R.LLVMTy;
345 EVT changeExtendedVectorElementTypeToInteger()
const;
348 unsigned NumElements);
351 bool isExtendedVector()
const LLVM_READONLY;
352 bool isExtended16BitVector()
const LLVM_READONLY;
353 bool isExtended32BitVector()
const LLVM_READONLY;
354 bool isExtended64BitVector()
const LLVM_READONLY;
355 bool isExtended128BitVector()
const LLVM_READONLY;
356 bool isExtended256BitVector()
const LLVM_READONLY;
357 bool isExtended512BitVector()
const LLVM_READONLY;
358 bool isExtended1024BitVector()
const LLVM_READONLY;
359 EVT getExtendedVectorElementType()
const;
360 unsigned getExtendedVectorNumElements() const LLVM_READONLY;
361 unsigned getExtendedSizeInBits() const;
EVT getRoundIntegerType(LLVMContext &Context) const
getRoundIntegerType - Rounds the bit-width of the given integer EVT up to the nearest power of two (a...
bool is16BitVector() const
is16BitVector - Return true if this is a 16-bit vector type.
bool is32BitVector() const
is32BitVector - Return true if this is a 32-bit vector type.
static MVT getIntegerVT(unsigned BitWidth)
unsigned Log2_32_Ceil(uint32_t Value)
Log2_32_Ceil - This function returns the ceil log base 2 of the specified value, 32 if the value is z...
bool is1024BitVector() const
is1024BitVector - Return true if this is a 1024-bit vector type.
static MVT getVectorVT(MVT VT, unsigned NumElements)
bool isExtended() const
isExtended - Test if the given EVT is extended (as opposed to being simple).
bool is512BitVector() const
is512BitVector - Return true if this is a 512-bit vector type.
static MVT getFloatingPointVT(unsigned BitWidth)
Type * getTypeForEVT(LLVMContext &Context) const
getTypeForEVT - This method returns an LLVM type corresponding to the specified EVT.
unsigned getSizeInBits() const
bool is32BitVector() const
is32BitVector - Return true if this is a 32-bit vector type.
bool bitsLT(EVT VT) const
bitsLT - Return true if this has less bits than VT.
bool is1024BitVector() const
is1024BitVector - Return true if this is a 1024-bit vector type.
bool isVector() const
isVector - Return true if this is a vector value type.
std::string getEVTString() const
getEVTString - This function returns value type as a string, e.g.
bool isRound() const
isRound - Return true if the size is a power-of-two number of bytes.
EVT getScalarType() const
getScalarType - If this is a vector type, return the element type, otherwise return this...
bool bitsGE(EVT VT) const
bitsGE - Return true if this has no less bits than VT.
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
LLVM_CONSTEXPR EVT(MVT::SimpleValueType SVT)
EVT getVectorElementType() const
getVectorElementType - Given a vector type, return the type of each element.
compareRawBits - A meaningless but well-behaved order, useful for constructing containers.
EVT getHalfSizedIntegerVT(LLVMContext &Context) const
getHalfSizedIntegerVT - Finds the smallest simple value type that is greater than or equal to half th...
bool operator()(EVT L, EVT R) const
bool bitsLE(EVT VT) const
bitsLE - Return true if this has no more bits than VT.
bool isPow2VectorType() const
isPow2VectorType - Returns true if the given vector is a power of 2.
LLVM_CONSTEXPR EVT(MVT S)
unsigned getScalarSizeInBits() const
unsigned getStoreSize() const
getStoreSize - Return the number of bytes overwritten by a store of the specified value type...
unsigned getStoreSizeInBits() const
getStoreSizeInBits - Return the number of bits overwritten by a store of the specified value type...
bool isInteger() const
isInteger - Return true if this is an integer, or a vector integer type.
bool is256BitVector() const
is256BitVector - Return true if this is a 256-bit vector type.
unsigned getVectorNumElements() const
MVT - Machine Value Type.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
bool isVector() const
isVector - Return true if this is a vector value type.
bool isFloatingPoint() const
isFloatingPoint - Return true if this is a FP, or a vector FP type.
static EVT getFloatingPointVT(unsigned BitWidth)
getFloatingPointVT - Returns the EVT that represents a floating point type with the given number of b...
EVT - Extended Value Type.
bool bitsEq(EVT VT) const
bitsEq - Return true if this has the same number of bits as VT.
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements)
getVectorVT - Returns the EVT that represents a vector NumElements in length, where each element is o...
bool bitsGT(EVT VT) const
bitsGT - Return true if this has more bits than VT.
bool is16BitVector() const
is16BitVector - Return true if this is a 16-bit vector type.
bool isOverloaded() const
isOverloaded - Return true if this is an overloaded type for TableGen.
bool is64BitVector() const
is64BitVector - Return true if this is a 64-bit vector type.
bool is128BitVector() const
is128BitVector - Return true if this is a 128-bit vector type.
bool operator==(EVT VT) const
EVT widenIntegerVectorElementType(LLVMContext &Context) const
Return a VT for an integer vector type with the size of the elements doubled.
bool is256BitVector() const
is256BitVector - Return true if this is a 256-bit vector type.
bool operator!=(EVT VT) const
unsigned getSizeInBits() const
getSizeInBits - Return the size of the specified value type in bits.
intptr_t getRawBits() const
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
getEVT - Return the value type corresponding to the specified type.
EVT getPow2VectorType(LLVMContext &Context) const
getPow2VectorType - Widens the length of the given vector EVT up to the nearest power of 2 and return...
bool is128BitVector() const
is128BitVector - Return true if this is a 128-bit vector type.
bool isByteSized() const
isByteSized - Return true if the bit size is a multiple of 8.
bool isFloatingPoint() const
isFloatingPoint - Return true if this is a FP, or a vector FP type.
bool isSimple() const
isSimple - Test if the given EVT is simple (as opposed to being extended).
MVT getVectorElementType() const
bool is512BitVector() const
is512BitVector - Return true if this is a 512-bit vector type.
bool is64BitVector() const
is64BitVector - Return true if this is a 64-bit vector type.
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
getIntegerVT - Returns the EVT that represents an integer with the given number of bits...
EVT changeVectorElementTypeToInteger() const
changeVectorElementTypeToInteger - Return a vector with the same number of elements as this vector...
MVT getSimpleVT() const
getSimpleVT - Return the SimpleValueType held in the specified simple EVT.
unsigned getVectorNumElements() const
getVectorNumElements - Given a vector type, return the number of elements it contains.