LLVM API Documentation

llvm::MVT Struct Reference

#include <ValueTypes.h>

Collaboration diagram for llvm::MVT:
[legend]

List of all members.

Public Types

enum  SimpleValueType {
  Other = 0, i1 = 1, i8 = 2, i16 = 3,
  i32 = 4, i64 = 5, i128 = 6, FIRST_INTEGER_VALUETYPE = i1,
  LAST_INTEGER_VALUETYPE = i128, f32 = 7, f64 = 8, f80 = 9,
  f128 = 10, ppcf128 = 11, Flag = 12, isVoid = 13,
  v2i8 = 14, v4i8 = 15, v2i16 = 16, v8i8 = 17,
  v4i16 = 18, v2i32 = 19, v1i64 = 20, v16i8 = 21,
  v8i16 = 22, v3i32 = 23, v4i32 = 24, v2i64 = 25,
  v2f32 = 26, v3f32 = 27, v4f32 = 28, v2f64 = 29,
  FIRST_VECTOR_VALUETYPE = v2i8, LAST_VECTOR_VALUETYPE = v2f64, LAST_VALUETYPE = 30, iPTRAny = 252,
  fAny = 253, iAny = 254, iPTR = 255, LastSimpleValueType = 255
}

Public Member Functions

 MVT ()
 MVT (SimpleValueType S)
bool operator== (const MVT VT) const
bool operator!= (const MVT VT) const
bool isSimple () const
bool isExtended () const
bool isFloatingPoint () const
 isFloatingPoint - Return true if this is a FP, or a vector FP type.
bool isInteger () const
 isInteger - Return true if this is an integer, or a vector integer type.
bool isVector () const
 isVector - Return true if this is a vector value type.
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 isByteSized () const
 isByteSized - Return true if the bit size is a multiple of 8.
bool isRound () const
 isRound - Return true if the size is a power-of-two number of bytes.
bool bitsEq (MVT VT) const
 bitsEq - Return true if this has the same number of bits as VT.
bool bitsGT (MVT VT) const
 bitsGT - Return true if this has more bits than VT.
bool bitsGE (MVT VT) const
 bitsGE - Return true if this has no less bits than VT.
bool bitsLT (MVT VT) const
 bitsLT - Return true if this has less bits than VT.
bool bitsLE (MVT VT) const
 bitsLE - Return true if this has no more bits than VT.
SimpleValueType getSimpleVT () const
MVT getVectorElementType () const
unsigned getVectorNumElements () const
unsigned getSizeInBits () const
 getSizeInBits - Return the size of the specified value type in bits.
unsigned getStoreSizeInBits () const
MVT getRoundIntegerType () const
bool isPow2VectorType () const
 isPow2VectorType - Retuns true if the given vector is a power of 2.
MVT getPow2VectorType () const
std::string getMVTString () const
 getMVTString - This function returns value type as a string, e.g. "i32".
const Type * getTypeForMVT () const
uintptr_t getRawBits () const
 getRawBits - Represent the type as a bunch of bits.

Static Public Member Functions

static MVT getFloatingPointVT (unsigned BitWidth)
static MVT getIntegerVT (unsigned BitWidth)
static MVT getVectorVT (MVT VT, unsigned NumElements)
static MVT getIntVectorWithNumElements (unsigned NumElts)
static MVT getMVT (const Type *Ty, bool HandleUnknown=false)

Classes

struct  compareRawBits


Detailed Description

Definition at line 27 of file ValueTypes.h.


Member Enumeration Documentation

Enumerator:
Other 
i1 
i8 
i16 
i32 
i64 
i128 
FIRST_INTEGER_VALUETYPE 
LAST_INTEGER_VALUETYPE 
f32 
f64 
f80 
f128 
ppcf128 
Flag 
isVoid 
v2i8 
v4i8 
v2i16 
v8i8 
v4i16 
v2i32 
v1i64 
v16i8 
v8i16 
v3i32 
v4i32 
v2i64 
v2f32 
v3f32 
v4f32 
v2f64 
FIRST_VECTOR_VALUETYPE 
LAST_VECTOR_VALUETYPE 
LAST_VALUETYPE 
iPTRAny 
fAny 
iAny 
iPTR 
LastSimpleValueType 

Definition at line 29 of file ValueTypes.h.


Constructor & Destructor Documentation

llvm::MVT::MVT (  )  [inline]

Definition at line 115 of file ValueTypes.h.

llvm::MVT::MVT ( SimpleValueType  S  )  [inline]

Definition at line 116 of file ValueTypes.h.


Member Function Documentation

bool llvm::MVT::operator== ( const MVT  VT  )  const [inline]

Definition at line 118 of file ValueTypes.h.

References getRawBits().

bool llvm::MVT::operator!= ( const MVT  VT  )  const [inline]

Definition at line 121 of file ValueTypes.h.

References getRawBits().

static MVT llvm::MVT::getFloatingPointVT ( unsigned  BitWidth  )  [inline, static]

getFloatingPointVT - Returns the MVT that represents a floating point type with the given number of bits. There are two floating point types with 128 bits - this returns f128 rather than ppcf128.

Definition at line 128 of file ValueTypes.h.

References f128, f32, f64, and f80.

Referenced by getCopyFromParts().

static MVT llvm::MVT::getIntegerVT ( unsigned  BitWidth  )  [inline, static]

getIntegerVT - Returns the MVT that represents an integer with the given number of bits.

Definition at line 145 of file ValueTypes.h.

References i1, i128, i16, i32, i64, and i8.

Referenced by FindAssocWidenVecType(), getCopyFromParts(), getCopyToParts(), getMVT(), llvm::SelectionDAGLowering::GetRegistersForValue(), getRoundIntegerType(), llvm::TargetLowering::getTypeToTransformTo(), and llvm::TargetLowering::SimplifySetCC().

static MVT llvm::MVT::getVectorVT ( MVT  VT,
unsigned  NumElements 
) [inline, static]

getVectorVT - Returns the MVT that represents a vector NumElements in length, where each element is of type VT.

Definition at line 167 of file ValueTypes.h.

References f32, f64, i16, i32, i64, i8, V, v16i8, v1i64, v2f32, v2f64, v2i16, v2i32, v2i64, v2i8, v3f32, v3i32, v4f32, v4i16, v4i32, v4i8, v8i16, and v8i8.

Referenced by FindAssocWidenVecType(), getIntVectorWithNumElements(), getMemsetStringVal(), getMVT(), getPow2VectorType(), llvm::TargetLowering::getTypeToTransformTo(), llvm::TargetLowering::getVectorTypeBreakdown(), LowerCTPOP(), LowerLOAD(), LowerSTORE(), and LowerTRUNCATE().

static MVT llvm::MVT::getIntVectorWithNumElements ( unsigned  NumElts  )  [inline, static]

getIntVectorWithNumElements - Return any integer vector type that has the specified number of elements.

Definition at line 205 of file ValueTypes.h.

References getVectorVT(), i8, v16i8, v1i64, v2i32, v3i32, v4i16, and v8i8.

Referenced by getMOVLMask(), getShuffleVectorZeroOrUndef(), getSwapEltZeroMask(), getUnpackhMask(), getUnpacklMask(), LowerVECTOR_SHUFFLEv8i16(), and RewriteAsNarrowerShuffle().

bool llvm::MVT::isSimple (  )  const [inline]

bool llvm::MVT::isExtended (  )  const [inline]

isExtended - Test if the given MVT is extended (as opposed to being simple).

Definition at line 225 of file ValueTypes.h.

References isSimple().

Referenced by llvm::TargetLowering::getOperationAction(), llvm::TargetLowering::ValueTypeActionImpl::getTypeAction(), getTypeForMVT(), and llvm::SelectionDAG::getValueType().

bool llvm::MVT::isFloatingPoint (  )  const [inline]

bool llvm::MVT::isInteger (  )  const [inline]

bool llvm::MVT::isVector (  )  const [inline]

bool llvm::MVT::is64BitVector (  )  const [inline]

is64BitVector - Return true if this is a 64-bit vector type.

Definition at line 255 of file ValueTypes.h.

References isSimple(), SimpleTy, v1i64, v2f32, v2i32, v4i16, and v8i8.

bool llvm::MVT::is128BitVector (  )  const [inline]

is128BitVector - Return true if this is a 128-bit vector type.

Definition at line 263 of file ValueTypes.h.

References isSimple(), SimpleTy, v16i8, v2f64, v2i64, v4f32, v4i32, and v8i16.

Referenced by LowerEXTRACT_VECTOR_ELT().

bool llvm::MVT::isByteSized (  )  const [inline]

isByteSized - Return true if the bit size is a multiple of 8.

Definition at line 271 of file ValueTypes.h.

References getSizeInBits().

bool llvm::MVT::isRound (  )  const [inline]

isRound - Return true if the size is a power-of-two number of bytes.

Definition at line 276 of file ValueTypes.h.

References getSizeInBits().

Referenced by llvm::TargetLowering::SimplifySetCC().

bool llvm::MVT::bitsEq ( MVT  VT  )  const [inline]

bitsEq - Return true if this has the same number of bits as VT.

Definition at line 282 of file ValueTypes.h.

References getSizeInBits().

bool llvm::MVT::bitsGT ( MVT  VT  )  const [inline]

bool llvm::MVT::bitsGE ( MVT  VT  )  const [inline]

bitsGE - Return true if this has no less bits than VT.

Definition at line 292 of file ValueTypes.h.

References getSizeInBits().

bool llvm::MVT::bitsLT ( MVT  VT  )  const [inline]

bool llvm::MVT::bitsLE ( MVT  VT  )  const [inline]

bitsLE - Return true if this has no more bits than VT.

Definition at line 302 of file ValueTypes.h.

References getSizeInBits().

Referenced by llvm::SelectionDAG::getNode().

SimpleValueType llvm::MVT::getSimpleVT (  )  const [inline]

getSimpleVT - Return the SimpleValueType held in the specified simple MVT.

Definition at line 309 of file ValueTypes.h.

References isSimple(), and SimpleTy.

Referenced by llvm::TargetLowering::AddPromotedToType(), llvm::TargetLowering::addRegisterClass(), ExpandConstantFP(), ExpandUnalignedStore(), llvm::FastISel::FastEmit_rf_(), llvm::TargetLowering::getCondCodeAction(), llvm::TargetLowering::getConvertAction(), llvm::TargetLowering::getIndexedLoadAction(), llvm::TargetLowering::getIndexedStoreAction(), llvm::TargetLowering::getLoadExtAction(), llvm::TargetLowering::getNumRegisters(), llvm::TargetLowering::getOperationAction(), llvm::TargetLowering::getRegClassFor(), llvm::FastISel::getRegForGEPIndex(), llvm::X86TargetLowering::getRegForInlineAsmConstraint(), llvm::FastISel::getRegForValue(), llvm::TargetLowering::getRegisterType(), llvm::TargetLowering::getTruncStoreAction(), llvm::TargetLowering::ValueTypeActionImpl::getTypeAction(), llvm::TargetLowering::getTypeToPromoteTo(), llvm::TargetLowering::getTypeToTransformTo(), llvm::SelectionDAG::getValueType(), llvm::getX86SubSuperRegister(), HowToPassArgument(), isIntS16Immediate(), isLegalAddressImmediate(), llvm::XCoreTargetLowering::isLegalAddressingMode(), llvm::ARMTargetLowering::isLegalAddressingMode(), llvm::TargetLowering::isTypeLegal(), llvm::SparcTargetLowering::LowerArguments(), LowerBUILD_VECTOR(), LowerCALL(), llvm::IA64TargetLowering::LowerCallTo(), llvm::AlphaTargetLowering::LowerCallTo(), LowerCTPOP(), LowerEXTRACT_VECTOR_ELT(), LowerFORMAL_ARGUMENTS(), LowerSCALAR_TO_VECTOR(), LowerTRUNCATE(), MeetsMaxMemopRequirement(), MVTToAPFloatSemantics(), RewriteAsNarrowerShuffle(), llvm::TargetLowering::setCondCodeAction(), llvm::TargetLowering::setConvertAction(), llvm::TargetLowering::setIndexedLoadAction(), llvm::TargetLowering::setIndexedStoreAction(), llvm::TargetLowering::setLoadExtAction(), llvm::TargetLowering::setOperationAction(), llvm::TargetLowering::setTruncStoreAction(), llvm::TargetLowering::ValueTypeActionImpl::setTypeAction(), X86ChooseCmpImmediateOpcode(), and X86ChooseCmpOpcode().

MVT llvm::MVT::getVectorElementType (  )  const [inline]

unsigned llvm::MVT::getVectorNumElements (  )  const [inline]

unsigned llvm::MVT::getSizeInBits (  )  const [inline]

getSizeInBits - Return the size of the specified value type in bits.

Definition at line 367 of file ValueTypes.h.

References f128, f32, f64, f80, fAny, i1, i128, i16, i32, i64, i8, iAny, iPTR, iPTRAny, ppcf128, V, v16i8, v1i64, v2f32, v2f64, v2i16, v2i32, v2i64, v2i8, v3f32, v3i32, v4f32, v4i16, v4i32, v4i8, v8i16, and v8i8.

Referenced by bitsEq(), bitsGE(), bitsGT(), bitsLE(), bitsLT(), llvm::TargetLowering::BuildSDIV(), CalculateStackSlotSize(), CalculateTailCallArgDest(), llvm::SelectionDAG::ComputeMaskedBits(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::SPUTargetLowering::ComputeNumSignBitsForTargetNode(), EltsFromConsecutiveLoads(), ExpandFCOPYSIGNToBitwiseOps(), llvm::PIC16TargetLowering::ExpandLoad(), ExpandUnalignedLoad(), ExpandUnalignedStore(), llvm::FastISel::FastEmit_rf_(), FindAssocWidenVecType(), FindWidenVecType(), llvm::SelectionDAG::getConstant(), GetConstantBuildVectorBits(), getCopyFromParts(), llvm::RegsForValue::getCopyFromRegs(), getCopyToParts(), llvm::SelectionDAG::getGlobalAddress(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), llvm::MemSDNode::getMemOperand(), getMemsetStores(), getMemsetStringVal(), getMemsetValue(), getMVTString(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), llvm::TargetLowering::getNumRegisters(), getOnesVector(), llvm::FastISel::getRegForValue(), llvm::SelectionDAGLowering::GetRegistersForValue(), getRoundIntegerType(), getStoreSizeInBits(), llvm::TargetLowering::getTypeToTransformTo(), llvm::SDNode::getValueSizeInBits(), llvm::SDValue::getValueSizeInBits(), llvm::TargetLowering::getVectorTypeBreakdown(), getVShift(), llvm::SelectionDAG::getZeroExtendInReg(), getZeroVector(), isByteSized(), llvm::TargetLowering::isConsecutiveLoad(), isRound(), llvm::X86TargetLowering::isShuffleMaskLegal(), llvm::X86TargetLowering::isTruncateFree(), llvm::X86TargetLowering::isVectorClearMaskLegal(), llvm::SparcTargetLowering::LowerArguments(), LowerBUILD_VECTOR(), LowerByteImmed(), llvm::PIC16TargetLowering::LowerCallArguments(), LowerCTPOP(), LowerEXTRACT_VECTOR_ELT(), LowerFORMAL_ARGUMENTS(), LowerLOAD(), llvm::IA64TargetLowering::LowerOperation(), LowerSETCC(), LowerSTORE(), LowerTRUNCATE(), LowerVAARG(), LowerVECTOR_SHUFFLE(), MeetsMaxMemopRequirement(), PerformSTORECombine(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::TargetLowering::SimplifySetCC(), and ValueHasExactlyOneBitSet().

unsigned llvm::MVT::getStoreSizeInBits (  )  const [inline]

getStoreSizeInBits - Return the number of bits overwritten by a store of the specified value type.

Definition at line 409 of file ValueTypes.h.

References getSizeInBits().

Referenced by llvm::SelectionDAG::CreateStackTemporary().

MVT llvm::MVT::getRoundIntegerType (  )  const [inline]

getRoundIntegerType - Rounds the bit-width of the given integer MVT up to the nearest power of two (and at least to eight), and returns the integer MVT with that number of bits.

Definition at line 416 of file ValueTypes.h.

References getIntegerVT(), getSizeInBits(), i8, isInteger(), isVector(), and llvm::Log2_32_Ceil().

Referenced by llvm::TargetLowering::ValueTypeActionImpl::getTypeAction(), and llvm::TargetLowering::getTypeToTransformTo().

bool llvm::MVT::isPow2VectorType (  )  const [inline]

isPow2VectorType - Retuns true if the given vector is a power of 2.

Definition at line 426 of file ValueTypes.h.

References getVectorNumElements().

Referenced by getPow2VectorType(), and llvm::TargetLowering::ValueTypeActionImpl::getTypeAction().

MVT llvm::MVT::getPow2VectorType (  )  const [inline]

getPow2VectorType - Widens the length of the given vector MVT up to the nearest power of 2 and returns that type.

Definition at line 433 of file ValueTypes.h.

References getVectorElementType(), getVectorNumElements(), getVectorVT(), isPow2VectorType(), and llvm::Log2_32_Ceil().

Referenced by llvm::TargetLowering::computeRegisterProperties(), and llvm::TargetLowering::getTypeToTransformTo().

std::string MVT::getMVTString (  )  const

const Type * MVT::getTypeForMVT (  )  const

getTypeForMVT - This method returns an LLVM type corresponding to the specified MVT. For integer types, this returns an unsigned type. Note that this will abort for types that cannot be represented.

getTypeForMVT - This method returns an LLVM type corresponding to the specified MVT. For integer types, this returns an unsigned type. Note that this will abort for types that cannot be represented.

Definition at line 124 of file ValueTypes.cpp.

References llvm::Type::DoubleTy, f128, f32, f64, f80, llvm::Type::FloatTy, llvm::Type::FP128Ty, llvm::VectorType::get(), llvm::IntegerType::get(), i1, i128, i16, i32, i64, i8, llvm::Type::Int16Ty, llvm::Type::Int1Ty, llvm::Type::Int32Ty, llvm::Type::Int64Ty, llvm::Type::Int8Ty, isExtended(), isVoid, LLVMTy, llvm::Type::PPC_FP128Ty, ppcf128, V, v16i8, v1i64, v2f32, v2f64, v2i16, v2i32, v2i64, v2i8, v3f32, v3i32, v4f32, v4i16, v4i32, v4i8, v8i16, v8i8, llvm::Type::VoidTy, and llvm::Type::X86_FP80Ty.

Referenced by llvm::SelectionDAG::CreateStackTemporary(), ExpandConstantFP(), ExpandLibCall(), llvm::TargetLowering::LowerArguments(), llvm::TargetLowering::LowerCallTo(), and MeetsMaxMemopRequirement().

MVT MVT::getMVT ( const Type *  Ty,
bool  HandleUnknown = false 
) [static]

getMVT - Return the value type corresponding to the specified type. This returns all pointers as iPTR. If HandleUnknown is true, unknown types are returned as Other, otherwise they are invalid.

getMVT - Return the value type corresponding to the specified type. This returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types are returned as Other, otherwise they are invalid.

Definition at line 163 of file ValueTypes.cpp.

References llvm::Type::DoubleTyID, f128, f32, f64, f80, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::SequentialType::getElementType(), getIntegerVT(), llvm::VectorType::getNumElements(), llvm::Type::getTypeID(), getVectorVT(), llvm::Type::IntegerTyID, iPTR, isVoid, Other, llvm::Type::PointerTyID, llvm::Type::PPC_FP128TyID, ppcf128, llvm::Type::VectorTyID, llvm::Type::VoidTyID, and llvm::Type::X86_FP80TyID.

Referenced by llvm::Intrinsic::getName(), llvm::FastISel::getRegForGEPIndex(), and llvm::TargetLowering::getValueType().

uintptr_t llvm::MVT::getRawBits (  )  const [inline]


Member Data Documentation

uintptr_t llvm::MVT::V

Definition at line 111 of file ValueTypes.h.

Referenced by getTypeForMVT().


The documentation for this struct was generated from the following files: