class X86TargetInfo

Declaration

class X86TargetInfo : public TargetInfo { /* full declaration omitted */ };

Description

Exposes information about the current target.

Declared at: clang/lib/Basic/Targets/X86.h:51

Inherits from: TargetInfo

Member Variables

private enum X86SSEEnum SSELevel = NoSSE
private enum MMX3DNowEnum MMX3DNowLevel = NoMMX3DNow
private enum XOPEnum XOPLevel = NoXOP
private bool HasAES = false
private bool HasVAES = false
private bool HasPCLMUL = false
private bool HasVPCLMULQDQ = false
private bool HasGFNI = false
private bool HasLZCNT = false
private bool HasRDRND = false
private bool HasFSGSBASE = false
private bool HasBMI = false
private bool HasBMI2 = false
private bool HasPOPCNT = false
private bool HasRTM = false
private bool HasPRFCHW = false
private bool HasRDSEED = false
private bool HasADX = false
private bool HasTBM = false
private bool HasLWP = false
private bool HasFMA = false
private bool HasF16C = false
private bool HasAVX512CD = false
private bool HasAVX512VPOPCNTDQ = false
private bool HasAVX512VNNI = false
private bool HasAVX512FP16 = false
private bool HasAVX512BF16 = false
private bool HasAVX512ER = false
private bool HasAVX512PF = false
private bool HasAVX512DQ = false
private bool HasAVX512BITALG = false
private bool HasAVX512BW = false
private bool HasAVX512VL = false
private bool HasAVX512VBMI = false
private bool HasAVX512VBMI2 = false
private bool HasAVX512IFMA = false
private bool HasAVX512VP2INTERSECT = false
private bool HasSHA = false
private bool HasSHSTK = false
private bool HasSGX = false
private bool HasCX8 = false
private bool HasCX16 = false
private bool HasFXSR = false
private bool HasXSAVE = false
private bool HasXSAVEOPT = false
private bool HasXSAVEC = false
private bool HasXSAVES = false
private bool HasMWAITX = false
private bool HasCLZERO = false
private bool HasCLDEMOTE = false
private bool HasPCONFIG = false
private bool HasPKU = false
private bool HasCLFLUSHOPT = false
private bool HasCLWB = false
private bool HasMOVBE = false
private bool HasPREFETCHWT1 = false
private bool HasRDPID = false
private bool HasRDPRU = false
private bool HasRetpolineExternalThunk = false
private bool HasLAHFSAHF = false
private bool HasWBNOINVD = false
private bool HasWAITPKG = false
private bool HasMOVDIRI = false
private bool HasMOVDIR64B = false
private bool HasPTWRITE = false
private bool HasINVPCID = false
private bool HasENQCMD = false
private bool HasKL = false
private bool HasWIDEKL = false
private bool HasHRESET = false
private bool HasAVXVNNI = false
private bool HasAMXTILE = false
private bool HasAMXINT8 = false
private bool HasAMXBF16 = false
private bool HasSERIALIZE = false
private bool HasTSXLDTRK = false
private bool HasUINTR = false
private bool HasCRC32 = false
private bool HasX87 = false
protected llvm::X86::CPUKind CPU = llvm::X86::CK_None
protected enum FPMathKind FPMath = FP_Default

Inherited from TargetInfo:

protected BigEndian
protected TLSSupported
protected VLASupported
protected NoAsmVariants
protected HasLegalHalfType
protected HasFloat128
protected HasFloat16
protected HasBFloat16
protected HasIbm128
protected HasLongDouble
protected HasFPReturn
protected HasStrictFP
protected MaxAtomicPromoteWidth
protected MaxAtomicInlineWidth
protected SimdDefaultAlign
protected DataLayoutString
protected UserLabelPrefix
protected MCountName
protected RegParmMax
protected SSERegParmMax
protected TheCXXABI
protected AddrSpaceMap
protected ProgramAddrSpace
protected PlatformName
protected PlatformMinVersion
protected HasAlignMac68kSupport
protected RealTypeUsesObjCFPRetMask
protected ComplexLongDoubleUsesFP2Ret
protected HasBuiltinMSVaList
protected IsRenderScriptTarget
protected HasAArch64SVETypes
protected HasRISCVVTypes
protected AllowAMDGPUUnsafeFPAtomics
protected ARMCDECoprocMask
protected MaxOpenCLWorkGroupSize
protected MaxBitIntWidth
protected DarwinTargetVariantTriple
protected UseAddrSpaceMapMangling

Inherited from TransferrableTargetInfo:

public PointerWidth
public PointerAlign
public BoolWidth
public BoolAlign
public IntWidth
public IntAlign
public HalfWidth
public HalfAlign
public BFloat16Width
public BFloat16Align
public FloatWidth
public FloatAlign
public DoubleWidth
public DoubleAlign
public LongDoubleWidth
public LongDoubleAlign
public Float128Align
public Ibm128Align
public LargeArrayMinWidth
public LargeArrayAlign
public LongWidth
public LongAlign
public LongLongWidth
public LongLongAlign
public ShortAccumWidth
public ShortAccumAlign
public AccumWidth
public AccumAlign
public LongAccumWidth
public LongAccumAlign
public ShortFractWidth
public ShortFractAlign
public FractWidth
public FractAlign
public LongFractWidth
public LongFractAlign
public PaddingOnUnsignedFixedPoint
public ShortAccumScale
public AccumScale
public LongAccumScale
public DefaultAlignForAttributeAligned
public MinGlobalAlign
public SuitableAlign
public NewAlign
public MaxVectorAlign
public MaxTLSAlign
public HalfFormat
public BFloat16Format
public FloatFormat
public DoubleFormat
public LongDoubleFormat
public Float128Format
public Ibm128Format
protected SizeType
protected IntMaxType
protected PtrDiffType
protected IntPtrType
protected WCharType
protected WIntType
protected Char16Type
protected Char32Type
protected Int64Type
protected Int16Type
protected SigAtomicType
protected ProcessIDType
protected UseSignedCharForObjCBool
protected UseBitFieldTypeAlignment
protected UseZeroLengthBitfieldAlignment
protected UseLeadingZeroLengthBitfield
protected UseExplicitBitFieldAlignment
protected ZeroLengthBitfieldBoundary
protected MaxAlignedAttribute

Method Overview

Inherited from TargetInfo:

Methods

char CPUSpecificManglingCharacter(
    llvm::StringRef Name) const

Declared at: clang/lib/Basic/Targets/X86.h:202

Parameters

llvm::StringRef Name

X86TargetInfo(const llvm::Triple& Triple,
              const clang::TargetOptions&)

Declared at: clang/lib/Basic/Targets/X86.h:157

Parameters

const llvm::Triple& Triple
const clang::TargetOptions&

bool checkArithmeticFenceSupported() const

Description

Controls if __arithmetic_fence is supported in the targeted backend.

Declared at: clang/lib/Basic/Targets/X86.h:380

bool checkCFProtectionBranchSupported(
    clang::DiagnosticsEngine& Diags) const

Description

Check if the target supports CFProtection branch.

Declared at: clang/lib/Basic/Targets/X86.h:240

Parameters

clang::DiagnosticsEngine& Diags

bool checkCFProtectionReturnSupported(
    clang::DiagnosticsEngine& Diags) const

Description

Check if the target supports CFProtection branch.

Declared at: clang/lib/Basic/Targets/X86.h:235

Parameters

clang::DiagnosticsEngine& Diags

clang::TargetInfo::CallingConvCheckResult
checkCallingConvention(
    clang::CallingConv CC) const

Description

Determines whether a given calling convention is valid for the target. A calling convention can either be accepted, produce a warning and be substituted with the default calling convention, or (someday) produce an error (such as using thiscall on a non-instance function).

Declared at: clang/lib/Basic/Targets/X86.h:358

Parameters

clang::CallingConv CC

std::string convertConstraint(
    const char*& Constraint) const

Declared at: clang/lib/Basic/Targets/X86.h:247

Parameters

const char*& Constraint

void fillValidCPUList(
    SmallVectorImpl<llvm::StringRef>& Values)
    const

Description

Fill a SmallVectorImpl with the valid values to setCPU.

Declared at: clang/lib/Basic/Targets/X86.h:341

Parameters

SmallVectorImpl<llvm::StringRef>& Values

void fillValidTuneCPUList(
    SmallVectorImpl<llvm::StringRef>& Values)
    const

Description

Fill a SmallVectorImpl with the valid values for tuning CPU.

Declared at: clang/lib/Basic/Targets/X86.h:342

Parameters

SmallVectorImpl<llvm::StringRef>& Values

llvm::StringRef getABI() const

Description

Get the ABI currently in use.

Declared at: clang/lib/Basic/Targets/X86.h:311

const char* getBFloat16Mangling() const

Description

Return the mangled code of bfloat.

Declared at: clang/lib/Basic/Targets/X86.h:402

Optional<unsigned int> getCPUCacheLineSize() const

Declared at: clang/lib/Basic/Targets/X86.h:210

void getCPUSpecificCPUDispatchFeatures(
    llvm::StringRef Name,
    llvm::SmallVectorImpl<StringRef>& Features)
    const

Declared at: clang/lib/Basic/Targets/X86.h:204

Parameters

llvm::StringRef Name
llvm::SmallVectorImpl<StringRef>& Features

llvm::StringRef getCPUSpecificTuneName(
    llvm::StringRef Name) const

Declared at: clang/lib/Basic/Targets/X86.h:208

Parameters

llvm::StringRef Name

const char* getClobbers() const

Description

Returns a string of target-specific clobbers, in LLVM format.

Declared at: clang/lib/Basic/Targets/X86.h:248

llvm::StringRef getConstraintRegister(
    llvm::StringRef Constraint,
    llvm::StringRef Expression) const

Description

Extracts a register from the passed constraint (if it is a single-register constraint) and the asm label expression related to a variable in the input or output list of an inline asm statement. This function is used by Sema in order to diagnose conflicts between the clobber list and the input/output lists.

Declared at: clang/lib/Basic/Targets/X86.h:252

Parameters

llvm::StringRef Constraint
llvm::StringRef Expression

clang::CallingConv getDefaultCallingConv() const

Description

Gets the default calling convention for the given target and declaration context.

Declared at: clang/lib/Basic/Targets/X86.h:382

LangOptions::FPEvalMethodKind getFPEvalMethod()
    const

Description

Return the value for the C99 FLT_EVAL_METHOD macro.

Declared at: clang/lib/Basic/Targets/X86.h:175

ArrayRef<TargetInfo::AddlRegName>
getGCCAddlRegNames() const

Declared at: clang/lib/Basic/Targets/X86.h:190

ArrayRef<TargetInfo::GCCRegAlias>
getGCCRegAliases() const

Declared at: clang/lib/Basic/Targets/X86.h:186

ArrayRef<const char*> getGCCRegNames() const

Declared at: clang/lib/Basic/Targets/X86.h:184

const char* getLongDoubleMangling() const

Description

Return the mangled code of long double.

Declared at: clang/lib/Basic/Targets/X86.h:171

uint64_t getPointerAlignV(
    unsigned int AddrSpace) const

Declared at: clang/lib/Basic/Targets/X86.h:398

Parameters

unsigned int AddrSpace

uint64_t getPointerWidthV(
    unsigned int AddrSpace) const

Declared at: clang/lib/Basic/Targets/X86.h:390

Parameters

unsigned int AddrSpace

void getTargetDefines(
    const clang::LangOptions& Opts,
    clang::MacroBuilder& Builder) const

Description

X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this particular subtarget.

Declared at: clang/lib/Basic/Targets/X86.h:293

Parameters

const clang::LangOptions& Opts
clang::MacroBuilder& Builder

bool handleTargetFeatures(
    std::vector<std::string>& Features,
    clang::DiagnosticsEngine& Diags)

Description

handleTargetFeatures - Perform initialization based on the user configured set of features.

Declared at: clang/lib/Basic/Targets/X86.h:308

Parameters

std::vector<std::string>& Features
clang::DiagnosticsEngine& Diags

bool hasFeature(llvm::StringRef Feature) const

Description

Determine whether the given target has the given feature.

Declared at: clang/lib/Basic/Targets/X86.h:306

Parameters

llvm::StringRef Feature

bool hasSjLjLowering() const

Description

Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp.

Declared at: clang/lib/Basic/Targets/X86.h:386

bool initFeatureMap(
    llvm::StringMap<bool>& Features,
    clang::DiagnosticsEngine& Diags,
    llvm::StringRef CPU,
    const std::vector<std::string>& FeaturesVec)
    const

Description

Initialize the map with the default set of target features for the CPU this should include all legal feature strings on the target.

Declared at: clang/lib/Basic/Targets/X86.h:300

Parameters

llvm::StringMap<bool>& Features
clang::DiagnosticsEngine& Diags
llvm::StringRef CPU
const std::vector<std::string>& FeaturesVec

Returns

False on error (invalid features).

bool isSPRegName(llvm::StringRef RegName) const

Declared at: clang/lib/Basic/Targets/X86.h:192

Parameters

llvm::StringRef RegName

bool isValidCPUName(llvm::StringRef Name) const

Description

brief Determine whether this TargetInfo supports the given CPU name.

Declared at: clang/lib/Basic/Targets/X86.h:326

Parameters

llvm::StringRef Name

bool isValidFeatureName(
    llvm::StringRef Name) const

Description

Determine whether this TargetInfo supports the given feature.

Declared at: clang/lib/Basic/Targets/X86.h:304

Parameters

llvm::StringRef Name

bool isValidTuneCPUName(
    llvm::StringRef Name) const

Description

brief Determine whether this TargetInfo supports the given CPU name for

Declared at: clang/lib/Basic/Targets/X86.h:331

Parameters

llvm::StringRef Name

unsigned int multiVersionSortPriority(
    llvm::StringRef Name) const

Declared at: clang/lib/Basic/Targets/X86.h:350

Parameters

llvm::StringRef Name

bool setCPU(const std::string& Name)

Description

Target the specified CPU.

Declared at: clang/lib/Basic/Targets/X86.h:344

Parameters

const std::string& Name

Returns

False on error (invalid CPU name).

bool setFPMath(llvm::StringRef Name)

Description

Use the specified unit for FP math.

Declared at: clang/lib/Basic/Targets/X86.h:352

Parameters

llvm::StringRef Name

Returns

False on error (invalid unit name).

void setFeatureEnabled(
    llvm::StringMap<bool>& Features,
    llvm::StringRef Name,
    bool Enabled) const

Description

Enable or disable a specific target feature; the feature name must be valid.

Declared at: clang/lib/Basic/Targets/X86.h:296

Parameters

llvm::StringMap<bool>& Features
llvm::StringRef Name
bool Enabled

void setSupportedOpenCLOpts()

Description

Set supported OpenCL extensions and optional core features.

Declared at: clang/lib/Basic/Targets/X86.h:388

bool supportSourceEvalMethod() const

Declared at: clang/lib/Basic/Targets/X86.h:182

bool supportsExtendIntArgs() const

Description

Whether the option -fextend-arguments={32,64} is supported on the target.

Declared at: clang/lib/Basic/Targets/X86.h:354

bool supportsTargetAttributeTune() const

Description

brief Determine whether this TargetInfo supports tune in target attribute.

Declared at: clang/lib/Basic/Targets/X86.h:322

bool useFP16ConversionIntrinsics() const

Description

Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp16. FIXME: This function should be removed once all targets stop using the conversion intrinsics.

Declared at: clang/lib/Basic/Targets/X86.h:289

bool validateAsmConstraint(
    const char*& Name,
    TargetInfo::ConstraintInfo& info) const

Declared at: clang/lib/Basic/Targets/X86.h:212

Parameters

const char*& Name
TargetInfo::ConstraintInfo& info

bool validateCPUSpecificCPUDispatch(
    llvm::StringRef Name) const

Declared at: clang/lib/Basic/Targets/X86.h:200

Parameters

llvm::StringRef Name

bool validateCpuIs(llvm::StringRef Name) const

Declared at: clang/lib/Basic/Targets/X86.h:198

Parameters

llvm::StringRef Name

bool validateCpuSupports(
    llvm::StringRef Name) const

Declared at: clang/lib/Basic/Targets/X86.h:196

Parameters

llvm::StringRef Name

bool validateGlobalRegisterVariable(
    llvm::StringRef RegName,
    unsigned int RegSize,
    bool& HasSizeMismatch) const

Description

Validate register name used for global register variables. This function returns true if the register passed in RegName can be used for global register variables on this target. In addition, it returns true in HasSizeMismatch if the size of the register doesn't match the variable size passed in RegSize.

Declared at: clang/lib/Basic/Targets/X86.h:215

Parameters

llvm::StringRef RegName
unsigned int RegSize
bool& HasSizeMismatch

bool validateInputSize(
    const llvm::StringMap<bool>& FeatureMap,
    llvm::StringRef Constraint,
    unsigned int Size) const

Declared at: clang/lib/Basic/Targets/X86.h:231

Parameters

const llvm::StringMap<bool>& FeatureMap
llvm::StringRef Constraint
unsigned int Size

virtual bool validateOperandSize(
    const llvm::StringMap<bool>& FeatureMap,
    llvm::StringRef Constraint,
    unsigned int Size) const

Declared at: clang/lib/Basic/Targets/X86.h:244

Parameters

const llvm::StringMap<bool>& FeatureMap
llvm::StringRef Constraint
unsigned int Size

bool validateOutputSize(
    const llvm::StringMap<bool>& FeatureMap,
    llvm::StringRef Constraint,
    unsigned int Size) const

Declared at: clang/lib/Basic/Targets/X86.h:228

Parameters

const llvm::StringMap<bool>& FeatureMap
llvm::StringRef Constraint
unsigned int Size