34 #define DEBUG_TYPE "subtarget"
36 #define GET_SUBTARGETINFO_TARGET_DESC
37 #define GET_SUBTARGETINFO_CTOR
38 #include "X86GenSubtargetInfo.inc"
44 cl::desc(
"Enable early if-conversion on X86"));
86 assert(
isTargetELF() &&
"Unknown rip-relative target");
181 std::string CPUName = CPU;
187 std::string FullFS =
FS;
190 FullFS =
"+64bit,+sse2," + FullFS;
192 FullFS =
"+64bit,+sse2";
198 InstrItins = getInstrItineraryForCPU(CPUName);
203 ToggleFeature(X86::Mode64Bit);
204 else if (In32BitMode)
205 ToggleFeature(X86::Mode32Bit);
206 else if (In16BitMode)
207 ToggleFeature(X86::Mode16Bit);
215 "64-bit code requested on a subtarget that doesn't support it!");
219 if (StackAlignOverride)
226 void X86Subtarget::initializeEnvironment() {
281 initializeEnvironment();
282 initSubtargetFeatures(CPU, FS);
288 unsigned StackAlignOverride)
290 PICStyle(PICStyles::
None), TargetTriple(TT),
291 StackAlignOverride(StackAlignOverride),
292 In64BitMode(TargetTriple.getArch() ==
Triple::x86_64),
293 In32BitMode(TargetTriple.getArch() ==
Triple::
x86 &&
294 TargetTriple.getEnvironment() !=
Triple::CODE16),
295 In16BitMode(TargetTriple.getArch() ==
Triple::
x86 &&
296 TargetTriple.getEnvironment() ==
Triple::CODE16),
297 TSInfo(), InstrInfo(initializeSubtargetDependencies(CPU, FS)),
298 TLInfo(TM, *this), FrameLowering(*this, getStackAlignment()) {
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool HasPRFCHW
Processor has PRFCHW instructions.
bool HasTBM
Target has TBM instructions.
bool HasBMI2
Processor has BMI2 instructions.
Reloc::Model getRelocationModel() const
Returns the code generation relocation model.
bool HasCDI
Processor has AVX-512 Conflict Detection Instructions.
bool HasAES
Target has AES instructions.
void setPICStyle(PICStyles::Style Style)
bool HasERI
Processor has AVX-512 Exponential and Reciprocal Instructions.
unsigned char ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const
ClassifyGlobalReference - Classify a global variable reference for the current subtarget according to...
unsigned MaxInlineSizeThreshold
Max.
bool LEAUsesAG
True if the LEA instruction inputs have to be ready at address generation (AG) time.
static cl::opt< bool > X86EarlyIfConv("x86-early-ifcvt", cl::Hidden, cl::desc("Enable early if-conversion on X86"))
bool IsUAMem32Slow
True if unaligned 32-byte memory accesses are slow.
MO_GOTPCREL - On a symbol operand this indicates that the immediate is offset to the GOT entry for th...
bool HasRDRAND
True if the processor has the RDRAND instruction.
bool HasFMA
Target has 3-operand fused multiply-add.
bool isMacOSX() const
isMacOSX - Is this a Mac OS X triple.
MO_DARWIN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is actually...
bool isTargetSolaris() const
bool hasCommonLinkage() const
bool hasDefaultVisibility() const
bool isTargetDarwin() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool HasPOPCNT
True if the processor supports POPCNT.
This file contains the simple types necessary to represent the attributes associated with functions a...
const Triple & getTargetTriple() const
bool HasSlowDivide32
True if 8-bit divisions are significantly faster than 32-bit divisions and should be used when possib...
bool isStrongDefinitionForLinker() const
Returns true if this global's definition will be the one chosen by the linker.
bool HasPFI
Processor has AVX-512 PreFetch Instructions.
unsigned isMacOSXVersionLT(unsigned Major, unsigned Minor=0, unsigned Micro=0) const
isMacOSXVersionLT - Comparison function for checking OS X version compatibility, which handles suppor...
MO_GOT - On a symbol operand this indicates that the immediate is the offset to the GOT entry for the...
bool is64Bit() const
Is this x86_64? (disregarding specific ABI / programming model)
bool HasCmpxchg16b
True if this processor has the CMPXCHG16B instruction; this is true for most x86-64 chips...
bool isPICStyleRIPRel() const
bool UseLeaForSP
True if the LEA instruction should be used for adjusting the stack pointer.
X863DNowEnum X863DNowLevel
3DNow, 3DNow Athlon, or none supported.
MO_DARWIN_NONLAZY - On a symbol operand "FOO", this indicates that the reference is actually to the "...
bool HasSSE4A
True if the processor supports SSE4A instructions.
bool CallRegIndirect
True if the Calls with memory reference should be converted to a register-based indirect call...
bool HasLZCNT
Processor has LZCNT instruction.
bool HasF16C
Processor has 16-bit floating point conversion instructions.
bool SlowIncDec
True if INC and DEC instructions are slow when writing to flags.
MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE - On a symbol operand "FOO", this indicates that the reference is a...
unsigned char ClassifyBlockAddressReference() const
Classify a blockaddress reference for the current subtarget according to how we should reference it i...
CodeModel::Model getCodeModel() const
Returns the code model.
bool isTargetCOFF() const
bool hasSinCos() const
This function returns true if the target has sincos() routine in its compiler runtime or math librari...
bool isPICStyleStubPIC() const
bool IsBTMemSlow
True if BT (bit test) of memory instructions are slow.
bool HasADX
Processor has ADX instructions.
bool HasBWI
Processor has AVX-512 Byte and Word instructions.
bool hasHiddenVisibility() const
bool isTargetWin32() const
bool IsLegalToCallImmediateAddr(const TargetMachine &TM) const
Return true if the subtarget allows calls to immediate address.
bool HasXOP
Target has XOP instructions.
bool SlowLEA
True if the LEA instruction with certain arguments is slow.
bool HasDQI
Processor has AVX-512 Doubleword and Quadword instructions.
bool isPICStyleStubNoDynamic() const
bool enableEarlyIfConversion() const override
bool IsSHLDSlow
True if SHLD instructions are slow.
bool isPICStyleGOT() const
InstrItineraryData InstrItins
Instruction itineraries for scheduling.
bool HasFSGSBase
Processor has FS/GS base insturctions.
Triple - Helper class for working with autoconf configuration names.
X86Subtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const X86TargetMachine &TM, unsigned StackAlignOverride)
This constructor initializes the data members to match that of the specified triple.
bool HasMPX
Processot supports MPX - Memory Protection Extensions.
bool hasDLLImportStorageClass() const
bool HasX86_64
True if the processor supports X86-64 instructions.
bool HasSSEUnalignedMem
True if SSE operations can have unaligned memory operands.
bool HasSHA
Processor has SHA instructions.
bool HasBMI
Processor has BMI1 instructions.
bool isTargetLinux() const
bool HasHLE
Processor has HLE.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool UseSoftFloat
Use software floating point for code generation.
bool HasPCLMUL
Target has carry-less multiplication.
MO_GOTOFF - On a symbol operand this indicates that the immediate is the offset to the location of th...
X86SSEEnum X86SSELevel
MMX, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or none supported.
bool hasLocalLinkage() const
bool HasCMov
True if this processor has conditional move instructions (generally pentium pro+).
bool isTargetWin64() const
bool HasFMA4
Target has 4-operand fused multiply-add.
bool HasRTM
Processor has RTM instructions.
Primary interface to the complete machine description for the target machine.
bool HasVLX
Processor has AVX-512 Vector Length eXtenstions.
const char * getBZeroEntry() const
This function returns the name of a function which has an interface like the non-standard bzero funct...
MO_PIC_BASE_OFFSET - On a symbol operand this indicates that the immediate should get the value of th...
StringRef - Represent a constant reference to a string, i.e.
bool HasRDSEED
Processor has RDSEED instructions.
unsigned stackAlignment
The minimum alignment known to hold of the stack frame on entry to the function and which must be mai...
bool IsUAMemFast
True if unaligned memory access is fast.
bool isDeclarationForLinker() const
bool HasMOVBE
True if the processor has the MOVBE instruction.
bool PadShortFunctions
True if the short functions should be padded to prevent a stall when returning too early...
MO_DLLIMPORT - On a symbol operand "FOO", this indicates that the reference is actually to the "__imp...
bool HasSlowDivide64
True if 16-bit divides are significantly faster than 64-bit divisions and should be used when possibl...