LLVM API Documentation

llvm::X86Subtarget Class Reference

#include <X86Subtarget.h>

Inheritance diagram for llvm::X86Subtarget:

Inheritance graph
[legend]
Collaboration diagram for llvm::X86Subtarget:

Collaboration graph
[legend]

List of all members.

Public Types

enum  AsmWriterFlavorTy { ATT = 0, Intel = 1, Unset }
enum  {
  isELF, isCygwin, isDarwin, isWindows,
  isMingw
}

Public Member Functions

 X86Subtarget (const Module &M, const std::string &FS, bool is64Bit)
unsigned getStackAlignment () const
unsigned getMaxInlineSizeThreshold () const
void ParseSubtargetFeatures (const std::string &FS, const std::string &CPU)
void AutoDetectSubtargetFeatures ()
bool is64Bit () const
PICStyles::Style getPICStyle () const
void setPICStyle (PICStyles::Style Style)
bool hasMMX () const
bool hasSSE1 () const
bool hasSSE2 () const
bool hasSSE3 () const
bool hasSSSE3 () const
bool hasSSE41 () const
bool hasSSE42 () const
bool has3DNow () const
bool has3DNowA () const
bool isBTMemSlow () const
unsigned getAsmFlavor () const
bool isFlavorAtt () const
bool isFlavorIntel () const
bool isTargetDarwin () const
bool isTargetELF () const
bool isTargetWindows () const
bool isTargetMingw () const
bool isTargetCygMing () const
bool isTargetCygwin () const
bool isTargetWin64 () const
std::string getDataLayout () const
bool isPICStyleSet () const
bool isPICStyleGOT () const
bool isPICStyleStub () const
bool isPICStyleRIPRel () const
bool isPICStyleWinPIC () const
unsigned getDarwinVers () const
 getDarwinVers - Return the darwin version number, 8 = tiger, 9 = leopard.
bool isLinux () const
 isLinux - Return true if the target is "Linux".
bool GVRequiresExtraLoad (const GlobalValue *GV, const TargetMachine &TM, bool isDirectCall) const
bool GVRequiresRegister (const GlobalValue *GV, const TargetMachine &TM, bool isDirectCall) const
const char * getBZeroEntry () const
unsigned getSpecialAddressLatency () const

Public Attributes

enum llvm::X86Subtarget:: { ... }  TargetType

Protected Types

enum  X86SSEEnum {
  NoMMXSSE, MMX, SSE1, SSE2,
  SSE3, SSSE3, SSE41, SSE42
}
enum  X863DNowEnum { NoThreeDNow, ThreeDNow, ThreeDNowA }

Protected Attributes

AsmWriterFlavorTy AsmFlavor
PICStyles::Style PICStyle
X86SSEEnum X86SSELevel
X863DNowEnum X863DNowLevel
bool HasX86_64
bool IsBTMemSlow
 IsBTMemSlow - True if BT (bit test) of memory instructions are slow.
unsigned char DarwinVers
bool IsLinux
 isLinux - true if this is a "linux" platform.
unsigned stackAlignment
unsigned MaxInlineSizeThreshold


Detailed Description

Definition at line 31 of file X86Subtarget.h.


Member Enumeration Documentation

Enumerator:
ATT 
Intel 
Unset 

Definition at line 33 of file X86Subtarget.h.

Enumerator:
NoMMXSSE 
MMX 
SSE1 
SSE2 
SSE3 
SSSE3 
SSE41 
SSE42 

Definition at line 39 of file X86Subtarget.h.

Enumerator:
NoThreeDNow 
ThreeDNow 
ThreeDNowA 

Definition at line 43 of file X86Subtarget.h.

anonymous enum

Enumerator:
isELF 
isCygwin 
isDarwin 
isWindows 
isMingw 

Definition at line 91 of file X86Subtarget.h.


Constructor & Destructor Documentation

X86Subtarget::X86Subtarget ( const Module M,
const std::string &  FS,
bool  is64Bit 
)


Member Function Documentation

unsigned llvm::X86Subtarget::getStackAlignment (  )  const [inline]

getStackAlignment - Returns the minimum alignment known to hold of the stack frame on entry to the function and which must be maintained by every function for this subtarget.

Definition at line 103 of file X86Subtarget.h.

References stackAlignment.

Referenced by llvm::X86TargetLowering::getOptimalMemOpType().

unsigned llvm::X86Subtarget::getMaxInlineSizeThreshold (  )  const [inline]

getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size that still makes it profitable to inline the call.

Definition at line 107 of file X86Subtarget.h.

References MaxInlineSizeThreshold.

void llvm::X86Subtarget::ParseSubtargetFeatures ( const std::string &  FS,
const std::string &  CPU 
)

ParseSubtargetFeatures - Parses features string setting specified subtarget options. Definition of function is auto generated by tblgen.

Referenced by X86Subtarget().

void X86Subtarget::AutoDetectSubtargetFeatures (  ) 

AutoDetectSubtargetFeatures - Auto-detect CPU features using CPUID instruction.

Definition at line 166 of file X86Subtarget.cpp.

References c, DetectFamilyModel(), llvm::N86::EAX, llvm::N86::EBX, llvm::N86::ECX, llvm::N86::EDX, llvm::X86::GetCpuIDAndInfo(), HasX86_64, IsBTMemSlow, MMX, SSE1, SSE2, SSE3, SSE41, SSE42, SSSE3, and X86SSELevel.

Referenced by X86Subtarget().

bool llvm::X86Subtarget::is64Bit (  )  const [inline]

PICStyles::Style llvm::X86Subtarget::getPICStyle (  )  const [inline]

Definition at line 119 of file X86Subtarget.h.

References PICStyle.

void llvm::X86Subtarget::setPICStyle ( PICStyles::Style  Style  )  [inline]

Definition at line 120 of file X86Subtarget.h.

References PICStyle.

Referenced by llvm::X86TargetMachine::X86TargetMachine().

bool llvm::X86Subtarget::hasMMX (  )  const [inline]

bool llvm::X86Subtarget::hasSSE1 (  )  const [inline]

bool llvm::X86Subtarget::hasSSE2 (  )  const [inline]

bool llvm::X86Subtarget::hasSSE3 (  )  const [inline]

Definition at line 125 of file X86Subtarget.h.

References SSE3, and X86SSELevel.

Referenced by llvm::X86TargetLowering::X86TargetLowering().

bool llvm::X86Subtarget::hasSSSE3 (  )  const [inline]

Definition at line 126 of file X86Subtarget.h.

References SSSE3, and X86SSELevel.

bool llvm::X86Subtarget::hasSSE41 (  )  const [inline]

Definition at line 127 of file X86Subtarget.h.

References SSE41, and X86SSELevel.

Referenced by llvm::X86TargetLowering::X86TargetLowering().

bool llvm::X86Subtarget::hasSSE42 (  )  const [inline]

Definition at line 128 of file X86Subtarget.h.

References SSE42, and X86SSELevel.

Referenced by llvm::X86TargetLowering::X86TargetLowering().

bool llvm::X86Subtarget::has3DNow (  )  const [inline]

Definition at line 129 of file X86Subtarget.h.

References ThreeDNow, and X863DNowLevel.

bool llvm::X86Subtarget::has3DNowA (  )  const [inline]

Definition at line 130 of file X86Subtarget.h.

References ThreeDNowA, and X863DNowLevel.

bool llvm::X86Subtarget::isBTMemSlow (  )  const [inline]

Definition at line 132 of file X86Subtarget.h.

References IsBTMemSlow.

unsigned llvm::X86Subtarget::getAsmFlavor (  )  const [inline]

Definition at line 134 of file X86Subtarget.h.

References AsmFlavor, and Unset.

Referenced by llvm::X86TargetAsmInfo< llvm::TargetAsmInfo >::X86TargetAsmInfo().

bool llvm::X86Subtarget::isFlavorAtt (  )  const [inline]

Definition at line 138 of file X86Subtarget.h.

References AsmFlavor, and ATT.

bool llvm::X86Subtarget::isFlavorIntel (  )  const [inline]

Definition at line 139 of file X86Subtarget.h.

References AsmFlavor, and Intel.

Referenced by llvm::X86TargetMachine::createTargetAsmInfo(), and llvm::createX86CodePrinterPass().

bool llvm::X86Subtarget::isTargetDarwin (  )  const [inline]

bool llvm::X86Subtarget::isTargetELF (  )  const [inline]

bool llvm::X86Subtarget::isTargetWindows (  )  const [inline]

Definition at line 145 of file X86Subtarget.h.

References isWindows, and TargetType.

Referenced by GVRequiresExtraLoad().

bool llvm::X86Subtarget::isTargetMingw (  )  const [inline]

Definition at line 146 of file X86Subtarget.h.

References isMingw, and TargetType.

Referenced by llvm::X86TargetLowering::X86TargetLowering().

bool llvm::X86Subtarget::isTargetCygMing (  )  const [inline]

bool llvm::X86Subtarget::isTargetCygwin (  )  const [inline]

Definition at line 149 of file X86Subtarget.h.

References isCygwin, and TargetType.

bool llvm::X86Subtarget::isTargetWin64 (  )  const [inline]

std::string llvm::X86Subtarget::getDataLayout (  )  const [inline]

Definition at line 154 of file X86Subtarget.h.

References is64Bit(), and isTargetDarwin().

bool llvm::X86Subtarget::isPICStyleSet (  )  const [inline]

Definition at line 167 of file X86Subtarget.h.

References llvm::PICStyles::None, and PICStyle.

bool llvm::X86Subtarget::isPICStyleGOT (  )  const [inline]

bool llvm::X86Subtarget::isPICStyleStub (  )  const [inline]

bool llvm::X86Subtarget::isPICStyleRIPRel (  )  const [inline]

bool llvm::X86Subtarget::isPICStyleWinPIC (  )  const [inline]

Definition at line 171 of file X86Subtarget.h.

References PICStyle, and llvm::PICStyles::WinPIC.

unsigned llvm::X86Subtarget::getDarwinVers (  )  const [inline]

getDarwinVers - Return the darwin version number, 8 = tiger, 9 = leopard.

Definition at line 174 of file X86Subtarget.h.

References DarwinVers.

Referenced by getBZeroEntry(), llvm::X86DarwinTargetAsmInfo::getEHGlobalPrefix(), llvm::X86ATTAsmPrinter::printOperand(), and llvm::X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo().

bool llvm::X86Subtarget::isLinux (  )  const [inline]

isLinux - Return true if the target is "Linux".

Definition at line 177 of file X86Subtarget.h.

References IsLinux.

bool X86Subtarget::GVRequiresExtraLoad ( const GlobalValue GV,
const TargetMachine TM,
bool  isDirectCall 
) const

True if accessing the GV requires an extra load. For Windows, dllimported symbols are indirect, loading the value at address GV rather then the value of GV itself. This means that the GlobalAddress must be in the base or index register of the address, not the GV offset field.

True if accessing the GV requires an extra load. For Windows, dllimported symbols are indirect, loading the value at address GV rather then the value of GV itself. This means that the GlobalAddress must be in the base or index register of the address, not the GV offset field.

Definition at line 37 of file X86Subtarget.cpp.

References llvm::TargetMachine::getCodeModel(), llvm::TargetMachine::getRelocationModel(), llvm::GlobalValue::hasCommonLinkage(), llvm::GlobalValue::hasDLLImportLinkage(), llvm::GlobalValue::hasHiddenVisibility(), llvm::GlobalValue::hasInternalLinkage(), llvm::GlobalValue::hasNotBeenReadFromBitcode(), llvm::GlobalValue::isDeclaration(), isTargetCygMing(), isTargetDarwin(), isTargetELF(), isTargetWindows(), llvm::CodeModel::Large, llvm::GlobalValue::mayBeOverridden(), and llvm::Reloc::Static.

Referenced by GVRequiresRegister(), llvm::X86TargetLowering::isLegalAddressingMode(), and llvm::X86ATTAsmPrinter::printOperand().

bool X86Subtarget::GVRequiresRegister ( const GlobalValue GV,
const TargetMachine TM,
bool  isDirectCall 
) const

True if accessing the GV requires a register. This is a superset of the cases where GVRequiresExtraLoad is true. Some variations of PIC require a register, but not an extra load.

True if accessing the GV requires a register. This is a superset of the cases where GVRequiresExtraLoad is true. Some variations of PIC require a register, but not an extra load.

Definition at line 72 of file X86Subtarget.cpp.

References llvm::TargetMachine::getRelocationModel(), GVRequiresExtraLoad(), llvm::GlobalValue::hasExternalLinkage(), llvm::GlobalValue::hasInternalLinkage(), and llvm::Reloc::PIC_.

Referenced by llvm::X86TargetLowering::isLegalAddressingMode().

const char * X86Subtarget::getBZeroEntry (  )  const

This function returns the name of a function which has an interface like the non-standard bzero function, if such a function exists on the current subtarget and it is considered prefereable over memset with zero passed as the second argument. Otherwise it returns null.

getBZeroEntry - This function returns the name of a function which has an interface like the non-standard bzero function, if such a function exists on the current subtarget and it is considered prefereable over memset with zero passed as the second argument. Otherwise it returns null.

Definition at line 90 of file X86Subtarget.cpp.

References getDarwinVers().

unsigned X86Subtarget::getSpecialAddressLatency (  )  const [virtual]

getSpecialAddressLatency - For targets where it is beneficial to backschedule instructions that compute addresses, return a value indicating the number of scheduling cycles of backscheduling that should be attempted.

getSpecialAddressLatency - For targets where it is beneficial to backschedule instructions that compute addresses, return a value indicating the number of scheduling cycles of backscheduling that should be attempted.

Reimplemented from llvm::TargetSubtarget.

Definition at line 102 of file X86Subtarget.cpp.


Member Data Documentation

AsmFlavor - Which x86 asm dialect to use.

Definition at line 49 of file X86Subtarget.h.

Referenced by getAsmFlavor(), isFlavorAtt(), isFlavorIntel(), and X86Subtarget().

PICStyle - Which PIC style to use

Definition at line 53 of file X86Subtarget.h.

Referenced by getPICStyle(), isPICStyleGOT(), isPICStyleRIPRel(), isPICStyleSet(), isPICStyleStub(), isPICStyleWinPIC(), and setPICStyle().

X86SSELevel - MMX, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or none supported.

Definition at line 57 of file X86Subtarget.h.

Referenced by AutoDetectSubtargetFeatures(), hasMMX(), hasSSE1(), hasSSE2(), hasSSE3(), hasSSE41(), hasSSE42(), hasSSSE3(), and X86Subtarget().

X863DNowLevel - 3DNow or 3DNow Athlon, or none supported.

Definition at line 61 of file X86Subtarget.h.

Referenced by has3DNow(), has3DNowA(), and X86Subtarget().

HasX86_64 - True if the processor supports X86-64 instructions.

Definition at line 65 of file X86Subtarget.h.

Referenced by AutoDetectSubtargetFeatures(), and X86Subtarget().

IsBTMemSlow - True if BT (bit test) of memory instructions are slow.

Definition at line 68 of file X86Subtarget.h.

Referenced by AutoDetectSubtargetFeatures(), and isBTMemSlow().

DarwinVers - Nonzero if this is a darwin platform: the numeric version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc.

Definition at line 72 of file X86Subtarget.h.

Referenced by getDarwinVers(), and X86Subtarget().

bool llvm::X86Subtarget::IsLinux [protected]

isLinux - true if this is a "linux" platform.

Definition at line 75 of file X86Subtarget.h.

Referenced by isLinux(), and X86Subtarget().

stackAlignment - The minimum alignment known to hold of the stack frame on entry to the function and which must be maintained by every function.

Definition at line 79 of file X86Subtarget.h.

Referenced by getStackAlignment(), and X86Subtarget().

Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.

Definition at line 83 of file X86Subtarget.h.

Referenced by getMaxInlineSizeThreshold().


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



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.