diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 11:06:01 +0000 |
commit | 486754660bb926339aefcf012a3f848592babb8b (patch) | |
tree | ecdbc446c9876f4f120f701c243373cd3cb43db3 /include/clang/Basic | |
parent | 55e6d896ad333f07bb3b1ba487df214fc268a4ab (diff) |
Notes
Diffstat (limited to 'include/clang/Basic')
92 files changed, 6445 insertions, 4485 deletions
diff --git a/include/clang/Basic/ABI.h b/include/clang/Basic/ABI.h index 75e9faf4617e2..bd919ce24f81f 100644 --- a/include/clang/Basic/ABI.h +++ b/include/clang/Basic/ABI.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Enums/classes describing ABI related information about constructors, +/// Enums/classes describing ABI related information about constructors, /// destructors and thunks. /// //===----------------------------------------------------------------------===// @@ -21,7 +21,7 @@ namespace clang { -/// \brief C++ constructor types. +/// C++ constructor types. enum CXXCtorType { Ctor_Complete, ///< Complete object ctor Ctor_Base, ///< Base object ctor @@ -30,7 +30,7 @@ enum CXXCtorType { Ctor_DefaultClosure, ///< Default closure variant of a ctor }; -/// \brief C++ destructor types. +/// C++ destructor types. enum CXXDtorType { Dtor_Deleting, ///< Deleting dtor Dtor_Complete, ///< Complete object dtor @@ -38,29 +38,29 @@ enum CXXDtorType { Dtor_Comdat ///< The COMDAT used for dtors }; -/// \brief A return adjustment. +/// A return adjustment. struct ReturnAdjustment { - /// \brief The non-virtual adjustment from the derived object to its + /// The non-virtual adjustment from the derived object to its /// nearest virtual base. int64_t NonVirtual; - /// \brief Holds the ABI-specific information about the virtual return + /// Holds the ABI-specific information about the virtual return /// adjustment, if needed. union VirtualAdjustment { // Itanium ABI struct { - /// \brief The offset (in bytes), relative to the address point + /// The offset (in bytes), relative to the address point /// of the virtual base class offset. int64_t VBaseOffsetOffset; } Itanium; // Microsoft ABI struct { - /// \brief The offset (in bytes) of the vbptr, relative to the beginning + /// The offset (in bytes) of the vbptr, relative to the beginning /// of the derived class. uint32_t VBPtrOffset; - /// \brief Index of the virtual base in the vbtable. + /// Index of the virtual base in the vbtable. uint32_t VBIndex; } Microsoft; @@ -104,31 +104,31 @@ struct ReturnAdjustment { } }; -/// \brief A \c this pointer adjustment. +/// A \c this pointer adjustment. struct ThisAdjustment { - /// \brief The non-virtual adjustment from the derived object to its + /// The non-virtual adjustment from the derived object to its /// nearest virtual base. int64_t NonVirtual; - /// \brief Holds the ABI-specific information about the virtual this + /// Holds the ABI-specific information about the virtual this /// adjustment, if needed. union VirtualAdjustment { // Itanium ABI struct { - /// \brief The offset (in bytes), relative to the address point, + /// The offset (in bytes), relative to the address point, /// of the virtual call offset. int64_t VCallOffsetOffset; } Itanium; struct { - /// \brief The offset of the vtordisp (in bytes), relative to the ECX. + /// The offset of the vtordisp (in bytes), relative to the ECX. int32_t VtordispOffset; - /// \brief The offset of the vbptr of the derived class (in bytes), + /// The offset of the vbptr of the derived class (in bytes), /// relative to the ECX after vtordisp adjustment. int32_t VBPtrOffset; - /// \brief The offset (in bytes) of the vbase offset in the vbtable. + /// The offset (in bytes) of the vbase offset in the vbtable. int32_t VBOffsetOffset; } Microsoft; @@ -174,16 +174,16 @@ struct ThisAdjustment { class CXXMethodDecl; -/// \brief The \c this pointer adjustment as well as an optional return +/// The \c this pointer adjustment as well as an optional return /// adjustment for a thunk. struct ThunkInfo { - /// \brief The \c this pointer adjustment. + /// The \c this pointer adjustment. ThisAdjustment This; - /// \brief The return adjustment. + /// The return adjustment. ReturnAdjustment Return; - /// \brief Holds a pointer to the overridden method this thunk is for, + /// Holds a pointer to the overridden method this thunk is for, /// if needed by the ABI to distinguish different thunks with equal /// adjustments. Otherwise, null. /// CAUTION: In the unlikely event you need to sort ThunkInfos, consider using diff --git a/include/clang/Basic/AddressSpaces.h b/include/clang/Basic/AddressSpaces.h index 6b0090813e9b4..217fbd763ff2e 100644 --- a/include/clang/Basic/AddressSpaces.h +++ b/include/clang/Basic/AddressSpaces.h @@ -1,4 +1,4 @@ -//===--- AddressSpaces.h - Language-specific address spaces -----*- C++ -*-===// +//===- AddressSpaces.h - Language-specific address spaces -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,25 +6,25 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Provides definitions for the various language-specific address +/// Provides definitions for the various language-specific address /// spaces. -/// +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_ADDRESSSPACES_H #define LLVM_CLANG_BASIC_ADDRESSSPACES_H -#include <assert.h> +#include <cassert> namespace clang { -/// \brief Defines the address space values used by the address space qualifier +/// Defines the address space values used by the address space qualifier /// of QualType. /// enum class LangAS : unsigned { - // The default value 0 is the value used in QualType for the the situation + // The default value 0 is the value used in QualType for the situation // where there is no address space qualifier. Default = 0, @@ -51,7 +51,7 @@ enum class LangAS : unsigned { /// The type of a lookup table which maps from language-specific address spaces /// to target-specific ones. -typedef unsigned LangASMap[(unsigned)LangAS::FirstTargetAddressSpace]; +using LangASMap = unsigned[(unsigned)LangAS::FirstTargetAddressSpace]; /// \return whether \p AS is a target-specific address space rather than a /// clang AST address space @@ -71,4 +71,4 @@ inline LangAS getLangASFromTargetAS(unsigned TargetAS) { } // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_ADDRESSSPACES_H diff --git a/include/clang/Basic/AlignedAllocation.h b/include/clang/Basic/AlignedAllocation.h index b3496949f39ac..9751f41184477 100644 --- a/include/clang/Basic/AlignedAllocation.h +++ b/include/clang/Basic/AlignedAllocation.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines a function that returns the minimum OS versions supporting +/// Defines a function that returns the minimum OS versions supporting /// C++17's aligned allocation functions. /// //===----------------------------------------------------------------------===// @@ -16,24 +16,24 @@ #ifndef LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H #define LLVM_CLANG_BASIC_ALIGNED_ALLOCATION_H -#include "clang/Basic/VersionTuple.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/VersionTuple.h" namespace clang { -inline VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) { +inline llvm::VersionTuple alignedAllocMinVersion(llvm::Triple::OSType OS) { switch (OS) { default: break; case llvm::Triple::Darwin: case llvm::Triple::MacOSX: // Earliest supporting version is 10.13. - return VersionTuple(10U, 13U); + return llvm::VersionTuple(10U, 13U); case llvm::Triple::IOS: case llvm::Triple::TvOS: // Earliest supporting version is 11.0.0. - return VersionTuple(11U); + return llvm::VersionTuple(11U); case llvm::Triple::WatchOS: // Earliest supporting version is 4.0.0. - return VersionTuple(4U); + return llvm::VersionTuple(4U); } llvm_unreachable("Unexpected OS"); diff --git a/include/clang/Basic/AllDiagnostics.h b/include/clang/Basic/AllDiagnostics.h index 1c83e2d0f8a0b..20c29d459d229 100644 --- a/include/clang/Basic/AllDiagnostics.h +++ b/include/clang/Basic/AllDiagnostics.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Includes all the separate Diagnostic headers & some related helpers. +/// Includes all the separate Diagnostic headers & some related helpers. /// //===----------------------------------------------------------------------===// diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 8b84c4b8b50de..0bbe52bf5f36f 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -83,6 +83,9 @@ def LocalVar : SubsetSubject<Var, def NonParmVar : SubsetSubject<Var, [{S->getKind() != Decl::ParmVar}], "variables">; +def NonLocalVar : SubsetSubject<Var, + [{!S->hasLocalStorage()}], + "variables with non-local storage">; def NonBitField : SubsetSubject<Field, [{!S->isBitField()}], "non-bit-field non-static data members">; @@ -111,6 +114,9 @@ def SharedVar : SubsetSubject<Var, def GlobalVar : SubsetSubject<Var, [{S->hasGlobalStorage()}], "global variables">; +def InlineFunction : SubsetSubject<Function, + [{S->isInlineSpecified()}], "inline functions">; + // FIXME: this hack is needed because DeclNodes.td defines the base Decl node // type to be a class, not a definition. This makes it impossible to create an // attribute subject which accepts a Decl. Normally, this is not a problem, @@ -162,6 +168,13 @@ class UnsignedArgument<string name, bit opt = 0> : Argument<name, opt>; class VariadicUnsignedArgument<string name> : Argument<name, 1>; class VariadicExprArgument<string name> : Argument<name, 1>; class VariadicStringArgument<string name> : Argument<name, 1>; +class VariadicIdentifierArgument<string name> : Argument<name, 1>; + +// Like VariadicUnsignedArgument except values are ParamIdx. +class VariadicParamIdxArgument<string name> : Argument<name, 1>; + +// Like VariadicParamIdxArgument but for a single function parameter index. +class ParamIdxArgument<string name, bit opt = 0> : Argument<name, opt>; // A version of the form major.minor[.subminor]. class VersionArgument<string name, bit opt = 0> : Argument<name, opt>; @@ -172,7 +185,8 @@ class VersionArgument<string name, bit opt = 0> : Argument<name, opt>; class AlignedArgument<string name, bit opt = 0> : Argument<name, opt>; // A bool argument with a default value -class DefaultBoolArgument<string name, bit default> : BoolArgument<name, 1> { +class DefaultBoolArgument<string name, bit default, bit fake = 0> + : BoolArgument<name, 1, fake> { bit Default = default; } @@ -231,9 +245,12 @@ class GCC<string name> : Spelling<name, "GCC"> { let KnownToGCC = 1; } -// The Clang spelling implies GNU<name> and CXX11<"clang", name>. This spelling -// should be used for any Clang-specific attributes. -class Clang<string name> : Spelling<name, "Clang">; +// The Clang spelling implies GNU<name>, CXX11<"clang", name>, and optionally, +// C2x<"clang", name>. This spelling should be used for any Clang-specific +// attributes. +class Clang<string name, bit allowInC = 1> : Spelling<name, "Clang"> { + bit AllowInC = allowInC; +} class Accessor<string name, list<Spelling> spellings> { string Name = name; @@ -291,6 +308,7 @@ def TargetAVR : TargetArch<["avr"]>; def TargetMips32 : TargetArch<["mips", "mipsel"]>; def TargetAnyMips : TargetArch<["mips", "mipsel", "mips64", "mips64el"]>; def TargetMSP430 : TargetArch<["msp430"]>; +def TargetRISCV : TargetArch<["riscv32", "riscv64"]>; def TargetX86 : TargetArch<["x86"]>; def TargetAnyX86 : TargetArch<["x86", "x86_64"]>; def TargetWindows : TargetArch<["x86", "x86_64", "arm", "thumb", "aarch64"]> { @@ -438,9 +456,6 @@ class Attr { // Set to true if all of the attribute's arguments should be parsed in an // unevaluated context. bit ParseArgumentsAsUnevaluated = 0; - // Set to true if this attribute can be duplicated on a subject when merging - // attributes. By default, attributes are not merged. - bit DuplicatesAllowedWhileMerging = 0; // Set to true if this attribute meaningful when applied to or inherited // in a class template definition. bit MeaningfulToClassTemplateDefinition = 0; @@ -475,7 +490,16 @@ class TypeAttr : Attr { class StmtAttr : Attr; /// An inheritable attribute is inherited by later redeclarations. -class InheritableAttr : Attr; +class InheritableAttr : Attr { + // Set to true if this attribute can be duplicated on a subject when inheriting + // attributes from prior declarations. + bit InheritEvenIfAlreadyPresent = 0; +} + +/// Some attributes, like calling conventions, can appear in either the +/// declaration or the type position. These attributes are morally type +/// attributes, but have historically been written on declarations. +class DeclOrTypeAttr : InheritableAttr; /// A target-specific attribute. This class is meant to be used as a mixin /// with InheritableAttr or Attr depending on the attribute's needs. @@ -487,7 +511,7 @@ class TargetSpecificAttr<TargetSpec target> { // "exists" for a given target. So two target-specific attributes can share // the same name when they exist in different targets. To support this, a // Kind can be explicitly specified for a target-specific attribute. This - // corresponds to the AttributeList::AT_* enum that is generated and it + // corresponds to the ParsedAttr::AT_* enum that is generated and it // should contain a shared value between the attributes. // // Target-specific attributes which use this feature should ensure that the @@ -584,6 +608,12 @@ def AlwaysInline : InheritableAttr { let Documentation = [Undocumented]; } +def Artificial : InheritableAttr { + let Spellings = [GCC<"artificial">]; + let Subjects = SubjectList<[InlineFunction], WarnDiag>; + let Documentation = [ArtificialDocs]; +} + def XRayInstrument : InheritableAttr { let Spellings = [Clang<"xray_always_instrument">, Clang<"xray_never_instrument">]; @@ -598,6 +628,12 @@ def XRayInstrument : InheritableAttr { def XRayLogArgs : InheritableAttr { let Spellings = [Clang<"xray_log_args">]; let Subjects = SubjectList<[Function, ObjCMethod]>; + // This argument is a count not an index, so it has the same encoding (base + // 1 including C++ implicit this parameter) at the source and LLVM levels of + // representation, so ParamIdxArgument is inappropriate. It is never used + // at the AST level of representation, so it never needs to be adjusted not + // to include any C++ implicit this parameter. Thus, we just store it and + // use it as an unsigned that never needs adjustment. let Args = [UnsignedArgument<"ArgumentCount">]; let Documentation = [XRayDocs]; } @@ -660,9 +696,7 @@ def AsmLabel : InheritableAttr { } def Availability : InheritableAttr { - // TODO: does not have a [[]] spelling because it requires custom parsing - // support. - let Spellings = [GNU<"availability">]; + let Spellings = [Clang<"availability">]; let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">, VersionArgument<"deprecated">, VersionArgument<"obsoleted">, BoolArgument<"unavailable">, StringArgument<"message">, @@ -706,7 +740,7 @@ static llvm::StringRef canonicalizePlatformName(llvm::StringRef Platform) { .Default(Platform); } }]; let HasCustomParsing = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Named]>; let Documentation = [AvailabilityDocs]; } @@ -739,7 +773,7 @@ def CarriesDependency : InheritableParamAttr { let Documentation = [CarriesDependencyDocs]; } -def CDecl : InheritableAttr { +def CDecl : DeclOrTypeAttr { let Spellings = [GCC<"cdecl">, Keyword<"__cdecl">, Keyword<"_cdecl">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; @@ -813,6 +847,27 @@ def Constructor : InheritableAttr { let Documentation = [Undocumented]; } +def CPUSpecific : InheritableAttr { + let Spellings = [Clang<"cpu_specific">]; + let Args = [VariadicIdentifierArgument<"Cpus">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [CPUSpecificCPUDispatchDocs]; + let AdditionalMembers = [{ + unsigned ActiveArgIndex = 0; + + IdentifierInfo *getCurCPUName() const { + return *(cpus_begin() + ActiveArgIndex); + } + }]; +} + +def CPUDispatch : InheritableAttr { + let Spellings = [Clang<"cpu_dispatch">]; + let Args = [VariadicIdentifierArgument<"Cpus">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [CPUSpecificCPUDispatchDocs]; +} + // CUDA attributes are spelled __attribute__((attr)) or __declspec(__attr__), // and they do not receive a [[]] spelling. def CUDAConstant : InheritableAttr { @@ -1007,7 +1062,8 @@ def EmptyBases : InheritableAttr, TargetSpecificAttr<TargetMicrosoftCXXABI> { def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; let Subjects = SubjectList<[Function]>; - let Args = [IntArgument<"ElemSizeParam">, IntArgument<"NumElemsParam", 1>]; + let Args = [ParamIdxArgument<"ElemSizeParam">, + ParamIdxArgument<"NumElemsParam", /*opt*/ 1>]; let TemplateDependent = 1; let Documentation = [AllocSizeDocs]; } @@ -1039,14 +1095,14 @@ def FallThrough : StmtAttr { let Documentation = [FallthroughDocs]; } -def FastCall : InheritableAttr { +def FastCall : DeclOrTypeAttr { let Spellings = [GCC<"fastcall">, Keyword<"__fastcall">, Keyword<"_fastcall">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [FastCallDocs]; } -def RegCall : InheritableAttr { +def RegCall : DeclOrTypeAttr { let Spellings = [GCC<"regcall">, Keyword<"__regcall">]; let Documentation = [RegCallDocs]; } @@ -1094,7 +1150,7 @@ def Format : InheritableAttr { def FormatArg : InheritableAttr { let Spellings = [GCC<"format_arg">]; - let Args = [IntArgument<"FormatIdx">]; + let Args = [ParamIdxArgument<"FormatIdx">]; let Subjects = SubjectList<[ObjCMethod, HasFunctionProto]>; let Documentation = [Undocumented]; } @@ -1155,6 +1211,15 @@ def LayoutVersion : InheritableAttr, TargetSpecificAttr<TargetMicrosoftCXXABI> { let Documentation = [LayoutVersionDocs]; } +def TrivialABI : InheritableAttr { + // This attribute does not have a C [[]] spelling because it requires the + // CPlusPlus language option. + let Spellings = [Clang<"trivial_abi", 0>]; + let Subjects = SubjectList<[CXXRecord]>; + let Documentation = [TrivialABIDocs]; + let LangOpts = [CPlusPlus]; +} + def MaxFieldAlignment : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; @@ -1169,7 +1234,7 @@ def MayAlias : InheritableAttr { let Documentation = [Undocumented]; } -def MSABI : InheritableAttr { +def MSABI : DeclOrTypeAttr { let Spellings = [GCC<"ms_abi">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [MSABIDocs]; @@ -1310,6 +1375,17 @@ def NoMicroMips : InheritableAttr, TargetSpecificAttr<TargetMips32> { let Documentation = [MicroMipsDocs]; } +def RISCVInterrupt : InheritableAttr, TargetSpecificAttr<TargetRISCV> { + let Spellings = [GCC<"interrupt">]; + let Subjects = SubjectList<[Function]>; + let Args = [EnumArgument<"Interrupt", "InterruptType", + ["user", "supervisor", "machine"], + ["user", "supervisor", "machine"], + 1>]; + let ParseKind = "Interrupt"; + let Documentation = [RISCVInterruptDocs]; +} + // This is not a TargetSpecificAttr so that is silently accepted and // ignored on other targets as encouraged by the OpenCL spec. // @@ -1328,28 +1404,28 @@ def NoMicroMips : InheritableAttr, TargetSpecificAttr<TargetMips32> { // this should be rejected on non-kernels. def AMDGPUFlatWorkGroupSize : InheritableAttr { - let Spellings = [Clang<"amdgpu_flat_work_group_size">]; + let Spellings = [Clang<"amdgpu_flat_work_group_size", 0>]; let Args = [UnsignedArgument<"Min">, UnsignedArgument<"Max">]; let Documentation = [AMDGPUFlatWorkGroupSizeDocs]; let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">; } def AMDGPUWavesPerEU : InheritableAttr { - let Spellings = [Clang<"amdgpu_waves_per_eu">]; + let Spellings = [Clang<"amdgpu_waves_per_eu", 0>]; let Args = [UnsignedArgument<"Min">, UnsignedArgument<"Max", 1>]; let Documentation = [AMDGPUWavesPerEUDocs]; let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">; } def AMDGPUNumSGPR : InheritableAttr { - let Spellings = [Clang<"amdgpu_num_sgpr">]; + let Spellings = [Clang<"amdgpu_num_sgpr", 0>]; let Args = [UnsignedArgument<"NumSGPR">]; let Documentation = [AMDGPUNumSGPRNumVGPRDocs]; let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">; } def AMDGPUNumVGPR : InheritableAttr { - let Spellings = [Clang<"amdgpu_num_vgpr">]; + let Spellings = [Clang<"amdgpu_num_vgpr", 0>]; let Args = [UnsignedArgument<"NumVGPR">]; let Documentation = [AMDGPUNumSGPRNumVGPRDocs]; let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">; @@ -1365,18 +1441,18 @@ def NonNull : InheritableParamAttr { let Spellings = [GCC<"nonnull">]; let Subjects = SubjectList<[ObjCMethod, HasFunctionProto, ParmVar], WarnDiag, "functions, methods, and parameters">; - let Args = [VariadicUnsignedArgument<"Args">]; - let AdditionalMembers = -[{bool isNonNull(unsigned idx) const { - if (!args_size()) - return true; - for (const auto &V : args()) - if (V == idx) + let Args = [VariadicParamIdxArgument<"Args">]; + let AdditionalMembers = [{ + bool isNonNull(unsigned IdxAST) const { + if (!args_size()) return true; - return false; - } }]; + return args_end() != std::find_if( + args_begin(), args_end(), + [=](const ParamIdx &Idx) { return Idx.getASTIndex() == IdxAST; }); + } + }]; // FIXME: We should merge duplicates into a single nonnull attribute. - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Documentation = [NonNullDocs]; } @@ -1432,7 +1508,7 @@ def AssumeAligned : InheritableAttr { def AllocAlign : InheritableAttr { let Spellings = [GCC<"alloc_align">]; let Subjects = SubjectList<[HasFunctionProto]>; - let Args = [IntArgument<"ParamIndex">]; + let Args = [ParamIdxArgument<"ParamIndex">]; let Documentation = [AllocAlignDocs]; } @@ -1454,6 +1530,12 @@ def NotTailCalled : InheritableAttr { let Documentation = [NotTailCalledDocs]; } +def NoStackProtector : InheritableAttr { + let Spellings = [Clang<"no_stack_protector">]; + let Subjects = SubjectList<[Function]>; + let Documentation = [NoStackProtectorDocs]; +} + def NoThrow : InheritableAttr { let Spellings = [GCC<"nothrow">, Declspec<"nothrow">]; let Subjects = SubjectList<[Function]>; @@ -1483,13 +1565,11 @@ def ObjCBridgeMutable : InheritableAttr { } def ObjCBridgeRelated : InheritableAttr { - // TODO: this attribute does not have a [[]] spelling because it requires - // custom parsing support. - let Spellings = [GNU<"objc_bridge_related">]; + let Spellings = [Clang<"objc_bridge_related">]; let Subjects = SubjectList<[Record], ErrorDiag>; let Args = [IdentifierArgument<"RelatedClass">, - IdentifierArgument<"ClassMethod", 1>, - IdentifierArgument<"InstanceMethod", 1>]; + IdentifierArgument<"ClassMethod">, + IdentifierArgument<"InstanceMethod">]; let HasCustomParsing = 1; let Documentation = [Undocumented]; } @@ -1643,7 +1723,8 @@ def Ownership : InheritableAttr { Returns; } }]; - let Args = [IdentifierArgument<"Module">, VariadicUnsignedArgument<"Args">]; + let Args = [IdentifierArgument<"Module">, + VariadicParamIdxArgument<"Args">]; let Subjects = SubjectList<[HasFunctionProto]>; let Documentation = [Undocumented]; } @@ -1654,13 +1735,13 @@ def Packed : InheritableAttr { let Documentation = [Undocumented]; } -def IntelOclBicc : InheritableAttr { - let Spellings = [Clang<"intel_ocl_bicc">]; +def IntelOclBicc : DeclOrTypeAttr { + let Spellings = [Clang<"intel_ocl_bicc", 0>]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; } -def Pcs : InheritableAttr { +def Pcs : DeclOrTypeAttr { let Spellings = [GCC<"pcs">]; let Args = [EnumArgument<"PCS", "PCSType", ["aapcs", "aapcs-vfp"], @@ -1690,7 +1771,9 @@ def ReqdWorkGroupSize : InheritableAttr { } def RequireConstantInit : InheritableAttr { - let Spellings = [Clang<"require_constant_initialization">]; + // This attribute does not have a C [[]] spelling because it requires the + // CPlusPlus language option. + let Spellings = [Clang<"require_constant_initialization", 0>]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; let Documentation = [RequireConstantInitDocs]; let LangOpts = [CPlusPlus]; @@ -1721,6 +1804,13 @@ def Section : InheritableAttr { let Documentation = [SectionDocs]; } +def CodeSeg : InheritableAttr { + let Spellings = [Declspec<"code_seg">]; + let Args = [StringArgument<"Name">]; + let Subjects = SubjectList<[Function, CXXRecord], ErrorDiag>; + let Documentation = [CodeSegDocs]; +} + def PragmaClangBSSSection : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; @@ -1761,13 +1851,13 @@ def Sentinel : InheritableAttr { let Documentation = [Undocumented]; } -def StdCall : InheritableAttr { +def StdCall : DeclOrTypeAttr { let Spellings = [GCC<"stdcall">, Keyword<"__stdcall">, Keyword<"_stdcall">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [StdCallDocs]; } -def SwiftCall : InheritableAttr { +def SwiftCall : DeclOrTypeAttr { let Spellings = [Clang<"swiftcall">]; // let Subjects = SubjectList<[Function]>; let Documentation = [SwiftCallDocs]; @@ -1794,38 +1884,38 @@ def Suppress : StmtAttr { let Documentation = [SuppressDocs]; } -def SysVABI : InheritableAttr { +def SysVABI : DeclOrTypeAttr { let Spellings = [GCC<"sysv_abi">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; } -def ThisCall : InheritableAttr { +def ThisCall : DeclOrTypeAttr { let Spellings = [GCC<"thiscall">, Keyword<"__thiscall">, Keyword<"_thiscall">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [ThisCallDocs]; } -def VectorCall : InheritableAttr { +def VectorCall : DeclOrTypeAttr { let Spellings = [Clang<"vectorcall">, Keyword<"__vectorcall">, Keyword<"_vectorcall">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [VectorCallDocs]; } -def Pascal : InheritableAttr { +def Pascal : DeclOrTypeAttr { let Spellings = [Clang<"pascal">, Keyword<"__pascal">, Keyword<"_pascal">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; } -def PreserveMost : InheritableAttr { +def PreserveMost : DeclOrTypeAttr { let Spellings = [Clang<"preserve_most">]; let Documentation = [PreserveMostDocs]; } -def PreserveAll : InheritableAttr { +def PreserveAll : DeclOrTypeAttr { let Spellings = [Clang<"preserve_all">]; let Documentation = [PreserveAllDocs]; } @@ -1840,12 +1930,27 @@ def Target : InheritableAttr { std::vector<std::string> Features; StringRef Architecture; bool DuplicateArchitecture = false; + bool operator ==(const ParsedTargetAttr &Other) const { + return DuplicateArchitecture == Other.DuplicateArchitecture && + Architecture == Other.Architecture && Features == Other.Features; + } }; ParsedTargetAttr parse() const { return parse(getFeaturesStr()); } + + template<class Compare> + ParsedTargetAttr parse(Compare cmp) const { + ParsedTargetAttr Attrs = parse(); + llvm::sort(std::begin(Attrs.Features), std::end(Attrs.Features), cmp); + return Attrs; + } + + bool isDefaultVersion() const { return getFeaturesStr() == "default"; } + static ParsedTargetAttr parse(StringRef Features) { ParsedTargetAttr Ret; + if (Features == "default") return Ret; SmallVector<StringRef, 1> AttrFeatures; Features.split(AttrFeatures, ","); @@ -1861,7 +1966,7 @@ def Target : InheritableAttr { // overall feature validity for the function with the rest of the // attributes on the function. if (Feature.startswith("fpmath=") || Feature.startswith("tune=")) - continue; + continue; // While we're here iterating check for a different target cpu. if (Feature.startswith("arch=")) { @@ -1879,6 +1984,13 @@ def Target : InheritableAttr { }]; } +def MinVectorWidth : InheritableAttr { + let Spellings = [Clang<"min_vector_width">]; + let Args = [UnsignedArgument<"VectorWidth">]; + let Subjects = SubjectList<[Function], ErrorDiag>; + let Documentation = [MinVectorWidthDocs]; +} + def TransparentUnion : InheritableAttr { let Spellings = [GCC<"transparent_union">]; // let Subjects = SubjectList<[Record, TypedefName]>; @@ -1913,7 +2025,7 @@ def DiagnoseIf : InheritableAttr { ["DT_Error", "DT_Warning"]>, BoolArgument<"ArgDependent", 0, /*fake*/ 1>, NamedArgument<"Parent", 0, /*fake*/ 1>]; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let LateParsed = 1; let AdditionalMembers = [{ bool isError() const { return diagnosticType == DT_Error; } @@ -1958,6 +2070,7 @@ def Unused : InheritableAttr { def Used : InheritableAttr { let Spellings = [GCC<"used">]; + let Subjects = SubjectList<[NonLocalVar, Function, ObjCMethod]>; let Documentation = [Undocumented]; } @@ -2006,7 +2119,10 @@ def TypeVisibility : InheritableAttr { } def VecReturn : InheritableAttr { - let Spellings = [Clang<"vecreturn">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to C++ struct/class/union. + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"vecreturn", 0>]; let Subjects = SubjectList<[CXXRecord], ErrorDiag>; let Documentation = [Undocumented]; } @@ -2066,6 +2182,12 @@ def AnyX86NoCallerSavedRegisters : InheritableAttr, let Documentation = [AnyX86NoCallerSavedRegistersDocs]; } +def AnyX86NoCfCheck : InheritableAttr, TargetSpecificAttr<TargetAnyX86>{ + let Spellings = [GCC<"nocf_check">]; + let Subjects = SubjectList<[FunctionLike]>; + let Documentation = [AnyX86NoCfCheckDocs]; +} + def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr<TargetAnyX86> { let Spellings = [GCC<"force_align_arg_pointer">]; // Technically, this appertains to a FunctionDecl, but the target-specific @@ -2112,13 +2234,13 @@ def NoSanitizeSpecific : InheritableAttr { // an updated captability-based name and the older name will only be supported // under the GNU-style spelling. def GuardedVar : InheritableAttr { - let Spellings = [Clang<"guarded_var">]; + let Spellings = [Clang<"guarded_var", 0>]; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; } def PtGuardedVar : InheritableAttr { - let Spellings = [Clang<"pt_guarded_var">]; + let Spellings = [Clang<"pt_guarded_var", 0>]; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; } @@ -2131,17 +2253,17 @@ def Lockable : InheritableAttr { } def ScopedLockable : InheritableAttr { - let Spellings = [Clang<"scoped_lockable">]; + let Spellings = [Clang<"scoped_lockable", 0>]; let Subjects = SubjectList<[Record]>; let Documentation = [Undocumented]; } def Capability : InheritableAttr { - let Spellings = [Clang<"capability">, Clang<"shared_capability">]; + let Spellings = [Clang<"capability", 0>, Clang<"shared_capability", 0>]; let Subjects = SubjectList<[Record, TypedefName], ErrorDiag>; let Args = [StringArgument<"Name">]; let Accessors = [Accessor<"isShared", - [Clang<"shared_capability">]>]; + [Clang<"shared_capability", 0>]>]; let Documentation = [Undocumented]; let AdditionalMembers = [{ bool isMutex() const { return getName().equals_lower("mutex"); } @@ -2150,83 +2272,83 @@ def Capability : InheritableAttr { } def AssertCapability : InheritableAttr { - let Spellings = [Clang<"assert_capability">, - Clang<"assert_shared_capability">]; + let Spellings = [Clang<"assert_capability", 0>, + Clang<"assert_shared_capability", 0>]; let Subjects = SubjectList<[Function]>; let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Args = [VariadicExprArgument<"Args">]; let Accessors = [Accessor<"isShared", - [Clang<"assert_shared_capability">]>]; + [Clang<"assert_shared_capability", 0>]>]; let Documentation = [AssertCapabilityDocs]; } def AcquireCapability : InheritableAttr { - let Spellings = [Clang<"acquire_capability">, - Clang<"acquire_shared_capability">, + let Spellings = [Clang<"acquire_capability", 0>, + Clang<"acquire_shared_capability", 0>, GNU<"exclusive_lock_function">, GNU<"shared_lock_function">]; let Subjects = SubjectList<[Function]>; let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Args = [VariadicExprArgument<"Args">]; let Accessors = [Accessor<"isShared", - [Clang<"acquire_shared_capability">, + [Clang<"acquire_shared_capability", 0>, GNU<"shared_lock_function">]>]; let Documentation = [AcquireCapabilityDocs]; } def TryAcquireCapability : InheritableAttr { - let Spellings = [Clang<"try_acquire_capability">, - Clang<"try_acquire_shared_capability">]; + let Spellings = [Clang<"try_acquire_capability", 0>, + Clang<"try_acquire_shared_capability", 0>]; let Subjects = SubjectList<[Function], ErrorDiag>; let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">]; let Accessors = [Accessor<"isShared", - [Clang<"try_acquire_shared_capability">]>]; + [Clang<"try_acquire_shared_capability", 0>]>]; let Documentation = [TryAcquireCapabilityDocs]; } def ReleaseCapability : InheritableAttr { - let Spellings = [Clang<"release_capability">, - Clang<"release_shared_capability">, - Clang<"release_generic_capability">, - Clang<"unlock_function">]; + let Spellings = [Clang<"release_capability", 0>, + Clang<"release_shared_capability", 0>, + Clang<"release_generic_capability", 0>, + Clang<"unlock_function", 0>]; let Subjects = SubjectList<[Function]>; let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Args = [VariadicExprArgument<"Args">]; let Accessors = [Accessor<"isShared", - [Clang<"release_shared_capability">]>, + [Clang<"release_shared_capability", 0>]>, Accessor<"isGeneric", - [Clang<"release_generic_capability">, - Clang<"unlock_function">]>]; + [Clang<"release_generic_capability", 0>, + Clang<"unlock_function", 0>]>]; let Documentation = [ReleaseCapabilityDocs]; } def RequiresCapability : InheritableAttr { - let Spellings = [Clang<"requires_capability">, - Clang<"exclusive_locks_required">, - Clang<"requires_shared_capability">, - Clang<"shared_locks_required">]; + let Spellings = [Clang<"requires_capability", 0>, + Clang<"exclusive_locks_required", 0>, + Clang<"requires_shared_capability", 0>, + Clang<"shared_locks_required", 0>]; let Args = [VariadicExprArgument<"Args">]; let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; - let Accessors = [Accessor<"isShared", [Clang<"requires_shared_capability">, - Clang<"shared_locks_required">]>]; + let Accessors = [Accessor<"isShared", [Clang<"requires_shared_capability", 0>, + Clang<"shared_locks_required", 0>]>]; let Documentation = [Undocumented]; } @@ -2242,7 +2364,7 @@ def GuardedBy : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; } @@ -2253,7 +2375,7 @@ def PtGuardedBy : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; } @@ -2264,7 +2386,7 @@ def AcquiredAfter : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; } @@ -2275,7 +2397,7 @@ def AcquiredBefore : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; } @@ -2286,7 +2408,7 @@ def AssertExclusiveLock : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; } @@ -2297,7 +2419,7 @@ def AssertSharedLock : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; } @@ -2310,7 +2432,7 @@ def ExclusiveTrylockFunction : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; } @@ -2323,7 +2445,7 @@ def SharedTrylockFunction : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; } @@ -2344,7 +2466,7 @@ def LocksExcluded : InheritableAttr { let LateParsed = 1; let TemplateDependent = 1; let ParseArgumentsAsUnevaluated = 1; - let DuplicatesAllowedWhileMerging = 1; + let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; } @@ -2352,7 +2474,10 @@ def LocksExcluded : InheritableAttr { // C/C++ consumed attributes. def Consumable : InheritableAttr { - let Spellings = [Clang<"consumable">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to C++ struct/class/union. + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"consumable", 0>]; let Subjects = SubjectList<[CXXRecord]>; let Args = [EnumArgument<"DefaultState", "ConsumedState", ["unknown", "consumed", "unconsumed"], @@ -2361,19 +2486,28 @@ def Consumable : InheritableAttr { } def ConsumableAutoCast : InheritableAttr { - let Spellings = [Clang<"consumable_auto_cast_state">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to C++ struct/class/union. + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"consumable_auto_cast_state", 0>]; let Subjects = SubjectList<[CXXRecord]>; let Documentation = [Undocumented]; } def ConsumableSetOnRead : InheritableAttr { - let Spellings = [Clang<"consumable_set_state_on_read">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to C++ struct/class/union. + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"consumable_set_state_on_read", 0>]; let Subjects = SubjectList<[CXXRecord]>; let Documentation = [Undocumented]; } def CallableWhen : InheritableAttr { - let Spellings = [Clang<"callable_when">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to C++ function (but doesn't require it to be a member function). + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"callable_when", 0>]; let Subjects = SubjectList<[CXXMethod]>; let Args = [VariadicEnumArgument<"CallableStates", "ConsumedState", ["unknown", "consumed", "unconsumed"], @@ -2382,7 +2516,10 @@ def CallableWhen : InheritableAttr { } def ParamTypestate : InheritableAttr { - let Spellings = [Clang<"param_typestate">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to a parameter whose type is a consumable C++ class. + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"param_typestate", 0>]; let Subjects = SubjectList<[ParmVar]>; let Args = [EnumArgument<"ParamState", "ConsumedState", ["unknown", "consumed", "unconsumed"], @@ -2391,7 +2528,10 @@ def ParamTypestate : InheritableAttr { } def ReturnTypestate : InheritableAttr { - let Spellings = [Clang<"return_typestate">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to a parameter or function return type that is a consumable C++ class. + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"return_typestate", 0>]; let Subjects = SubjectList<[Function, ParmVar]>; let Args = [EnumArgument<"State", "ConsumedState", ["unknown", "consumed", "unconsumed"], @@ -2400,7 +2540,10 @@ def ReturnTypestate : InheritableAttr { } def SetTypestate : InheritableAttr { - let Spellings = [Clang<"set_typestate">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to C++ function (but doesn't require it to be a member function). + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"set_typestate", 0>]; let Subjects = SubjectList<[CXXMethod]>; let Args = [EnumArgument<"NewState", "ConsumedState", ["unknown", "consumed", "unconsumed"], @@ -2409,7 +2552,10 @@ def SetTypestate : InheritableAttr { } def TestTypestate : InheritableAttr { - let Spellings = [Clang<"test_typestate">]; + // This attribute does not have a C [[]] spelling because it only appertains + // to C++ function (but doesn't require it to be a member function). + // FIXME: should this attribute have a CPlusPlus language option? + let Spellings = [Clang<"test_typestate", 0>]; let Subjects = SubjectList<[CXXMethod]>; let Args = [EnumArgument<"TestState", "ConsumedState", ["consumed", "unconsumed"], @@ -2420,18 +2566,18 @@ def TestTypestate : InheritableAttr { // Type safety attributes for `void *' pointers and type tags. def ArgumentWithTypeTag : InheritableAttr { - let Spellings = [GNU<"argument_with_type_tag">, - GNU<"pointer_with_type_tag">]; + let Spellings = [Clang<"argument_with_type_tag">, + Clang<"pointer_with_type_tag">]; + let Subjects = SubjectList<[HasFunctionProto], ErrorDiag>; let Args = [IdentifierArgument<"ArgumentKind">, - UnsignedArgument<"ArgumentIdx">, - UnsignedArgument<"TypeTagIdx">, - BoolArgument<"IsPointer">]; - let HasCustomParsing = 1; + ParamIdxArgument<"ArgumentIdx">, + ParamIdxArgument<"TypeTagIdx">, + BoolArgument<"IsPointer", /*opt*/0, /*fake*/1>]; let Documentation = [ArgumentWithTypeTagDocs, PointerWithTypeTagDocs]; } def TypeTagForDatatype : InheritableAttr { - let Spellings = [GNU<"type_tag_for_datatype">]; + let Spellings = [Clang<"type_tag_for_datatype">]; let Args = [IdentifierArgument<"ArgumentKind">, TypeArgument<"MatchingCType">, BoolArgument<"LayoutCompatible">, @@ -2469,6 +2615,16 @@ def DLLImport : InheritableAttr, TargetSpecificAttr<TargetWindows> { let Spellings = [Declspec<"dllimport">, GCC<"dllimport">]; let Subjects = SubjectList<[Function, Var, CXXRecord, ObjCInterface]>; let Documentation = [DLLImportDocs]; + + + let AdditionalMembers = [{ +private: + bool PropagatedToBaseTemplate = false; + +public: + void setPropagatedToBaseTemplate() { PropagatedToBaseTemplate = true; } + bool wasPropagatedToBaseTemplate() { return PropagatedToBaseTemplate; } + }]; } def SelectAny : InheritableAttr { @@ -2510,7 +2666,7 @@ def UPtr : TypeAttr { def MSInheritance : InheritableAttr { let LangOpts = [MicrosoftExt]; - let Args = [DefaultBoolArgument<"BestCase", 1>]; + let Args = [DefaultBoolArgument<"BestCase", /*default*/1, /*fake*/1>]; let Spellings = [Keyword<"__single_inheritance">, Keyword<"__multiple_inheritance">, Keyword<"__virtual_inheritance">, @@ -2565,7 +2721,7 @@ def InitSeg : Attr { let Documentation = [InitSegDocs]; let AdditionalMembers = [{ void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const { - OS << '(' << getSection() << ')'; + OS << " (" << getSection() << ')'; } }]; } @@ -2575,7 +2731,7 @@ def LoopHint : Attr { /// vectorize: vectorizes loop operations if State == Enable. /// vectorize_width: vectorize loop operations with width 'Value'. /// interleave: interleave multiple loop iterations if State == Enable. - /// interleave_count: interleaves 'Value' loop interations. + /// interleave_count: interleaves 'Value' loop iterations. /// unroll: fully unroll loop if State == Enable. /// unroll_count: unrolls loop 'Value' times. /// distribute: attempt to distribute loop if State == Enable @@ -2620,12 +2776,12 @@ def LoopHint : Attr { if (SpellingIndex == Pragma_nounroll) return; else if (SpellingIndex == Pragma_unroll) { - OS << getValueString(Policy); + OS << ' ' << getValueString(Policy); return; } assert(SpellingIndex == Pragma_clang_loop && "Unexpected spelling"); - OS << getOptionName(option) << getValueString(Policy); + OS << ' ' << getOptionName(option) << getValueString(Policy); } // Return a string containing the loop hint argument including the @@ -2693,6 +2849,14 @@ def OMPCaptureKind : Attr { let Documentation = [Undocumented]; } +def OMPReferencedVar : Attr { + // This attribute has no spellings as it is only ever created implicitly. + let Spellings = []; + let SemaHandler = 0; + let Args = [ExprArgument<"Ref">]; + let Documentation = [Undocumented]; +} + def OMPDeclareSimdDecl : Attr { let Spellings = [Pragma<"omp", "declare simd">]; let Subjects = SubjectList<[Function]>; @@ -2712,37 +2876,37 @@ def OMPDeclareSimdDecl : Attr { void printPrettyPragma(raw_ostream & OS, const PrintingPolicy &Policy) const { if (getBranchState() != BS_Undefined) - OS << ConvertBranchStateTyToStr(getBranchState()) << " "; + OS << ' ' << ConvertBranchStateTyToStr(getBranchState()); if (auto *E = getSimdlen()) { - OS << "simdlen("; + OS << " simdlen("; E->printPretty(OS, nullptr, Policy); - OS << ") "; + OS << ")"; } if (uniforms_size() > 0) { - OS << "uniform"; + OS << " uniform"; StringRef Sep = "("; for (auto *E : uniforms()) { OS << Sep; E->printPretty(OS, nullptr, Policy); Sep = ", "; } - OS << ") "; + OS << ")"; } alignments_iterator NI = alignments_begin(); for (auto *E : aligneds()) { - OS << "aligned("; + OS << " aligned("; E->printPretty(OS, nullptr, Policy); if (*NI) { OS << ": "; (*NI)->printPretty(OS, nullptr, Policy); } - OS << ") "; + OS << ")"; ++NI; } steps_iterator I = steps_begin(); modifiers_iterator MI = modifiers_begin(); for (auto *E : linears()) { - OS << "linear("; + OS << " linear("; if (*MI != OMPC_LINEAR_unknown) OS << getOpenMPSimpleClauseTypeName(OMPC_linear, *MI) << "("; E->printPretty(OS, nullptr, Policy); @@ -2752,7 +2916,7 @@ def OMPDeclareSimdDecl : Attr { OS << ": "; (*I)->printPretty(OS, nullptr, Policy); } - OS << ") "; + OS << ")"; ++I; ++MI; } @@ -2773,7 +2937,7 @@ def OMPDeclareTargetDecl : Attr { void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const { // Use fake syntax because it is for testing and debugging purpose only. if (getMapType() != MT_To) - OS << ConvertMapTypeTyToStr(getMapType()) << " "; + OS << ' ' << ConvertMapTypeTyToStr(getMapType()); } }]; } diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index ecff329c4ccba..5a5ab78b49d11 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -191,6 +191,65 @@ in generation of more efficient code. }]; } +def CPUSpecificCPUDispatchDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``cpu_specific`` and ``cpu_dispatch`` attributes are used to define and +resolve multiversioned functions. This form of multiversioning provides a +mechanism for declaring versions across translation units and manually +specifying the resolved function list. A specified CPU defines a set of minimum +features that are required for the function to be called. The result of this is +that future processors execute the most restrictive version of the function the +new processor can execute. + +Function versions are defined with ``cpu_specific``, which takes one or more CPU +names as a parameter. For example: + +.. code-block:: c + + // Declares and defines the ivybridge version of single_cpu. + __attribute__((cpu_specific(ivybridge))) + void single_cpu(void){} + + // Declares and defines the atom version of single_cpu. + __attribute__((cpu_specific(atom))) + void single_cpu(void){} + + // Declares and defines both the ivybridge and atom version of multi_cpu. + __attribute__((cpu_specific(ivybridge, atom))) + void multi_cpu(void){} + +A dispatching (or resolving) function can be declared anywhere in a project's +source code with ``cpu_dispatch``. This attribute takes one or more CPU names +as a parameter (like ``cpu_specific``). Functions marked with ``cpu_dispatch`` +are not expected to be defined, only declared. If such a marked function has a +definition, any side effects of the function are ignored; trivial function +bodies are permissible for ICC compatibility. + +.. code-block:: c + + // Creates a resolver for single_cpu above. + __attribute__((cpu_dispatch(ivybridge, atom))) + void single_cpu(void){} + + // Creates a resolver for multi_cpu, but adds a 3rd version defined in another + // translation unit. + __attribute__((cpu_dispatch(ivybridge, atom, sandybridge))) + void multi_cpu(void){} + +Note that it is possible to have a resolving function that dispatches based on +more or fewer options than are present in the program. Specifying fewer will +result in the omitted options not being considered during resolution. Specifying +a version for resolution that isn't defined in the program will result in a +linking failure. + +It is also possible to specify a CPU name of ``generic`` which will be resolved +if the executing processor doesn't satisfy the features required in the CPU +name. The behavior of a program executing on a processor that doesn't satisfy +any option of a multiversioned function is undefined. + }]; +} + def C11NoReturnDocs : Documentation { let Category = DocCatFunction; let Content = [{ @@ -273,7 +332,7 @@ def AllocSizeDocs : Documentation { let Content = [{ The ``alloc_size`` attribute can be placed on functions that return pointers in order to hint to the compiler how many bytes of memory will be available at the -returned poiner. ``alloc_size`` takes one or two arguments. +returned pointer. ``alloc_size`` takes one or two arguments. - ``alloc_size(N)`` implies that argument number N equals the number of available bytes at the returned pointer. @@ -306,12 +365,24 @@ An example of how to use ``alloc_size`` }]; } +def CodeSegDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``__declspec(code_seg)`` attribute enables the placement of code into separate +named segments that can be paged or locked in memory individually. This attribute +is used to control the placement of instantiated templates and compiler-generated +code. See the documentation for `__declspec(code_seg)`_ on MSDN. + +.. _`__declspec(code_seg)`: http://msdn.microsoft.com/en-us/library/dn636922.aspx + }]; +} + def AllocAlignDocs : Documentation { let Category = DocCatFunction; let Content = [{ Use ``__attribute__((alloc_align(<alignment>))`` on a function declaration to specify that the return value of the function (which must be a -pointer type) is at least as aligned as the value of the indicated parameter. The +pointer type) is at least as aligned as the value of the indicated parameter. The parameter is given by its index in the list of formal parameters; the first parameter has index 1 unless the function is a C++ non-static member function, in which case the first parameter has index 2 to account for the implicit ``this`` @@ -330,7 +401,7 @@ parameter. void *Foo::b(void *v, size_t align) __attribute__((alloc_align(3))); Note that this attribute merely informs the compiler that a function always -returns a sufficiently aligned pointer. It does not cause the compiler to +returns a sufficiently aligned pointer. It does not cause the compiler to emit code to enforce that alignment. The behavior is undefined if the returned poitner is not sufficiently aligned. }]; @@ -353,7 +424,7 @@ available in C. int isdigit(int c); int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); - + void foo(char c) { isdigit(c); isdigit(10); @@ -406,7 +477,7 @@ overload out of a number of viable overloads using enable_if. void f() __attribute__((enable_if(true, ""))); // #1 void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 - + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 @@ -913,16 +984,16 @@ in the metadata name for that object. The `objc_runtime_name` attribute allows annotated interfaces or protocols to use the specified string argument in the object's metadata name instead of the default name. - + **Usage**: ``__attribute__((objc_runtime_name("MyLocalName")))``. This attribute can only be placed before an @protocol or @interface declaration: - + .. code-block:: objc - + __attribute__((objc_runtime_name("MyLocalName"))) @interface Message @end - + }]; } @@ -1228,7 +1299,7 @@ potentially-evaluated discarded-value expression that is not explicitly cast to .. code-block: c++ struct [[nodiscard]] error_info { /*...*/ }; error_info enable_missile_safety_mode(); - + void launch_missiles(); void test_missiles() { enable_missile_safety_mode(); // diagnoses @@ -1430,6 +1501,29 @@ as ``-mlong-calls`` and ``-mno-long-calls``. }]; } +def RISCVInterruptDocs : Documentation { + let Category = DocCatFunction; + let Heading = "interrupt (RISCV)"; + let Content = [{ +Clang supports the GNU style ``__attribute__((interrupt))`` attribute on RISCV +targets. This attribute may be attached to a function definition and instructs +the backend to generate appropriate function entry/exit code so that it can be +used directly as an interrupt service routine. + +Permissible values for this parameter are ``user``, ``supervisor``, +and ``machine``. If there is no parameter, then it defaults to machine. + +Repeated interrupt attribute on the same declaration will cause a warning +to be emitted. In case of repeated declarations, the last one prevails. + +Refer to: +https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Function-Attributes.html +https://riscv.org/specifications/privileged-isa/ +The RISC-V Instruction Set Manual Volume II: Privileged Architecture +Version 1.10. + }]; +} + def AVRInterruptDocs : Documentation { let Category = DocCatFunction; let Heading = "interrupt (AVR)"; @@ -1474,6 +1568,49 @@ for the function. Example "subtarget features" from the x86 backend include: "mmx", "sse", "sse4.2", "avx", "xop" and largely correspond to the machine specific options handled by the front end. + +Additionally, this attribute supports function multiversioning for ELF based +x86/x86-64 targets, which can be used to create multiple implementations of the +same function that will be resolved at runtime based on the priority of their +``target`` attribute strings. A function is considered a multiversioned function +if either two declarations of the function have different ``target`` attribute +strings, or if it has a ``target`` attribute string of ``default``. For +example: + + .. code-block:: c++ + + __attribute__((target("arch=atom"))) + void foo() {} // will be called on 'atom' processors. + __attribute__((target("default"))) + void foo() {} // will be called on any other processors. + +All multiversioned functions must contain a ``default`` (fallback) +implementation, otherwise usages of the function are considered invalid. +Additionally, a function may not become multiversioned after its first use. +}]; +} + +def MinVectorWidthDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Clang supports the ``__attribute__((min_vector_width(width)))`` attribute. This +attribute may be attached to a function and informs the backend that this +function desires vectors of at least this width to be generated. Target-specific +maximum vector widths still apply. This means even if you ask for something +larger than the target supports, you will only get what the target supports. +This attribute is meant to be a hint to control target heuristics that may +generate narrower vectors than what the target hardware supports. + +This is currently used by the X86 target to allow some CPUs that support 512-bit +vectors to be limited to using 256-bit vectors to avoid frequency penalties. +This is currently enabled with the ``-prefer-vector-width=256`` command line +option. The ``min_vector_width`` attribute can be used to prevent the backend +from trying to split vector operations to match the ``prefer-vector-width``. All +X86 vector intrinsics from x86intrin.h already set this attribute. Additionally, +use of any of the X86-specific vector builtins will implicitly set this +attribute on the calling function. The intent is that explicitly writing vector +code using the X86 intrinsics will prevent ``prefer-vector-width`` from +affecting the code. }]; } @@ -1785,13 +1922,14 @@ This attribute accepts a single parameter that must be one of the following: def NoSanitizeDocs : Documentation { let Category = DocCatFunction; let Content = [{ -Use the ``no_sanitize`` attribute on a function declaration to specify -that a particular instrumentation or set of instrumentations should not be -applied to that function. The attribute takes a list of string literals, -which have the same meaning as values accepted by the ``-fno-sanitize=`` -flag. For example, ``__attribute__((no_sanitize("address", "thread")))`` -specifies that AddressSanitizer and ThreadSanitizer should not be applied -to the function. +Use the ``no_sanitize`` attribute on a function or a global variable +declaration to specify that a particular instrumentation or set of +instrumentations should not be applied. The attribute takes a list of +string literals, which have the same meaning as values accepted by the +``-fno-sanitize=`` flag. For example, +``__attribute__((no_sanitize("address", "thread")))`` specifies that +AddressSanitizer and ThreadSanitizer should not be applied to the +function or variable. See :ref:`Controlling Code Generation <controlling-code-generation>` for a full list of supported sanitizer flags. @@ -1806,9 +1944,9 @@ def NoSanitizeAddressDocs : Documentation { let Content = [{ .. _langext-address_sanitizer: -Use ``__attribute__((no_sanitize_address))`` on a function declaration to -specify that address safety instrumentation (e.g. AddressSanitizer) should -not be applied to that function. +Use ``__attribute__((no_sanitize_address))`` on a function or a global +variable declaration to specify that address safety instrumentation +(e.g. AddressSanitizer) should not be applied. }]; } @@ -2224,6 +2362,48 @@ It is only supported when using the Microsoft C++ ABI. }]; } +def TrivialABIDocs : Documentation { + let Category = DocCatVariable; + let Content = [{ +The ``trivial_abi`` attribute can be applied to a C++ class, struct, or union. +It instructs the compiler to pass and return the type using the C ABI for the +underlying type when the type would otherwise be considered non-trivial for the +purpose of calls. +A class annotated with `trivial_abi` can have non-trivial destructors or copy/move constructors without automatically becoming non-trivial for the purposes of calls. For example: + + .. code-block:: c++ + + // A is trivial for the purposes of calls because `trivial_abi` makes the + // user-provided special functions trivial. + struct __attribute__((trivial_abi)) A { + ~A(); + A(const A &); + A(A &&); + int x; + }; + + // B's destructor and copy/move constructor are considered trivial for the + // purpose of calls because A is trivial. + struct B { + A a; + }; + +If a type is trivial for the purposes of calls, has a non-trivial destructor, +and is passed as an argument by value, the convention is that the callee will +destroy the object before returning. + +Attribute ``trivial_abi`` has no effect in the following cases: + +- The class directly declares a virtual base or virtual methods. +- The class has a base class that is non-trivial for the purposes of calls. +- The class has a non-static data member whose type is non-trivial for the purposes of calls, which includes: + + - classes that are non-trivial for the purposes of calls + - __weak-qualified types in Objective-C++ + - arrays of any of the above + }]; +} + def MSInheritanceDocs : Documentation { let Category = DocCatType; let Heading = "__single_inhertiance, __multiple_inheritance, __virtual_inheritance"; @@ -2565,7 +2745,7 @@ The ``_Nullable`` nullability qualifier indicates that a value of the ``_Nullabl int fetch_or_zero(int * _Nullable ptr); -a caller of ``fetch_or_zero`` can provide null. +a caller of ``fetch_or_zero`` can provide null. }]; } @@ -2641,23 +2821,23 @@ used to process multiple arguments from a single invocation from a SIMD loop concurrently. The syntax of the `declare simd` construct is as follows: - .. code-block:: c + .. code-block:: none - #pragma omp declare simd [clause[[,] clause] ...] new-line - [#pragma omp declare simd [clause[[,] clause] ...] new-line] - [...] - function definition or declaration + #pragma omp declare simd [clause[[,] clause] ...] new-line + [#pragma omp declare simd [clause[[,] clause] ...] new-line] + [...] + function definition or declaration where clause is one of the following: - .. code-block:: c + .. code-block:: none - simdlen(length) - linear(argument-list[:constant-linear-step]) - aligned(argument-list[:alignment]) - uniform(argument-list) - inbranch - notinbranch + simdlen(length) + linear(argument-list[:constant-linear-step]) + aligned(argument-list[:alignment]) + uniform(argument-list) + inbranch + notinbranch }]; } @@ -2673,12 +2853,34 @@ The syntax of the declare target directive is as follows: .. code-block:: c - #pragma omp declare target new-line - declarations-definition-seq - #pragma omp end declare target new-line + #pragma omp declare target new-line + declarations-definition-seq + #pragma omp end declare target new-line }]; } +def NoStackProtectorDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Clang supports the ``__attribute__((no_stack_protector))`` attribute which disables +the stack protector on the specified function. This attribute is useful for +selectively disabling the stack protector on some functions when building with +``-fstack-protector`` compiler option. + +For example, it disables the stack protector for the function ``foo`` but function +``bar`` will still be built with the stack protector with the ``-fstack-protector`` +option. + +.. code-block:: c + + int __attribute__((no_stack_protector)) + foo (int x); // stack protection will be disabled for foo. + + int bar(int y); // bar can be built with the stack protector. + + }]; +} + def NotTailCalledDocs : Documentation { let Category = DocCatFunction; let Content = [{ @@ -2737,7 +2939,7 @@ def NoThrowDocs : Documentation { let Category = DocCatFunction; let Content = [{ Clang supports the GNU style ``__attribute__((nothrow))`` and Microsoft style -``__declspec(nothrow)`` attribute as an equivilent of `noexcept` on function +``__declspec(nothrow)`` attribute as an equivalent of `noexcept` on function declarations. This attribute informs the compiler that the annotated function does not throw an exception. This prevents exception-unwinding. This attribute is particularly useful on functions in the C Standard Library that are @@ -2800,7 +3002,7 @@ Use this attribute to indicate that the specified function has no caller-saved registers. That is, all registers are callee-saved except for registers used for passing parameters to the function or returning parameters from the function. -The compiler saves and restores any modified registers that were not used for +The compiler saves and restores any modified registers that were not used for passing or returning arguments to the function. The user can call functions specified with the 'no_caller_saved_registers' @@ -2852,6 +3054,23 @@ jumps from i386 arch code). }]; } +def AnyX86NoCfCheckDocs : Documentation{ + let Category = DocCatFunction; + let Content = [{ +Jump Oriented Programming attacks rely on tampering with addresses used by +indirect call / jmp, e.g. redirect control-flow to non-programmer +intended bytes in the binary. +X86 Supports Indirect Branch Tracking (IBT) as part of Control-Flow +Enforcement Technology (CET). IBT instruments ENDBR instructions used to +specify valid targets of indirect call / jmp. +The ``nocf_check`` attribute has two roles: +1. Appertains to a function - do not add ENDBR instruction at the beginning of +the function. +2. Appertains to a function pointer - do not track the target function of this +pointer (by adding nocf_check prefix to the indirect-call instruction). +}]; +} + def SwiftCallDocs : Documentation { let Category = DocCatVariable; let Content = [{ @@ -3031,7 +3250,7 @@ the ability to distinguish between different versions of the same entity but with different ABI versions supported. For example, a newer version of a class could have a different set of data members and thus have a different size. Using the ``abi_tag`` attribute, it is possible to have different mangled names for -a global variable of the class type. Therefor, the old code could keep using +a global variable of the class type. Therefore, the old code could keep using the old manged name and the new code will use the new mangled name with tags. }]; } @@ -3213,3 +3432,13 @@ For more information see or `msvc documentation <https://docs.microsoft.com/pl-pl/cpp/cpp/selectany>`_. }]; } + +def ArtificialDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``artificial`` attribute can be applied to an inline function. If such a +function is inlined, the attribute indicates that debuggers should associate +the resulting instructions with the call site, rather than with the +corresponding line within the inlined callee. + }]; +} diff --git a/include/clang/Basic/AttrKinds.h b/include/clang/Basic/AttrKinds.h index 8f7394f59d4d1..d82dbb032be97 100644 --- a/include/clang/Basic/AttrKinds.h +++ b/include/clang/Basic/AttrKinds.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::attr::Kind enum. +/// Defines the clang::attr::Kind enum. /// //===----------------------------------------------------------------------===// @@ -19,7 +19,7 @@ namespace clang { namespace attr { -// \brief A list of all the recognized kinds of attributes. +// A list of all the recognized kinds of attributes. enum Kind { #define ATTR(X) X, #define ATTR_RANGE(CLASS, FIRST_NAME, LAST_NAME) \ diff --git a/include/clang/Basic/AttrSubjectMatchRules.h b/include/clang/Basic/AttrSubjectMatchRules.h index 4c88adf57f17d..81aa634dfeb86 100644 --- a/include/clang/Basic/AttrSubjectMatchRules.h +++ b/include/clang/Basic/AttrSubjectMatchRules.h @@ -16,7 +16,7 @@ namespace clang { namespace attr { -/// \brief A list of all the recognized kinds of attributes. +/// A list of all the recognized kinds of attributes. enum SubjectMatchRule { #define ATTR_MATCH_RULE(X, Spelling, IsAbstract) X, #include "clang/Basic/AttrSubMatchRulesList.inc" diff --git a/include/clang/Basic/Attributes.h b/include/clang/Basic/Attributes.h index c651abacd482b..3152453694c9d 100644 --- a/include/clang/Basic/Attributes.h +++ b/include/clang/Basic/Attributes.h @@ -32,7 +32,7 @@ enum class AttrSyntax { Pragma }; -/// \brief Return the version number associated with the attribute if we +/// Return the version number associated with the attribute if we /// recognize and implement the attribute specified by the given information. int hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope, const IdentifierInfo *Attr, const TargetInfo &Target, diff --git a/include/clang/Basic/BitmaskEnum.h b/include/clang/Basic/BitmaskEnum.h new file mode 100644 index 0000000000000..12ff3cf207be3 --- /dev/null +++ b/include/clang/Basic/BitmaskEnum.h @@ -0,0 +1,25 @@ +//===--- BitmaskEnum.h - wrapper of LLVM's bitmask enum facility-*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +/// \file +/// Provides LLVM's BitmaskEnum facility to enumeration types declared in +/// namespace clang. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_BASIC_BITMASKENUM_H +#define LLVM_CLANG_BASIC_BITMASKENUM_H + +#include "llvm/ADT/BitmaskEnum.h" + +namespace clang { + LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE(); +} + +#endif diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def index 3d4deb5ed3064..edd823754a374 100644 --- a/include/clang/Basic/Builtins.def +++ b/include/clang/Basic/Builtins.def @@ -48,8 +48,8 @@ // . -> "...". This may only occur at the end of the function list. // // Types may be prefixed with the following modifiers: -// L -> long (e.g. Li for 'long int') -// LL -> long long +// L -> long (e.g. Li for 'long int', Ld for 'long double') +// LL -> long long (e.g. LLi for 'long long int', LLd for __float128) // LLL -> __int128_t (e.g. LLLi) // W -> int64_t // N -> 'int' size if target is LP64, 'L' otherwise. @@ -89,9 +89,10 @@ // S:N: -> similar to the s:N: attribute, but the function is like vscanf // in that it accepts its arguments as a va_list rather than // through an ellipsis -// e -> const, but only when -fmath-errno=0 +// e -> const, but only when -fno-math-errno // j -> returns_twice (like setjmp) // u -> arguments are not evaluated for their side-effects +// V:N: -> requires vectors of at least N bits to be legal // FIXME: gcc has nonnull #if defined(BUILTIN) && !defined(LIBBUILTIN) @@ -110,9 +111,11 @@ BUILTIN(__builtin_abs , "ii" , "ncF") BUILTIN(__builtin_copysign, "ddd", "ncF") BUILTIN(__builtin_copysignf, "fff", "ncF") BUILTIN(__builtin_copysignl, "LdLdLd", "ncF") +BUILTIN(__builtin_copysignf128, "LLdLLdLLd", "ncF") BUILTIN(__builtin_fabs , "dd" , "ncF") BUILTIN(__builtin_fabsf, "ff" , "ncF") BUILTIN(__builtin_fabsl, "LdLd", "ncF") +BUILTIN(__builtin_fabsf128, "LLdLLd", "ncF") BUILTIN(__builtin_fmod , "ddd" , "Fne") BUILTIN(__builtin_fmodf, "fff" , "Fne") BUILTIN(__builtin_fmodl, "LdLdLd", "Fne") @@ -122,9 +125,11 @@ BUILTIN(__builtin_frexpl, "LdLdi*", "Fn") BUILTIN(__builtin_huge_val, "d", "nc") BUILTIN(__builtin_huge_valf, "f", "nc") BUILTIN(__builtin_huge_vall, "Ld", "nc") +BUILTIN(__builtin_huge_valf128, "LLd", "nc") BUILTIN(__builtin_inf , "d" , "nc") BUILTIN(__builtin_inff , "f" , "nc") BUILTIN(__builtin_infl , "Ld" , "nc") +BUILTIN(__builtin_inff128 , "LLd" , "nc") BUILTIN(__builtin_labs , "LiLi" , "Fnc") BUILTIN(__builtin_llabs, "LLiLLi", "Fnc") BUILTIN(__builtin_ldexp , "ddi" , "Fne") @@ -133,12 +138,14 @@ BUILTIN(__builtin_ldexpl, "LdLdi", "Fne") BUILTIN(__builtin_modf , "ddd*" , "Fn") BUILTIN(__builtin_modff, "fff*" , "Fn") BUILTIN(__builtin_modfl, "LdLdLd*", "Fn") -BUILTIN(__builtin_nan, "dcC*" , "ncF") -BUILTIN(__builtin_nanf, "fcC*" , "ncF") -BUILTIN(__builtin_nanl, "LdcC*", "ncF") -BUILTIN(__builtin_nans, "dcC*" , "ncF") -BUILTIN(__builtin_nansf, "fcC*" , "ncF") -BUILTIN(__builtin_nansl, "LdcC*", "ncF") +BUILTIN(__builtin_nan, "dcC*" , "FnU") +BUILTIN(__builtin_nanf, "fcC*" , "FnU") +BUILTIN(__builtin_nanl, "LdcC*", "FnU") +BUILTIN(__builtin_nanf128, "LLdcC*", "FnU") +BUILTIN(__builtin_nans, "dcC*" , "FnU") +BUILTIN(__builtin_nansf, "fcC*" , "FnU") +BUILTIN(__builtin_nansl, "LdcC*", "FnU") +BUILTIN(__builtin_nansf128, "LLdcC*", "FnU") BUILTIN(__builtin_powi , "ddi" , "Fnc") BUILTIN(__builtin_powif, "ffi" , "Fnc") BUILTIN(__builtin_powil, "LdLdi", "Fnc") @@ -715,6 +722,10 @@ ATOMIC_BUILTIN(__opencl_atomic_fetch_xor, "v.", "t") ATOMIC_BUILTIN(__opencl_atomic_fetch_min, "v.", "t") ATOMIC_BUILTIN(__opencl_atomic_fetch_max, "v.", "t") +// GCC does not support these, they are a Clang extension. +ATOMIC_BUILTIN(__atomic_fetch_min, "v.", "t") +ATOMIC_BUILTIN(__atomic_fetch_max, "v.", "t") + #undef ATOMIC_BUILTIN // Non-overloaded atomic builtins. @@ -734,6 +745,14 @@ BUILTIN(__builtin_rindex, "c*cC*i", "Fn") LANGBUILTIN(_alloca, "v*z", "n", ALL_MS_LANGUAGES) LANGBUILTIN(__annotation, "wC*.","n", ALL_MS_LANGUAGES) LANGBUILTIN(__assume, "vb", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittest, "UcNiC*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittestandcomplement, "UcNi*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittestandreset, "UcNi*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittestandset, "UcNi*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittest64, "UcWiC*Wi", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittestandcomplement64, "UcWi*Wi", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittestandreset64, "UcWi*Wi", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_bittestandset64, "UcWi*Wi", "n", ALL_MS_LANGUAGES) LIBBUILTIN(_byteswap_ushort, "UsUs", "fnc", "stdlib.h", ALL_MS_LANGUAGES) LIBBUILTIN(_byteswap_ulong, "UNiUNi", "fnc", "stdlib.h", ALL_MS_LANGUAGES) LIBBUILTIN(_byteswap_uint64, "ULLiULLi", "fnc", "stdlib.h", ALL_MS_LANGUAGES) @@ -773,7 +792,16 @@ LANGBUILTIN(_InterlockedOr, "NiNiD*Ni", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_InterlockedXor8, "ccD*c", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_InterlockedXor16, "ssD*s", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_InterlockedXor, "NiNiD*Ni", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(_interlockedbittestandset, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandreset, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandreset64, "UcWiD*Wi", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandreset_acq, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandreset_nf, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandreset_rel, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandset, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandset64, "UcWiD*Wi", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandset_acq, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandset_nf, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(_interlockedbittestandset_rel, "UcNiD*Ni", "n", ALL_MS_LANGUAGES) LANGBUILTIN(__noop, "i.", "n", ALL_MS_LANGUAGES) LANGBUILTIN(__popcnt16, "UsUs", "nc", ALL_MS_LANGUAGES) LANGBUILTIN(__popcnt, "UiUi", "nc", ALL_MS_LANGUAGES) @@ -796,6 +824,10 @@ LANGBUILTIN(__fastfail, "vUi", "nr", ALL_MS_LANGUAGES) LIBBUILTIN(_setjmpex, "iJ", "fj", "setjmpex.h", ALL_MS_LANGUAGES) // C99 library functions +// C99 stdarg.h +LIBBUILTIN(va_start, "vA.", "fn", "stdarg.h", ALL_LANGUAGES) +LIBBUILTIN(va_end, "vA", "fn", "stdarg.h", ALL_LANGUAGES) +LIBBUILTIN(va_copy, "vAA", "fn", "stdarg.h", ALL_LANGUAGES) // C99 stdlib.h LIBBUILTIN(abort, "v", "fr", "stdlib.h", ALL_LANGUAGES) LIBBUILTIN(calloc, "v*zz", "f", "stdlib.h", ALL_LANGUAGES) @@ -803,6 +835,13 @@ LIBBUILTIN(exit, "vi", "fr", "stdlib.h", ALL_LANGUAGES) LIBBUILTIN(_Exit, "vi", "fr", "stdlib.h", ALL_LANGUAGES) LIBBUILTIN(malloc, "v*z", "f", "stdlib.h", ALL_LANGUAGES) LIBBUILTIN(realloc, "v*v*z", "f", "stdlib.h", ALL_LANGUAGES) +LIBBUILTIN(strtod, "dcC*c**", "f", "stdlib.h", ALL_LANGUAGES) +LIBBUILTIN(strtof, "fcC*c**", "f", "stdlib.h", ALL_LANGUAGES) +LIBBUILTIN(strtold, "LdcC*c**", "f", "stdlib.h", ALL_LANGUAGES) +LIBBUILTIN(strtol, "LicC*c**i", "f", "stdlib.h", ALL_LANGUAGES) +LIBBUILTIN(strtoll, "LLicC*c**i", "f", "stdlib.h", ALL_LANGUAGES) +LIBBUILTIN(strtoul, "ULicC*c**i", "f", "stdlib.h", ALL_LANGUAGES) +LIBBUILTIN(strtoull, "ULLicC*c**i", "f", "stdlib.h", ALL_LANGUAGES) // C99 string.h LIBBUILTIN(memcpy, "v*v*vC*z", "f", "string.h", ALL_LANGUAGES) LIBBUILTIN(memcmp, "ivC*vC*z", "f", "string.h", ALL_LANGUAGES) @@ -826,6 +865,7 @@ LIBBUILTIN(memset, "v*v*iz", "f", "string.h", ALL_LANGUAGES) LIBBUILTIN(strerror, "c*i", "f", "string.h", ALL_LANGUAGES) LIBBUILTIN(strlen, "zcC*", "f", "string.h", ALL_LANGUAGES) // C99 stdio.h +// FIXME: This list is incomplete. LIBBUILTIN(printf, "icC*.", "fp:0:", "stdio.h", ALL_LANGUAGES) LIBBUILTIN(fprintf, "iP*cC*.", "fp:1:", "stdio.h", ALL_LANGUAGES) LIBBUILTIN(snprintf, "ic*zcC*.", "fp:2:", "stdio.h", ALL_LANGUAGES) @@ -840,6 +880,10 @@ LIBBUILTIN(sscanf, "icC*RcC*R.", "fs:1:", "stdio.h", ALL_LANGUAGES) LIBBUILTIN(vscanf, "icC*Ra", "fS:0:", "stdio.h", ALL_LANGUAGES) LIBBUILTIN(vfscanf, "iP*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES) LIBBUILTIN(vsscanf, "icC*RcC*Ra", "fS:1:", "stdio.h", ALL_LANGUAGES) +LIBBUILTIN(fopen, "P*cC*cC*", "f", "stdio.h", ALL_LANGUAGES) +LIBBUILTIN(fread, "zv*zzP*", "f", "stdio.h", ALL_LANGUAGES) +LIBBUILTIN(fwrite, "zvC*zzP*", "f", "stdio.h", ALL_LANGUAGES) + // C99 ctype.h LIBBUILTIN(isalnum, "ii", "fnU", "ctype.h", ALL_LANGUAGES) LIBBUILTIN(isalpha, "ii", "fnU", "ctype.h", ALL_LANGUAGES) @@ -1361,12 +1405,15 @@ BUILTIN(__builtin_smulll_overflow, "bSLLiCSLLiCSLLi*", "n") // Clang builtins (not available in GCC). BUILTIN(__builtin_addressof, "v*v&", "nct") -BUILTIN(__builtin_operator_new, "v*z", "c") -BUILTIN(__builtin_operator_delete, "vv*", "n") +BUILTIN(__builtin_operator_new, "v*z", "tc") +BUILTIN(__builtin_operator_delete, "vv*", "tn") BUILTIN(__builtin_char_memchr, "c*cC*iz", "n") +BUILTIN(__builtin_dump_struct, "ivC*v*", "tn") // Safestack builtins BUILTIN(__builtin___get_unsafe_stack_start, "v*", "Fn") +BUILTIN(__builtin___get_unsafe_stack_bottom, "v*", "Fn") +BUILTIN(__builtin___get_unsafe_stack_top, "v*", "Fn") BUILTIN(__builtin___get_unsafe_stack_ptr, "v*", "Fn") // Nontemporal loads/stores builtins @@ -1381,6 +1428,7 @@ BUILTIN(__builtin_coro_promise, "v*v*IiIb", "n") BUILTIN(__builtin_coro_size, "z", "n") BUILTIN(__builtin_coro_frame, "v*", "n") +BUILTIN(__builtin_coro_noop, "v*", "n") BUILTIN(__builtin_coro_free, "v*v*", "n") BUILTIN(__builtin_coro_id, "v*Iiv*v*v*", "n") @@ -1443,6 +1491,7 @@ LANGBUILTIN(omp_is_initial_device, "i", "nc", OMP_LANG) // Builtins for XRay BUILTIN(__xray_customevent, "vcC*z", "") +BUILTIN(__xray_typedevent, "vzcC*z", "") // Win64-compatible va_list functions BUILTIN(__builtin_ms_va_start, "vc*&.", "nt") diff --git a/include/clang/Basic/Builtins.h b/include/clang/Basic/Builtins.h index 963c72ea82e0e..fa2bcc4c7ab0b 100644 --- a/include/clang/Basic/Builtins.h +++ b/include/clang/Basic/Builtins.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines enum values for all the target-independent builtin +/// Defines enum values for all the target-independent builtin /// functions. /// //===----------------------------------------------------------------------===// @@ -59,7 +59,7 @@ struct Info { const char *Features; }; -/// \brief Holds information about both target-independent and +/// Holds information about both target-independent and /// target-specific builtins, allowing easy queries by clients. /// /// Builtins from an optional auxiliary target are stored in @@ -72,122 +72,129 @@ class Context { public: Context() {} - /// \brief Perform target-specific initialization + /// Perform target-specific initialization /// \param AuxTarget Target info to incorporate builtins from. May be nullptr. void InitializeTarget(const TargetInfo &Target, const TargetInfo *AuxTarget); - /// \brief Mark the identifiers for all the builtins with their + /// Mark the identifiers for all the builtins with their /// appropriate builtin ID # and mark any non-portable builtin identifiers as /// such. void initializeBuiltins(IdentifierTable &Table, const LangOptions& LangOpts); - /// \brief Return the identifier name for the specified builtin, + /// Return the identifier name for the specified builtin, /// e.g. "__builtin_abs". const char *getName(unsigned ID) const { return getRecord(ID).Name; } - /// \brief Get the type descriptor string for the specified builtin. + /// Get the type descriptor string for the specified builtin. const char *getTypeString(unsigned ID) const { return getRecord(ID).Type; } - /// \brief Return true if this function is a target-specific builtin. + /// Return true if this function is a target-specific builtin. bool isTSBuiltin(unsigned ID) const { return ID >= Builtin::FirstTSBuiltin; } - /// \brief Return true if this function has no side effects. + /// Return true if this function has no side effects. bool isPure(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'U') != nullptr; } - /// \brief Return true if this function has no side effects and doesn't + /// Return true if this function has no side effects and doesn't /// read memory. bool isConst(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'c') != nullptr; } - /// \brief Return true if we know this builtin never throws an exception. + /// Return true if we know this builtin never throws an exception. bool isNoThrow(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'n') != nullptr; } - /// \brief Return true if we know this builtin never returns. + /// Return true if we know this builtin never returns. bool isNoReturn(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'r') != nullptr; } - /// \brief Return true if we know this builtin can return twice. + /// Return true if we know this builtin can return twice. bool isReturnsTwice(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'j') != nullptr; } - /// \brief Returns true if this builtin does not perform the side-effects + /// Returns true if this builtin does not perform the side-effects /// of its arguments. bool isUnevaluated(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'u') != nullptr; } - /// \brief Return true if this is a builtin for a libc/libm function, + /// Return true if this is a builtin for a libc/libm function, /// with a "__builtin_" prefix (e.g. __builtin_abs). bool isLibFunction(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'F') != nullptr; } - /// \brief Determines whether this builtin is a predefined libc/libm + /// Determines whether this builtin is a predefined libc/libm /// function, such as "malloc", where we know the signature a /// priori. bool isPredefinedLibFunction(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'f') != nullptr; } - /// \brief Returns true if this builtin requires appropriate header in other + /// Returns true if this builtin requires appropriate header in other /// compilers. In Clang it will work even without including it, but we can emit /// a warning about missing header. bool isHeaderDependentFunction(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'h') != nullptr; } - /// \brief Determines whether this builtin is a predefined compiler-rt/libgcc + /// Determines whether this builtin is a predefined compiler-rt/libgcc /// function, such as "__clear_cache", where we know the signature a /// priori. bool isPredefinedRuntimeFunction(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'i') != nullptr; } - /// \brief Determines whether this builtin has custom typechecking. + /// Determines whether this builtin has custom typechecking. bool hasCustomTypechecking(unsigned ID) const { return strchr(getRecord(ID).Attributes, 't') != nullptr; } - /// \brief Determines whether this builtin has a result or any arguments which + /// Determines whether this builtin has a result or any arguments which /// are pointer types. bool hasPtrArgsOrResult(unsigned ID) const { return strchr(getRecord(ID).Type, '*') != nullptr; } - /// \brief Completely forget that the given ID was ever considered a builtin, + /// Return true if this builtin has a result or any arguments which are + /// reference types. + bool hasReferenceArgsOrResult(unsigned ID) const { + return strchr(getRecord(ID).Type, '&') != nullptr || + strchr(getRecord(ID).Type, 'A') != nullptr; + } + + /// Completely forget that the given ID was ever considered a builtin, /// e.g., because the user provided a conflicting signature. void forgetBuiltin(unsigned ID, IdentifierTable &Table); - /// \brief If this is a library function that comes from a specific + /// If this is a library function that comes from a specific /// header, retrieve that header name. const char *getHeaderName(unsigned ID) const { return getRecord(ID).HeaderName; } - /// \brief Determine whether this builtin is like printf in its + /// Determine whether this builtin is like printf in its /// formatting rules and, if so, set the index to the format string /// argument and whether this function as a va_list argument. bool isPrintfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg); - /// \brief Determine whether this builtin is like scanf in its + /// Determine whether this builtin is like scanf in its /// formatting rules and, if so, set the index to the format string /// argument and whether this function as a va_list argument. bool isScanfLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg); - /// \brief Return true if this function has no side effects and doesn't + /// Return true if this function has no side effects and doesn't /// read memory, except for possibly errno. /// /// Such functions can be const when the MathErrno lang option is disabled. @@ -199,12 +206,14 @@ public: return getRecord(ID).Features; } - /// \brief Return true if builtin ID belongs to AuxTarget. + unsigned getRequiredVectorWidth(unsigned ID) const; + + /// Return true if builtin ID belongs to AuxTarget. bool isAuxBuiltinID(unsigned ID) const { return ID >= (Builtin::FirstTSBuiltin + TSRecords.size()); } - /// Return real buitin ID (i.e. ID it would have furing compilation + /// Return real builtin ID (i.e. ID it would have during compilation /// for AuxTarget). unsigned getAuxBuiltinID(unsigned ID) const { return ID - TSRecords.size(); } @@ -212,26 +221,30 @@ public: /// prefix. static bool isBuiltinFunc(const char *Name); + /// Returns true if this is a builtin that can be redeclared. Returns true + /// for non-builtins. + bool canBeRedeclared(unsigned ID) const; + private: const Info &getRecord(unsigned ID) const; - /// \brief Is this builtin supported according to the given language options? + /// Is this builtin supported according to the given language options? bool builtinIsSupported(const Builtin::Info &BuiltinInfo, const LangOptions &LangOpts); - /// \brief Helper function for isPrintfLike and isScanfLike. + /// Helper function for isPrintfLike and isScanfLike. bool isLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg, const char *Fmt) const; }; } -/// \brief Kinds of BuiltinTemplateDecl. +/// Kinds of BuiltinTemplateDecl. enum BuiltinTemplateKind : int { - /// \brief This names the __make_integer_seq BuiltinTemplateDecl. + /// This names the __make_integer_seq BuiltinTemplateDecl. BTK__make_integer_seq, - /// \brief This names the __type_pack_element BuiltinTemplateDecl. + /// This names the __type_pack_element BuiltinTemplateDecl. BTK__type_pack_element }; diff --git a/include/clang/Basic/BuiltinsAArch64.def b/include/clang/Basic/BuiltinsAArch64.def index 55a4f70176d00..b5d971d0bc6e4 100644 --- a/include/clang/Basic/BuiltinsAArch64.def +++ b/include/clang/Basic/BuiltinsAArch64.def @@ -18,6 +18,10 @@ # define LANGBUILTIN(ID, TYPE, ATTRS, BUILTIN_LANG) BUILTIN(ID, TYPE, ATTRS) #endif +#if defined(BUILTIN) && !defined(TARGET_HEADER_BUILTIN) +# define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANG, FEATURE) BUILTIN(ID, TYPE, ATTRS) +#endif + // In libgcc BUILTIN(__clear_cache, "vv*v*", "i") @@ -65,9 +69,40 @@ BUILTIN(__builtin_arm_wsr, "vcC*Ui", "nc") BUILTIN(__builtin_arm_wsr64, "vcC*LUi", "nc") BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc") +// MSVC LANGBUILTIN(__dmb, "vUi", "nc", ALL_MS_LANGUAGES) LANGBUILTIN(__dsb, "vUi", "nc", ALL_MS_LANGUAGES) LANGBUILTIN(__isb, "vUi", "nc", ALL_MS_LANGUAGES) +LANGBUILTIN(__yield, "v", "", ALL_MS_LANGUAGES) +LANGBUILTIN(__wfe, "v", "", ALL_MS_LANGUAGES) +LANGBUILTIN(__wfi, "v", "", ALL_MS_LANGUAGES) +LANGBUILTIN(__sev, "v", "", ALL_MS_LANGUAGES) +LANGBUILTIN(__sevl, "v", "", ALL_MS_LANGUAGES) + +// MSVC intrinsics for volatile but non-acquire/release loads and stores +LANGBUILTIN(__iso_volatile_load8, "ccCD*", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(__iso_volatile_load16, "ssCD*", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(__iso_volatile_load32, "iiCD*", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(__iso_volatile_load64, "LLiLLiCD*", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(__iso_volatile_store8, "vcD*c", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(__iso_volatile_store16, "vsD*s", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(__iso_volatile_store32, "viD*i", "n", ALL_MS_LANGUAGES) +LANGBUILTIN(__iso_volatile_store64, "vLLiD*LLi", "n", ALL_MS_LANGUAGES) + +TARGET_HEADER_BUILTIN(_BitScanForward, "UcUNi*UNi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_BitScanReverse, "UcUNi*UNi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_BitScanForward64, "UcUNi*ULLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_BitScanReverse64, "UcUNi*ULLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") + +TARGET_HEADER_BUILTIN(_InterlockedAnd64, "LLiLLiD*LLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_InterlockedDecrement64, "LLiLLiD*", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_InterlockedExchange64, "LLiLLiD*LLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_InterlockedExchangeAdd64, "LLiLLiD*LLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_InterlockedExchangeSub64, "LLiLLiD*LLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_InterlockedIncrement64, "LLiLLiD*", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_InterlockedOr64, "LLiLLiD*LLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_InterlockedXor64, "LLiLLiD*LLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") #undef BUILTIN #undef LANGBUILTIN +#undef TARGET_HEADER_BUILTIN diff --git a/include/clang/Basic/BuiltinsAMDGPU.def b/include/clang/Basic/BuiltinsAMDGPU.def index ec6a0fb917657..46cd738ae43f6 100644 --- a/include/clang/Basic/BuiltinsAMDGPU.def +++ b/include/clang/Basic/BuiltinsAMDGPU.def @@ -21,9 +21,9 @@ // SI+ only builtins. //===----------------------------------------------------------------------===// -BUILTIN(__builtin_amdgcn_dispatch_ptr, "Uc*2", "nc") -BUILTIN(__builtin_amdgcn_kernarg_segment_ptr, "Uc*2", "nc") -BUILTIN(__builtin_amdgcn_implicitarg_ptr, "Uc*2", "nc") +BUILTIN(__builtin_amdgcn_dispatch_ptr, "Uc*4", "nc") +BUILTIN(__builtin_amdgcn_kernarg_segment_ptr, "Uc*4", "nc") +BUILTIN(__builtin_amdgcn_implicitarg_ptr, "Uc*4", "nc") BUILTIN(__builtin_amdgcn_workgroup_id_x, "Ui", "nc") BUILTIN(__builtin_amdgcn_workgroup_id_y, "Ui", "nc") @@ -93,6 +93,9 @@ BUILTIN(__builtin_amdgcn_ds_bpermute, "iii", "nc") BUILTIN(__builtin_amdgcn_readfirstlane, "ii", "nc") BUILTIN(__builtin_amdgcn_readlane, "iii", "nc") BUILTIN(__builtin_amdgcn_fmed3f, "ffff", "nc") +BUILTIN(__builtin_amdgcn_ds_faddf, "ff*fIiIiIb", "n") +BUILTIN(__builtin_amdgcn_ds_fminf, "ff*fIiIiIb", "n") +BUILTIN(__builtin_amdgcn_ds_fmaxf, "ff*fIiIiIb", "n") //===----------------------------------------------------------------------===// // VI+ only builtins. @@ -118,6 +121,18 @@ TARGET_BUILTIN(__builtin_amdgcn_mov_dpp, "iiIiIiIiIb", "nc", "dpp") TARGET_BUILTIN(__builtin_amdgcn_fmed3h, "hhhh", "nc", "gfx9-insts") //===----------------------------------------------------------------------===// +// Deep learning builtins. +//===----------------------------------------------------------------------===// + +TARGET_BUILTIN(__builtin_amdgcn_fdot2, "fV2hV2hf", "nc", "dl-insts") +TARGET_BUILTIN(__builtin_amdgcn_sdot2, "SiV2SsV2SsSi", "nc", "dl-insts") +TARGET_BUILTIN(__builtin_amdgcn_udot2, "UiV2UsV2UsUi", "nc", "dl-insts") +TARGET_BUILTIN(__builtin_amdgcn_sdot4, "SiSiSiSi", "nc", "dl-insts") +TARGET_BUILTIN(__builtin_amdgcn_udot4, "UiUiUiUi", "nc", "dl-insts") +TARGET_BUILTIN(__builtin_amdgcn_sdot8, "SiSiSiSi", "nc", "dl-insts") +TARGET_BUILTIN(__builtin_amdgcn_udot8, "UiUiUiUi", "nc", "dl-insts") + +//===----------------------------------------------------------------------===// // Special builtins. //===----------------------------------------------------------------------===// BUILTIN(__builtin_amdgcn_read_exec, "LUi", "nc") diff --git a/include/clang/Basic/BuiltinsHexagon.def b/include/clang/Basic/BuiltinsHexagon.def index fda50b53589bd..f976720d116d0 100644 --- a/include/clang/Basic/BuiltinsHexagon.def +++ b/include/clang/Basic/BuiltinsHexagon.def @@ -17,28 +17,51 @@ // The builtins below are not autogenerated from iset.py. // Make sure you do not overwrite these. -BUILTIN(__builtin_brev_ldd, "LLi*LLi*LLi*i", "") -BUILTIN(__builtin_brev_ldw, "i*i*i*i", "") -BUILTIN(__builtin_brev_ldh, "s*s*s*i", "") -BUILTIN(__builtin_brev_lduh, "Us*Us*Us*i", "") -BUILTIN(__builtin_brev_ldb, "c*c*c*i", "") -BUILTIN(__builtin_brev_ldub, "Uc*Uc*Uc*i", "") +BUILTIN(__builtin_brev_ldd, "v*LLi*CLLi*iC", "") +BUILTIN(__builtin_brev_ldw, "v*i*Ci*iC", "") +BUILTIN(__builtin_brev_ldh, "v*s*Cs*iC", "") +BUILTIN(__builtin_brev_lduh, "v*Us*CUs*iC", "") +BUILTIN(__builtin_brev_ldb, "v*Sc*CSc*iC", "") +BUILTIN(__builtin_brev_ldub, "v*Uc*CUc*iC", "") BUILTIN(__builtin_circ_ldd, "LLi*LLi*LLi*iIi", "") BUILTIN(__builtin_circ_ldw, "i*i*i*iIi", "") BUILTIN(__builtin_circ_ldh, "s*s*s*iIi", "") BUILTIN(__builtin_circ_lduh, "Us*Us*Us*iIi", "") BUILTIN(__builtin_circ_ldb, "c*c*c*iIi", "") BUILTIN(__builtin_circ_ldub, "Uc*Uc*Uc*iIi", "") -BUILTIN(__builtin_brev_std, "LLi*LLi*LLii", "") -BUILTIN(__builtin_brev_stw, "i*i*ii", "") -BUILTIN(__builtin_brev_sth, "s*s*ii", "") -BUILTIN(__builtin_brev_sthhi, "s*s*ii", "") -BUILTIN(__builtin_brev_stb, "c*c*ii", "") +BUILTIN(__builtin_brev_std, "LLi*CLLi*LLiiC", "") +BUILTIN(__builtin_brev_stw, "i*Ci*iiC", "") +BUILTIN(__builtin_brev_sth, "s*Cs*iiC", "") +BUILTIN(__builtin_brev_sthhi, "s*Cs*iiC", "") +BUILTIN(__builtin_brev_stb, "c*Cc*iiC", "") BUILTIN(__builtin_circ_std, "LLi*LLi*LLiiIi", "") BUILTIN(__builtin_circ_stw, "i*i*iiIi", "") BUILTIN(__builtin_circ_sth, "s*s*iiIi", "") BUILTIN(__builtin_circ_sthhi, "s*s*iiIi", "") BUILTIN(__builtin_circ_stb, "c*c*iiIi", "") +BUILTIN(__builtin_HEXAGON_L2_loadrub_pci, "iv*IiivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadrb_pci, "iv*IiivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadruh_pci, "iv*IiivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadrh_pci, "iv*IiivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadri_pci, "iv*IiivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadrd_pci, "LLiv*IiivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadrub_pcr, "iv*ivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadrb_pcr, "iv*ivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadruh_pcr, "iv*ivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadrh_pcr, "iv*ivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadri_pcr, "iv*ivC*", "") +BUILTIN(__builtin_HEXAGON_L2_loadrd_pcr, "LLiv*ivC*", "") + +BUILTIN(__builtin_HEXAGON_S2_storerb_pci, "vv*IiiivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storerh_pci, "vv*IiiivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storerf_pci, "vv*IiiivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storeri_pci, "vv*IiiivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storerd_pci, "vv*IiiLLivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storerb_pcr, "vv*iivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storerh_pcr, "vv*iivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storerf_pcr, "vv*iivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storeri_pcr, "vv*iivC*", "") +BUILTIN(__builtin_HEXAGON_S2_storerd_pcr, "vv*iLLivC*", "") // The builtins above are not autogenerated from iset.py. // Make sure you do not overwrite these. diff --git a/include/clang/Basic/BuiltinsNEON.def b/include/clang/Basic/BuiltinsNEON.def index 7800ae69c4c96..241b93a915a94 100644 --- a/include/clang/Basic/BuiltinsNEON.def +++ b/include/clang/Basic/BuiltinsNEON.def @@ -16,6 +16,7 @@ #define GET_NEON_BUILTINS #include "clang/Basic/arm_neon.inc" +#include "clang/Basic/arm_fp16.inc" #undef GET_NEON_BUILTINS #undef BUILTIN diff --git a/include/clang/Basic/BuiltinsNVPTX.def b/include/clang/Basic/BuiltinsNVPTX.def index 7bab73a3b110c..08c60979779b7 100644 --- a/include/clang/Basic/BuiltinsNVPTX.def +++ b/include/clang/Basic/BuiltinsNVPTX.def @@ -18,6 +18,19 @@ # define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) #endif +#pragma push_macro("SM_70") +#define SM_70 "sm_70|sm_71" +#pragma push_macro("SM_60") +#define SM_60 "sm_60|sm_61|sm_62|" SM_70 + +#pragma push_macro("PTX61") +#define PTX61 "ptx61" +#pragma push_macro("PTX60") +#define PTX60 "ptx60|" PTX61 + +#pragma push_macro("AND") +#define AND(a, b) a "," b + // Special Registers BUILTIN(__nvvm_read_ptx_sreg_tid_x, "i", "nc") @@ -372,7 +385,7 @@ BUILTIN(__nvvm_bitcast_ll2d, "dLLi", "") BUILTIN(__nvvm_bitcast_d2ll, "LLid", "") // FNS -TARGET_BUILTIN(__nvvm_fns, "UiUiUii", "n", "ptx60") +TARGET_BUILTIN(__nvvm_fns, "UiUiUii", "n", PTX60) // Sync @@ -381,9 +394,9 @@ BUILTIN(__nvvm_bar0_popc, "ii", "") BUILTIN(__nvvm_bar0_and, "ii", "") BUILTIN(__nvvm_bar0_or, "ii", "") BUILTIN(__nvvm_bar_sync, "vi", "n") -TARGET_BUILTIN(__nvvm_bar_warp_sync, "vUi", "n", "ptx60") -TARGET_BUILTIN(__nvvm_barrier_sync, "vUi", "n", "ptx60") -TARGET_BUILTIN(__nvvm_barrier_sync_cnt, "vUiUi", "n", "ptx60") +TARGET_BUILTIN(__nvvm_bar_warp_sync, "vUi", "n", PTX60) +TARGET_BUILTIN(__nvvm_barrier_sync, "vUi", "n", PTX60) +TARGET_BUILTIN(__nvvm_barrier_sync_cnt, "vUiUi", "n", PTX60) // Shuffle @@ -396,14 +409,14 @@ BUILTIN(__nvvm_shfl_bfly_f32, "ffii", "") BUILTIN(__nvvm_shfl_idx_i32, "iiii", "") BUILTIN(__nvvm_shfl_idx_f32, "ffii", "") -TARGET_BUILTIN(__nvvm_shfl_sync_down_i32, "iUiiii", "", "ptx60") -TARGET_BUILTIN(__nvvm_shfl_sync_down_f32, "fUifii", "", "ptx60") -TARGET_BUILTIN(__nvvm_shfl_sync_up_i32, "iUiiii", "", "ptx60") -TARGET_BUILTIN(__nvvm_shfl_sync_up_f32, "fUifii", "", "ptx60") -TARGET_BUILTIN(__nvvm_shfl_sync_bfly_i32, "iUiiii", "", "ptx60") -TARGET_BUILTIN(__nvvm_shfl_sync_bfly_f32, "fUifii", "", "ptx60") -TARGET_BUILTIN(__nvvm_shfl_sync_idx_i32, "iUiiii", "", "ptx60") -TARGET_BUILTIN(__nvvm_shfl_sync_idx_f32, "fUifii", "", "ptx60") +TARGET_BUILTIN(__nvvm_shfl_sync_down_i32, "iUiiii", "", PTX60) +TARGET_BUILTIN(__nvvm_shfl_sync_down_f32, "fUifii", "", PTX60) +TARGET_BUILTIN(__nvvm_shfl_sync_up_i32, "iUiiii", "", PTX60) +TARGET_BUILTIN(__nvvm_shfl_sync_up_f32, "fUifii", "", PTX60) +TARGET_BUILTIN(__nvvm_shfl_sync_bfly_i32, "iUiiii", "", PTX60) +TARGET_BUILTIN(__nvvm_shfl_sync_bfly_f32, "fUifii", "", PTX60) +TARGET_BUILTIN(__nvvm_shfl_sync_idx_i32, "iUiiii", "", PTX60) +TARGET_BUILTIN(__nvvm_shfl_sync_idx_f32, "fUifii", "", PTX60) // Vote BUILTIN(__nvvm_vote_all, "bb", "") @@ -411,17 +424,17 @@ BUILTIN(__nvvm_vote_any, "bb", "") BUILTIN(__nvvm_vote_uni, "bb", "") BUILTIN(__nvvm_vote_ballot, "Uib", "") -TARGET_BUILTIN(__nvvm_vote_all_sync, "bUib", "", "ptx60") -TARGET_BUILTIN(__nvvm_vote_any_sync, "bUib", "", "ptx60") -TARGET_BUILTIN(__nvvm_vote_uni_sync, "bUib", "", "ptx60") -TARGET_BUILTIN(__nvvm_vote_ballot_sync, "UiUib", "", "ptx60") +TARGET_BUILTIN(__nvvm_vote_all_sync, "bUib", "", PTX60) +TARGET_BUILTIN(__nvvm_vote_any_sync, "bUib", "", PTX60) +TARGET_BUILTIN(__nvvm_vote_uni_sync, "bUib", "", PTX60) +TARGET_BUILTIN(__nvvm_vote_ballot_sync, "UiUib", "", PTX60) // Match -TARGET_BUILTIN(__nvvm_match_any_sync_i32, "UiUiUi", "", "ptx60") -TARGET_BUILTIN(__nvvm_match_any_sync_i64, "WiUiWi", "", "ptx60") +TARGET_BUILTIN(__nvvm_match_any_sync_i32, "UiUiUi", "", PTX60) +TARGET_BUILTIN(__nvvm_match_any_sync_i64, "WiUiWi", "", PTX60) // These return a pair {value, predicate}, which requires custom lowering. -TARGET_BUILTIN(__nvvm_match_all_sync_i32p, "UiUiUii*", "", "ptx60") -TARGET_BUILTIN(__nvvm_match_all_sync_i64p, "WiUiWii*", "", "ptx60") +TARGET_BUILTIN(__nvvm_match_all_sync_i32p, "UiUiUii*", "", PTX60) +TARGET_BUILTIN(__nvvm_match_all_sync_i64p, "WiUiWii*", "", PTX60) // Membar @@ -462,194 +475,120 @@ BUILTIN(__builtin_ptx_get_image_channel_orderi_, "ii", "") // - they are used in address space analysis and optimization // So it does not hurt to expose them as builtins. // -BUILTIN(__nvvm_atom_add_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_add_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_add_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_i, "iiD*i", "n", "satom") -BUILTIN(__nvvm_atom_add_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_add_s_l, "LiLiD*3Li", "n") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_i, "iiD*i", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_i, "iiD*i", "n", SM_60) BUILTIN(__nvvm_atom_add_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_l, "LiLiD*Li", "n", "satom") -BUILTIN(__nvvm_atom_add_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_add_s_ll, "LLiLLiD*3LLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_l, "LiLiD*Li", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_l, "LiLiD*Li", "n", SM_60) BUILTIN(__nvvm_atom_add_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_ll, "LLiLLiD*LLi", "n", "satom") -BUILTIN(__nvvm_atom_add_g_f, "ffD*1f", "n") -BUILTIN(__nvvm_atom_add_s_f, "ffD*3f", "n") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_ll, "LLiLLiD*LLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_ll, "LLiLLiD*LLi", "n", SM_60) BUILTIN(__nvvm_atom_add_gen_f, "ffD*f", "n") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_f, "ffD*f", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_f, "ffD*f", "n", "satom") -BUILTIN(__nvvm_atom_add_g_d, "ddD*1d", "n") -BUILTIN(__nvvm_atom_add_s_d, "ddD*3d", "n") -TARGET_BUILTIN(__nvvm_atom_add_gen_d, "ddD*d", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_cta_add_gen_d, "ddD*d", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_add_gen_d, "ddD*d", "n", "satom") - -BUILTIN(__nvvm_atom_sub_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_sub_s_i, "iiD*3i", "n") +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_f, "ffD*f", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_f, "ffD*f", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_add_gen_d, "ddD*d", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_cta_add_gen_d, "ddD*d", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_add_gen_d, "ddD*d", "n", SM_60) + BUILTIN(__nvvm_atom_sub_gen_i, "iiD*i", "n") -BUILTIN(__nvvm_atom_sub_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_sub_s_l, "LiLiD*3Li", "n") BUILTIN(__nvvm_atom_sub_gen_l, "LiLiD*Li", "n") -BUILTIN(__nvvm_atom_sub_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_sub_s_ll, "LLiLLiD*3LLi", "n") BUILTIN(__nvvm_atom_sub_gen_ll, "LLiLLiD*LLi", "n") -BUILTIN(__nvvm_atom_xchg_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_xchg_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_xchg_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_i, "iiD*i", "n", "satom") -BUILTIN(__nvvm_atom_xchg_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_xchg_s_l, "LiLiD*3Li", "n") +TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_i, "iiD*i", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_i, "iiD*i", "n", SM_60) BUILTIN(__nvvm_atom_xchg_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_l, "LiLiD*Li", "n", "satom") -BUILTIN(__nvvm_atom_xchg_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_xchg_s_ll, "LLiLLiD*3LLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_l, "LiLiD*Li", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_l, "LiLiD*Li", "n", SM_60) BUILTIN(__nvvm_atom_xchg_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xchg_gen_ll, "LLiLLiD*LLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_xchg_gen_ll, "LLiLLiD*LLi", "n", SM_60) -BUILTIN(__nvvm_atom_max_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_max_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_max_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_i, "iiD*i", "n", "satom") -BUILTIN(__nvvm_atom_max_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_max_s_ui, "UiUiD*3Ui", "n") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_i, "iiD*i", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_i, "iiD*i", "n", SM_60) BUILTIN(__nvvm_atom_max_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ui, "UiUiD*Ui", "n", "satom") -BUILTIN(__nvvm_atom_max_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_max_s_l, "LiLiD*3Li", "n") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ui, "UiUiD*Ui", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ui, "UiUiD*Ui", "n", SM_60) BUILTIN(__nvvm_atom_max_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_l, "LiLiD*Li", "n", "satom") -BUILTIN(__nvvm_atom_max_g_ul, "ULiULiD*1ULi", "n") -BUILTIN(__nvvm_atom_max_s_ul, "ULiULiD*3ULi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_l, "LiLiD*Li", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_l, "LiLiD*Li", "n", SM_60) BUILTIN(__nvvm_atom_max_gen_ul, "ULiULiD*ULi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ul, "ULiULiD*ULi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ul, "ULiULiD*ULi", "n", "satom") -BUILTIN(__nvvm_atom_max_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_max_s_ll, "LLiLLiD*3LLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ul, "ULiULiD*ULi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ul, "ULiULiD*ULi", "n", SM_60) BUILTIN(__nvvm_atom_max_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ll, "LLiLLiD*LLi", "n", "satom") -BUILTIN(__nvvm_atom_max_g_ull, "ULLiULLiD*1ULLi", "n") -BUILTIN(__nvvm_atom_max_s_ull, "ULLiULLiD*3ULLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ll, "LLiLLiD*LLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ll, "LLiLLiD*LLi", "n", SM_60) BUILTIN(__nvvm_atom_max_gen_ull, "ULLiULLiD*ULLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ull, "ULLiULLiD*ULLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ull, "ULLiULLiD*ULLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_max_gen_ull, "ULLiULLiD*ULLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_max_gen_ull, "ULLiULLiD*ULLi", "n", SM_60) -BUILTIN(__nvvm_atom_min_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_min_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_min_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_i, "iiD*i", "n", "satom") -BUILTIN(__nvvm_atom_min_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_min_s_ui, "UiUiD*3Ui", "n") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_i, "iiD*i", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_i, "iiD*i", "n", SM_60) BUILTIN(__nvvm_atom_min_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ui, "UiUiD*Ui", "n", "satom") -BUILTIN(__nvvm_atom_min_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_min_s_l, "LiLiD*3Li", "n") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ui, "UiUiD*Ui", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ui, "UiUiD*Ui", "n", SM_60) BUILTIN(__nvvm_atom_min_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_l, "LiLiD*Li", "n", "satom") -BUILTIN(__nvvm_atom_min_g_ul, "ULiULiD*1ULi", "n") -BUILTIN(__nvvm_atom_min_s_ul, "ULiULiD*3ULi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_l, "LiLiD*Li", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_l, "LiLiD*Li", "n", SM_60) BUILTIN(__nvvm_atom_min_gen_ul, "ULiULiD*ULi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ul, "ULiULiD*ULi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ul, "ULiULiD*ULi", "n", "satom") -BUILTIN(__nvvm_atom_min_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_min_s_ll, "LLiLLiD*3LLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ul, "ULiULiD*ULi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ul, "ULiULiD*ULi", "n", SM_60) BUILTIN(__nvvm_atom_min_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ll, "LLiLLiD*LLi", "n", "satom") -BUILTIN(__nvvm_atom_min_g_ull, "ULLiULLiD*1ULLi", "n") -BUILTIN(__nvvm_atom_min_s_ull, "ULLiULLiD*3ULLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ll, "LLiLLiD*LLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ll, "LLiLLiD*LLi", "n", SM_60) BUILTIN(__nvvm_atom_min_gen_ull, "ULLiULLiD*ULLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ull, "ULLiULLiD*ULLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ull, "ULLiULLiD*ULLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_min_gen_ull, "ULLiULLiD*ULLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_min_gen_ull, "ULLiULLiD*ULLi", "n", SM_60) -BUILTIN(__nvvm_atom_inc_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_inc_s_ui, "UiUiD*3Ui", "n") BUILTIN(__nvvm_atom_inc_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_inc_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_inc_gen_ui, "UiUiD*Ui", "n", "satom") -BUILTIN(__nvvm_atom_dec_g_ui, "UiUiD*1Ui", "n") -BUILTIN(__nvvm_atom_dec_s_ui, "UiUiD*3Ui", "n") +TARGET_BUILTIN(__nvvm_atom_cta_inc_gen_ui, "UiUiD*Ui", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_inc_gen_ui, "UiUiD*Ui", "n", SM_60) BUILTIN(__nvvm_atom_dec_gen_ui, "UiUiD*Ui", "n") -TARGET_BUILTIN(__nvvm_atom_cta_dec_gen_ui, "UiUiD*Ui", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_dec_gen_ui, "UiUiD*Ui", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_dec_gen_ui, "UiUiD*Ui", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_dec_gen_ui, "UiUiD*Ui", "n", SM_60) -BUILTIN(__nvvm_atom_and_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_and_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_and_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_and_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_and_gen_i, "iiD*i", "n", "satom") -BUILTIN(__nvvm_atom_and_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_and_s_l, "LiLiD*3Li", "n") +TARGET_BUILTIN(__nvvm_atom_cta_and_gen_i, "iiD*i", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_and_gen_i, "iiD*i", "n", SM_60) BUILTIN(__nvvm_atom_and_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_and_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_and_gen_l, "LiLiD*Li", "n", "satom") -BUILTIN(__nvvm_atom_and_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_and_s_ll, "LLiLLiD*3LLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_and_gen_l, "LiLiD*Li", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_and_gen_l, "LiLiD*Li", "n", SM_60) BUILTIN(__nvvm_atom_and_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_and_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_and_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_and_gen_ll, "LLiLLiD*LLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_and_gen_ll, "LLiLLiD*LLi", "n", SM_60) -BUILTIN(__nvvm_atom_or_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_or_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_or_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_or_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_or_gen_i, "iiD*i", "n", "satom") -BUILTIN(__nvvm_atom_or_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_or_s_l, "LiLiD*3Li", "n") +TARGET_BUILTIN(__nvvm_atom_cta_or_gen_i, "iiD*i", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_or_gen_i, "iiD*i", "n", SM_60) BUILTIN(__nvvm_atom_or_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_or_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_or_gen_l, "LiLiD*Li", "n", "satom") -BUILTIN(__nvvm_atom_or_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_or_s_ll, "LLiLLiD*3LLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_or_gen_l, "LiLiD*Li", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_or_gen_l, "LiLiD*Li", "n", SM_60) BUILTIN(__nvvm_atom_or_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_or_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_or_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_or_gen_ll, "LLiLLiD*LLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_or_gen_ll, "LLiLLiD*LLi", "n", SM_60) -BUILTIN(__nvvm_atom_xor_g_i, "iiD*1i", "n") -BUILTIN(__nvvm_atom_xor_s_i, "iiD*3i", "n") BUILTIN(__nvvm_atom_xor_gen_i, "iiD*i", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_i, "iiD*i", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_i, "iiD*i", "n", "satom") -BUILTIN(__nvvm_atom_xor_g_l, "LiLiD*1Li", "n") -BUILTIN(__nvvm_atom_xor_s_l, "LiLiD*3Li", "n") +TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_i, "iiD*i", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_i, "iiD*i", "n", SM_60) BUILTIN(__nvvm_atom_xor_gen_l, "LiLiD*Li", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_l, "LiLiD*Li", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_l, "LiLiD*Li", "n", "satom") -BUILTIN(__nvvm_atom_xor_g_ll, "LLiLLiD*1LLi", "n") -BUILTIN(__nvvm_atom_xor_s_ll, "LLiLLiD*3LLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_l, "LiLiD*Li", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_l, "LiLiD*Li", "n", SM_60) BUILTIN(__nvvm_atom_xor_gen_ll, "LLiLLiD*LLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_ll, "LLiLLiD*LLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_ll, "LLiLLiD*LLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_xor_gen_ll, "LLiLLiD*LLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_xor_gen_ll, "LLiLLiD*LLi", "n", SM_60) -BUILTIN(__nvvm_atom_cas_g_i, "iiD*1ii", "n") -BUILTIN(__nvvm_atom_cas_s_i, "iiD*3ii", "n") BUILTIN(__nvvm_atom_cas_gen_i, "iiD*ii", "n") -TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_i, "iiD*ii", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_i, "iiD*ii", "n", "satom") -BUILTIN(__nvvm_atom_cas_g_l, "LiLiD*1LiLi", "n") -BUILTIN(__nvvm_atom_cas_s_l, "LiLiD*3LiLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_i, "iiD*ii", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_i, "iiD*ii", "n", SM_60) BUILTIN(__nvvm_atom_cas_gen_l, "LiLiD*LiLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_l, "LiLiD*LiLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_l, "LiLiD*LiLi", "n", "satom") -BUILTIN(__nvvm_atom_cas_g_ll, "LLiLLiD*1LLiLLi", "n") -BUILTIN(__nvvm_atom_cas_s_ll, "LLiLLiD*3LLiLLi", "n") +TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_l, "LiLiD*LiLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_l, "LiLiD*LiLi", "n", SM_60) BUILTIN(__nvvm_atom_cas_gen_ll, "LLiLLiD*LLiLLi", "n") -TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_ll, "LLiLLiD*LLiLLi", "n", "satom") -TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_ll, "LLiLLiD*LLiLLi", "n", "satom") +TARGET_BUILTIN(__nvvm_atom_cta_cas_gen_ll, "LLiLLiD*LLiLLi", "n", SM_60) +TARGET_BUILTIN(__nvvm_atom_sys_cas_gen_ll, "LLiLLiD*LLiLLi", "n", SM_60) // Compiler Error Warn BUILTIN(__nvvm_compiler_error, "vcC*4", "n") @@ -692,17 +631,46 @@ BUILTIN(__nvvm_ldg_f4, "E4fE4fC*", "") BUILTIN(__nvvm_ldg_d2, "E2dE2dC*", "") // Builtins to support WMMA instructions on sm_70 -TARGET_BUILTIN(__hmma_m16n16k16_ld_a, "vi*iC*UiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_ld_b, "vi*iC*UiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_ld_c_f16, "vi*iC*UiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_ld_c_f32, "vf*fC*UiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_st_c_f16, "vi*i*UiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_st_c_f32, "vf*f*UiIi", "", "ptx60") - -TARGET_BUILTIN(__hmma_m16n16k16_mma_f16f16, "vi*iC*iC*iC*IiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_mma_f32f16, "vf*iC*iC*iC*IiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_mma_f32f32, "vf*iC*iC*fC*IiIi", "", "ptx60") -TARGET_BUILTIN(__hmma_m16n16k16_mma_f16f32, "vi*iC*iC*fC*IiIi", "", "ptx60") +TARGET_BUILTIN(__hmma_m16n16k16_ld_a, "vi*iC*UiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_ld_b, "vi*iC*UiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_ld_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_ld_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_st_c_f16, "vi*i*UiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_st_c_f32, "vf*f*UiIi", "", AND(SM_70,PTX60)) + +TARGET_BUILTIN(__hmma_m32n8k16_ld_a, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_ld_b, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_ld_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_ld_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_st_c_f16, "vi*i*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_st_c_f32, "vf*f*UiIi", "", AND(SM_70,PTX61)) + +TARGET_BUILTIN(__hmma_m8n32k16_ld_a, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_ld_b, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_ld_c_f16, "vi*iC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_ld_c_f32, "vf*fC*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_st_c_f16, "vi*i*UiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_st_c_f32, "vf*f*UiIi", "", AND(SM_70,PTX61)) + +TARGET_BUILTIN(__hmma_m16n16k16_mma_f16f16, "vi*iC*iC*iC*IiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_mma_f32f16, "vf*iC*iC*iC*IiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_mma_f32f32, "vf*iC*iC*fC*IiIi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__hmma_m16n16k16_mma_f16f32, "vi*iC*iC*fC*IiIi", "", AND(SM_70,PTX60)) + +TARGET_BUILTIN(__hmma_m32n8k16_mma_f16f16, "vi*iC*iC*iC*IiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_mma_f32f16, "vf*iC*iC*iC*IiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_mma_f32f32, "vf*iC*iC*fC*IiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m32n8k16_mma_f16f32, "vi*iC*iC*fC*IiIi", "", AND(SM_70,PTX61)) + +TARGET_BUILTIN(__hmma_m8n32k16_mma_f16f16, "vi*iC*iC*iC*IiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_mma_f32f16, "vf*iC*iC*iC*IiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_mma_f32f32, "vf*iC*iC*fC*IiIi", "", AND(SM_70,PTX61)) +TARGET_BUILTIN(__hmma_m8n32k16_mma_f16f32, "vi*iC*iC*fC*IiIi", "", AND(SM_70,PTX61)) #undef BUILTIN #undef TARGET_BUILTIN +#pragma pop_macro("AND") +#pragma pop_macro("SM_60") +#pragma pop_macro("SM_70") +#pragma pop_macro("PTX60") +#pragma pop_macro("PTX61") diff --git a/include/clang/Basic/BuiltinsPPC.def b/include/clang/Basic/BuiltinsPPC.def index faa70a48edc3c..8cd8a2be20030 100644 --- a/include/clang/Basic/BuiltinsPPC.def +++ b/include/clang/Basic/BuiltinsPPC.def @@ -423,6 +423,15 @@ BUILTIN(__builtin_vsx_extractuword, "V2ULLiV16UcIi", "") BUILTIN(__builtin_vsx_xxpermdi, "v.", "t") BUILTIN(__builtin_vsx_xxsldwi, "v.", "t") +// Float 128 built-ins +BUILTIN(__builtin_sqrtf128_round_to_odd, "LLdLLd", "") +BUILTIN(__builtin_addf128_round_to_odd, "LLdLLdLLd", "") +BUILTIN(__builtin_subf128_round_to_odd, "LLdLLdLLd", "") +BUILTIN(__builtin_mulf128_round_to_odd, "LLdLLdLLd", "") +BUILTIN(__builtin_divf128_round_to_odd, "LLdLLdLLd", "") +BUILTIN(__builtin_fmaf128_round_to_odd, "LLdLLdLLdLLd", "") +BUILTIN(__builtin_truncf128_round_to_odd, "dLLd", "") + // HTM builtins BUILTIN(__builtin_tbegin, "UiUIi", "") BUILTIN(__builtin_tend, "UiUIi", "") diff --git a/include/clang/Basic/BuiltinsWebAssembly.def b/include/clang/Basic/BuiltinsWebAssembly.def index 19318dcebb9ec..b3d877dcedf38 100644 --- a/include/clang/Basic/BuiltinsWebAssembly.def +++ b/include/clang/Basic/BuiltinsWebAssembly.def @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief This file defines the WebAssembly-specific builtin function database. +/// This file defines the WebAssembly-specific builtin function database. /// Users of this file must define the BUILTIN macro to make use of this /// information. /// @@ -16,8 +16,17 @@ // The format of this database matches clang/Basic/Builtins.def. -// Note that current_memory is not "c" (readnone) because it must be sequenced -// with respect to grow_memory calls. +// Query the current memory size, and increase the current memory size. +// Note that memory.size is not "c" (readnone) because it must be sequenced +// with respect to memory.grow calls. +BUILTIN(__builtin_wasm_memory_size, "zIi", "n") +BUILTIN(__builtin_wasm_memory_grow, "zIiz", "n") + +// These are the old names. +BUILTIN(__builtin_wasm_mem_size, "zIi", "n") +BUILTIN(__builtin_wasm_mem_grow, "zIiz", "n") + +// These are the old old names. They also lack the immediate field. BUILTIN(__builtin_wasm_current_memory, "z", "n") BUILTIN(__builtin_wasm_grow_memory, "zz", "n") diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 465551be77427..e98f7d612c3c6 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -27,8 +27,6 @@ # define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANG, FEATURE) BUILTIN(ID, TYPE, ATTRS) #endif -// FIXME: Are these nothrow/const? - // Miscellaneous builtin for checking x86 cpu features. // TODO: Make this somewhat generic so that other backends // can use it? @@ -38,9 +36,9 @@ BUILTIN(__builtin_cpu_is, "bcC*", "nc") // Undefined Values // -TARGET_BUILTIN(__builtin_ia32_undef128, "V2d", "nc", "") -TARGET_BUILTIN(__builtin_ia32_undef256, "V4d", "nc", "") -TARGET_BUILTIN(__builtin_ia32_undef512, "V8d", "nc", "") +TARGET_BUILTIN(__builtin_ia32_undef128, "V2d", "ncV:128:", "") +TARGET_BUILTIN(__builtin_ia32_undef256, "V4d", "ncV:256:", "") +TARGET_BUILTIN(__builtin_ia32_undef512, "V8d", "ncV:512:", "") // FLAGS // @@ -49,33 +47,33 @@ TARGET_BUILTIN(__builtin_ia32_writeeflags_u32, "vUi", "n", "") // 3DNow! // -TARGET_BUILTIN(__builtin_ia32_femms, "v", "", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pavgusb, "V8cV8cV8c", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pf2id, "V2iV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfacc, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfadd, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfcmpeq, "V2iV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfcmpge, "V2iV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfcmpgt, "V2iV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfmax, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfmin, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfmul, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrcp, "V2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrcpit1, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrcpit2, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrsqrt, "V2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfrsqit1, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfsub, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pfsubr, "V2fV2fV2f", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pi2fd, "V2fV2i", "nc", "3dnow") -TARGET_BUILTIN(__builtin_ia32_pmulhrw, "V4sV4sV4s", "nc", "3dnow") +TARGET_BUILTIN(__builtin_ia32_femms, "v", "n", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pavgusb, "V8cV8cV8c", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pf2id, "V2iV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfacc, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfadd, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfcmpeq, "V2iV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfcmpge, "V2iV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfcmpgt, "V2iV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfmax, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfmin, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfmul, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfrcp, "V2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfrcpit1, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfrcpit2, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfrsqrt, "V2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfrsqit1, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfsub, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pfsubr, "V2fV2fV2f", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pi2fd, "V2fV2i", "ncV:64:", "3dnow") +TARGET_BUILTIN(__builtin_ia32_pmulhrw, "V4sV4sV4s", "ncV:64:", "3dnow") // 3DNow! Extensions (3dnowa). -TARGET_BUILTIN(__builtin_ia32_pf2iw, "V2iV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pfnacc, "V2fV2fV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pfpnacc, "V2fV2fV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pi2fw, "V2fV2i", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pswapdsf, "V2fV2f", "nc", "3dnowa") -TARGET_BUILTIN(__builtin_ia32_pswapdsi, "V2iV2i", "nc", "3dnowa") +TARGET_BUILTIN(__builtin_ia32_pf2iw, "V2iV2f", "ncV:64:", "3dnowa") +TARGET_BUILTIN(__builtin_ia32_pfnacc, "V2fV2fV2f", "ncV:64:", "3dnowa") +TARGET_BUILTIN(__builtin_ia32_pfpnacc, "V2fV2fV2f", "ncV:64:", "3dnowa") +TARGET_BUILTIN(__builtin_ia32_pi2fw, "V2fV2i", "ncV:64:", "3dnowa") +TARGET_BUILTIN(__builtin_ia32_pswapdsf, "V2fV2f", "ncV:64:", "3dnowa") +TARGET_BUILTIN(__builtin_ia32_pswapdsi, "V2iV2i", "ncV:64:", "3dnowa") // MMX // @@ -86,1808 +84,1758 @@ TARGET_BUILTIN(__builtin_ia32_pswapdsi, "V2iV2i", "nc", "3dnowa") // argument and our prior approach of using a #define to the current built-in // doesn't work in the presence of re-declaration of _mm_prefetch for windows. TARGET_BUILTIN(_mm_prefetch, "vcC*i", "nc", "mmx") -TARGET_BUILTIN(__builtin_ia32_emms, "v", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddsb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddsw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddusb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_paddusw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubsb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubsw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubusb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psubusw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pmulhw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pmullw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pmaddwd, "V2iV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pand, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pandn, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_por, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pxor, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllw, "V4sV4sV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pslld, "V2iV2iV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllq, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlw, "V4sV4sV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrld, "V2iV2iV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlq, "V1LLiV1LLiV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psraw, "V4sV4sV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrad, "V2iV2iV1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllwi, "V4sV4si", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pslldi, "V2iV2ii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psllqi, "V1LLiV1LLii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlwi, "V4sV4si", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrldi, "V2iV2ii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrlqi, "V1LLiV1LLii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psrawi, "V4sV4si", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_psradi, "V2iV2ii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_packsswb, "V8cV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_packssdw, "V4sV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_packuswb, "V8cV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckhbw, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckhwd, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckhdq, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpcklbw, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpcklwd, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_punpckldq, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpeqb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpeqw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpeqd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpgtb, "V8cV8cV8c", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpgtw, "V4sV4sV4s", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_pcmpgtd, "V2iV2iV2i", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_maskmovq, "vV8cV8cc*", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_movntq, "vV1LLi*V1LLi", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_init_v2si, "V2iii", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_init_v4hi, "V4sssss", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_init_v8qi, "V8ccccccccc", "", "mmx") -TARGET_BUILTIN(__builtin_ia32_vec_ext_v2si, "iV2ii", "", "mmx") +TARGET_BUILTIN(__builtin_ia32_emms, "v", "n", "mmx") +TARGET_BUILTIN(__builtin_ia32_paddb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_paddw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_paddd, "V2iV2iV2i", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_paddsb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_paddsw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_paddusb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_paddusw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psubb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psubw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psubd, "V2iV2iV2i", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psubsb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psubsw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psubusb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psubusw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pmulhw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pmullw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pmaddwd, "V2iV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pand, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pandn, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_por, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pxor, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psllw, "V4sV4sV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pslld, "V2iV2iV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psllq, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrlw, "V4sV4sV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrld, "V2iV2iV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrlq, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psraw, "V4sV4sV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrad, "V2iV2iV1LLi", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psllwi, "V4sV4si", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pslldi, "V2iV2ii", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psllqi, "V1LLiV1LLii", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrlwi, "V4sV4si", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrldi, "V2iV2ii", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrlqi, "V1LLiV1LLii", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psrawi, "V4sV4si", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_psradi, "V2iV2ii", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_packsswb, "V8cV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_packssdw, "V4sV2iV2i", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_packuswb, "V8cV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_punpckhbw, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_punpckhwd, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_punpckhdq, "V2iV2iV2i", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_punpcklbw, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_punpcklwd, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_punpckldq, "V2iV2iV2i", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pcmpeqb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pcmpeqw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pcmpeqd, "V2iV2iV2i", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pcmpgtb, "V8cV8cV8c", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pcmpgtw, "V4sV4sV4s", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_pcmpgtd, "V2iV2iV2i", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_maskmovq, "vV8cV8cc*", "nV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_movntq, "vV1LLi*V1LLi", "nV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_vec_init_v2si, "V2iii", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_vec_init_v4hi, "V4sssss", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_vec_init_v8qi, "V8ccccccccc", "ncV:64:", "mmx") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v2si, "iV2ii", "ncV:64:", "mmx") // MMX2 (MMX+SSE) intrinsics -TARGET_BUILTIN(__builtin_ia32_cvtpi2ps, "V4fV4fV2i", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvtps2pi, "V2iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvttps2pi, "V2iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pavgb, "V8cV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pavgw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmaxsw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmaxub, "V8cV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pminsw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pminub, "V8cV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmovmskb, "iV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pmulhuw, "V4sV4sV4s", "", "sse") -TARGET_BUILTIN(__builtin_ia32_psadbw, "V4sV8cV8c", "", "sse") -TARGET_BUILTIN(__builtin_ia32_pshufw, "V4sV4sIc", "", "sse") -TARGET_BUILTIN(__builtin_ia32_vec_ext_v4hi, "iV4sIi", "", "sse") -TARGET_BUILTIN(__builtin_ia32_vec_set_v4hi, "V4sV4siIi", "", "sse") +TARGET_BUILTIN(__builtin_ia32_cvtpi2ps, "V4fV4fV2i", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_cvtps2pi, "V2iV4f", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_cvttps2pi, "V2iV4f", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pavgb, "V8cV8cV8c", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pavgw, "V4sV4sV4s", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pmaxsw, "V4sV4sV4s", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pmaxub, "V8cV8cV8c", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pminsw, "V4sV4sV4s", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pminub, "V8cV8cV8c", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pmovmskb, "iV8c", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pmulhuw, "V4sV4sV4s", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_psadbw, "V4sV8cV8c", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_pshufw, "V4sV4sIc", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v4hi, "iV4sIi", "ncV:64:", "mmx,sse") +TARGET_BUILTIN(__builtin_ia32_vec_set_v4hi, "V4sV4siIi", "ncV:64:", "mmx,sse") // MMX+SSE2 -TARGET_BUILTIN(__builtin_ia32_cvtpd2pi, "V2iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtpi2pd, "V2dV2i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttpd2pi, "V2iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddq, "V1LLiV1LLiV1LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmuludq, "V1LLiV2iV2i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubq, "V1LLiV1LLiV1LLi", "", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvtpd2pi, "V2iV2d", "ncV:64:", "mmx,sse2") +TARGET_BUILTIN(__builtin_ia32_cvtpi2pd, "V2dV2i", "ncV:64:", "mmx,sse2") +TARGET_BUILTIN(__builtin_ia32_cvttpd2pi, "V2iV2d", "ncV:64:", "mmx,sse2") +TARGET_BUILTIN(__builtin_ia32_paddq, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx,sse2") +TARGET_BUILTIN(__builtin_ia32_pmuludq, "V1LLiV2iV2i", "ncV:64:", "mmx,sse2") +TARGET_BUILTIN(__builtin_ia32_psubq, "V1LLiV1LLiV1LLi", "ncV:64:", "mmx,sse2") // MMX+SSSE3 -TARGET_BUILTIN(__builtin_ia32_pabsb, "V8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsd, "V2iV2i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsw, "V4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_palignr, "V8cV8cV8cIc", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddd, "V2iV2iV2i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddsw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubd, "V2iV2iV2i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubsw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw, "V8cV8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pshufb, "V8cV8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignw, "V4sV4sV4s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignb, "V8cV8cV8c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignd, "V2iV2iV2i", "", "ssse3") +TARGET_BUILTIN(__builtin_ia32_pabsb, "V8cV8c", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_pabsd, "V2iV2i", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_pabsw, "V4sV4s", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_palignr, "V8cV8cV8cIc", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_phaddd, "V2iV2iV2i", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_phaddsw, "V4sV4sV4s", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_phaddw, "V4sV4sV4s", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_phsubd, "V2iV2iV2i", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_phsubsw, "V4sV4sV4s", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_phsubw, "V4sV4sV4s", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_pmaddubsw, "V8cV8cV8c", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_pmulhrsw, "V4sV4sV4s", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_pshufb, "V8cV8cV8c", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_psignw, "V4sV4sV4s", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_psignb, "V8cV8cV8c", "ncV:64:", "mmx,ssse3") +TARGET_BUILTIN(__builtin_ia32_psignd, "V2iV2iV2i", "ncV:64:", "mmx,ssse3") // SSE intrinsics. -TARGET_BUILTIN(__builtin_ia32_comieq, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comilt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comile, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comigt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comige, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_comineq, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomieq, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomilt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomile, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomigt, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomige, "iV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_ucomineq, "iV4fV4f", "", "sse") - -TARGET_BUILTIN(__builtin_ia32_comisdeq, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdlt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdle, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdgt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdge, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_comisdneq, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdeq, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdlt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdle, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdgt, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdge, "iV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_ucomisdneq, "iV2dV2d", "", "sse2") - -TARGET_BUILTIN(__builtin_ia32_cmpeqps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpltps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpleps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpunordps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpneqps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnltps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnleps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpordps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpeqss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpltss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpless, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpunordss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpneqss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnltss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpnless, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cmpordss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_minps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_maxps, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_minss, "V4fV4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_maxss, "V4fV4fV4f", "", "sse") - -TARGET_BUILTIN(__builtin_ia32_cmpeqpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpltpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmplepd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpunordpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpneqpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnltpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnlepd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpordpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpeqsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpltsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmplesd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpunordsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpneqsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnltsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpnlesd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cmpordsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_minpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_maxpd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_minsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_maxsd, "V2dV2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddsb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubsb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddusb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddusw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubusb128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubusw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmulhw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmaxub128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmaxsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pminub128, "V16cV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pminsw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_packsswb128, "V16cV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_packssdw128, "V8sV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_packuswb128, "V16cV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmulhuw128, "V8sV8sV8s", "", "sse2") - -TARGET_BUILTIN(__builtin_ia32_addsubps, "V4fV4fV4f", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_addsubpd, "V2dV2dV2d", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_haddps, "V4fV4fV4f", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_haddpd, "V2dV2dV2d", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_hsubps, "V4fV4fV4f", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_hsubpd, "V2dV2dV2d", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_phaddw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddd128, "V4iV4iV4i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phaddsw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubd128, "V4iV4iV4i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_phsubsw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw128, "V8sV16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pshufb128, "V16cV16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignb128, "V16cV16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignw128, "V8sV8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_psignd128, "V4iV4iV4i", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsb128, "V16cV16c", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsw128, "V8sV8s", "", "ssse3") -TARGET_BUILTIN(__builtin_ia32_pabsd128, "V4iV4i", "", "ssse3") - -TARGET_BUILTIN(__builtin_ia32_ldmxcsr, "vUi", "", "sse") -TARGET_HEADER_BUILTIN(_mm_setcsr, "vUi", "h","xmmintrin.h", ALL_LANGUAGES, "sse") -TARGET_BUILTIN(__builtin_ia32_stmxcsr, "Ui", "", "sse") -TARGET_HEADER_BUILTIN(_mm_getcsr, "Ui", "h", "xmmintrin.h", ALL_LANGUAGES, "sse") -TARGET_BUILTIN(__builtin_ia32_cvtss2si, "iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvttss2si, "iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_storehps, "vV2i*V4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_storelps, "vV2i*V4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_movmskps, "iV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_sfence, "v", "", "sse") -TARGET_HEADER_BUILTIN(_mm_sfence, "v", "h", "xmmintrin.h", ALL_LANGUAGES, "sse") -TARGET_BUILTIN(__builtin_ia32_rcpps, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_rcpss, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_rsqrtps, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_rsqrtss, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_sqrtps, "V4fV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_sqrtss, "V4fV4f", "", "sse") - -TARGET_BUILTIN(__builtin_ia32_maskmovdqu, "vV16cV16cc*", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movmskpd, "iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmovmskb128, "iV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movnti, "vi*i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_movnti64, "vLLi*LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psadbw128, "V2LLiV16cV16c", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_sqrtpd, "V2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_sqrtsd, "V2dV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps, "V4fV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq, "V2LLiV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps, "V4fV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq, "V4iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtsd2si, "iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttsd2si, "iV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtsd2ss, "V4fV4fV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq, "V4iV4f", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq, "V4iV4f", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_clflush, "vvC*", "", "sse2") -TARGET_HEADER_BUILTIN(_mm_clflush, "vvC*", "h", "emmintrin.h", ALL_LANGUAGES, "sse2") -TARGET_BUILTIN(__builtin_ia32_lfence, "v", "", "sse2") -TARGET_HEADER_BUILTIN(_mm_lfence, "v", "h", "emmintrin.h", ALL_LANGUAGES, "sse2") -TARGET_BUILTIN(__builtin_ia32_mfence, "v", "", "sse2") -TARGET_HEADER_BUILTIN(_mm_mfence, "v", "h", "emmintrin.h", ALL_LANGUAGES, "sse2") -TARGET_BUILTIN(__builtin_ia32_pause, "v", "", "") -TARGET_HEADER_BUILTIN(_mm_pause, "v", "h", "emmintrin.h", ALL_LANGUAGES, "") -TARGET_BUILTIN(__builtin_ia32_pmuludq128, "V2LLiV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psraw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrad128, "V4iV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrld128, "V4iV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlq128, "V2LLiV2LLiV2LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllw128, "V8sV8sV8s", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pslld128, "V4iV4iV4i", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllq128, "V2LLiV2LLiV2LLi", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllwi128, "V8sV8si", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pslldi128, "V4iV4ii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psllqi128, "V2LLiV2LLii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlwi128, "V8sV8si", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrldi128, "V4iV4ii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrlqi128, "V2LLiV2LLii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psrawi128, "V8sV8si", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_psradi128, "V4iV4ii", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_pmaddwd128, "V4iV8sV8s", "", "sse2") - -TARGET_BUILTIN(__builtin_ia32_monitor, "vv*UiUi", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_mwait, "vUiUi", "", "sse3") -TARGET_BUILTIN(__builtin_ia32_lddqu, "V16ccC*", "", "sse3") - -TARGET_BUILTIN(__builtin_ia32_palignr128, "V16cV16cV16cIi", "", "ssse3") - -TARGET_BUILTIN(__builtin_ia32_insertps128, "V4fV4fV4fIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pblendvb128, "V16cV16cV16cV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_blendvpd, "V2dV2dV2dV2d", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_blendvps, "V4fV4fV4fV4f", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_packusdw128, "V8sV4iV4i", "", "sse4.1") - -TARGET_BUILTIN(__builtin_ia32_pmaxsb128, "V16cV16cV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmaxsd128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmaxud128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmaxuw128, "V8sV8sV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminsb128, "V16cV16cV16c", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminsd128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminud128, "V4iV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pminuw128, "V8sV8sV8s", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundps, "V4fV4fIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundss, "V4fV4fV4fIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundsd, "V2dV2dV2dIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_roundpd, "V2dV2dIi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_dpps, "V4fV4fV4fIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_dppd, "V2dV2dV2dIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_ptestz128, "iV2LLiV2LLi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_ptestc128, "iV2LLiV2LLi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_ptestnzc128, "iV2LLiV2LLi", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_mpsadbw128, "V16cV16cV16cIc", "", "sse4.1") -TARGET_BUILTIN(__builtin_ia32_phminposuw128, "V8sV8s", "", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_comieq, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_comilt, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_comile, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_comigt, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_comige, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_comineq, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_ucomieq, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_ucomilt, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_ucomile, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_ucomigt, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_ucomige, "iV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_ucomineq, "iV4fV4f", "ncV:128:", "sse") + +TARGET_BUILTIN(__builtin_ia32_comisdeq, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_comisdlt, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_comisdle, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_comisdgt, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_comisdge, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_comisdneq, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_ucomisdeq, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_ucomisdlt, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_ucomisdle, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_ucomisdgt, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_ucomisdge, "iV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_ucomisdneq, "iV2dV2d", "ncV:128:", "sse2") + +TARGET_BUILTIN(__builtin_ia32_cmpeqps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpltps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpleps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpunordps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpneqps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpnltps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpnleps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpordps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpeqss, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpltss, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpless, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpunordss, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpneqss, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpnltss, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpnless, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cmpordss, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_minps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_maxps, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_minss, "V4fV4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_maxss, "V4fV4fV4f", "ncV:128:", "sse") + +TARGET_BUILTIN(__builtin_ia32_cmpeqpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpltpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmplepd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpunordpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpneqpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpnltpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpnlepd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpordpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpeqsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpltsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmplesd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpunordsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpneqsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpnltsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpnlesd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cmpordsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_minpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_maxpd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_minsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_maxsd, "V2dV2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_paddsb128, "V16cV16cV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_paddsw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psubsb128, "V16cV16cV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psubsw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_paddusb128, "V16cV16cV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_paddusw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psubusb128, "V16cV16cV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psubusw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pmulhw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pmaxub128, "V16cV16cV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pmaxsw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pminub128, "V16cV16cV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pminsw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_packsswb128, "V16cV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_packssdw128, "V8sV4iV4i", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_packuswb128, "V16cV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pmulhuw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v4si, "iV4iIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v4sf, "fV4fIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v8hi, "sV8sIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_vec_set_v8hi, "V8sV8ssIi", "ncV:128:", "sse2") + +TARGET_BUILTIN(__builtin_ia32_addsubps, "V4fV4fV4f", "ncV:128:", "sse3") +TARGET_BUILTIN(__builtin_ia32_addsubpd, "V2dV2dV2d", "ncV:128:", "sse3") +TARGET_BUILTIN(__builtin_ia32_haddps, "V4fV4fV4f", "ncV:128:", "sse3") +TARGET_BUILTIN(__builtin_ia32_haddpd, "V2dV2dV2d", "ncV:128:", "sse3") +TARGET_BUILTIN(__builtin_ia32_hsubps, "V4fV4fV4f", "ncV:128:", "sse3") +TARGET_BUILTIN(__builtin_ia32_hsubpd, "V2dV2dV2d", "ncV:128:", "sse3") +TARGET_BUILTIN(__builtin_ia32_phaddw128, "V8sV8sV8s", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_phaddd128, "V4iV4iV4i", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_phaddsw128, "V8sV8sV8s", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_phsubw128, "V8sV8sV8s", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_phsubd128, "V4iV4iV4i", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_phsubsw128, "V8sV8sV8s", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_pmaddubsw128, "V8sV16cV16c", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_pmulhrsw128, "V8sV8sV8s", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_pshufb128, "V16cV16cV16c", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_psignb128, "V16cV16cV16c", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_psignw128, "V8sV8sV8s", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_psignd128, "V4iV4iV4i", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_pabsb128, "V16cV16c", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_pabsw128, "V8sV8s", "ncV:128:", "ssse3") +TARGET_BUILTIN(__builtin_ia32_pabsd128, "V4iV4i", "ncV:128:", "ssse3") + +TARGET_BUILTIN(__builtin_ia32_ldmxcsr, "vUi", "n", "sse") +TARGET_HEADER_BUILTIN(_mm_setcsr, "vUi", "nh","xmmintrin.h", ALL_LANGUAGES, "sse") +TARGET_BUILTIN(__builtin_ia32_stmxcsr, "Ui", "n", "sse") +TARGET_HEADER_BUILTIN(_mm_getcsr, "Ui", "nh", "xmmintrin.h", ALL_LANGUAGES, "sse") +TARGET_BUILTIN(__builtin_ia32_cvtss2si, "iV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cvttss2si, "iV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_storehps, "vV2i*V4f", "nV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_storelps, "vV2i*V4f", "nV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_movmskps, "iV4f", "nV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_sfence, "v", "n", "sse") +TARGET_HEADER_BUILTIN(_mm_sfence, "v", "nh", "xmmintrin.h", ALL_LANGUAGES, "sse") +TARGET_BUILTIN(__builtin_ia32_rcpps, "V4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_rcpss, "V4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_rsqrtps, "V4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_rsqrtss, "V4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_sqrtps, "V4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_sqrtss, "V4fV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_shufps, "V4fV4fV4fIi", "ncV:128:", "sse") + +TARGET_BUILTIN(__builtin_ia32_maskmovdqu, "vV16cV16cc*", "nV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_movmskpd, "iV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pmovmskb128, "iV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_movnti, "vi*i", "n", "sse2") +TARGET_BUILTIN(__builtin_ia32_pshufd, "V4iV4iIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pshuflw, "V8sV8sIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pshufhw, "V8sV8sIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psadbw128, "V2LLiV16cV16c", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_sqrtpd, "V2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_sqrtsd, "V2dV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_shufpd, "V2dV2dV2dIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvtpd2dq, "V2LLiV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvtpd2ps, "V4fV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvttpd2dq, "V4iV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvtsd2si, "iV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvttsd2si, "iV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvtsd2ss, "V4fV4fV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvtps2dq, "V4iV4f", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvttps2dq, "V4iV4f", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_clflush, "vvC*", "n", "sse2") +TARGET_HEADER_BUILTIN(_mm_clflush, "vvC*", "nh", "emmintrin.h", ALL_LANGUAGES, "sse2") +TARGET_BUILTIN(__builtin_ia32_lfence, "v", "n", "sse2") +TARGET_HEADER_BUILTIN(_mm_lfence, "v", "nh", "emmintrin.h", ALL_LANGUAGES, "sse2") +TARGET_BUILTIN(__builtin_ia32_mfence, "v", "n", "sse2") +TARGET_HEADER_BUILTIN(_mm_mfence, "v", "nh", "emmintrin.h", ALL_LANGUAGES, "sse2") +TARGET_BUILTIN(__builtin_ia32_pause, "v", "n", "") +TARGET_HEADER_BUILTIN(_mm_pause, "v", "nh", "emmintrin.h", ALL_LANGUAGES, "") +TARGET_BUILTIN(__builtin_ia32_pmuludq128, "V2LLiV4iV4i", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psraw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrad128, "V4iV4iV4i", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrlw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrld128, "V4iV4iV4i", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrlq128, "V2LLiV2LLiV2LLi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psllw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pslld128, "V4iV4iV4i", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psllq128, "V2LLiV2LLiV2LLi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psllwi128, "V8sV8si", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pslldi128, "V4iV4ii", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psllqi128, "V2LLiV2LLii", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrlwi128, "V8sV8si", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrldi128, "V4iV4ii", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrlqi128, "V2LLiV2LLii", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrawi128, "V8sV8si", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psradi128, "V4iV4ii", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pmaddwd128, "V4iV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_pslldqi128_byteshift, "V2LLiV2LLiIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_psrldqi128_byteshift, "V2LLiV2LLiIi", "ncV:128:", "sse2") + +TARGET_BUILTIN(__builtin_ia32_monitor, "vv*UiUi", "n", "sse3") +TARGET_BUILTIN(__builtin_ia32_mwait, "vUiUi", "n", "sse3") +TARGET_BUILTIN(__builtin_ia32_lddqu, "V16ccC*", "nV:128:", "sse3") + +TARGET_BUILTIN(__builtin_ia32_palignr128, "V16cV16cV16cIi", "ncV:128:", "ssse3") + +TARGET_BUILTIN(__builtin_ia32_insertps128, "V4fV4fV4fIc", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pblendvb128, "V16cV16cV16cV16c", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pblendw128, "V8sV8sV8sIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_blendpd, "V2dV2dV2dIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_blendps, "V4fV4fV4fIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_blendvpd, "V2dV2dV2dV2d", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_blendvps, "V4fV4fV4fV4f", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_packusdw128, "V8sV4iV4i", "ncV:128:", "sse4.1") + +TARGET_BUILTIN(__builtin_ia32_pmaxsb128, "V16cV16cV16c", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pmaxsd128, "V4iV4iV4i", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pmaxud128, "V4iV4iV4i", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pmaxuw128, "V8sV8sV8s", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pminsb128, "V16cV16cV16c", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pminsd128, "V4iV4iV4i", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pminud128, "V4iV4iV4i", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pminuw128, "V8sV8sV8s", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_pmuldq128, "V2LLiV4iV4i", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_roundps, "V4fV4fIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_roundss, "V4fV4fV4fIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_roundsd, "V2dV2dV2dIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_roundpd, "V2dV2dIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_dpps, "V4fV4fV4fIc", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_dppd, "V2dV2dV2dIc", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_ptestz128, "iV2LLiV2LLi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_ptestc128, "iV2LLiV2LLi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_ptestnzc128, "iV2LLiV2LLi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_mpsadbw128, "V16cV16cV16cIc", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_phminposuw128, "V8sV8s", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v16qi, "cV16cIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_vec_set_v16qi, "V16cV16ccIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_vec_set_v4si, "V4iV4iiIi", "ncV:128:", "sse4.1") // SSE 4.2 -TARGET_BUILTIN(__builtin_ia32_pcmpistrm128, "V16cV16cV16cIc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistri128, "iV16cV16cIc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestrm128, "V16cV16ciV16ciIc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestri128, "iV16ciV16ciIc","", "sse4.2") - -TARGET_BUILTIN(__builtin_ia32_pcmpistria128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistric128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistrio128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistris128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpistriz128, "iV16cV16cIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestria128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestric128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestrio128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestris128, "iV16ciV16ciIc","", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_pcmpestriz128, "iV16ciV16ciIc","", "sse4.2") - -TARGET_BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpistrm128, "V16cV16cV16cIc", "ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpistri128, "iV16cV16cIc", "ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpestrm128, "V16cV16ciV16ciIc", "ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpestri128, "iV16ciV16ciIc","ncV:128:", "sse4.2") + +TARGET_BUILTIN(__builtin_ia32_pcmpistria128, "iV16cV16cIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpistric128, "iV16cV16cIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpistrio128, "iV16cV16cIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpistris128, "iV16cV16cIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpistriz128, "iV16cV16cIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpestria128, "iV16ciV16ciIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpestric128, "iV16ciV16ciIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpestrio128, "iV16ciV16ciIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpestris128, "iV16ciV16ciIc","ncV:128:", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_pcmpestriz128, "iV16ciV16ciIc","ncV:128:", "sse4.2") + +TARGET_BUILTIN(__builtin_ia32_crc32qi, "UiUiUc", "nc", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_crc32hi, "UiUiUs", "nc", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_crc32si, "UiUiUi", "nc", "sse4.2") // SSE4a -TARGET_BUILTIN(__builtin_ia32_extrqi, "V2LLiV2LLiIcIc", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_extrq, "V2LLiV2LLiV16c", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_insertqi, "V2LLiV2LLiV2LLiIcIc", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_insertq, "V2LLiV2LLiV2LLi", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_movntsd, "vd*V2d", "", "sse4a") -TARGET_BUILTIN(__builtin_ia32_movntss, "vf*V4f", "", "sse4a") +TARGET_BUILTIN(__builtin_ia32_extrqi, "V2LLiV2LLiIcIc", "ncV:128:", "sse4a") +TARGET_BUILTIN(__builtin_ia32_extrq, "V2LLiV2LLiV16c", "ncV:128:", "sse4a") +TARGET_BUILTIN(__builtin_ia32_insertqi, "V2LLiV2LLiV2LLiIcIc", "ncV:128:", "sse4a") +TARGET_BUILTIN(__builtin_ia32_insertq, "V2LLiV2LLiV2LLi", "ncV:128:", "sse4a") +TARGET_BUILTIN(__builtin_ia32_movntsd, "vd*V2d", "nV:128:", "sse4a") +TARGET_BUILTIN(__builtin_ia32_movntss, "vf*V4f", "nV:128:", "sse4a") // AES -TARGET_BUILTIN(__builtin_ia32_aesenc128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesenclast128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesdec128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesdeclast128, "V2LLiV2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aesimc128, "V2LLiV2LLi", "", "aes") -TARGET_BUILTIN(__builtin_ia32_aeskeygenassist128, "V2LLiV2LLiIc", "", "aes") +TARGET_BUILTIN(__builtin_ia32_aesenc128, "V2LLiV2LLiV2LLi", "ncV:128:", "aes") +TARGET_BUILTIN(__builtin_ia32_aesenclast128, "V2LLiV2LLiV2LLi", "ncV:128:", "aes") +TARGET_BUILTIN(__builtin_ia32_aesdec128, "V2LLiV2LLiV2LLi", "ncV:128:", "aes") +TARGET_BUILTIN(__builtin_ia32_aesdeclast128, "V2LLiV2LLiV2LLi", "ncV:128:", "aes") +TARGET_BUILTIN(__builtin_ia32_aesimc128, "V2LLiV2LLi", "ncV:128:", "aes") +TARGET_BUILTIN(__builtin_ia32_aeskeygenassist128, "V2LLiV2LLiIc", "ncV:128:", "aes") // VAES -TARGET_BUILTIN(__builtin_ia32_aesenc256, "V4LLiV4LLiV4LLi", "", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesenc512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") -TARGET_BUILTIN(__builtin_ia32_aesenclast256, "V4LLiV4LLiV4LLi", "", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesenclast512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") -TARGET_BUILTIN(__builtin_ia32_aesdec256, "V4LLiV4LLiV4LLi", "", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesdec512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") -TARGET_BUILTIN(__builtin_ia32_aesdeclast256, "V4LLiV4LLiV4LLi", "", "vaes") -TARGET_BUILTIN(__builtin_ia32_aesdeclast512, "V8LLiV8LLiV8LLi", "", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesenc256, "V4LLiV4LLiV4LLi", "ncV:256:", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesenc512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesenclast256, "V4LLiV4LLiV4LLi", "ncV:256:", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesenclast512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesdec256, "V4LLiV4LLiV4LLi", "ncV:256:", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesdec512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f,vaes") +TARGET_BUILTIN(__builtin_ia32_aesdeclast256, "V4LLiV4LLiV4LLi", "ncV:256:", "vaes") +TARGET_BUILTIN(__builtin_ia32_aesdeclast512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f,vaes") // GFNI -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v16qi, "V16cV16cV16cIc", "", "gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v32qi, "V32cV32cV32cIc", "", "avx,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v64qi, "V64cV64cV64cIc", "", "avx512bw,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v16qi, "V16cV16cV16cIc", "", "gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v32qi, "V32cV32cV32cIc", "", "avx,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v64qi, "V64cV64cV64cIc", "", "avx512bw,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v16qi, "V16cV16cV16c", "", "gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v32qi, "V32cV32cV32c", "", "avx,gfni") -TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v64qi, "V64cV64cV64c", "", "avx512bw,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v16qi, "V16cV16cV16cIc", "ncV:128:", "gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v32qi, "V32cV32cV32cIc", "ncV:256:", "avx,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineinvqb_v64qi, "V64cV64cV64cIc", "ncV:512:", "avx512bw,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v16qi, "V16cV16cV16cIc", "ncV:128:", "gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v32qi, "V32cV32cV32cIc", "ncV:256:", "avx,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8affineqb_v64qi, "V64cV64cV64cIc", "ncV:512:", "avx512bw,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v16qi, "V16cV16cV16c", "ncV:128:", "gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v32qi, "V32cV32cV32c", "ncV:256:", "avx,gfni") +TARGET_BUILTIN(__builtin_ia32_vgf2p8mulb_v64qi, "V64cV64cV64c", "ncV:512:", "avx512bw,gfni") // CLMUL -TARGET_BUILTIN(__builtin_ia32_pclmulqdq128, "V2LLiV2LLiV2LLiIc", "", "pclmul") +TARGET_BUILTIN(__builtin_ia32_pclmulqdq128, "V2LLiV2LLiV2LLiIc", "ncV:128:", "pclmul") // VPCLMULQDQ -TARGET_BUILTIN(__builtin_ia32_pclmulqdq256, "V4LLiV4LLiV4LLiIc", "", "vpclmulqdq") -TARGET_BUILTIN(__builtin_ia32_pclmulqdq512, "V8LLiV8LLiV8LLiIc", "", "avx512f,vpclmulqdq") +TARGET_BUILTIN(__builtin_ia32_pclmulqdq256, "V4LLiV4LLiV4LLiIc", "ncV:256:", "vpclmulqdq") +TARGET_BUILTIN(__builtin_ia32_pclmulqdq512, "V8LLiV8LLiV8LLiIc", "ncV:512:", "avx512f,vpclmulqdq") // AVX -TARGET_BUILTIN(__builtin_ia32_addsubpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_addsubps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_haddpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_hsubps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_hsubpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_haddps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maxpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maxps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_minpd256, "V4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_minps256, "V8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarpd, "V2dV2dV2LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarps, "V4fV4fV4i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarpd256, "V4dV4dV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vpermilvarps256, "V8fV8fV8i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_blendvpd256, "V4dV4dV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_blendvps256, "V8fV8fV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmppd, "V2dV2dV2dIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmppd256, "V4dV4dV4dIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmpps, "V4fV4fV4fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmpps256, "V8fV8fV8fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmpsd, "V2dV2dV2dIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cmpss, "V4fV4fV4fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps256, "V8fV8i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps256, "V4fV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq256, "V8iV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq256, "V4iV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq256, "V4iV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq256, "V8iV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vperm2f128_pd256, "V4dV4dV4dIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vperm2f128_ps256, "V8fV8fV8fIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vperm2f128_si256, "V8iV8iV8iIc", "", "avx") -TARGET_BUILTIN(__builtin_ia32_sqrtpd256, "V4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_sqrtps256, "V8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_rsqrtps256, "V8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_rcpps256, "V8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_roundpd256, "V4dV4dIi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_roundps256, "V8fV8fIi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzpd, "iV2dV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcpd, "iV2dV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcpd, "iV2dV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzps, "iV4fV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcps, "iV4fV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcps, "iV4fV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzpd256, "iV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcpd256, "iV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcpd256, "iV4dV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestzps256, "iV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestcps256, "iV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vtestnzcps256, "iV8fV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_ptestz256, "iV4LLiV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_ptestc256, "iV4LLiV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_ptestnzc256, "iV4LLiV4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_movmskpd256, "iV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_movmskps256, "iV8f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vzeroall, "v", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vzeroupper, "v", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vbroadcastf128_pd256, "V4dV2dC*", "", "avx") -TARGET_BUILTIN(__builtin_ia32_vbroadcastf128_ps256, "V8fV4fC*", "", "avx") -TARGET_BUILTIN(__builtin_ia32_lddqu256, "V32ccC*", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadpd, "V2dV2dC*V2LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadps, "V4fV4fC*V4i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadpd256, "V4dV4dC*V4LLi", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskloadps256, "V8fV8fC*V8i", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstorepd, "vV2d*V2LLiV2d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstoreps, "vV4f*V4iV4f", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstorepd256, "vV4d*V4LLiV4d", "", "avx") -TARGET_BUILTIN(__builtin_ia32_maskstoreps256, "vV8f*V8iV8f", "", "avx") +TARGET_BUILTIN(__builtin_ia32_addsubpd256, "V4dV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_addsubps256, "V8fV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_haddpd256, "V4dV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_hsubps256, "V8fV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_hsubpd256, "V4dV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_haddps256, "V8fV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_maxpd256, "V4dV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_maxps256, "V8fV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_minpd256, "V4dV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_minps256, "V8fV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilvarpd, "V2dV2dV2LLi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilvarps, "V4fV4fV4i", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilvarpd256, "V4dV4dV4LLi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilvarps256, "V8fV8fV8i", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_blendpd256, "V4dV4dV4dIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_blendps256, "V8fV8fV8fIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_blendvpd256, "V4dV4dV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_blendvps256, "V8fV8fV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_shufpd256, "V4dV4dV4dIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_shufps256, "V8fV8fV8fIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_dpps256, "V8fV8fV8fIc", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cmppd, "V2dV2dV2dIc", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_cmppd256, "V4dV4dV4dIc", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cmpps, "V4fV4fV4fIc", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_cmpps256, "V8fV8fV8fIc", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cmpsd, "V2dV2dV2dIc", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_cmpss, "V4fV4fV4fIc", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vextractf128_pd256, "V2dV4dIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vextractf128_ps256, "V4fV8fIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vextractf128_si256, "V4iV8iIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cvtpd2ps256, "V4fV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cvtps2dq256, "V8iV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cvttpd2dq256, "V4iV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cvtpd2dq256, "V4iV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_cvttps2dq256, "V8iV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vperm2f128_pd256, "V4dV4dV4dIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vperm2f128_ps256, "V8fV8fV8fIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vperm2f128_si256, "V8iV8iV8iIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilpd, "V2dV2dIi", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilps, "V4fV4fIi", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilpd256, "V4dV4dIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vpermilps256, "V8fV8fIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vinsertf128_pd256, "V4dV4dV2dIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vinsertf128_ps256, "V8fV8fV4fIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vinsertf128_si256, "V8iV8iV4iIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_sqrtpd256, "V4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_sqrtps256, "V8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_rsqrtps256, "V8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_rcpps256, "V8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_roundpd256, "V4dV4dIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_roundps256, "V8fV8fIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestzpd, "iV2dV2d", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestcpd, "iV2dV2d", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestnzcpd, "iV2dV2d", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestzps, "iV4fV4f", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestcps, "iV4fV4f", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestnzcps, "iV4fV4f", "ncV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestzpd256, "iV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestcpd256, "iV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestnzcpd256, "iV4dV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestzps256, "iV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestcps256, "iV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vtestnzcps256, "iV8fV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_ptestz256, "iV4LLiV4LLi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_ptestc256, "iV4LLiV4LLi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_ptestnzc256, "iV4LLiV4LLi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_movmskpd256, "iV4d", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_movmskps256, "iV8f", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vzeroall, "v", "n", "avx") +TARGET_BUILTIN(__builtin_ia32_vzeroupper, "v", "n", "avx") +TARGET_BUILTIN(__builtin_ia32_lddqu256, "V32ccC*", "nV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskloadpd, "V2dV2dC*V2LLi", "nV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskloadps, "V4fV4fC*V4i", "nV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskloadpd256, "V4dV4dC*V4LLi", "nV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskloadps256, "V8fV8fC*V8i", "nV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskstorepd, "vV2d*V2LLiV2d", "nV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskstoreps, "vV4f*V4iV4f", "nV:128:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskstorepd256, "vV4d*V4LLiV4d", "nV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_maskstoreps256, "vV8f*V8iV8f", "nV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v32qi, "cV32cIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v16hi, "sV16sIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v8si, "iV8iIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vec_set_v32qi, "V32cV32ccIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vec_set_v16hi, "V16sV16ssIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vec_set_v8si, "V8iV8iiIi", "ncV:256:", "avx") // AVX2 -TARGET_BUILTIN(__builtin_ia32_mpsadbw256, "V32cV32cV32cIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pabsb256, "V32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pabsw256, "V16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pabsd256, "V8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packsswb256, "V32cV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packssdw256, "V16sV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packuswb256, "V32cV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_packusdw256, "V16sV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddusb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddusw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubusb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubusw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_palignr256, "V32cV32cV32cIi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pblendvb256, "V32cV32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phaddw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phaddd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phaddsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phsubw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phsubd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_phsubsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaddubsw256, "V16sV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaddwd256, "V8iV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxub256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxuw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxud256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmaxsd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminub256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminuw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminud256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminsb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pminsd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmovmskb256, "iV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmuldq256, "V4LLiV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmulhrsw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmulhuw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmulhw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pmuludq256, "V4LLiV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psadbw256, "V4LLiV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pshufb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psignb256, "V32cV32cV32c", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psignw256, "V16sV16sV16s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psignd256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllwi256, "V16sV16si", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllw256, "V16sV16sV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pslldi256, "V8iV8ii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_pslld256, "V8iV8iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllqi256, "V4LLiV4LLii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllq256, "V4LLiV4LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrawi256, "V16sV16si", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psraw256, "V16sV16sV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psradi256, "V8iV8ii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrad256, "V8iV8iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlwi256, "V16sV16si", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlw256, "V16sV16sV8s", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrldi256, "V8iV8ii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrld256, "V8iV8iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlqi256, "V4LLiV4LLii", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlq256, "V4LLiV4LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_permvarsi256, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_permvarsf256, "V8fV8fV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_permti256, "V4LLiV4LLiV4LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadd256, "V8iV8iC*V8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadq256, "V4LLiV4LLiC*V4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadd, "V4iV4iC*V4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskloadq, "V2LLiV2LLiC*V2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstored256, "vV8i*V8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstoreq256, "vV4LLi*V4LLiV4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstored, "vV4i*V4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_maskstoreq, "vV2LLi*V2LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv8si, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv4si, "V4iV4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv4di, "V4LLiV4LLiV4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psllv2di, "V2LLiV2LLiV2LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrav8si, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrav4si, "V4iV4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv8si, "V8iV8iV8i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv4si, "V4iV4iV4i", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv4di, "V4LLiV4LLiV4LLi", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_psrlv2di, "V2LLiV2LLiV2LLi", "", "avx2") +TARGET_BUILTIN(__builtin_ia32_mpsadbw256, "V32cV32cV32cIc", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pabsb256, "V32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pabsw256, "V16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pabsd256, "V8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_packsswb256, "V32cV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_packssdw256, "V16sV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_packuswb256, "V32cV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_packusdw256, "V16sV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_paddsb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_paddsw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psubsb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psubsw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_paddusb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_paddusw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psubusb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psubusw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_palignr256, "V32cV32cV32cIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pblendvb256, "V32cV32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pblendw256, "V16sV16sV16sIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_phaddw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_phaddd256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_phaddsw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_phsubw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_phsubd256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_phsubsw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaddubsw256, "V16sV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaddwd256, "V8iV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaxub256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaxuw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaxud256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaxsb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaxsw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmaxsd256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pminub256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pminuw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pminud256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pminsb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pminsw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pminsd256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmovmskb256, "iV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmuldq256, "V4LLiV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmulhrsw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmulhuw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmulhw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pmuludq256, "V4LLiV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psadbw256, "V4LLiV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pshufb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pshufd256, "V8iV8iIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pshuflw256, "V16sV16sIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pshufhw256, "V16sV16sIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psignb256, "V32cV32cV32c", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psignw256, "V16sV16sV16s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psignd256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllwi256, "V16sV16si", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllw256, "V16sV16sV8s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pslldqi256_byteshift, "V4LLiV4LLiIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pslldi256, "V8iV8ii", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pslld256, "V8iV8iV4i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllqi256, "V4LLiV4LLii", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllq256, "V4LLiV4LLiV2LLi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrawi256, "V16sV16si", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psraw256, "V16sV16sV8s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psradi256, "V8iV8ii", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrad256, "V8iV8iV4i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrldqi256_byteshift, "V4LLiV4LLiIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlwi256, "V16sV16si", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlw256, "V16sV16sV8s", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrldi256, "V8iV8ii", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrld256, "V8iV8iV4i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlqi256, "V4LLiV4LLii", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlq256, "V4LLiV4LLiV2LLi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pblendd128, "V4iV4iV4iIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_pblendd256, "V8iV8iV8iIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_permvarsi256, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_permdf256, "V4dV4dIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_permvarsf256, "V8fV8fV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_permti256, "V4LLiV4LLiV4LLiIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_permdi256, "V4LLiV4LLiIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_extract128i256, "V2LLiV4LLiIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_insert128i256, "V4LLiV4LLiV2LLiIi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskloadd256, "V8iV8iC*V8i", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskloadq256, "V4LLiV4LLiC*V4LLi", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskloadd, "V4iV4iC*V4i", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskloadq, "V2LLiV2LLiC*V2LLi", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskstored256, "vV8i*V8iV8i", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskstoreq256, "vV4LLi*V4LLiV4LLi", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskstored, "vV4i*V4iV4i", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_maskstoreq, "vV2LLi*V2LLiV2LLi", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllv8si, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllv4si, "V4iV4iV4i", "ncV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllv4di, "V4LLiV4LLiV4LLi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psllv2di, "V2LLiV2LLiV2LLi", "ncV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrav8si, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrav4si, "V4iV4iV4i", "ncV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlv8si, "V8iV8iV8i", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlv4si, "V4iV4iV4i", "ncV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlv4di, "V4LLiV4LLiV4LLi", "ncV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_psrlv2di, "V2LLiV2LLiV2LLi", "ncV:128:", "avx2") // GATHER -TARGET_BUILTIN(__builtin_ia32_gatherd_pd, "V2dV2ddC*V4iV2dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_pd256, "V4dV4ddC*V4iV4dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_pd, "V2dV2ddC*V2LLiV2dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_pd256, "V4dV4ddC*V4LLiV4dIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_ps, "V4fV4ffC*V4iV4fIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_ps256, "V8fV8ffC*V8iV8fIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_ps, "V4fV4ffC*V2LLiV4fIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_ps256, "V4fV4ffC*V4LLiV4fIc", "", "avx2") - -TARGET_BUILTIN(__builtin_ia32_gatherd_q, "V2LLiV2LLiLLiC*V4iV2LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_q256, "V4LLiV4LLiLLiC*V4iV4LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_q, "V2LLiV2LLiLLiC*V2LLiV2LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_q256, "V4LLiV4LLiLLiC*V4LLiV4LLiIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_d, "V4iV4iiC*V4iV4iIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherd_d256, "V8iV8iiC*V8iV8iIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_d, "V4iV4iiC*V2LLiV4iIc", "", "avx2") -TARGET_BUILTIN(__builtin_ia32_gatherq_d256, "V4iV4iiC*V4LLiV4iIc", "", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherd_pd, "V2dV2ddC*V4iV2dIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherd_pd256, "V4dV4ddC*V4iV4dIc", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_pd, "V2dV2ddC*V2LLiV2dIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_pd256, "V4dV4ddC*V4LLiV4dIc", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherd_ps, "V4fV4ffC*V4iV4fIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherd_ps256, "V8fV8ffC*V8iV8fIc", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_ps, "V4fV4ffC*V2LLiV4fIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_ps256, "V4fV4ffC*V4LLiV4fIc", "nV:256:", "avx2") + +TARGET_BUILTIN(__builtin_ia32_gatherd_q, "V2LLiV2LLiLLiC*V4iV2LLiIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherd_q256, "V4LLiV4LLiLLiC*V4iV4LLiIc", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_q, "V2LLiV2LLiLLiC*V2LLiV2LLiIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_q256, "V4LLiV4LLiLLiC*V4LLiV4LLiIc", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherd_d, "V4iV4iiC*V4iV4iIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherd_d256, "V8iV8iiC*V8iV8iIc", "nV:256:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_d, "V4iV4iiC*V2LLiV4iIc", "nV:128:", "avx2") +TARGET_BUILTIN(__builtin_ia32_gatherq_d256, "V4iV4iiC*V4LLiV4iIc", "nV:256:", "avx2") // F16C -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph, "V8sV4fIi", "", "f16c") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph256, "V8sV8fIi", "", "f16c") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps, "V4fV8s", "", "f16c") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps256, "V8fV8s", "", "f16c") +TARGET_BUILTIN(__builtin_ia32_vcvtps2ph, "V8sV4fIi", "ncV:128:", "f16c") +TARGET_BUILTIN(__builtin_ia32_vcvtps2ph256, "V8sV8fIi", "ncV:256:", "f16c") +TARGET_BUILTIN(__builtin_ia32_vcvtph2ps, "V4fV8s", "ncV:128:", "f16c") +TARGET_BUILTIN(__builtin_ia32_vcvtph2ps256, "V8fV8s", "ncV:256:", "f16c") // RDRAND -TARGET_BUILTIN(__builtin_ia32_rdrand16_step, "UiUs*", "", "rdrnd") -TARGET_BUILTIN(__builtin_ia32_rdrand32_step, "UiUi*", "", "rdrnd") -TARGET_BUILTIN(__builtin_ia32_rdrand64_step, "UiULLi*", "", "rdrnd") - -// FSGSBASE -TARGET_BUILTIN(__builtin_ia32_rdfsbase32, "Ui", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_rdgsbase32, "Ui", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrfsbase32, "vUi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrgsbase32, "vUi", "", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_rdrand16_step, "UiUs*", "n", "rdrnd") +TARGET_BUILTIN(__builtin_ia32_rdrand32_step, "UiUi*", "n", "rdrnd") // FXSR -TARGET_BUILTIN(__builtin_ia32_fxrstor, "vv*", "", "fxsr") -TARGET_BUILTIN(__builtin_ia32_fxsave, "vv*", "", "fxsr") +TARGET_BUILTIN(__builtin_ia32_fxrstor, "vv*", "n", "fxsr") +TARGET_BUILTIN(__builtin_ia32_fxsave, "vv*", "n", "fxsr") // XSAVE -TARGET_BUILTIN(__builtin_ia32_xsave, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xrstor, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xsaveopt, "vv*ULLi", "", "xsaveopt") -TARGET_BUILTIN(__builtin_ia32_xrstors, "vv*ULLi", "", "xsaves") -TARGET_BUILTIN(__builtin_ia32_xsavec, "vv*ULLi", "", "xsavec") -TARGET_BUILTIN(__builtin_ia32_xsaves, "vv*ULLi", "", "xsaves") +TARGET_BUILTIN(__builtin_ia32_xsave, "vv*ULLi", "n", "xsave") +TARGET_BUILTIN(__builtin_ia32_xrstor, "vv*ULLi", "n", "xsave") +TARGET_BUILTIN(__builtin_ia32_xsaveopt, "vv*ULLi", "n", "xsaveopt") +TARGET_BUILTIN(__builtin_ia32_xrstors, "vv*ULLi", "n", "xsaves") +TARGET_BUILTIN(__builtin_ia32_xsavec, "vv*ULLi", "n", "xsavec") +TARGET_BUILTIN(__builtin_ia32_xsaves, "vv*ULLi", "n", "xsaves") // SHSTK -TARGET_BUILTIN(__builtin_ia32_incsspd, "vUi", "u", "shstk") -TARGET_BUILTIN(__builtin_ia32_rdsspd, "UiUi", "Un", "shstk") -TARGET_BUILTIN(__builtin_ia32_saveprevssp, "v", "", "shstk") -TARGET_BUILTIN(__builtin_ia32_rstorssp, "vv*", "", "shstk") -TARGET_BUILTIN(__builtin_ia32_wrssd, "vUiv*", "", "shstk") -TARGET_BUILTIN(__builtin_ia32_wrussd, "vUiv*", "", "shstk") -TARGET_BUILTIN(__builtin_ia32_setssbsy, "v", "", "shstk") -TARGET_BUILTIN(__builtin_ia32_clrssbsy, "vv*", "", "shstk") +TARGET_BUILTIN(__builtin_ia32_incsspd, "vUi", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_rdsspd, "UiUi", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_saveprevssp, "v", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_rstorssp, "vv*", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_wrssd, "vUiv*", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_wrussd, "vUiv*", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_setssbsy, "v", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_clrssbsy, "vv*", "n", "shstk") //CLFLUSHOPT -TARGET_BUILTIN(__builtin_ia32_clflushopt, "vvC*", "", "clflushopt") +TARGET_BUILTIN(__builtin_ia32_clflushopt, "vvC*", "n", "clflushopt") //CLWB -TARGET_BUILTIN(__builtin_ia32_clwb, "vvC*", "", "clwb") +TARGET_BUILTIN(__builtin_ia32_clwb, "vvC*", "n", "clwb") + +//WB[NO]INVD +TARGET_BUILTIN(__builtin_ia32_wbinvd, "v", "n", "") +TARGET_BUILTIN(__builtin_ia32_wbnoinvd, "v", "n", "wbnoinvd") // ADX -TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "", "adx") -TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "", "") -TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "", "") +TARGET_BUILTIN(__builtin_ia32_addcarryx_u32, "UcUcUiUiUi*", "n", "adx") +TARGET_BUILTIN(__builtin_ia32_addcarry_u32, "UcUcUiUiUi*", "n", "") +TARGET_BUILTIN(__builtin_ia32_subborrow_u32, "UcUcUiUiUi*", "n", "") // RDSEED -TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "", "rdseed") -TARGET_BUILTIN(__builtin_ia32_rdseed32_step, "UiUi*", "", "rdseed") +TARGET_BUILTIN(__builtin_ia32_rdseed16_step, "UiUs*", "n", "rdseed") +TARGET_BUILTIN(__builtin_ia32_rdseed32_step, "UiUi*", "n", "rdseed") // BMI -TARGET_BUILTIN(__builtin_ia32_bextr_u32, "UiUiUi", "", "bmi") +TARGET_BUILTIN(__builtin_ia32_bextr_u32, "UiUiUi", "nc", "bmi") // BMI2 -TARGET_BUILTIN(__builtin_ia32_bzhi_si, "UiUiUi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pdep_si, "UiUiUi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pext_si, "UiUiUi", "", "bmi2") +TARGET_BUILTIN(__builtin_ia32_bzhi_si, "UiUiUi", "nc", "bmi2") +TARGET_BUILTIN(__builtin_ia32_pdep_si, "UiUiUi", "nc", "bmi2") +TARGET_BUILTIN(__builtin_ia32_pext_si, "UiUiUi", "nc", "bmi2") // TBM -TARGET_BUILTIN(__builtin_ia32_bextri_u32, "UiUiIUi", "", "tbm") +TARGET_BUILTIN(__builtin_ia32_bextri_u32, "UiUiIUi", "nc", "tbm") // LWP -TARGET_BUILTIN(__builtin_ia32_llwpcb, "vv*", "", "lwp") -TARGET_BUILTIN(__builtin_ia32_slwpcb, "v*", "", "lwp") -TARGET_BUILTIN(__builtin_ia32_lwpins32, "UcUiUiUi", "", "lwp") -TARGET_BUILTIN(__builtin_ia32_lwpval32, "vUiUiUi", "", "lwp") +TARGET_BUILTIN(__builtin_ia32_llwpcb, "vv*", "n", "lwp") +TARGET_BUILTIN(__builtin_ia32_slwpcb, "v*", "n", "lwp") +TARGET_BUILTIN(__builtin_ia32_lwpins32, "UcUiUiUi", "n", "lwp") +TARGET_BUILTIN(__builtin_ia32_lwpval32, "vUiUiUi", "n", "lwp") // SHA -TARGET_BUILTIN(__builtin_ia32_sha1rnds4, "V4iV4iV4iIc", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha1nexte, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha1msg1, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha1msg2, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha256rnds2, "V4iV4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha256msg1, "V4iV4iV4i", "", "sha") -TARGET_BUILTIN(__builtin_ia32_sha256msg2, "V4iV4iV4i", "", "sha") +TARGET_BUILTIN(__builtin_ia32_sha1rnds4, "V4iV4iV4iIc", "ncV:128:", "sha") +TARGET_BUILTIN(__builtin_ia32_sha1nexte, "V4iV4iV4i", "ncV:128:", "sha") +TARGET_BUILTIN(__builtin_ia32_sha1msg1, "V4iV4iV4i", "ncV:128:", "sha") +TARGET_BUILTIN(__builtin_ia32_sha1msg2, "V4iV4iV4i", "ncV:128:", "sha") +TARGET_BUILTIN(__builtin_ia32_sha256rnds2, "V4iV4iV4iV4i", "ncV:128:", "sha") +TARGET_BUILTIN(__builtin_ia32_sha256msg1, "V4iV4iV4i", "ncV:128:", "sha") +TARGET_BUILTIN(__builtin_ia32_sha256msg2, "V4iV4iV4i", "ncV:128:", "sha") // FMA -TARGET_BUILTIN(__builtin_ia32_vfmaddps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddss3, "V4fV4fV4fV4f", "", "fma") -TARGET_BUILTIN(__builtin_ia32_vfmaddsd3, "V2dV2dV2dV2d", "", "fma") -TARGET_BUILTIN(__builtin_ia32_vfmaddss, "V4fV4fV4fV4f", "", "fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsd, "V2dV2dV2dV2d", "", "fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps, "V4fV4fV4fV4f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd, "V2dV2dV2dV2d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256, "V4dV4dV4dV4d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd256, "V4dV4dV4dV4d", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256, "V8fV8fV8fV8f", "", "fma|fma4") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256, "V4dV4dV4dV4d", "", "fma|fma4") - -TARGET_BUILTIN(__builtin_ia32_vfmaddpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd128_maskz, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd256_maskz, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_maskz, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmaddps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps128_maskz, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddps256_maskz, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddps512_maskz, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd128_maskz, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256_maskz, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_maskz, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps128_maskz, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256_maskz, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_maskz, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfmsubaddps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmaddps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmaddps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd128_mask3, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd256_mask3, "V4dV4dV4dV4dUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfnmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps128_mask3, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps256_mask3, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vfnmsubps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfnmsubps512_mask3, "V16fV16fV16fV16fUsIi", "", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddps, "V4fV4fV4fV4f", "ncV:128:", "fma|fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddpd, "V2dV2dV2dV2d", "ncV:128:", "fma|fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddss3, "V4fV4fV4fV4f", "ncV:128:", "fma") +TARGET_BUILTIN(__builtin_ia32_vfmaddsd3, "V2dV2dV2dV2d", "ncV:128:", "fma") +TARGET_BUILTIN(__builtin_ia32_vfmaddss, "V4fV4fV4fV4f", "ncV:128:", "fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddsd, "V2dV2dV2dV2d", "ncV:128:", "fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps, "V4fV4fV4fV4f", "ncV:128:", "fma|fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd, "V2dV2dV2dV2d", "ncV:128:", "fma|fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddps256, "V8fV8fV8fV8f", "ncV:256:", "fma|fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddpd256, "V4dV4dV4dV4d", "ncV:256:", "fma|fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps256, "V8fV8fV8fV8f", "ncV:256:", "fma|fma4") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd256, "V4dV4dV4dV4d", "ncV:256:", "fma|fma4") + +TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_maskz, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmsubpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddps512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmsubps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_maskz, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmsubaddpd512_mask3, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_maskz, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsubps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmsubaddps512_mask3, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") // XOP -TARGET_BUILTIN(__builtin_ia32_vpmacssww, "V8sV8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsww, "V8sV8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsswd, "V4iV8sV8sV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacswd, "V4iV8sV8sV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacssdd, "V4iV4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsdd, "V4iV4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacssdql, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsdql, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacssdqh, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmacsdqh, "V2LLiV4iV4iV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmadcsswd, "V4iV8sV8sV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpmadcswd, "V4iV8sV8sV4i", "", "xop") - -TARGET_BUILTIN(__builtin_ia32_vphaddbw, "V8sV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddbd, "V4iV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddbq, "V2LLiV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddwd, "V4iV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddwq, "V2LLiV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphadddq, "V2LLiV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddubw, "V8sV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddubd, "V4iV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddubq, "V2LLiV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphadduwd, "V4iV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphadduwq, "V2LLiV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphaddudq, "V2LLiV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphsubbw, "V8sV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphsubwd, "V4iV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vphsubdq, "V2LLiV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpperm, "V16cV16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotb, "V16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotw, "V8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotd, "V4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotq, "V2LLiV2LLiV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotbi, "V16cV16cIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotwi, "V8sV8sIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotdi, "V4iV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vprotqi, "V2LLiV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshlb, "V16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshlw, "V8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshld, "V4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshlq, "V2LLiV2LLiV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshab, "V16cV16cV16c", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshaw, "V8sV8sV8s", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshad, "V4iV4iV4i", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpshaq, "V2LLiV2LLiV2LLi", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomub, "V16cV16cV16cIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomuw, "V8sV8sV8sIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomud, "V4iV4iV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomuq, "V2LLiV2LLiV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomb, "V16cV16cV16cIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomw, "V8sV8sV8sIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomd, "V4iV4iV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpcomq, "V2LLiV2LLiV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2pd, "V2dV2dV2dV2LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2pd256, "V4dV4dV4dV4LLiIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2ps, "V4fV4fV4fV4iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vpermil2ps256, "V8fV8fV8fV8iIc", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczss, "V4fV4f", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczsd, "V2dV2d", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczps, "V4fV4f", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczpd, "V2dV2d", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczps256, "V8fV8f", "", "xop") -TARGET_BUILTIN(__builtin_ia32_vfrczpd256, "V4dV4d", "", "xop") - -TARGET_BUILTIN(__builtin_ia32_xbegin, "i", "", "rtm") -TARGET_BUILTIN(__builtin_ia32_xend, "v", "", "rtm") -TARGET_BUILTIN(__builtin_ia32_xabort, "vIc", "", "rtm") -TARGET_BUILTIN(__builtin_ia32_xtest, "i", "", "rtm") +TARGET_BUILTIN(__builtin_ia32_vpmacssww, "V8sV8sV8sV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacsww, "V8sV8sV8sV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacsswd, "V4iV8sV8sV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacswd, "V4iV8sV8sV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacssdd, "V4iV4iV4iV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacsdd, "V4iV4iV4iV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacssdql, "V2LLiV4iV4iV2LLi", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacsdql, "V2LLiV4iV4iV2LLi", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacssdqh, "V2LLiV4iV4iV2LLi", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmacsdqh, "V2LLiV4iV4iV2LLi", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmadcsswd, "V4iV8sV8sV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpmadcswd, "V4iV8sV8sV4i", "ncV:128:", "xop") + +TARGET_BUILTIN(__builtin_ia32_vphaddbw, "V8sV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddbd, "V4iV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddbq, "V2LLiV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddwd, "V4iV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddwq, "V2LLiV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphadddq, "V2LLiV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddubw, "V8sV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddubd, "V4iV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddubq, "V2LLiV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphadduwd, "V4iV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphadduwq, "V2LLiV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphaddudq, "V2LLiV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphsubbw, "V8sV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphsubwd, "V4iV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vphsubdq, "V2LLiV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpperm, "V16cV16cV16cV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotb, "V16cV16cV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotw, "V8sV8sV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotd, "V4iV4iV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotq, "V2LLiV2LLiV2LLi", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotbi, "V16cV16cIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotwi, "V8sV8sIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotdi, "V4iV4iIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vprotqi, "V2LLiV2LLiIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshlb, "V16cV16cV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshlw, "V8sV8sV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshld, "V4iV4iV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshlq, "V2LLiV2LLiV2LLi", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshab, "V16cV16cV16c", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshaw, "V8sV8sV8s", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshad, "V4iV4iV4i", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpshaq, "V2LLiV2LLiV2LLi", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomub, "V16cV16cV16cIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomuw, "V8sV8sV8sIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomud, "V4iV4iV4iIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomuq, "V2LLiV2LLiV2LLiIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomb, "V16cV16cV16cIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomw, "V8sV8sV8sIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomd, "V4iV4iV4iIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpcomq, "V2LLiV2LLiV2LLiIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpermil2pd, "V2dV2dV2dV2LLiIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpermil2pd256, "V4dV4dV4dV4LLiIc", "ncV:256:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpermil2ps, "V4fV4fV4fV4iIc", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vpermil2ps256, "V8fV8fV8fV8iIc", "ncV:256:", "xop") +TARGET_BUILTIN(__builtin_ia32_vfrczss, "V4fV4f", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vfrczsd, "V2dV2d", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vfrczps, "V4fV4f", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vfrczpd, "V2dV2d", "ncV:128:", "xop") +TARGET_BUILTIN(__builtin_ia32_vfrczps256, "V8fV8f", "ncV:256:", "xop") +TARGET_BUILTIN(__builtin_ia32_vfrczpd256, "V4dV4d", "ncV:256:", "xop") + +TARGET_BUILTIN(__builtin_ia32_xbegin, "i", "n", "rtm") +TARGET_BUILTIN(__builtin_ia32_xend, "v", "n", "rtm") +TARGET_BUILTIN(__builtin_ia32_xabort, "vIc", "n", "rtm") +TARGET_BUILTIN(__builtin_ia32_xtest, "i", "n", "rtm") BUILTIN(__builtin_ia32_rdpmc, "ULLii", "") BUILTIN(__builtin_ia32_rdtsc, "ULLi", "") BUILTIN(__rdtsc, "ULLi", "") BUILTIN(__builtin_ia32_rdtscp, "ULLiUi*", "") + +TARGET_BUILTIN(__builtin_ia32_rdpid, "Ui", "n", "rdpid") + // PKU -TARGET_BUILTIN(__builtin_ia32_rdpkru, "Ui", "", "pku") -TARGET_BUILTIN(__builtin_ia32_wrpkru, "vUi", "", "pku") +TARGET_BUILTIN(__builtin_ia32_rdpkru, "Ui", "n", "pku") +TARGET_BUILTIN(__builtin_ia32_wrpkru, "vUi", "n", "pku") // AVX-512 -TARGET_BUILTIN(__builtin_ia32_sqrtpd512_mask, "V8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_sqrtps512_mask, "V16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14sd_mask, "V2dV2dV2dV2dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14ss_mask, "V4fV4fV4fV4fUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14pd512_mask, "V8dV8dV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14ps512_mask, "V16fV16fV16fUs", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_rsqrt28sd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28ss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28pd_mask, "V8dV8dV8dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rsqrt28ps_mask, "V16fV16fV16fUsIi", "", "avx512er") - -TARGET_BUILTIN(__builtin_ia32_rcp14sd_mask, "V2dV2dV2dV2dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14ss_mask, "V4fV4fV4fV4fUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14pd512_mask, "V8dV8dV8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rcp14ps512_mask, "V16fV16fV16fUs", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_rcp28sd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28ss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28pd_mask, "V8dV8dV8dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_rcp28ps_mask, "V16fV16fV16fUsIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_exp2pd_mask, "V8dV8dV8dUcIi", "", "avx512er") -TARGET_BUILTIN(__builtin_ia32_exp2ps_mask, "V16fV16fV16fUsIi", "", "avx512er") - -TARGET_BUILTIN(__builtin_ia32_cvttps2dq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttps2udq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq512_mask, "V8iV8dV8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvttpd2udq512_mask, "V8iV8dV8iUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_cmpps512_mask, "UsV16fV16fIiUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpps256_mask, "UcV8fV8fIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpps128_mask, "UcV4fV4fIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmppd512_mask, "UcV8dV8dIiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmppd256_mask, "UcV4dV4dIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmppd128_mask, "UcV2dV2dIiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_rndscaleps_mask, "V16fV16fIiV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_rndscalepd_mask, "V8dV8dIiV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq512_mask, "V8iV8dV8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2udq512_mask, "V16iV16fV16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2udq512_mask, "V8iV8dV8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps512_mask, "V16fV16iV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtudq2ps512_mask, "V16fV16iV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps512_mask, "V8fV8dV8fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph512_mask, "V16sV16fIiV16sUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps512_mask, "V16fV16sV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pabsd512_mask, "V16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pabsq512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxsd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxsq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxud512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmaxuq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminsd512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminsq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminud512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pminuq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmuldq512, "V8LLiV16iV16i", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_pmuludq512, "V8LLiV16iV16i", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16iiC*V16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8LLiLLiC*V8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16ffC*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadaps512_mask, "V16fV16fC*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadupd512_mask, "V8ddC*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_loadapd512_mask, "V8dV8dC*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storedqudi512_mask, "vLLi*V8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storedqusi512_mask, "vi*V16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeupd512_mask, "vd*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeapd512_mask, "vV8d*V8dUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeups512_mask, "vf*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_storeaps512_mask, "vV16f*V16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard512_mask, "V16iV16iV16iV16iUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps512_mask, "V16fV16iV16fV16fUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd512_mask, "V8dV8LLiV8dV8dUc", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_vpdpbusd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusd512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusds128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusds256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusds512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssd512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssds128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssds256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssds512_mask, "V16iV16iV16iV16iUs", "", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusds128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusds256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpbusds512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssds128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssds256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vnni") -TARGET_BUILTIN(__builtin_ia32_vpdpwssds512_maskz, "V16iV16iV16iV16iUs", "", "avx512vnni") - -TARGET_BUILTIN(__builtin_ia32_gather3div2df, "V2dV2ddC*V2LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div2di, "V2LLiV2LLiLLiC*V2LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4df, "V4dV4ddC*V4LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4di, "V4LLiV4LLiLLiC*V4LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4sf, "V4fV4ffC*V2LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div4si, "V4iV4iiC*V2LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div8sf, "V4fV4ffC*V4LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3div8si, "V4iV4iiC*V4LLiUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv2df, "V2dV2ddC*V4iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv2di, "V2LLiV2LLiLLiC*V4iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4df, "V4dV4ddC*V4iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4di, "V4LLiV4LLiLLiC*V4iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4sf, "V4fV4ffC*V4iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv4si, "V4iV4iiC*V4iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv8sf, "V8fV8ffC*V8iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gather3siv8si, "V8iV8iiC*V8iUcIi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_gathersiv8df, "V8dV8ddC*V8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16sf, "V16fV16ffC*V16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8df, "V8dV8ddC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16sf, "V8fV8ffC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv8di, "V8LLiV8LLiLLiC*V8iUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gathersiv16si, "V16iV16iiC*V16iUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv8di, "V8LLiV8LLiLLiC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_gatherdiv16si, "V8iV8iiC*V8LLiUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8df, "vd*UcV8iV8dIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16sf, "vf*UsV16iV16fIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8df, "vd*UcV8LLiV8dIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16sf, "vf*UcV8LLiV8fIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv8di, "vLLi*UcV8iV8LLiIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scattersiv16si, "vi*UsV16iV16iIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8di, "vLLi*UcV8LLiV8LLiIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_scatterdiv16si, "vi*UcV8LLiV8iIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_gatherpfdpd, "vUcV8iLLiC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfdps, "vUsV16iiC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqpd, "vUcV8LLiLLiC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_gatherpfqps, "vUcV8LLiiC*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdpd, "vUcV8iLLi*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfdps, "vUsV16ii*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8LLiLLi*IiIi", "", "avx512pf") -TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8LLii*IiIi", "", "avx512pf") - -TARGET_BUILTIN(__builtin_ia32_knothi, "UsUs", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_cmpb128_mask, "UsV16cV16cIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpd128_mask, "UcV4iV4iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpq128_mask, "UcV2LLiV2LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpw128_mask, "UcV8sV8sIiUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpb256_mask, "UiV32cV32cIiUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpd256_mask, "UcV8iV8iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpq256_mask, "UcV4LLiV4LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cmpw256_mask, "UsV16sV16sIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpb512_mask, "ULLiV64cV64cIiULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cmpd512_mask, "UsV16iV16iIiUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpq512_mask, "UcV8LLiV8LLiIiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpw512_mask, "UiV32sV32sIiUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpb128_mask, "UsV16cV16cIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpd128_mask, "UcV4iV4iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpq128_mask, "UcV2LLiV2LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpw128_mask, "UcV8sV8sIiUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpb256_mask, "UiV32cV32cIiUi", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpd256_mask, "UcV8iV8iIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpq256_mask, "UcV4LLiV4LLiIiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_ucmpw256_mask, "UsV16sV16sIiUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpb512_mask, "ULLiV64cV64cIiULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_ucmpd512_mask, "UsV16iV16iIiUs", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ucmpq512_mask, "UcV8LLiV8LLiIiUc", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_ucmpw512_mask, "UiV32sV32sIiUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pabsb512_mask, "V64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pabsw512_mask, "V32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packssdw512, "V32sV16iV16i", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packsswb512, "V64cV32sV32s", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packusdw512, "V32sV16iV16i", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_packuswb512, "V64cV32sV32s", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxub512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaxuw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminub512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pminuw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pshufb512, "V64cV64cV64c", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_vpermi2varhi512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi512_maskz, "V32sV32sV32sV32sUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_vpconflictdi_128_mask, "V2LLiV2LLiV2LLiUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpconflictdi_256_mask, "V4LLiV4LLiV4LLiUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpconflictsi_128_mask, "V4iV4iV4iUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpconflictsi_256_mask, "V8iV8iV8iUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpconflictdi_512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vpconflictsi_512_mask, "V16iV16iV16iUs", "", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vplzcntd_512_mask, "V16iV16iV16iUs", "", "avx512cd") -TARGET_BUILTIN(__builtin_ia32_vplzcntq_512_mask, "V8LLiV8LLiV8LLiUc", "", "avx512cd") - -TARGET_BUILTIN(__builtin_ia32_vpopcntd_128, "V4iV4i", "", "avx512vpopcntdq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpopcntq_128, "V2LLiV2LLi", "", "avx512vpopcntdq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpopcntd_256, "V8iV8i", "", "avx512vpopcntdq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpopcntq_256, "V4LLiV4LLi", "", "avx512vpopcntdq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpopcntd_512, "V16iV16i", "", "avx512vpopcntdq") -TARGET_BUILTIN(__builtin_ia32_vpopcntq_512, "V8LLiV8LLi", "", "avx512vpopcntdq") - -TARGET_BUILTIN(__builtin_ia32_vpopcntb_128, "V16cV16c", "", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpopcntw_128, "V8sV8s", "", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpopcntb_256, "V32cV32c", "", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpopcntw_256, "V16sV16s", "", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpopcntb_512, "V64cV64c", "", "avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpopcntw_512, "V32sV32s", "", "avx512bitalg") - -TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb128_mask, "UsV16cV16cUs", "", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb256_mask, "UiV32cV32cUi", "", "avx512vl,avx512bitalg") -TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb512_mask, "ULLiV64cV64cULLi", "", "avx512bitalg") - -TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi128_maskz, "V8sV8sV8sV8sUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_vpermt2varhi256_maskz, "V16sV16sV16sV16sUs", "", "avx512vl,avx512bw") - -TARGET_BUILTIN(__builtin_ia32_pmulhrsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhuw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmulhw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_addpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_addps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subpd512_mask, "V8dV8dV8dV8dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subps512_mask, "V16fV16fV16fV16fUsIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_pmaddubsw512_mask, "V32sV64cV64cV32sUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmaddwd512_mask, "V16iV32sV32sV16iUs", "", "avx512bw") - -TARGET_BUILTIN(__builtin_ia32_addss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minss_round_mask, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_addsd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_divsd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_mulsd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_subsd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_maxsd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_minsd_round_mask, "V2dV2dV2dV2dUcIi", "", "avx512f") - -TARGET_BUILTIN(__builtin_ia32_compressdf128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressdf256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressdi128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressdi256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_compresshi128_mask, "V8sV8sV8sUc","","avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compresshi256_mask, "V16sV16sV16sUs","","avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressqi128_mask, "V16cV16cV16cUs","","avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressqi256_mask, "V32cV32cV32cUi","","avx512vl,avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_compresssf128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compresssf256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compresssi128_mask, "V4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compresssi256_mask, "V8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredf128_mask, "vV2d*V2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredf256_mask, "vV4d*V4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredi128_mask, "vV2LLi*V2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoredi256_mask, "vV4LLi*V4LLiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_compressstorehi128_mask, "vV8s*V8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressstorehi256_mask, "vV16s*V16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressstoreqi128_mask, "vV16c*V16cUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressstoreqi256_mask, "vV32c*V32cUi", "", "avx512vl,avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_compressstoresf128_mask, "vV4f*V4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoresf256_mask, "vV8f*V8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoresi128_mask, "vV4i*V4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_compressstoresi256_mask, "vV8i*V8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps128_mask, "V4fV4iV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtdq2ps256_mask, "V8fV8iV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2dq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps_mask, "V4fV2dV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2ps256_mask, "V4fV4dV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2udq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtpd2udq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2dq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd128_mask, "V2dV4fV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd256_mask, "V4dV4fV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2udq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtps2udq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2dq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2udq128_mask, "V4iV2dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttpd2udq256_mask, "V4iV4dV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2dq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2udq128_mask, "V4iV4fV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvttps2udq256_mask, "V8iV8fV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtudq2ps128_mask, "V4fV4iV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtudq2ps256_mask, "V8fV8iV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddf128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddf256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddi128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expanddi256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_expandhi128_mask, "V8sV8sV8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandhi256_mask, "V16sV16sV16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandqi128_mask, "V16cV16cV16cUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandqi256_mask, "V32cV32cV32cUi", "", "avx512vl,avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_expandloaddf128_mask, "V2dV2d*V2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloaddf256_mask, "V4dV4d*V4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloaddi128_mask, "V4iV2LLi*V2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloaddi256_mask, "V4LLiV4LLi*V4LLiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_expandloadhi128_mask, "V8sV8sC*V8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloadhi256_mask, "V16sV16sC*V16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloadqi128_mask, "V16cV16cC*V16cUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloadqi256_mask, "V32cV32cC*V32cUi", "", "avx512vl,avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_expandloadsf128_mask, "V4fV4f*V4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloadsf256_mask, "V8fV8f*V8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloadsi128_mask, "V4iV4i*V4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandloadsi256_mask, "V8iV8i*V8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsf128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsf256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsi128_mask, "V4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_expandsi256_mask, "V8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexppd128_mask, "V2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexppd256_mask, "V4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexpps128_mask, "V4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_getexpps256_mask, "V8fV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pabsq128_mask, "V2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pabsq256_mask, "V4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxsq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxsq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxuq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmaxuq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminsq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminsq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminuq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_pminuq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscalepd_128_mask, "V2dV2dIiV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscalepd_256_mask, "V4dV4dIiV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscaleps_128_mask, "V4fV4fIiV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_rndscaleps_256_mask, "V8fV8fIiV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefpd128_mask, "V2dV2dV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefpd256_mask, "V4dV4dV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefps128_mask, "V4fV4fV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scalefps256_mask, "V8fV8fV8fV8fUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_scatterdiv2df, "vd*UcV2LLiV2dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv2di, "vLLi*UcV2LLiV2LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4df, "vd*UcV4LLiV4dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4di, "vLLi*UcV4LLiV4LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4sf, "vf*UcV2LLiV4fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv4si, "vi*UcV2LLiV4iIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8sf, "vf*UcV4LLiV4fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scatterdiv8si, "vi*UcV4LLiV4iIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv2df, "vd*UcV4iV2dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv2di, "vLLi*UcV4iV2LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4df, "vd*UcV4iV4dIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4di, "vLLi*UcV4iV4LLiIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4sf, "vf*UcV4iV4fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv4si, "vi*UcV4iV4iIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv8sf, "vf*UcV8iV8fIi", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_scattersiv8si, "vi*UcV8iV8iIi", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vpermi2vard128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2vard256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varpd128_mask, "V2dV2dV2LLiV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varpd256_mask, "V4dV4dV4LLiV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varps128_mask, "V4fV4fV4iV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varps256_mask, "V8fV8fV8iV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard128_mask, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard256_mask, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd128_mask, "V2dV2LLiV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd128_maskz, "V2dV2LLiV2dV2dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd256_mask, "V4dV4LLiV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd256_maskz, "V4dV4LLiV4dV4dUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps128_mask, "V4fV4iV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps128_maskz, "V4fV4iV4fV4fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps256_mask, "V8fV8iV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps256_maskz, "V8fV8iV8fV8fUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl") - -TARGET_BUILTIN(__builtin_ia32_vpshldd128_mask, "V4iV4iV4iIiV4iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldd256_mask, "V8iV8iV8iIiV8iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldd512_mask, "V16iV16iV16iIiV16iUs", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldq128_mask, "V2LLiV2LLiV2LLiIiV2LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldq256_mask, "V4LLiV4LLiV4LLiIiV4LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldq512_mask, "V8LLiV8LLiV8LLiIiV8LLiUc", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldw128_mask, "V8sV8sV8sIiV8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldw256_mask, "V16sV16sV16sIiV16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldw512_mask, "V32sV32sV32sIiV32sUi", "", "avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_vpshldvd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd512_mask, "V16iV16iV16iV16iUs", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw512_mask, "V32sV32sV32sV32sUi", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw128_maskz, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw256_maskz, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshldvw512_maskz, "V32sV32sV32sV32sUi", "", "avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_mask, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_mask, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_mask, "V16iV16iV16iV16iUs", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_mask, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_mask, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_mask, "V32sV32sV32sV32sUi", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_maskz, "V4iV4iV4iV4iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_maskz, "V8iV8iV8iV8iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_maskz, "V16iV16iV16iV16iUs", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_maskz, "V8sV8sV8sV8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_maskz, "V16sV16sV16sV16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_maskz, "V32sV32sV32sV32sUi", "", "avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_vpshrdd128_mask, "V4iV4iV4iiV4iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdd256_mask, "V8iV8iV8iiV8iUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdd512_mask, "V16iV16iV16iiV16iUs", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdq128_mask, "V2LLiV2LLiV2LLiiV2LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdq256_mask, "V4LLiV4LLiV4LLiiV4LLiUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdq512_mask, "V8LLiV8LLiV8LLiiV8LLiUc", "", "avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdw128_mask, "V8sV8sV8siV8sUc", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdw256_mask, "V16sV16sV16siV16sUs", "", "avx512vl,avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_vpshrdw512_mask, "V32sV32sV32siV32sUi", "", "avx512vbmi2") - -TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtpd2qq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2qq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2qq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2qq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2uqq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2uqq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2pd128_mask, "V2dV2LLiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2pd256_mask, "V4dV4LLiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2ps128_mask, "V4fV2LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2ps256_mask, "V4fV4LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2qq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2qq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq128_mask, "V2LLiV2dV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq256_mask, "V4LLiV4dV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2qq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2qq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2uqq128_mask, "V2LLiV4fV2LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2uqq256_mask, "V4LLiV4fV4LLiUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd128_mask, "V2dV2LLiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd256_mask, "V4dV4LLiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps128_mask, "V4fV2LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps256_mask, "V4fV4LLiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangepd128_mask, "V2dV2dV2dIiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangepd256_mask, "V4dV4dV4dIiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangeps128_mask, "V4fV4fV4fIiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangeps256_mask, "V8fV8fV8fIiV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangesd128_round_mask, "V2dV2dV2dV2dUcIiIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangess128_round_mask, "V4fV4fV4fV4fUcIiIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducepd128_mask, "V2dV2dIiV2dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducepd256_mask, "V4dV4dIiV4dUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reduceps128_mask, "V4fV4fIiV4fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reduceps256_mask, "V8fV8fIiV8fUc", "", "avx512vl,avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducesd_mask, "V2dV2dV2dV2dUcIiIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducess_mask, "V4fV4fV4fV4fUcIiIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_pmovswb128_mask, "V16cV8sV16cUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovswb256_mask, "V16cV16sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovuswb128_mask, "V16cV8sV16cUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovuswb256_mask, "V16cV16sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovwb128_mask, "V16cV8sV16cUc", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovwb256_mask, "V16cV16sV16cUs", "", "avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8LLiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8LLiV8fUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8LLiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8LLiV8fUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "", "avx512dq") -TARGET_BUILTIN(__builtin_ia32_prold512_mask, "V16iV16iIiV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prolq512_mask, "V8LLiV8LLiIiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prold128_mask, "V4iV4iIiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prold256_mask, "V8iV8iIiV8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prolq128_mask, "V2LLiV2LLiIiV2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prolq256_mask, "V4LLiV4LLiIiV4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prolvd512_mask, "V16iV16iV16iV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prolvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prord512_mask, "V16iV16iiV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prorq512_mask, "V8LLiV8LLiiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prolvd128_mask, "V4iV4iV4iV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prolvd256_mask, "V8iV8iV8iV8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prolvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prolvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prord128_mask, "V4iV4iIiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prord256_mask, "V8iV8iIiV8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prorq128_mask, "V2LLiV2LLiIiV2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prorq256_mask, "V4LLiV4LLiIiV4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prorvd512_mask, "V16iV16iV16iV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prorvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_prorvd128_mask, "V4iV4iV4iV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prorvd256_mask, "V8iV8iV8iV8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prorvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_prorvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_psllv32hi, "V32sV32sV32s","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psllw512, "V32sV32sV8s","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psllwi512, "V32sV32si","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psllv16hi, "V16sV16sV16s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_psllv8hi, "V8sV8sV8s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_pslldi512, "V16iV16ii","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psllqi512, "V8LLiV8LLii","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlv32hi, "V32sV32sV32s","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrlv16hi, "V16sV16sV16s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_psrlv8hi, "V8sV8sV8s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_psrldi512, "V16iV16ii","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlqi512, "V8LLiV8LLii","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrav32hi, "V32sV32sV32s","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrav16hi, "V16sV16sV16s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_psrav8hi, "V8sV8sV8s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_psravq128, "V2LLiV2LLiV2LLi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_psravq256, "V4LLiV4LLiV4LLi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_psraw512, "V32sV32sV8s","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrawi512, "V32sV32si","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrlw512, "V32sV32sV8s","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psrlwi512, "V32sV32si","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_movdqa32load128_mask, "V4iV4i*V4iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa32load256_mask, "V8iV8i*V8iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa32load512_mask, "V16iV16iC*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa32store512_mask, "vV16i*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa64load512_mask, "V8LLiV8LLiC*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa64store512_mask, "vV8LLi*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa32store128_mask, "vV4i*V4iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa32store256_mask, "vV8i*V8iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa64load128_mask, "V2LLiV2LLiC*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_movdqa64load256_mask, "V4LLiV4LLiC*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_movdqa64store128_mask, "vV2LLi*V2LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_movdqa64store256_mask, "vV4LLi*V4LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpmadd52huq512_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512ifma") -TARGET_BUILTIN(__builtin_ia32_vpmadd52huq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc","","avx512ifma") -TARGET_BUILTIN(__builtin_ia32_vpmadd52luq512_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512ifma") -TARGET_BUILTIN(__builtin_ia32_vpmadd52luq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc","","avx512ifma") -TARGET_BUILTIN(__builtin_ia32_vpmadd52huq128_mask, "V2LLiV2LLiV2LLiV2LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52huq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52huq256_mask, "V4LLiV4LLiV4LLiV4LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52huq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52luq128_mask, "V2LLiV2LLiV2LLiV2LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52luq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52luq256_mask, "V4LLiV4LLiV4LLiV4LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmadd52luq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc","","avx512ifma,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varqi512_mask, "V64cV64cV64cV64cULLi","","avx512vbmi") -TARGET_BUILTIN(__builtin_ia32_vpermt2varqi512_mask, "V64cV64cV64cV64cULLi","","avx512vbmi") -TARGET_BUILTIN(__builtin_ia32_vpermt2varqi512_maskz, "V64cV64cV64cV64cULLi","","avx512vbmi") -TARGET_BUILTIN(__builtin_ia32_vpermi2varqi128_mask, "V16cV16cV16cV16cUs","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermi2varqi256_mask, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varqi128_mask, "V16cV16cV16cV16cUs","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varqi128_maskz, "V16cV16cV16cV16cUs","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varqi256_mask, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpermt2varqi256_maskz, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcomisd, "iV2dV2dIiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcomiss, "iV4fV4fIiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_kunpckdi, "ULLiULLiULLi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_kunpcksi, "UiUiUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_loaddquhi512_mask, "V32sV32s*V32sUi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddquqi512_mask, "V64cV64c*V64cULLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_mask, "V8dV8dV8dV8LLiIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_maskz, "V8dV8dV8dV8LLiIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmps512_mask, "V16fV16fV16fV16iIiUsIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmps512_maskz, "V16fV16fV16fV16iIiUsIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmsd_mask, "V2dV2dV2dV2LLiIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmsd_maskz, "V2dV2dV2dV2LLiIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmss_mask, "V4fV4fV4fV4iIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_fixupimmss_maskz, "V4fV4fV4fV4iIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_getexpsd128_round_mask, "V2dV2dV2dV2dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_getexpss128_round_mask, "V4fV4fV4fV4fUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_getmantsd_round_mask, "V2dV2dV2dIiV2dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_getmantss_round_mask, "V4fV4fV4fIiV4fUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddquhi128_mask, "V8sV8s*V8sUc","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_loaddquhi256_mask, "V16sV16s*V16sUs","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_loaddquqi128_mask, "V16cV16c*V16cUs","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_loaddquqi256_mask, "V32cV32c*V32cUi","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd128_mask, "V2dV2dV2dV2LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd128_maskz, "V2dV2dV2dV2LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd256_mask, "V4dV4dV4dV4LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmpd256_maskz, "V4dV4dV4dV4LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmps128_mask, "V4fV4fV4fV4iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmps128_maskz, "V4fV4fV4fV4iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmps256_mask, "V8fV8fV8fV8iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fixupimmps256_maskz, "V8fV8fV8fV8iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loadapd128_mask, "V2dV2d*V2dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loadsd128_mask, "V8dV8d*V8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_loadapd256_mask, "V4dV4d*V4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loadaps128_mask, "V4fV4f*V4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loadss128_mask, "V16fV16f*V16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_loadaps256_mask, "V8fV8f*V8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loaddqudi128_mask, "V2LLiV2LLi*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loaddqudi256_mask, "V4LLiV4LLi*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loaddqusi128_mask, "V4iV4i*V4iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_loaddqusi256_mask, "V8iV8i*V8iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_loadupd128_mask, "V2dV2d*V2dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loadupd256_mask, "V4dV4d*V4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loadups128_mask, "V4fV4f*V4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_loadups256_mask, "V8fV8f*V8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storedquhi512_mask, "vV32s*V32sUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_storedquqi512_mask, "vV64c*V64cULLi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_storedquhi128_mask, "vV8s*V8sUc","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_storedquhi256_mask, "vV16s*V16sUs","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_storedquqi128_mask, "vV16c*V16cUs","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_storedquqi256_mask, "vV32c*V32cUi","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_storeapd128_mask, "vV2d*V2dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storesd128_mask, "vV8d*V8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_storeapd256_mask, "vV4d*V4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storeaps128_mask, "vV4f*V4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storess128_mask, "vV16f*V16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_storeaps256_mask, "vV8f*V8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storedqudi128_mask, "vV2LLi*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storedqudi256_mask, "vV4LLi*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storedqusi128_mask, "vV4i*V4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storedqusi256_mask, "vV8i*V8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storeupd128_mask, "vV2d*V2dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storeupd256_mask, "vV4d*V4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storeups128_mask, "vV4f*V4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_storeups256_mask, "vV8f*V8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_rcp14pd128_mask, "V2dV2dV2dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_rcp14pd256_mask, "V4dV4dV4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_rcp14ps128_mask, "V4fV4fV4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_rcp14ps256_mask, "V8fV8fV8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_vplzcntd_128_mask, "V4iV4iV4iUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vplzcntd_256_mask, "V8iV8iV8iUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vplzcntq_128_mask, "V2LLiV2LLiV2LLiUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vplzcntq_256_mask, "V4LLiV4LLiV4LLiUc","","avx512cd,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtsd2si32, "iV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtsd2usi32, "UiV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtss2si32, "iV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtss2usi32, "UiV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttsd2si32, "iV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttsd2usi32, "UiV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttss2si32, "iV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttss2usi32, "UiV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermi2vard512_mask, "V16iV16iV16iV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermi2varpd512_mask, "V8dV8dV8LLiV8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermi2varps512_mask, "V16fV16fV16iV16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermi2varq512_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermilvarpd512, "V8dV8dV8LLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermilvarps512, "V16fV16fV16i","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2vard512_maskz, "V16iV16iV16iV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varpd512_maskz, "V8dV8LLiV8dV8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varps512_maskz, "V16fV16iV16fV16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpermt2varq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_rndscalesd_round_mask, "V2dV2dV2dV2dUcIiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_rndscaless_round_mask, "V4fV4fV4fV4fUcIiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_scalefpd512_mask, "V8dV8dV8dV8dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_scalefps512_mask, "V16fV16fV16fV16fUsIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_scalefsd_round_mask, "V2dV2dV2dV2dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_scalefss_round_mask, "V4fV4fV4fV4fUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psradi512, "V16iV16ii","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psraqi512, "V8LLiV8LLii","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psraq128, "V2LLiV2LLiV2LLi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_psraq256, "V4LLiV4LLiV2LLi","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_psraqi128, "V2LLiV2LLii","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_psraqi256, "V4LLiV4LLii","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pslld512, "V16iV16iV4i","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psllq512, "V8LLiV8LLiV2LLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psllv16si, "V16iV16iV16i","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psllv8di, "V8LLiV8LLiV8LLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrad512, "V16iV16iV4i","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psraq512, "V8LLiV8LLiV2LLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrav16si, "V16iV16iV16i","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrav8di, "V8LLiV8LLiV8LLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrld512, "V16iV16iV4i","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlq512, "V8LLiV8LLiV2LLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlv16si, "V16iV16iV16i","","avx512f") -TARGET_BUILTIN(__builtin_ia32_psrlv8di, "V8LLiV8LLiV8LLi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogd512_mask, "V16iV16iV16iV16iIiUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogd512_maskz, "V16iV16iV16iV16iIiUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogq512_mask, "V8LLiV8LLiV8LLiV8LLiIiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogq512_maskz, "V8LLiV8LLiV8LLiV8LLiIiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pternlogd128_mask, "V4iV4iV4iV4iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pternlogd128_maskz, "V4iV4iV4iV4iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pternlogd256_mask, "V8iV8iV8iV8iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pternlogd256_maskz, "V8iV8iV8iV8iIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pternlogq128_mask, "V2LLiV2LLiV2LLiV2LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pternlogq128_maskz, "V2LLiV2LLiV2LLiV2LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pternlogq256_mask, "V4LLiV4LLiV4LLiV4LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pternlogq256_maskz, "V4LLiV4LLiV4LLiV4LLiIiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_f32x4_mask, "V16fV16fV16fIiV16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_f64x2_mask, "V8dV8dV8dIiV8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_i32x4_mask, "V16iV16iV16iIiV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_i64x2_mask, "V8LLiV8LLiV8LLiIiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_shuf_f32x4_256_mask, "V8fV8fV8fIiV8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_f64x2_256_mask, "V4dV4dV4dIiV4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_i32x4_256_mask, "V8iV8iV8iIiV8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_shuf_i64x2_256_mask, "V4LLiV4LLiV4LLiIiV4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_sqrtsd_round_mask, "V2dV2dV2dV2dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_sqrtss_round_mask, "V4fV4fV4fV4fUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_rsqrt14pd128_mask, "V2dV2dV2dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_rsqrt14pd256_mask, "V4dV4dV4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_rsqrt14ps128_mask, "V4fV4fV4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_rsqrt14ps256_mask, "V8fV8fV8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtb2mask512, "ULLiV64c","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtmask2b512, "V64cULLi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtmask2w512, "V32sUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtd2mask512, "UsV16i","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtmask2d512, "V16iUs","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtmask2q512, "V8LLiUc","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtq2mask512, "UcV8LLi","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_cvtb2mask128, "UsV16c","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtb2mask256, "UiV32c","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2b128, "V16cUs","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2b256, "V32cUi","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2w128, "V8sUc","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2w256, "V16sUs","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtd2mask128, "UcV4i","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtd2mask256, "UcV8i","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2d128, "V4iUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2d256, "V8iUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2q128, "V2LLiUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtmask2q256, "V4LLiUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtq2mask128, "UcV2LLi","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtq2mask256, "UcV4LLi","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsdb512_mask, "V16cV16iV16cUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsdb512mem_mask, "vV16c*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovswb512mem_mask, "vV32c*V32sUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovsdw512_mask, "V16sV16iV16sUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsdw512mem_mask, "vV16s*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqb512_mask, "V16cV8LLiV16cUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqb512mem_mask, "vV16c*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqd512_mask, "V8iV8LLiV8iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqd512mem_mask, "vV8i*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqw512_mask, "V8sV8LLiV8sUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsqw512mem_mask, "vV8s*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovsdb128_mask, "V16cV4iV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsdb128mem_mask, "vV16c*V4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovswb128mem_mask, "vV16c*V8sUc","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovsdb256_mask, "V16cV8iV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsdb256mem_mask, "vV16c*V8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovswb256mem_mask, "vV16c*V16sUs","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovsdw128_mask, "V8sV4iV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsdw128mem_mask, "vV8s*V4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsdw256_mask, "V8sV8iV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsdw256mem_mask, "vV8s*V8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqb128_mask, "V16cV2LLiV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqb128mem_mask, "vV16c*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqb256_mask, "V16cV4LLiV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqb256mem_mask, "vV16c*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqd128_mask, "V4iV2LLiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqd128mem_mask, "vV4i*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqd256_mask, "V4iV4LLiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqd256mem_mask, "vV4i*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqw128_mask, "V8sV2LLiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqw128mem_mask, "vV8s*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqw256_mask, "V8sV4LLiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovsqw256mem_mask, "vV8s*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusdb512_mask, "V16cV16iV16cUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusdb512mem_mask, "vV16c*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovuswb512mem_mask, "vV32c*V32sUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovusdw512_mask, "V16sV16iV16sUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusdw512mem_mask, "vV16s*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqb512_mask, "V16cV8LLiV16cUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqb512mem_mask, "vV16c*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqd512_mask, "V8iV8LLiV8iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqd512mem_mask, "vV8i*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqw512_mask, "V8sV8LLiV8sUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusqw512mem_mask, "vV8s*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovusdb128_mask, "V16cV4iV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusdb128mem_mask, "vV16c*V4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovuswb128mem_mask, "vV16c*V8sUc","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovusdb256_mask, "V16cV8iV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusdb256mem_mask, "vV16c*V8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovuswb256mem_mask, "vV16c*V16sUs","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovusdw128_mask, "V8sV4iV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusdw128mem_mask, "vV8s*V4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusdw256_mask, "V8sV8iV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusdw256mem_mask, "vV8s*V8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqb128_mask, "V16cV2LLiV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqb128mem_mask, "vV16c*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqb256_mask, "V16cV4LLiV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqb256mem_mask, "vV16c*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqd128_mask, "V4iV2LLiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqd128mem_mask, "vV4i*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqd256_mask, "V4iV4LLiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqd256mem_mask, "vV4i*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqw128_mask, "V8sV2LLiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqw128mem_mask, "vV8s*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqw256_mask, "V8sV4LLiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovusqw256mem_mask, "vV8s*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovdb512_mask, "V16cV16iV16cUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovdb512mem_mask, "vV16c*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovwb512mem_mask, "vV32c*V32sUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovdw512_mask, "V16sV16iV16sUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovdw512mem_mask, "vV16s*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqb512_mask, "V16cV8LLiV16cUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqb512mem_mask, "vV16c*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqd512_mask, "V8iV8LLiV8iUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqd512mem_mask, "vV8i*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqw512_mask, "V8sV8LLiV8sUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovqw512mem_mask, "vV8s*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_pmovdb128_mask, "V16cV4iV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovwb128mem_mask, "vV16c*V8sUc","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovdb128mem_mask, "vV16c*V4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovdb256_mask, "V16cV8iV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovdb256mem_mask, "vV16c*V8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovwb256mem_mask, "vV16c*V16sUs","","avx512vl,avx512bw") -TARGET_BUILTIN(__builtin_ia32_pmovdw128_mask, "V8sV4iV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovdw128mem_mask, "vV8s*V4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovdw256_mask, "V8sV8iV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovdw256mem_mask, "vV8s*V8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqb128_mask, "V16cV2LLiV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqb128mem_mask, "vV16c*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqb256_mask, "V16cV4LLiV16cUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqb256mem_mask, "vV16c*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqd128_mask, "V4iV2LLiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqd128mem_mask, "vV4i*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqd256_mask, "V4iV4LLiV4iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqd256mem_mask, "vV4i*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqw128_mask, "V8sV2LLiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqw128mem_mask, "vV8s*V2LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqw256_mask, "V8sV4LLiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_pmovqw256mem_mask, "vV8s*V4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_getmantpd128_mask, "V2dV2diV2dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_getmantpd256_mask, "V4dV4diV4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_getmantps128_mask, "V4fV4fiV4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_getmantps256_mask, "V8fV8fiV8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_getmantpd512_mask, "V8dV8diV8dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_getmantps512_mask, "V16fV16fiV16fUsIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_getexppd512_mask, "V8dV8dV8dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_getexpps512_mask, "V16fV16fV16fUsIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddss3_mask, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddss3_maskz, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddss3_mask3, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_maskz, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask3, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfmsubss3_mask3, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfnmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_vfnmsubss3_mask3, "V4fV4fV4fV4fUcIi", "", "avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarhi512_mask, "V32sV32sV32sV32sUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_permvardf512_mask, "V8dV8dV8LLiV8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_permvardi512_mask, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarsf512_mask, "V16fV16fV16iV16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarsi512_mask, "V16iV16iV16iV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_permvarqi512_mask, "V64cV64cV64cV64cULLi","","avx512vbmi") -TARGET_BUILTIN(__builtin_ia32_permvarqi128_mask, "V16cV16cV16cV16cUs","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarqi256_mask, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarhi128_mask, "V8sV8sV8sV8sUc","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarhi256_mask, "V16sV16sV16sV16sUs","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvardf256_mask, "V4dV4dV4LLiV4dUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvardi256_mask, "V4LLiV4LLiV4LLiV4LLiUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarsf256_mask, "V8fV8fV8iV8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_permvarsi256_mask, "V8iV8iV8iV8iUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_fpclasspd128_mask, "UcV2dIiUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_fpclasspd256_mask, "UcV4dIiUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_fpclassps128_mask, "UcV4fIiUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_fpclassps256_mask, "UcV8fIiUc","","avx512dq,avx512vl") -TARGET_BUILTIN(__builtin_ia32_fpclassps512_mask, "UsV16fIiUs","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_fpclasspd512_mask, "UcV8dIiUc","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_fpclasssd_mask, "UcV2dIiUc","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_fpclassss_mask, "UcV4fIiUc","","avx512dq") -TARGET_BUILTIN(__builtin_ia32_kandhi, "UsUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_kandnhi, "UsUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_korhi, "UsUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_kortestchi, "iUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_kortestzhi, "iUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_kunpckhi, "UsUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_kxnorhi, "UsUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_kxorhi, "UsUsUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_palignr512_mask, "V64cV64cV64cIiV64cULLi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_dbpsadbw128_mask, "V8sV16cV16cIiV8sUc","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_dbpsadbw256_mask, "V16sV32cV32cIiV16sUs","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_dbpsadbw512_mask, "V32sV64cV64cIiV32sUi","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_psadbw512, "V8LLiV64cV64c","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_compressdf512_mask, "V8dV8dV8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_compressdi512_mask, "V8LLiV8LLiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_compresshi512_mask, "V32sV32sV32sUi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressqi512_mask, "V64cV64cV64cULLi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compresssf512_mask, "V16fV16fV16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_compresssi512_mask, "V16iV16iV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpsd_mask, "UcV2dV2dIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cmpss_mask, "UcV4fV4fIiUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expanddf512_mask, "V8dV8dV8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expanddi512_mask, "V8LLiV8LLiV8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expandhi512_mask, "V32sV32sV32sUi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandqi512_mask, "V64cV64cV64cULLi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloaddf512_mask, "V8dV8dC*V8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expandloaddi512_mask, "V8LLiV8LLiC*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expandloadhi512_mask, "V32sV32sC*V32sUi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloadqi512_mask, "V64cV64cC*V64cULLi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_expandloadsf512_mask, "V16fV16fC*V16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expandloadsi512_mask, "V16iV16iC*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expandsf512_mask, "V16fV16fV16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_expandsi512_mask, "V16iV16iV16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtps2pd512_mask, "V8dV8fV8dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstoredf512_mask, "vV8d*V8dUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstoredi512_mask, "vV8LLi*V8LLiUc","","avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstorehi512_mask, "vV32s*V32sUi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressstoreqi512_mask, "vV64c*V64cULLi","","avx512vbmi2") -TARGET_BUILTIN(__builtin_ia32_compressstoresf512_mask, "vV16f*V16fUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_compressstoresi512_mask, "vV16i*V16iUs","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps_mask, "V4fV8sV4fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtph2ps256_mask, "V8fV8sV8fUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph_mask, "V8sV4fIiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_vcvtps2ph256_mask, "V8sV8fIiV8sUc","","avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtw2mask512, "UiV32s","","avx512bw") -TARGET_BUILTIN(__builtin_ia32_cvtw2mask128, "UcV8s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtw2mask256, "UsV16s","","avx512bw,avx512vl") -TARGET_BUILTIN(__builtin_ia32_cvtsd2ss_round_mask, "V4fV4fV2dV4fUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtsi2ss32, "V4fV4fiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtss2sd_round_mask, "V2dV2dV4fV2dUcIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtusi2sd32, "V2dV2dUi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtusi2ss32, "V4fV4fUiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512_mask, "V64cV64cV64cV64cULLi","","avx512vbmi") -TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128_mask, "V16cV16cV16cV16cUs","","avx512vbmi,avx512vl") -TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256_mask, "V32cV32cV32cV32cUi","","avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_sqrtpd512, "V8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_sqrtps512, "V16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rsqrt14sd_mask, "V2dV2dV2dV2dUc", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rsqrt14ss_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rsqrt14pd512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rsqrt14ps512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_rsqrt28sd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rsqrt28ss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rsqrt28pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rsqrt28ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er") + +TARGET_BUILTIN(__builtin_ia32_rcp14sd_mask, "V2dV2dV2dV2dUc", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rcp14ss_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rcp14pd512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rcp14ps512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_rcp28sd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rcp28ss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rcp28pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_rcp28ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_exp2pd_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512er") +TARGET_BUILTIN(__builtin_ia32_exp2ps_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512er") + +TARGET_BUILTIN(__builtin_ia32_cvttps2dq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvttps2udq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvttpd2dq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvttpd2udq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_cmpps512_mask, "UsV16fV16fIiUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmpps256_mask, "UcV8fV8fIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cmpps128_mask, "UcV4fV4fIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cmppd512_mask, "UcV8dV8dIiUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmppd256_mask, "UcV4dV4dIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cmppd128_mask, "UcV2dV2dIiUc", "ncV:128:", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_rndscaleps_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rndscalepd_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtps2dq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtpd2dq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtps2udq512_mask, "V16iV16fV16iUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtpd2udq512_mask, "V8iV8dV8iUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_minps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_minpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_maxps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_maxpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtdq2ps512_mask, "V16fV16iV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtudq2ps512_mask, "V16fV16iV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtpd2ps512_mask, "V8fV8dV8fUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtps2ph512_mask, "V16sV16fIiV16sUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtph2ps512_mask, "V16fV16sV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pabsd512, "V16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pabsq512, "V8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmaxsd512, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmaxsq512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmaxud512, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmaxuq512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pminsd512, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pminsq512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pminud512, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pminuq512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmuldq512, "V8LLiV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmuludq512, "V8LLiV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loaddqusi512_mask, "V16iiC*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loaddqudi512_mask, "V8LLiLLiC*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loadups512_mask, "V16ffC*V16fUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loadaps512_mask, "V16fV16fC*V16fUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loadupd512_mask, "V8ddC*V8dUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loadapd512_mask, "V8dV8dC*V8dUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storedqudi512_mask, "vLLi*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storedqusi512_mask, "vi*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storeupd512_mask, "vd*V8dUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storeapd512_mask, "vV8d*V8dUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storeups512_mask, "vf*V16fUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storeaps512_mask, "vV16f*V16fUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_alignq512, "V8LLiV8LLiV8LLiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_alignd512, "V16iV16iV16iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_alignd128, "V4iV4iV4iIi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_alignd256, "V8iV8iV8iIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_alignq128, "V2LLiV2LLiV2LLiIi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_alignq256, "V4LLiV4LLiV4LLiIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_extractf64x4_mask, "V4dV8dIiV4dUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_extractf32x4_mask, "V4fV16fIiV4fUc", "ncV:512:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_vpdpbusd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpbusds512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssd512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl,avx512vnni") +TARGET_BUILTIN(__builtin_ia32_vpdpwssds512, "V16iV16iV16iV16i", "ncV:512:", "avx512vnni") + +TARGET_BUILTIN(__builtin_ia32_gather3div2df, "V2dV2ddC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div2di, "V2LLiV2LLiLLiC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4df, "V4dV4ddC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4di, "V4LLiV4LLiLLiC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4sf, "V4fV4ffC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div4si, "V4iV4iiC*V2LLiUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div8sf, "V4fV4ffC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3div8si, "V4iV4iiC*V4LLiUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv2df, "V2dV2ddC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv2di, "V2LLiV2LLiLLiC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4df, "V4dV4ddC*V4iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4di, "V4LLiV4LLiLLiC*V4iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4sf, "V4fV4ffC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv4si, "V4iV4iiC*V4iUcIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv8sf, "V8fV8ffC*V8iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gather3siv8si, "V8iV8iiC*V8iUcIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_gathersiv8df, "V8dV8ddC*V8iUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gathersiv16sf, "V16fV16ffC*V16fUsIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv8df, "V8dV8ddC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv16sf, "V8fV8ffC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gathersiv8di, "V8LLiV8LLiLLiC*V8iUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gathersiv16si, "V16iV16iiC*V16iUsIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv8di, "V8LLiV8LLiLLiC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_gatherdiv16si, "V8iV8iiC*V8LLiUcIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv8df, "vd*UcV8iV8dIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv16sf, "vf*UsV16iV16fIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8df, "vd*UcV8LLiV8dIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv16sf, "vf*UcV8LLiV8fIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv8di, "vLLi*UcV8iV8LLiIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scattersiv16si, "vi*UsV16iV16iIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8di, "vLLi*UcV8LLiV8LLiIi", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scatterdiv16si, "vi*UcV8LLiV8iIi", "nV:512:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_gatherpfdpd, "vUcV8iLLiC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gatherpfdps, "vUsV16iiC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gatherpfqpd, "vUcV8LLiLLiC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_gatherpfqps, "vUcV8LLiiC*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfdpd, "vUcV8iLLi*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfdps, "vUsV16ii*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfqpd, "vUcV8LLiLLi*IiIi", "nV:512:", "avx512pf") +TARGET_BUILTIN(__builtin_ia32_scatterpfqps, "vUcV8LLii*IiIi", "nV:512:", "avx512pf") + +TARGET_BUILTIN(__builtin_ia32_knothi, "UsUs", "nc", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_cmpb128_mask, "UsV16cV16cIiUs", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_cmpd128_mask, "UcV4iV4iIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cmpq128_mask, "UcV2LLiV2LLiIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cmpw128_mask, "UcV8sV8sIiUc", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_cmpb256_mask, "UiV32cV32cIiUi", "ncV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_cmpd256_mask, "UcV8iV8iIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cmpq256_mask, "UcV4LLiV4LLiIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cmpw256_mask, "UsV16sV16sIiUs", "ncV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_cmpb512_mask, "ULLiV64cV64cIiULLi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cmpd512_mask, "UsV16iV16iIiUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmpq512_mask, "UcV8LLiV8LLiIiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmpw512_mask, "UiV32sV32sIiUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_ucmpb128_mask, "UsV16cV16cIiUs", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_ucmpd128_mask, "UcV4iV4iIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_ucmpq128_mask, "UcV2LLiV2LLiIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_ucmpw128_mask, "UcV8sV8sIiUc", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_ucmpb256_mask, "UiV32cV32cIiUi", "ncV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_ucmpd256_mask, "UcV8iV8iIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_ucmpq256_mask, "UcV4LLiV4LLiIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_ucmpw256_mask, "UsV16sV16sIiUs", "ncV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_ucmpb512_mask, "ULLiV64cV64cIiULLi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_ucmpd512_mask, "UsV16iV16iIiUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_ucmpq512_mask, "UcV8LLiV8LLiIiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_ucmpw512_mask, "UiV32sV32sIiUi", "ncV:512:", "avx512bw") + +TARGET_BUILTIN(__builtin_ia32_pabsb512, "V64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pabsw512, "V32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_packssdw512, "V32sV16iV16i", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_packsswb512, "V64cV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_packusdw512, "V32sV16iV16i", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_packuswb512, "V64cV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_paddsb512_mask, "V64cV64cV64cV64cULLi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_paddsw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_paddusb512_mask, "V64cV64cV64cV64cULLi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_paddusw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmaxsb512, "V64cV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmaxsw512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmaxub512, "V64cV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmaxuw512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pminsb512, "V64cV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pminsw512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pminub512, "V64cV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pminuw512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pshufb512, "V64cV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psubsb512_mask, "V64cV64cV64cV64cULLi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psubsw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psubusb512_mask, "V64cV64cV64cV64cULLi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psubusw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512bw") + +TARGET_BUILTIN(__builtin_ia32_vpconflictdi_128_mask, "V2LLiV2LLiV2LLiUc", "ncV:128:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpconflictdi_256_mask, "V4LLiV4LLiV4LLiUc", "ncV:256:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpconflictsi_128_mask, "V4iV4iV4iUc", "ncV:128:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpconflictsi_256_mask, "V8iV8iV8iUc", "ncV:256:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpconflictdi_512_mask, "V8LLiV8LLiV8LLiUc", "ncV:512:", "avx512cd") +TARGET_BUILTIN(__builtin_ia32_vpconflictsi_512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512cd") +TARGET_BUILTIN(__builtin_ia32_vplzcntd_512, "V16iV16i", "ncV:512:", "avx512cd") +TARGET_BUILTIN(__builtin_ia32_vplzcntq_512, "V8LLiV8LLi", "ncV:512:", "avx512cd") + +TARGET_BUILTIN(__builtin_ia32_vpopcntd_128, "V4iV4i", "ncV:128:", "avx512vpopcntdq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpopcntq_128, "V2LLiV2LLi", "ncV:128:", "avx512vpopcntdq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpopcntd_256, "V8iV8i", "ncV:256:", "avx512vpopcntdq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpopcntq_256, "V4LLiV4LLi", "ncV:256:", "avx512vpopcntdq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpopcntd_512, "V16iV16i", "ncV:512:", "avx512vpopcntdq") +TARGET_BUILTIN(__builtin_ia32_vpopcntq_512, "V8LLiV8LLi", "ncV:512:", "avx512vpopcntdq") + +TARGET_BUILTIN(__builtin_ia32_vpopcntb_128, "V16cV16c", "ncV:128:", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntw_128, "V8sV8s", "ncV:128:", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntb_256, "V32cV32c", "ncV:256:", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntw_256, "V16sV16s", "ncV:256:", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntb_512, "V64cV64c", "ncV:512:", "avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpopcntw_512, "V32sV32s", "ncV:512:", "avx512bitalg") + +TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb128_mask, "UsV16cV16cUs", "ncV:128:", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb256_mask, "UiV32cV32cUi", "ncV:256:", "avx512vl,avx512bitalg") +TARGET_BUILTIN(__builtin_ia32_vpshufbitqmb512_mask, "ULLiV64cV64cULLi", "ncV:512:", "avx512bitalg") + +TARGET_BUILTIN(__builtin_ia32_pmulhrsw512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmulhuw512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmulhw512, "V32sV32sV32s", "ncV:512:", "avx512bw") + +TARGET_BUILTIN(__builtin_ia32_addpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_addps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_divpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_divps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_mulpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_mulps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_subpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_subps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_pmaddubsw512, "V32sV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmaddwd512, "V16iV32sV32s", "ncV:512:", "avx512bw") + +TARGET_BUILTIN(__builtin_ia32_addss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_divss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_mulss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_subss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_maxss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_minss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_addsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_divsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_mulsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_subsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_maxsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_minsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") + +TARGET_BUILTIN(__builtin_ia32_compressdf128_mask, "V2dV2dV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressdf256_mask, "V4dV4dV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressdi128_mask, "V2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressdi256_mask, "V4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_compresshi128_mask, "V8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compresshi256_mask, "V16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressqi128_mask, "V16cV16cV16cUs", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressqi256_mask, "V32cV32cV32cUi", "ncV:256:", "avx512vl,avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_compresssf128_mask, "V4fV4fV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compresssf256_mask, "V8fV8fV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compresssi128_mask, "V4iV4iV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compresssi256_mask, "V8iV8iV8iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoredf128_mask, "vV2d*V2dUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoredf256_mask, "vV4d*V4dUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoredi128_mask, "vV2LLi*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoredi256_mask, "vV4LLi*V4LLiUc", "nV:256:", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_compressstorehi128_mask, "vV8s*V8sUc", "nV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstorehi256_mask, "vV16s*V16sUs", "nV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstoreqi128_mask, "vV16c*V16cUs", "nV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstoreqi256_mask, "vV32c*V32cUi", "nV:256:", "avx512vl,avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_compressstoresf128_mask, "vV4f*V4fUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoresf256_mask, "vV8f*V8fUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoresi128_mask, "vV4i*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_compressstoresi256_mask, "vV8i*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtpd2dq128_mask, "V4iV2dV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtpd2ps_mask, "V4fV2dV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtpd2udq128_mask, "V4iV2dV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtpd2udq256_mask, "V4iV4dV4iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtps2udq128_mask, "V4iV4fV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtps2udq256_mask, "V8iV8fV8iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvttpd2dq128_mask, "V4iV2dV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvttpd2udq128_mask, "V4iV2dV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvttpd2udq256_mask, "V4iV4dV4iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvttps2udq128_mask, "V4iV4fV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvttps2udq256_mask, "V8iV8fV8iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expanddf128_mask, "V2dV2dV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expanddf256_mask, "V4dV4dV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expanddi128_mask, "V2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expanddi256_mask, "V4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_expandhi128_mask, "V8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandhi256_mask, "V16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandqi128_mask, "V16cV16cV16cUs", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandqi256_mask, "V32cV32cV32cUi", "ncV:256:", "avx512vl,avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_expandloaddf128_mask, "V2dV2dC*V2dUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandloaddf256_mask, "V4dV4dC*V4dUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandloaddi128_mask, "V4iV2LLiC*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandloaddi256_mask, "V4LLiV4LLiC*V4LLiUc", "nV:256:", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_expandloadhi128_mask, "V8sV8sC*V8sUc", "nV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadhi256_mask, "V16sV16sC*V16sUs", "nV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadqi128_mask, "V16cV16cC*V16cUs", "nV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadqi256_mask, "V32cV32cC*V32cUi", "nV:256:", "avx512vl,avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_expandloadsf128_mask, "V4fV4fC*V4fUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandloadsf256_mask, "V8fV8fC*V8fUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandloadsi128_mask, "V4iV4iC*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandloadsi256_mask, "V8iV8iC*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandsf128_mask, "V4fV4fV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandsf256_mask, "V8fV8fV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandsi128_mask, "V4iV4iV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_expandsi256_mask, "V8iV8iV8iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getexppd128_mask, "V2dV2dV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getexppd256_mask, "V4dV4dV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getexpps128_mask, "V4fV4fV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getexpps256_mask, "V8fV8fV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pabsq128, "V2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pabsq256, "V4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmaxsq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmaxsq256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmaxuq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmaxuq256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pminsq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pminsq256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pminuq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pminuq256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rndscalepd_128_mask, "V2dV2dIiV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rndscalepd_256_mask, "V4dV4dIiV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rndscaleps_128_mask, "V4fV4fIiV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rndscaleps_256_mask, "V8fV8fIiV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scalefpd128_mask, "V2dV2dV2dV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scalefpd256_mask, "V4dV4dV4dV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scalefps128_mask, "V4fV4fV4fV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scalefps256_mask, "V8fV8fV8fV8fUc", "ncV:256:", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_scatterdiv2df, "vd*UcV2LLiV2dIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv2di, "vLLi*UcV2LLiV2LLiIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4df, "vd*UcV4LLiV4dIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4di, "vLLi*UcV4LLiV4LLiIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4sf, "vf*UcV2LLiV4fIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv4si, "vi*UcV2LLiV4iIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8sf, "vf*UcV4LLiV4fIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scatterdiv8si, "vi*UcV4LLiV4iIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv2df, "vd*UcV4iV2dIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv2di, "vLLi*UcV4iV2LLiIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4df, "vd*UcV4iV4dIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4di, "vLLi*UcV4iV4LLiIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4sf, "vf*UcV4iV4fIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv4si, "vi*UcV4iV4iIi", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv8sf, "vf*UcV8iV8fIi", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_scattersiv8si, "vi*UcV8iV8iIi", "nV:256:", "avx512vl") + +TARGET_BUILTIN(__builtin_ia32_vpermi2vard128, "V4iV4iV4iV4i", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2vard256, "V8iV8iV8iV8i", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2vard512, "V16iV16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2varpd128, "V2dV2dV2LLiV2d", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varpd256, "V4dV4dV4LLiV4d", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varpd512, "V8dV8dV8LLiV8d", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2varps128, "V4fV4fV4iV4f", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varps256, "V8fV8fV8iV8f", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varps512, "V16fV16fV16iV16f", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2varq128, "V2LLiV2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varq256, "V4LLiV4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varq512, "V8LLiV8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermi2varqi128, "V16cV16cV16cV16c", "ncV:128:", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varqi256, "V32cV32cV32cV32c", "ncV:256:", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpermi2varqi512, "V64cV64cV64cV64c", "ncV:512:", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_vpermi2varhi128, "V8sV8sV8sV8s", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_vpermi2varhi256, "V16sV16sV16sV16s", "ncV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_vpermi2varhi512, "V32sV32sV32sV32s", "ncV:512:", "avx512bw") + +TARGET_BUILTIN(__builtin_ia32_vpshldd128, "V4iV4iV4iIi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldd256, "V8iV8iV8iIi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldd512, "V16iV16iV16iIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldq128, "V2LLiV2LLiV2LLiIi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldq256, "V4LLiV4LLiV4LLiIi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldq512, "V8LLiV8LLiV8LLiIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldw128, "V8sV8sV8sIi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldw256, "V16sV16sV16sIi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldw512, "V32sV32sV32sIi", "ncV:512:", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_vpshldvd128_mask, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd256_mask, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd512_mask, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw128_mask, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw256_mask, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd128_maskz, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd256_maskz, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvd512_maskz, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw128_maskz, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw256_maskz, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshldvw512_maskz, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_mask, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_mask, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_mask, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_mask, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_mask, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_mask, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_mask, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_mask, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_mask, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd128_maskz, "V4iV4iV4iV4iUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd256_maskz, "V8iV8iV8iV8iUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvd512_maskz, "V16iV16iV16iV16iUs", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq128_maskz, "V2LLiV2LLiV2LLiV2LLiUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq256_maskz, "V4LLiV4LLiV4LLiV4LLiUc", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw128_maskz, "V8sV8sV8sV8sUc", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw256_maskz, "V16sV16sV16sV16sUs", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdvw512_maskz, "V32sV32sV32sV32sUi", "ncV:512:", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_vpshrdd128, "V4iV4iV4iIi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdd256, "V8iV8iV8iIi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdd512, "V16iV16iV16iIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdq128, "V2LLiV2LLiV2LLiIi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdq256, "V4LLiV4LLiV4LLiIi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdq512, "V8LLiV8LLiV8LLiIi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdw128, "V8sV8sV8sIi", "ncV:128:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdw256, "V16sV16sV16sIi", "ncV:256:", "avx512vl,avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_vpshrdw512, "V32sV32sV32sIi", "ncV:512:", "avx512vbmi2") + +TARGET_BUILTIN(__builtin_ia32_pmovswb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovuswb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovwb512_mask, "V32cV32sV32cUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cvtpd2qq128_mask, "V2LLiV2dV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtpd2qq256_mask, "V4LLiV4dV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq128_mask, "V2LLiV2dV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq256_mask, "V4LLiV4dV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtps2qq128_mask, "V2LLiV4fV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtps2qq256_mask, "V4LLiV4fV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtps2uqq128_mask, "V2LLiV4fV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtps2uqq256_mask, "V4LLiV4fV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtqq2ps128_mask, "V4fV2LLiV4fUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtqq2ps256_mask, "V4fV4LLiV4fUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttpd2qq128_mask, "V2LLiV2dV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttpd2qq256_mask, "V4LLiV4dV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq128_mask, "V2LLiV2dV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq256_mask, "V4LLiV4dV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttps2qq128_mask, "V2LLiV4fV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttps2qq256_mask, "V4LLiV4fV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttps2uqq128_mask, "V2LLiV4fV2LLiUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttps2uqq256_mask, "V4LLiV4fV4LLiUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps128_mask, "V4fV2LLiV4fUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps256_mask, "V4fV4LLiV4fUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangepd128_mask, "V2dV2dV2dIiV2dUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangepd256_mask, "V4dV4dV4dIiV4dUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangeps128_mask, "V4fV4fV4fIiV4fUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangeps256_mask, "V8fV8fV8fIiV8fUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangesd128_round_mask, "V2dV2dV2dV2dUcIiIi", "ncV:128:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangess128_round_mask, "V4fV4fV4fV4fUcIiIi", "ncV:128:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_reducepd128_mask, "V2dV2dIiV2dUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_reducepd256_mask, "V4dV4dIiV4dUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_reduceps128_mask, "V4fV4fIiV4fUc", "ncV:128:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_reduceps256_mask, "V8fV8fIiV8fUc", "ncV:256:", "avx512vl,avx512dq") +TARGET_BUILTIN(__builtin_ia32_reducesd_mask, "V2dV2dV2dV2dUcIiIi", "ncV:128:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_reducess_mask, "V4fV4fV4fV4fUcIiIi", "ncV:128:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_pmovswb128_mask, "V16cV8sV16cUc", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovswb256_mask, "V16cV16sV16cUs", "ncV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovuswb128_mask, "V16cV8sV16cUc", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovuswb256_mask, "V16cV16sV16cUs", "ncV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovwb128_mask, "V16cV8sV16cUc", "ncV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_cvtpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtps2qq512_mask, "V8LLiV8fV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtqq2pd512_mask, "V8dV8LLiV8dUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtqq2ps512_mask, "V8fV8LLiV8fUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttpd2qq512_mask, "V8LLiV8dV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttpd2uqq512_mask, "V8LLiV8dV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttps2qq512_mask, "V8LLiV8fV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvttps2uqq512_mask, "V8LLiV8fV8LLiUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtuqq2pd512_mask, "V8dV8LLiV8dUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtuqq2ps512_mask, "V8fV8LLiV8fUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangepd512_mask, "V8dV8dV8dIiV8dUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_rangeps512_mask, "V16fV16fV16fIiV16fUsIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_reducepd512_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_reduceps512_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_prold512, "V16iV16iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prolq512, "V8LLiV8LLiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prold128, "V4iV4iIi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prold256, "V8iV8iIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prolq128, "V2LLiV2LLiIi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prolq256, "V4LLiV4LLiIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prolvd512, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prolvq512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prord512, "V16iV16iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prorq512, "V8LLiV8LLiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prolvd128, "V4iV4iV4i", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prolvd256, "V8iV8iV8i", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prolvq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prolvq256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prord128, "V4iV4iIi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prord256, "V8iV8iIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prorq128, "V2LLiV2LLiIi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prorq256, "V4LLiV4LLiIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prorvd512, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prorvq512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_prorvd128, "V4iV4iV4i", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prorvd256, "V8iV8iV8i", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prorvq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_prorvq256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pshufhw512, "V32sV32sIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pshuflw512, "V32sV32sIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psllv32hi, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psllw512, "V32sV32sV8s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psllwi512, "V32sV32si", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psllv16hi, "V16sV16sV16s", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_psllv8hi, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_pslldi512, "V16iV16ii", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psllqi512, "V8LLiV8LLii", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlv32hi, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psrlv16hi, "V16sV16sV16s", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_psrlv8hi, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_psrldi512, "V16iV16ii", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlqi512, "V8LLiV8LLii", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrav32hi, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psrav16hi, "V16sV16sV16s", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_psrav8hi, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_psravq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_psravq256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_psraw512, "V32sV32sV8s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psrawi512, "V32sV32si", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psrlw512, "V32sV32sV8s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psrlwi512, "V32sV32si", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pslldqi512_byteshift, "V8LLiV8LLiIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psrldqi512_byteshift, "V8LLiV8LLiIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_movdqa32load128_mask, "V4iV4i*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_movdqa32load256_mask, "V8iV8i*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_movdqa32load512_mask, "V16iV16iC*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_movdqa32store512_mask, "vV16i*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_movdqa64load512_mask, "V8LLiV8LLiC*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_movdqa64store512_mask, "vV8LLi*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_movdqa32store128_mask, "vV4i*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_movdqa32store256_mask, "vV8i*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_movdqa64load128_mask, "V2LLiV2LLiC*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_movdqa64load256_mask, "V4LLiV4LLiC*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_movdqa64store128_mask, "vV2LLi*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_movdqa64store256_mask, "vV4LLi*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpmadd52huq512, "V8LLiV8LLiV8LLiV8LLi", "ncV:512:", "avx512ifma") +TARGET_BUILTIN(__builtin_ia32_vpmadd52luq512, "V8LLiV8LLiV8LLiV8LLi", "ncV:512:", "avx512ifma") +TARGET_BUILTIN(__builtin_ia32_vpmadd52huq128, "V2LLiV2LLiV2LLiV2LLi", "ncV:128:", "avx512ifma,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpmadd52huq256, "V4LLiV4LLiV4LLiV4LLi", "ncV:256:", "avx512ifma,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpmadd52luq128, "V2LLiV2LLiV2LLiV2LLi", "ncV:128:", "avx512ifma,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpmadd52luq256, "V4LLiV4LLiV4LLiV4LLi", "ncV:256:", "avx512ifma,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vcomisd, "iV2dV2dIiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcomiss, "iV4fV4fIiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kunpckdi, "ULLiULLiULLi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_kunpcksi, "UiUiUi", "nc", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_loaddquhi512_mask, "V32sV32s*V32sUi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_loaddquqi512_mask, "V64cV64c*V64cULLi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_mask, "V8dV8dV8dV8LLiIiUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd512_maskz, "V8dV8dV8dV8LLiIiUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_fixupimmps512_mask, "V16fV16fV16fV16iIiUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_fixupimmps512_maskz, "V16fV16fV16fV16iIiUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_fixupimmsd_mask, "V2dV2dV2dV2LLiIiUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_fixupimmsd_maskz, "V2dV2dV2dV2LLiIiUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_fixupimmss_mask, "V4fV4fV4fV4iIiUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_fixupimmss_maskz, "V4fV4fV4fV4iIiUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getexpsd128_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getexpss128_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getmantsd_round_mask, "V2dV2dV2dIiV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getmantss_round_mask, "V4fV4fV4fIiV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loaddquhi128_mask, "V8sV8s*V8sUc", "nV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_loaddquhi256_mask, "V16sV16s*V16sUs", "nV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_loaddquqi128_mask, "V16cV16c*V16cUs", "nV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_loaddquqi256_mask, "V32cV32c*V32cUi", "nV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd128_mask, "V2dV2dV2dV2LLiIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd128_maskz, "V2dV2dV2dV2LLiIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd256_mask, "V4dV4dV4dV4LLiIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmpd256_maskz, "V4dV4dV4dV4LLiIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmps128_mask, "V4fV4fV4fV4iIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmps128_maskz, "V4fV4fV4fV4iIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmps256_mask, "V8fV8fV8fV8iIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fixupimmps256_maskz, "V8fV8fV8fV8iIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadapd128_mask, "V2dV2d*V2dUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadsd128_mask, "V2dV2d*V2dUc", "nV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loadapd256_mask, "V4dV4d*V4dUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadaps128_mask, "V4fV4f*V4fUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadss128_mask, "V4fV4f*V4fUc", "nV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_loadaps256_mask, "V8fV8f*V8fUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loaddqudi128_mask, "V2LLiV2LLi*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loaddqudi256_mask, "V4LLiV4LLi*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loaddqusi128_mask, "V4iV4i*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loaddqusi256_mask, "V8iV8i*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadupd128_mask, "V2dV2d*V2dUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadupd256_mask, "V4dV4d*V4dUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadups128_mask, "V4fV4f*V4fUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_loadups256_mask, "V8fV8f*V8fUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storedquhi512_mask, "vV32s*V32sUi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_storedquqi512_mask, "vV64c*V64cULLi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_storedquhi128_mask, "vV8s*V8sUc", "nV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_storedquhi256_mask, "vV16s*V16sUs", "nV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_storedquqi128_mask, "vV16c*V16cUs", "nV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_storedquqi256_mask, "vV32c*V32cUi", "nV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_storeapd128_mask, "vV2d*V2dUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storesd128_mask, "vV2d*V2dUc", "nV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storeapd256_mask, "vV4d*V4dUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storeaps128_mask, "vV4f*V4fUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storess128_mask, "vV4f*V4fUc", "nV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_storeaps256_mask, "vV8f*V8fUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storedqudi128_mask, "vV2LLi*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storedqudi256_mask, "vV4LLi*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storedqusi128_mask, "vV4i*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storedqusi256_mask, "vV8i*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storeupd128_mask, "vV2d*V2dUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storeupd256_mask, "vV4d*V4dUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storeups128_mask, "vV4f*V4fUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_storeups256_mask, "vV8f*V8fUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rcp14pd128_mask, "V2dV2dV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rcp14pd256_mask, "V4dV4dV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rcp14ps128_mask, "V4fV4fV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rcp14ps256_mask, "V8fV8fV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vplzcntd_128, "V4iV4i", "ncV:128:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vplzcntd_256, "V8iV8i", "ncV:256:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vplzcntq_128, "V2LLiV2LLi", "ncV:128:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vplzcntq_256, "V4LLiV4LLi", "ncV:256:", "avx512cd,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vcvtsd2si32, "iV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtsd2usi32, "UiV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtss2si32, "iV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtss2usi32, "UiV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttsd2si32, "iV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttsd2usi32, "UiV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttss2si32, "iV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttss2usi32, "UiV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermilpd512, "V8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermilps512, "V16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermilvarpd512, "V8dV8dV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpermilvarps512, "V16fV16fV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rndscalesd_round_mask, "V2dV2dV2dV2dUcIiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rndscaless_round_mask, "V4fV4fV4fV4fUcIiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scalefpd512_mask, "V8dV8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scalefps512_mask, "V16fV16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scalefsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_scalefss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psradi512, "V16iV16ii", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psraqi512, "V8LLiV8LLii", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psraq128, "V2LLiV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_psraq256, "V4LLiV4LLiV2LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_psraqi128, "V2LLiV2LLii", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_psraqi256, "V4LLiV4LLii", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pslld512, "V16iV16iV4i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psllq512, "V8LLiV8LLiV2LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psllv16si, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psllv8di, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrad512, "V16iV16iV4i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psraq512, "V8LLiV8LLiV2LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrav16si, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrav8di, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrld512, "V16iV16iV4i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlq512, "V8LLiV8LLiV2LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlv16si, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_psrlv8di, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogd512_mask, "V16iV16iV16iV16iIiUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogd512_maskz, "V16iV16iV16iV16iIiUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogq512_mask, "V8LLiV8LLiV8LLiV8LLiIiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogq512_maskz, "V8LLiV8LLiV8LLiV8LLiIiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pternlogd128_mask, "V4iV4iV4iV4iIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogd128_maskz, "V4iV4iV4iV4iIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogd256_mask, "V8iV8iV8iV8iIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogd256_maskz, "V8iV8iV8iV8iIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq128_mask, "V2LLiV2LLiV2LLiV2LLiIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq128_maskz, "V2LLiV2LLiV2LLiV2LLiIiUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq256_mask, "V4LLiV4LLiV4LLiV4LLiIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pternlogq256_maskz, "V4LLiV4LLiV4LLiV4LLiIiUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_shuf_f32x4, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_shuf_f64x2, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_shuf_i32x4, "V16iV16iV16iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_shuf_i64x2, "V8LLiV8LLiV8LLiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_shufpd512, "V8dV8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_shufps512, "V16fV16fV16fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_shuf_f32x4_256, "V8fV8fV8fIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_shuf_f64x2_256, "V4dV4dV4dIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_shuf_i32x4_256, "V8iV8iV8iIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_shuf_i64x2_256, "V4LLiV4LLiV4LLiIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_sqrtsd_round_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_sqrtss_round_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_rsqrt14pd128_mask, "V2dV2dV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rsqrt14pd256_mask, "V4dV4dV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rsqrt14ps128_mask, "V4fV4fV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_rsqrt14ps256_mask, "V8fV8fV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtb2mask512, "ULLiV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cvtmask2b512, "V64cULLi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cvtmask2w512, "V32sUi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cvtd2mask512, "UsV16i", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtmask2d512, "V16iUs", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtmask2q512, "V8LLiUc", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtq2mask512, "UcV8LLi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_cvtb2mask128, "UsV16c", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtb2mask256, "UiV32c", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2b128, "V16cUs", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2b256, "V32cUi", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2w128, "V8sUc", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2w256, "V16sUs", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtd2mask128, "UcV4i", "ncV:128:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtd2mask256, "UcV8i", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2d128, "V4iUc", "ncV:128:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2d256, "V8iUc", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2q128, "V2LLiUc", "ncV:128:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtmask2q256, "V4LLiUc", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtq2mask128, "UcV2LLi", "ncV:128:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtq2mask256, "UcV4LLi", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovswb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovsdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsqb512_mask, "V16cV8LLiV16cUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsqb512mem_mask, "vV16c*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsqd512_mask, "V8iV8LLiV8iUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsqd512mem_mask, "vV8i*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsqw512_mask, "V8sV8LLiV8sUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsqw512mem_mask, "vV8s*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovsdb128_mask, "V16cV4iV16cUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsdb128mem_mask, "vV16c*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovswb128mem_mask, "vV16c*V8sUc", "nV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovsdb256_mask, "V16cV8iV16cUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsdb256mem_mask, "vV16c*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovswb256mem_mask, "vV16c*V16sUs", "nV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovsdw128_mask, "V8sV4iV8sUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsdw128mem_mask, "vV8s*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsdw256_mask, "V8sV8iV8sUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsdw256mem_mask, "vV8s*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqb128_mask, "V16cV2LLiV16cUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqb128mem_mask, "vV16c*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqb256_mask, "V16cV4LLiV16cUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqb256mem_mask, "vV16c*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqd128_mask, "V4iV2LLiV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqd128mem_mask, "vV4i*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqd256_mask, "V4iV4LLiV4iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqd256mem_mask, "vV4i*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqw128_mask, "V8sV2LLiV8sUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqw128mem_mask, "vV8s*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqw256_mask, "V8sV4LLiV8sUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovsqw256mem_mask, "vV8s*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovuswb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovusdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqb512_mask, "V16cV8LLiV16cUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqb512mem_mask, "vV16c*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqd512_mask, "V8iV8LLiV8iUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqd512mem_mask, "vV8i*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqw512_mask, "V8sV8LLiV8sUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqw512mem_mask, "vV8s*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdb128_mask, "V16cV4iV16cUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdb128mem_mask, "vV16c*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovuswb128mem_mask, "vV16c*V8sUc", "nV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovusdb256_mask, "V16cV8iV16cUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdb256mem_mask, "vV16c*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovuswb256mem_mask, "vV16c*V16sUs", "nV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovusdw128_mask, "V8sV4iV8sUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdw128mem_mask, "vV8s*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdw256_mask, "V8sV8iV8sUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdw256mem_mask, "vV8s*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb128_mask, "V16cV2LLiV16cUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb128mem_mask, "vV16c*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb256_mask, "V16cV4LLiV16cUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb256mem_mask, "vV16c*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd128_mask, "V4iV2LLiV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd128mem_mask, "vV4i*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd256_mask, "V4iV4LLiV4iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd256mem_mask, "vV4i*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw128_mask, "V8sV2LLiV8sUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw128mem_mask, "vV8s*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw256_mask, "V8sV4LLiV8sUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw256mem_mask, "vV8s*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdb512_mask, "V16cV16iV16cUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdb512mem_mask, "vV16c*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovwb512mem_mask, "vV32c*V32sUi", "nV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovdw512_mask, "V16sV16iV16sUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdw512mem_mask, "vV16s*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqb512_mask, "V16cV8LLiV16cUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqb512mem_mask, "vV16c*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqd512_mask, "V8iV8LLiV8iUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqd512mem_mask, "vV8i*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqw512_mask, "V8sV8LLiV8sUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqw512mem_mask, "vV8s*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdb128_mask, "V16cV4iV16cUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovwb128mem_mask, "vV16c*V8sUc", "nV:128:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovdb128mem_mask, "vV16c*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdb256_mask, "V16cV8iV16cUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdb256mem_mask, "vV16c*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovwb256mem_mask, "vV16c*V16sUs", "nV:256:", "avx512vl,avx512bw") +TARGET_BUILTIN(__builtin_ia32_pmovdw128_mask, "V8sV4iV8sUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdw128mem_mask, "vV8s*V4iUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdw256_mask, "V8sV8iV8sUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdw256mem_mask, "vV8s*V8iUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb128_mask, "V16cV2LLiV16cUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb128mem_mask, "vV16c*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb256_mask, "V16cV4LLiV16cUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb256mem_mask, "vV16c*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqd128_mask, "V4iV2LLiV4iUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqd128mem_mask, "vV4i*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqd256mem_mask, "vV4i*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw128_mask, "V8sV2LLiV8sUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw128mem_mask, "vV8s*V2LLiUc", "nV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw256_mask, "V8sV4LLiV8sUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw256mem_mask, "vV8s*V4LLiUc", "nV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_extractf32x8_mask, "V8fV16fIiV8fUc", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_extractf64x2_512_mask, "V2dV8dIiV2dUc", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_extracti32x8_mask, "V8iV16iIiV8iUc", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_extracti64x2_512_mask, "V2LLiV8LLiIiV2LLiUc", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_extracti32x4_mask, "V4iV16iIiV4iUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_extracti64x4_mask, "V4LLiV8LLiIiV4LLiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_extractf64x2_256_mask, "V2dV4dIiV2dUc", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_extracti64x2_256_mask, "V2LLiV4LLiIiV2LLiUc", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_extractf32x4_256_mask, "V4fV8fIiV4fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_extracti32x4_256_mask, "V4iV8iIiV4iUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_insertf32x8, "V16fV16fV8fIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_insertf64x2_512, "V8dV8dV2dIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_inserti32x8, "V16iV16iV8iIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_inserti64x2_512, "V8LLiV8LLiV2LLiIi", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_insertf64x4, "V8dV8dV4dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_inserti64x4, "V8LLiV8LLiV4LLiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_insertf64x2_256, "V4dV4dV2dIi", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_inserti64x2_256, "V4LLiV4LLiV2LLiIi", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_insertf32x4_256, "V8fV8fV4fIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_inserti32x4_256, "V8iV8iV4iIi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_insertf32x4, "V16fV16fV4fIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_inserti32x4, "V16iV16iV4iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getmantpd128_mask, "V2dV2dIiV2dUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getmantpd256_mask, "V4dV4dIiV4dUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getmantps128_mask, "V4fV4fIiV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getmantps256_mask, "V8fV8fIiV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_getmantpd512_mask, "V8dV8dIiV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getmantps512_mask, "V16fV16fIiV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getexppd512_mask, "V8dV8dV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_getexpps512_mask, "V16fV16fV16fUsIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddss3_mask, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddss3_maskz, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddss3_mask3, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_maskz, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmaddsd3_mask3, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmsubsd3_mask3, "V2dV2dV2dV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vfmsubss3_mask3, "V4fV4fV4fV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permdf512, "V8dV8dIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permdi512, "V8LLiV8LLiIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvarhi512, "V32sV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_permvardf512, "V8dV8dV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvardi512, "V8LLiV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvarsf512, "V16fV16fV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvarsi512, "V16iV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_permvarqi512, "V64cV64cV64c", "ncV:512:", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_permvarqi128, "V16cV16cV16c", "ncV:128:", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvarqi256, "V32cV32cV32c", "ncV:256:", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvarhi128, "V8sV8sV8s", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvarhi256, "V16sV16sV16s", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvardf256, "V4dV4dV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_permvardi256, "V4LLiV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_fpclasspd128_mask, "UcV2dIiUc", "ncV:128:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_fpclasspd256_mask, "UcV4dIiUc", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_fpclassps128_mask, "UcV4fIiUc", "ncV:128:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_fpclassps256_mask, "UcV8fIiUc", "ncV:256:", "avx512dq,avx512vl") +TARGET_BUILTIN(__builtin_ia32_fpclassps512_mask, "UsV16fIiUs", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_fpclasspd512_mask, "UcV8dIiUc", "ncV:512:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_fpclasssd_mask, "UcV2dIiUc", "ncV:128:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_fpclassss_mask, "UcV4fIiUc", "ncV:128:", "avx512dq") +TARGET_BUILTIN(__builtin_ia32_kandhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kandnhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_korhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kortestchi, "iUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kortestzhi, "iUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kunpckhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kxnorhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_kxorhi, "UsUsUs", "nc", "avx512f") +TARGET_BUILTIN(__builtin_ia32_palignr512, "V64cV64cV64cIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_dbpsadbw128, "V8sV16cV16cIi", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_dbpsadbw256, "V16sV32cV32cIi", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_dbpsadbw512, "V32sV64cV64cIi", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_psadbw512, "V8LLiV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_compressdf512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_compressdi512_mask, "V8LLiV8LLiV8LLiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_compresshi512_mask, "V32sV32sV32sUi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressqi512_mask, "V64cV64cV64cULLi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compresssf512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_compresssi512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmpsd_mask, "UcV2dV2dIiUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cmpss_mask, "UcV4fV4fIiUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_pshufd512, "V16iV16iIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expanddf512_mask, "V8dV8dV8dUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expanddi512_mask, "V8LLiV8LLiV8LLiUc", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expandhi512_mask, "V32sV32sV32sUi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandqi512_mask, "V64cV64cV64cULLi", "ncV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloaddf512_mask, "V8dV8dC*V8dUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expandloaddi512_mask, "V8LLiV8LLiC*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expandloadhi512_mask, "V32sV32sC*V32sUi", "nV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadqi512_mask, "V64cV64cC*V64cULLi", "nV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_expandloadsf512_mask, "V16fV16fC*V16fUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expandloadsi512_mask, "V16iV16iC*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expandsf512_mask, "V16fV16fV16fUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_expandsi512_mask, "V16iV16iV16iUs", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtps2pd512_mask, "V8dV8fV8dUcIi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstoredf512_mask, "vV8d*V8dUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstoredi512_mask, "vV8LLi*V8LLiUc", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstorehi512_mask, "vV32s*V32sUi", "nV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstoreqi512_mask, "vV64c*V64cULLi", "nV:512:", "avx512vbmi2") +TARGET_BUILTIN(__builtin_ia32_compressstoresf512_mask, "vV16f*V16fUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_compressstoresi512_mask, "vV16i*V16iUs", "nV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtph2ps_mask, "V4fV8sV4fUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vcvtph2ps256_mask, "V8fV8sV8fUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vcvtps2ph_mask, "V8sV4fIiV8sUc", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_vcvtps2ph256_mask, "V8sV8fIiV8sUc", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtw2mask512, "UiV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_cvtw2mask128, "UcV8s", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtw2mask256, "UsV16s", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_cvtsd2ss_round_mask, "V4fV4fV2dV4fUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtsi2ss32, "V4fV4fiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtss2sd_round_mask, "V2dV2dV4fV2dUcIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtusi2ss32, "V4fV4fUiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb512_mask, "V64cV64cV64cV64cULLi", "ncV:512:", "avx512vbmi") +TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb128_mask, "V16cV16cV16cV16cUs", "ncV:128:", "avx512vbmi,avx512vl") +TARGET_BUILTIN(__builtin_ia32_vpmultishiftqb256_mask, "V32cV32cV32cV32cUi", "ncV:256:", "avx512vbmi,avx512vl") // generic select intrinsics -TARGET_BUILTIN(__builtin_ia32_selectb_128, "V16cUsV16cV16c", "", "") -TARGET_BUILTIN(__builtin_ia32_selectb_256, "V32cUiV32cV32c", "", "") -TARGET_BUILTIN(__builtin_ia32_selectb_512, "V64cULLiV64cV64c", "", "") -TARGET_BUILTIN(__builtin_ia32_selectw_128, "V8sUcV8sV8s", "", "") -TARGET_BUILTIN(__builtin_ia32_selectw_256, "V16sUsV16sV16s", "", "") -TARGET_BUILTIN(__builtin_ia32_selectw_512, "V32sUiV32sV32s", "", "") -TARGET_BUILTIN(__builtin_ia32_selectd_128, "V4iUcV4iV4i", "", "") -TARGET_BUILTIN(__builtin_ia32_selectd_256, "V8iUcV8iV8i", "", "") -TARGET_BUILTIN(__builtin_ia32_selectd_512, "V16iUsV16iV16i", "", "") -TARGET_BUILTIN(__builtin_ia32_selectq_128, "V2LLiUcV2LLiV2LLi", "", "") -TARGET_BUILTIN(__builtin_ia32_selectq_256, "V4LLiUcV4LLiV4LLi", "", "") -TARGET_BUILTIN(__builtin_ia32_selectq_512, "V8LLiUcV8LLiV8LLi", "", "") -TARGET_BUILTIN(__builtin_ia32_selectps_128, "V4fUcV4fV4f", "", "") -TARGET_BUILTIN(__builtin_ia32_selectps_256, "V8fUcV8fV8f", "", "") -TARGET_BUILTIN(__builtin_ia32_selectps_512, "V16fUsV16fV16f", "", "") -TARGET_BUILTIN(__builtin_ia32_selectpd_128, "V2dUcV2dV2d", "", "") -TARGET_BUILTIN(__builtin_ia32_selectpd_256, "V4dUcV4dV4d", "", "") -TARGET_BUILTIN(__builtin_ia32_selectpd_512, "V8dUcV8dV8d", "", "") +TARGET_BUILTIN(__builtin_ia32_selectb_128, "V16cUsV16cV16c", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectb_256, "V32cUiV32cV32c", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectb_512, "V64cULLiV64cV64c", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_selectw_128, "V8sUcV8sV8s", "ncV:128:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectw_256, "V16sUsV16sV16s", "ncV:256:", "avx512bw,avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectw_512, "V32sUiV32sV32s", "ncV:512:", "avx512bw") +TARGET_BUILTIN(__builtin_ia32_selectd_128, "V4iUcV4iV4i", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectd_256, "V8iUcV8iV8i", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectd_512, "V16iUsV16iV16i", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectq_128, "V2LLiUcV2LLiV2LLi", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectq_256, "V4LLiUcV4LLiV4LLi", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectq_512, "V8LLiUcV8LLiV8LLi", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectps_128, "V4fUcV4fV4f", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectps_256, "V8fUcV8fV8f", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectps_512, "V16fUsV16fV16f", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectpd_128, "V2dUcV2dV2d", "ncV:128:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectpd_256, "V4dUcV4dV4d", "ncV:256:", "avx512vl") +TARGET_BUILTIN(__builtin_ia32_selectpd_512, "V8dUcV8dV8d", "ncV:512:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectss_128, "V4fUcV4fV4f", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_selectsd_128, "V2dUcV2dV2d", "ncV:128:", "avx512f") // MONITORX/MWAITX -TARGET_BUILTIN(__builtin_ia32_monitorx, "vv*UiUi", "", "mwaitx") -TARGET_BUILTIN(__builtin_ia32_mwaitx, "vUiUiUi", "", "mwaitx") +TARGET_BUILTIN(__builtin_ia32_monitorx, "vv*UiUi", "n", "mwaitx") +TARGET_BUILTIN(__builtin_ia32_mwaitx, "vUiUiUi", "n", "mwaitx") + +// WAITPKG +TARGET_BUILTIN(__builtin_ia32_umonitor, "vv*", "n", "waitpkg") +TARGET_BUILTIN(__builtin_ia32_umwait, "UcUiUiUi", "n", "waitpkg") +TARGET_BUILTIN(__builtin_ia32_tpause, "UcUiUiUi", "n", "waitpkg") // CLZERO -TARGET_BUILTIN(__builtin_ia32_clzero, "vv*", "", "clzero") +TARGET_BUILTIN(__builtin_ia32_clzero, "vv*", "n", "clzero") + +// CLDEMOTE +TARGET_BUILTIN(__builtin_ia32_cldemote, "vvC*", "n", "cldemote") + +// Direct Move +TARGET_BUILTIN(__builtin_ia32_directstore_u32, "vUi*Ui", "n", "movdiri") +TARGET_BUILTIN(__builtin_ia32_movdir64b, "vv*vC*", "n", "movdir64b") + +// PTWRITE +TARGET_BUILTIN(__builtin_ia32_ptwrite32, "vUi", "n", "ptwrite") + +// INVPCID +TARGET_BUILTIN(__builtin_ia32_invpcid, "vUiv*", "nc", "invpcid") // MSVC TARGET_HEADER_BUILTIN(_BitScanForward, "UcUNi*UNi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") @@ -1897,14 +1845,14 @@ TARGET_HEADER_BUILTIN(_ReadWriteBarrier, "v", "nh", "intrin.h", ALL_MS_LANGUAGES TARGET_HEADER_BUILTIN(_ReadBarrier, "v", "nh", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(_WriteBarrier, "v", "nh", "intrin.h", ALL_MS_LANGUAGES, "") -TARGET_HEADER_BUILTIN(__emul, "LLiii", "nh", "intrin.h", ALL_MS_LANGUAGES, "") -TARGET_HEADER_BUILTIN(__emulu, "ULLiUiUi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__emul, "LLiii", "nch", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__emulu, "ULLiUiUi", "nch", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(_AddressOfReturnAddress, "v*", "nh", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__stosb, "vUc*Ucz", "nh", "intrin.h", ALL_MS_LANGUAGES, "") -TARGET_HEADER_BUILTIN(__int2c, "v", "nr", "intrin.h", ALL_MS_LANGUAGES, "") -TARGET_HEADER_BUILTIN(__ud2, "v", "nr", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__int2c, "v", "nhr", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__ud2, "v", "nhr", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__readfsbyte, "UcUNi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__readfsword, "UsUNi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") diff --git a/include/clang/Basic/BuiltinsX86_64.def b/include/clang/Basic/BuiltinsX86_64.def index fe2c887c7e0f5..cc400c0697f91 100644 --- a/include/clang/Basic/BuiltinsX86_64.def +++ b/include/clang/Basic/BuiltinsX86_64.def @@ -27,8 +27,8 @@ TARGET_HEADER_BUILTIN(_BitScanReverse64, "UcUNi*ULLi", "nh", "intrin.h", ALL_MS_ TARGET_HEADER_BUILTIN(__mulh, "LLiLLiLLi", "nch", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__umulh, "ULLiULLiULLi", "nch", "intrin.h", ALL_MS_LANGUAGES, "") -TARGET_HEADER_BUILTIN(_mul128, "LLiLLiLLiLLi*", "nh", "intrin.h", ALL_MS_LANGUAGES, "") -TARGET_HEADER_BUILTIN(_umul128, "ULLiULLiULLiULLi*", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_mul128, "LLiLLiLLiLLi*", "nch", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(_umul128, "ULLiULLiULLiULLi*", "nch", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__faststorefence, "v", "nh", "intrin.h", ALL_MS_LANGUAGES, "") @@ -44,50 +44,62 @@ TARGET_HEADER_BUILTIN(_InterlockedCompareExchange128, "UcLLiD*LLiLLiLLi*", "nh", TARGET_BUILTIN(__builtin_ia32_readeflags_u64, "ULLi", "n", "") TARGET_BUILTIN(__builtin_ia32_writeeflags_u64, "vULLi", "n", "") -TARGET_BUILTIN(__builtin_ia32_cvtss2si64, "LLiV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvttss2si64, "LLiV4f", "", "sse") -TARGET_BUILTIN(__builtin_ia32_cvtsd2si64, "LLiV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_cvttsd2si64, "LLiV2d", "", "sse2") -TARGET_BUILTIN(__builtin_ia32_crc32di, "ULLiULLiULLi", "", "sse4.2") -TARGET_BUILTIN(__builtin_ia32_rdfsbase64, "ULLi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_rdgsbase64, "ULLi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrfsbase64, "vULLi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_wrgsbase64, "vULLi", "", "fsgsbase") -TARGET_BUILTIN(__builtin_ia32_fxrstor64, "vv*", "", "fxsr") -TARGET_BUILTIN(__builtin_ia32_fxsave64, "vv*", "", "fxsr") -TARGET_BUILTIN(__builtin_ia32_xsave64, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xrstor64, "vv*ULLi", "", "xsave") -TARGET_BUILTIN(__builtin_ia32_xsaveopt64, "vv*ULLi", "", "xsaveopt") -TARGET_BUILTIN(__builtin_ia32_xrstors64, "vv*ULLi", "", "xsaves") -TARGET_BUILTIN(__builtin_ia32_xsavec64, "vv*ULLi", "", "xsavec") -TARGET_BUILTIN(__builtin_ia32_xsaves64, "vv*ULLi", "", "xsaves") -TARGET_BUILTIN(__builtin_ia32_incsspq, "vULLi", "u", "shstk") -TARGET_BUILTIN(__builtin_ia32_rdsspq, "ULLiULLi", "Un", "shstk") -TARGET_BUILTIN(__builtin_ia32_wrssq, "vULLiv*", "", "shstk") -TARGET_BUILTIN(__builtin_ia32_wrussq, "vULLiv*", "", "shstk") -TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "", "adx") -TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "", "") -TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "", "") -TARGET_BUILTIN(__builtin_ia32_rdseed64_step, "UiULLi*", "", "rdseed") -TARGET_BUILTIN(__builtin_ia32_bextr_u64, "ULLiULLiULLi", "", "bmi") -TARGET_BUILTIN(__builtin_ia32_bzhi_di, "ULLiULLiULLi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pdep_di, "ULLiULLiULLi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_pext_di, "ULLiULLiULLi", "", "bmi2") -TARGET_BUILTIN(__builtin_ia32_bextri_u64, "ULLiULLiIULLi", "", "tbm") -TARGET_BUILTIN(__builtin_ia32_lwpins64, "UcULLiUiUi", "", "lwp") -TARGET_BUILTIN(__builtin_ia32_lwpval64, "vULLiUiUi", "", "lwp") -TARGET_BUILTIN(__builtin_ia32_vcvtsd2si64, "LLiV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtsd2usi64, "ULLiV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtss2si64, "LLiV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvtss2usi64, "ULLiV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttsd2si64, "LLiV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttsd2usi64, "ULLiV2dIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttss2si64, "LLiV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_vcvttss2usi64, "ULLiV4fIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtsi2sd64, "V2dV2dLLiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtsi2ss64, "V4fV4fLLiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtusi2sd64, "V2dV2dULLiIi","","avx512f") -TARGET_BUILTIN(__builtin_ia32_cvtusi2ss64, "V4fV4fULLiIi","","avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtss2si64, "LLiV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cvttss2si64, "LLiV4f", "ncV:128:", "sse") +TARGET_BUILTIN(__builtin_ia32_cvtsd2si64, "LLiV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_cvttsd2si64, "LLiV2d", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_movnti64, "vLLi*LLi", "n", "sse2") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v2di, "LLiV2LLiIi", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_vec_set_v2di, "V2LLiV2LLiLLiIi", "ncV:128:", "sse4.1") +TARGET_BUILTIN(__builtin_ia32_crc32di, "ULLiULLiULLi", "nc", "sse4.2") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v4di, "LLiV4LLiIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_vec_set_v4di, "V4LLiV4LLiLLiIi", "ncV:256:", "avx") +TARGET_BUILTIN(__builtin_ia32_rdfsbase32, "Ui", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_rdfsbase64, "ULLi", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_rdgsbase32, "Ui", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_rdgsbase64, "ULLi", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_wrfsbase32, "vUi", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_wrfsbase64, "vULLi", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_wrgsbase32, "vUi", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_wrgsbase64, "vULLi", "n", "fsgsbase") +TARGET_BUILTIN(__builtin_ia32_fxrstor64, "vv*", "n", "fxsr") +TARGET_BUILTIN(__builtin_ia32_fxsave64, "vv*", "n", "fxsr") +TARGET_BUILTIN(__builtin_ia32_xsave64, "vv*ULLi", "n", "xsave") +TARGET_BUILTIN(__builtin_ia32_xrstor64, "vv*ULLi", "n", "xsave") +TARGET_BUILTIN(__builtin_ia32_xsaveopt64, "vv*ULLi", "n", "xsaveopt") +TARGET_BUILTIN(__builtin_ia32_xrstors64, "vv*ULLi", "n", "xsaves") +TARGET_BUILTIN(__builtin_ia32_xsavec64, "vv*ULLi", "n", "xsavec") +TARGET_BUILTIN(__builtin_ia32_xsaves64, "vv*ULLi", "n", "xsaves") +TARGET_BUILTIN(__builtin_ia32_incsspq, "vULLi", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_rdsspq, "ULLiULLi", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_wrssq, "vULLiv*", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_wrussq, "vULLiv*", "n", "shstk") +TARGET_BUILTIN(__builtin_ia32_addcarryx_u64, "UcUcULLiULLiULLi*", "n", "adx") +TARGET_BUILTIN(__builtin_ia32_addcarry_u64, "UcUcULLiULLiULLi*", "n", "") +TARGET_BUILTIN(__builtin_ia32_subborrow_u64, "UcUcULLiULLiULLi*", "n", "") +TARGET_BUILTIN(__builtin_ia32_rdrand64_step, "UiULLi*", "n", "rdrnd") +TARGET_BUILTIN(__builtin_ia32_rdseed64_step, "UiULLi*", "n", "rdseed") +TARGET_BUILTIN(__builtin_ia32_bextr_u64, "ULLiULLiULLi", "nc", "bmi") +TARGET_BUILTIN(__builtin_ia32_bzhi_di, "ULLiULLiULLi", "nc", "bmi2") +TARGET_BUILTIN(__builtin_ia32_pdep_di, "ULLiULLiULLi", "nc", "bmi2") +TARGET_BUILTIN(__builtin_ia32_pext_di, "ULLiULLiULLi", "nc", "bmi2") +TARGET_BUILTIN(__builtin_ia32_bextri_u64, "ULLiULLiIULLi", "nc", "tbm") +TARGET_BUILTIN(__builtin_ia32_lwpins64, "UcULLiUiUi", "n", "lwp") +TARGET_BUILTIN(__builtin_ia32_lwpval64, "vULLiUiUi", "n", "lwp") +TARGET_BUILTIN(__builtin_ia32_vcvtsd2si64, "LLiV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtsd2usi64, "ULLiV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtss2si64, "LLiV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvtss2usi64, "ULLiV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttsd2si64, "LLiV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttsd2usi64, "ULLiV2dIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttss2si64, "LLiV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_vcvttss2usi64, "ULLiV4fIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtsi2sd64, "V2dV2dLLiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtsi2ss64, "V4fV4fLLiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtusi2sd64, "V2dV2dULLiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_cvtusi2ss64, "V4fV4fULLiIi", "ncV:128:", "avx512f") +TARGET_BUILTIN(__builtin_ia32_directstore_u64, "vULi*ULi", "n", "movdiri") +TARGET_BUILTIN(__builtin_ia32_ptwrite64, "vULLi", "n", "ptwrite") #undef BUILTIN #undef TARGET_BUILTIN diff --git a/include/clang/Basic/CMakeLists.txt b/include/clang/Basic/CMakeLists.txt index 821c405913c8b..15bed5adec9e1 100644 --- a/include/clang/Basic/CMakeLists.txt +++ b/include/clang/Basic/CMakeLists.txt @@ -43,6 +43,8 @@ clang_tablegen(AttrHasAttributeImpl.inc -gen-clang-attr-has-attribute-impl # ARM NEON clang_tablegen(arm_neon.inc -gen-arm-neon-sema - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ SOURCE arm_neon.td TARGET ClangARMNeon) +clang_tablegen(arm_fp16.inc -gen-arm-neon-sema + SOURCE arm_fp16.td + TARGET ClangARMFP16) diff --git a/include/clang/Basic/CapturedStmt.h b/include/clang/Basic/CapturedStmt.h index c4a289b696dd9..324e1b1d3d093 100644 --- a/include/clang/Basic/CapturedStmt.h +++ b/include/clang/Basic/CapturedStmt.h @@ -13,9 +13,10 @@ namespace clang { -/// \brief The different kinds of captured statement. +/// The different kinds of captured statement. enum CapturedRegionKind { CR_Default, + CR_ObjCAtFinally, CR_OpenMP }; diff --git a/include/clang/Basic/CharInfo.h b/include/clang/Basic/CharInfo.h index cc27bbb48e0d1..e6c5e90d346c6 100644 --- a/include/clang/Basic/CharInfo.h +++ b/include/clang/Basic/CharInfo.h @@ -1,4 +1,4 @@ -//===--- clang/Basic/CharInfo.h - Classifying ASCII Characters ------------===// +//===--- clang/Basic/CharInfo.h - Classifying ASCII Characters --*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -180,14 +180,15 @@ LLVM_READONLY inline char toUppercase(char c) { /// Return true if this is a valid ASCII identifier. /// -/// Note that this is a very simple check; it does not accept '$' or UCNs as -/// valid identifier characters. -LLVM_READONLY inline bool isValidIdentifier(StringRef S) { - if (S.empty() || !isIdentifierHead(S[0])) +/// Note that this is a very simple check; it does not accept UCNs as valid +/// identifier characters. +LLVM_READONLY inline bool isValidIdentifier(StringRef S, + bool AllowDollar = false) { + if (S.empty() || !isIdentifierHead(S[0], AllowDollar)) return false; for (StringRef::iterator I = S.begin(), E = S.end(); I != E; ++I) - if (!isIdentifierBody(*I)) + if (!isIdentifierBody(*I, AllowDollar)) return false; return true; diff --git a/include/clang/Basic/CommentOptions.h b/include/clang/Basic/CommentOptions.h index 92419f91b741b..6cc9cf6b199c5 100644 --- a/include/clang/Basic/CommentOptions.h +++ b/include/clang/Basic/CommentOptions.h @@ -1,4 +1,4 @@ -//===--- CommentOptions.h - Options for parsing comments -----*- C++ -*-===// +//===- CommentOptions.h - Options for parsing comments ----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines the clang::CommentOptions interface. -/// +/// Defines the clang::CommentOptions interface. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_COMMENTOPTIONS_H @@ -20,20 +20,20 @@ namespace clang { -/// \brief Options for controlling comment parsing. +/// Options for controlling comment parsing. struct CommentOptions { - typedef std::vector<std::string> BlockCommandNamesTy; + using BlockCommandNamesTy = std::vector<std::string>; - /// \brief Command names to treat as block commands in comments. + /// Command names to treat as block commands in comments. /// Should not include the leading backslash. BlockCommandNamesTy BlockCommandNames; - /// \brief Treat ordinary comments as documentation comments. - bool ParseAllComments; + /// Treat ordinary comments as documentation comments. + bool ParseAllComments = false; - CommentOptions() : ParseAllComments(false) { } + CommentOptions() = default; }; -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_COMMENTOPTIONS_H diff --git a/include/clang/Basic/Cuda.h b/include/clang/Basic/Cuda.h index 1a0731c37a35f..24159e160f3fc 100644 --- a/include/clang/Basic/Cuda.h +++ b/include/clang/Basic/Cuda.h @@ -22,7 +22,9 @@ enum class CudaVersion { CUDA_75, CUDA_80, CUDA_90, - LATEST = CUDA_90, + CUDA_91, + CUDA_92, + LATEST = CUDA_92, }; const char *CudaVersionToString(CudaVersion V); @@ -44,6 +46,21 @@ enum class CudaArch { SM_61, SM_62, SM_70, + SM_72, + GFX600, + GFX601, + GFX700, + GFX701, + GFX702, + GFX703, + GFX704, + GFX801, + GFX802, + GFX803, + GFX810, + GFX900, + GFX902, + LAST, }; const char *CudaArchToString(CudaArch A); @@ -64,6 +81,8 @@ enum class CudaVirtualArch { COMPUTE_61, COMPUTE_62, COMPUTE_70, + COMPUTE_72, + COMPUTE_AMDGCN, }; const char *CudaVirtualArchToString(CudaVirtualArch A); diff --git a/include/clang/Basic/DebugInfoOptions.h b/include/clang/Basic/DebugInfoOptions.h index e7ff4a662b630..037c813c6114f 100644 --- a/include/clang/Basic/DebugInfoOptions.h +++ b/include/clang/Basic/DebugInfoOptions.h @@ -28,7 +28,7 @@ enum DebugInfoKind { /// forward decls for types that could be /// replaced with forward decls in the source /// code. For dynamic C++ classes type info - /// is only emitted int the module that + /// is only emitted into the module that /// contains the classe's vtable. FullDebugInfo /// Generate complete debug info. }; diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index a7458d45618ee..5205b4c210a6f 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -1,4 +1,4 @@ -//===--- Diagnostic.h - C Language Family Diagnostic Handling ---*- C++ -*-===// +//===- Diagnostic.h - C Language Family Diagnostic Handling -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines the Diagnostic-related interfaces. -/// +/// Defines the Diagnostic-related interfaces. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_DIAGNOSTIC_H @@ -22,12 +22,13 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/iterator_range.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" -#include <algorithm> +#include "llvm/ADT/iterator_range.h" +#include "llvm/Support/Compiler.h" #include <cassert> #include <cstdint> +#include <limits> #include <list> #include <map> #include <memory> @@ -44,15 +45,16 @@ class DiagnosticConsumer; class IdentifierInfo; class LangOptions; class Preprocessor; +class SourceManager; class StoredDiagnostic; namespace tok { - enum TokenKind : unsigned short; +enum TokenKind : unsigned short; -} // end namespace tok +} // namespace tok -/// \brief Annotates a diagnostic with some code that should be +/// Annotates a diagnostic with some code that should be /// inserted, removed, or replaced to fix the problem. /// /// This kind of hint should be used when we are certain that the @@ -63,29 +65,29 @@ namespace tok { /// compilation. class FixItHint { public: - /// \brief Code that should be replaced to correct the error. Empty for an + /// Code that should be replaced to correct the error. Empty for an /// insertion hint. CharSourceRange RemoveRange; - /// \brief Code in the specific range that should be inserted in the insertion + /// Code in the specific range that should be inserted in the insertion /// location. CharSourceRange InsertFromRange; - /// \brief The actual code to insert at the insertion location, as a + /// The actual code to insert at the insertion location, as a /// string. std::string CodeToInsert; - bool BeforePreviousInsertions; + bool BeforePreviousInsertions = false; - /// \brief Empty code modification hint, indicating that no code + /// Empty code modification hint, indicating that no code /// modification is known. - FixItHint() : BeforePreviousInsertions(false) { } + FixItHint() = default; bool isNull() const { return !RemoveRange.isValid(); } - /// \brief Create a code modification hint that inserts the given + /// Create a code modification hint that inserts the given /// code string at a specific location. static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code, @@ -98,7 +100,7 @@ public: return Hint; } - /// \brief Create a code modification hint that inserts the given + /// Create a code modification hint that inserts the given /// code from \p FromRange at a specific location. static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc, CharSourceRange FromRange, @@ -111,7 +113,7 @@ public: return Hint; } - /// \brief Create a code modification hint that removes the given + /// Create a code modification hint that removes the given /// source range. static FixItHint CreateRemoval(CharSourceRange RemoveRange) { FixItHint Hint; @@ -122,7 +124,7 @@ public: return CreateRemoval(CharSourceRange::getTokenRange(RemoveRange)); } - /// \brief Create a code modification hint that replaces the given + /// Create a code modification hint that replaces the given /// source range with the given code string. static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code) { @@ -138,7 +140,7 @@ public: } }; -/// \brief Concrete class used by the front-end to report problems and issues. +/// Concrete class used by the front-end to report problems and issues. /// /// This massages the diagnostics (e.g. handling things like "report warnings /// as errors" and passes them off to the DiagnosticConsumer for reporting to @@ -146,7 +148,7 @@ public: /// SourceManager. class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> { public: - /// \brief The level of the diagnostic, after it has been through mapping. + /// The level of the diagnostic, after it has been through mapping. enum Level { Ignored = DiagnosticIDs::Ignored, Note = DiagnosticIDs::Note, @@ -157,45 +159,88 @@ public: }; enum ArgumentKind { - ak_std_string, ///< std::string - ak_c_string, ///< const char * - ak_sint, ///< int - ak_uint, ///< unsigned - ak_tokenkind, ///< enum TokenKind : unsigned - ak_identifierinfo, ///< IdentifierInfo - ak_qualtype, ///< QualType - ak_declarationname, ///< DeclarationName - ak_nameddecl, ///< NamedDecl * - ak_nestednamespec, ///< NestedNameSpecifier * - ak_declcontext, ///< DeclContext * - ak_qualtype_pair, ///< pair<QualType, QualType> - ak_attr ///< Attr * + /// std::string + ak_std_string, + + /// const char * + ak_c_string, + + /// int + ak_sint, + + /// unsigned + ak_uint, + + /// enum TokenKind : unsigned + ak_tokenkind, + + /// IdentifierInfo + ak_identifierinfo, + + /// QualType + ak_qualtype, + + /// DeclarationName + ak_declarationname, + + /// NamedDecl * + ak_nameddecl, + + /// NestedNameSpecifier * + ak_nestednamespec, + + /// DeclContext * + ak_declcontext, + + /// pair<QualType, QualType> + ak_qualtype_pair, + + /// Attr * + ak_attr }; - /// \brief Represents on argument value, which is a union discriminated + /// Represents on argument value, which is a union discriminated /// by ArgumentKind, with a value. - typedef std::pair<ArgumentKind, intptr_t> ArgumentValue; + using ArgumentValue = std::pair<ArgumentKind, intptr_t>; private: - unsigned char AllExtensionsSilenced; // Used by __extension__ - bool SuppressAfterFatalError; // Suppress diagnostics after a fatal error? - bool SuppressAllDiagnostics; // Suppress all diagnostics. - bool ElideType; // Elide common types of templates. - bool PrintTemplateTree; // Print a tree when comparing templates. - bool ShowColors; // Color printing is enabled. - OverloadsShown ShowOverloads; // Which overload candidates to show. - unsigned ErrorLimit; // Cap of # errors emitted, 0 -> no limit. - unsigned TemplateBacktraceLimit; // Cap on depth of template backtrace stack, - // 0 -> no limit. - unsigned ConstexprBacktraceLimit; // Cap on depth of constexpr evaluation - // backtrace stack, 0 -> no limit. + // Used by __extension__ + unsigned char AllExtensionsSilenced = 0; + + // Suppress diagnostics after a fatal error? + bool SuppressAfterFatalError = true; + + // Suppress all diagnostics. + bool SuppressAllDiagnostics = false; + + // Elide common types of templates. + bool ElideType = true; + + // Print a tree when comparing templates. + bool PrintTemplateTree = false; + + // Color printing is enabled. + bool ShowColors = false; + + // Which overload candidates to show. + OverloadsShown ShowOverloads = Ovl_All; + + // Cap of # errors emitted, 0 -> no limit. + unsigned ErrorLimit = 0; + + // Cap on depth of template backtrace stack, 0 -> no limit. + unsigned TemplateBacktraceLimit = 0; + + // Cap on depth of constexpr evaluation backtrace stack, 0 -> no limit. + unsigned ConstexprBacktraceLimit = 0; + IntrusiveRefCntPtr<DiagnosticIDs> Diags; IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; - DiagnosticConsumer *Client; + DiagnosticConsumer *Client = nullptr; std::unique_ptr<DiagnosticConsumer> Owner; - SourceManager *SourceMgr; + SourceManager *SourceMgr = nullptr; - /// \brief Mapping information for diagnostics. + /// Mapping information for diagnostics. /// /// Mapping info is packed into four bits per diagnostic. The low three /// bits are the mapping (an instance of diag::Severity), or zero if unset. @@ -211,25 +256,38 @@ private: public: // "Global" configuration state that can actually vary between modules. - unsigned IgnoreAllWarnings : 1; // Ignore all warnings: -w - unsigned EnableAllWarnings : 1; // Enable all warnings. - unsigned WarningsAsErrors : 1; // Treat warnings like errors. - unsigned ErrorsAsFatal : 1; // Treat errors like fatal errors. - unsigned SuppressSystemWarnings : 1; // Suppress warnings in system headers. - diag::Severity ExtBehavior; // Map extensions to warnings or errors? + + // Ignore all warnings: -w + unsigned IgnoreAllWarnings : 1; + + // Enable all warnings. + unsigned EnableAllWarnings : 1; + + // Treat warnings like errors. + unsigned WarningsAsErrors : 1; + + // Treat errors like fatal errors. + unsigned ErrorsAsFatal : 1; + + // Suppress warnings in system headers. + unsigned SuppressSystemWarnings : 1; + + // Map extensions to warnings or errors? + diag::Severity ExtBehavior = diag::Severity::Ignored; DiagState() : IgnoreAllWarnings(false), EnableAllWarnings(false), WarningsAsErrors(false), ErrorsAsFatal(false), - SuppressSystemWarnings(false), ExtBehavior(diag::Severity::Ignored) {} + SuppressSystemWarnings(false) {} - typedef llvm::DenseMap<unsigned, DiagnosticMapping>::iterator iterator; - typedef llvm::DenseMap<unsigned, DiagnosticMapping>::const_iterator - const_iterator; + using iterator = llvm::DenseMap<unsigned, DiagnosticMapping>::iterator; + using const_iterator = + llvm::DenseMap<unsigned, DiagnosticMapping>::const_iterator; void setMapping(diag::kind Diag, DiagnosticMapping Info) { DiagMap[Diag] = Info; } + DiagnosticMapping lookupMapping(diag::kind Diag) const { return DiagMap.lookup(Diag); } @@ -240,7 +298,7 @@ private: const_iterator end() const { return DiagMap.end(); } }; - /// \brief Keeps and automatically disposes all DiagStates that we create. + /// Keeps and automatically disposes all DiagStates that we create. std::list<DiagState> DiagStates; /// A mapping from files to the diagnostic states for those files. Lazily @@ -249,12 +307,16 @@ private: public: /// Add an initial diagnostic state. void appendFirst(DiagState *State); + /// Add a new latest state point. void append(SourceManager &SrcMgr, SourceLocation Loc, DiagState *State); + /// Look up the diagnostic state at a given source location. DiagState *lookup(SourceManager &SrcMgr, SourceLocation Loc) const; + /// Determine whether this map is empty. bool empty() const { return Files.empty(); } + /// Clear out this map. void clear() { Files.clear(); @@ -262,13 +324,21 @@ private: CurDiagStateLoc = SourceLocation(); } + /// Produce a debugging dump of the diagnostic state. + LLVM_DUMP_METHOD void dump(SourceManager &SrcMgr, + StringRef DiagName = StringRef()) const; + /// Grab the most-recently-added state point. DiagState *getCurDiagState() const { return CurDiagState; } + /// Get the location at which a diagnostic state was last added. SourceLocation getCurDiagStateLoc() const { return CurDiagStateLoc; } private: - /// \brief Represents a point in source where the diagnostic state was + friend class ASTReader; + friend class ASTWriter; + + /// Represents a point in source where the diagnostic state was /// modified because of a pragma. /// /// 'Loc' can be null if the point represents the diagnostic state @@ -276,8 +346,9 @@ private: struct DiagStatePoint { DiagState *State; unsigned Offset; + DiagStatePoint(DiagState *State, unsigned Offset) - : State(State), Offset(Offset) { } + : State(State), Offset(Offset) {} }; /// Description of the diagnostic states and state transitions for a @@ -287,11 +358,14 @@ private: /// as looking up the DecomposedIncludedLoc for the FileID in the Files /// map would give us this, but we cache it here for performance. File *Parent = nullptr; + /// The offset of this file within its parent. unsigned ParentOffset = 0; + /// Whether this file has any local (not imported from an AST file) /// diagnostic state transitions. bool HasLocalTransitions = false; + /// The points within the file where the state changes. There will always /// be at least one of these (the state on entry to the file). llvm::SmallVector<DiagStatePoint, 4> StateTransitions; @@ -304,21 +378,20 @@ private: /// The initial diagnostic state. DiagState *FirstDiagState; + /// The current diagnostic state. DiagState *CurDiagState; + /// The location at which the current diagnostic state was established. SourceLocation CurDiagStateLoc; /// Get the diagnostic state information for a file. File *getFile(SourceManager &SrcMgr, FileID ID) const; - - friend class ASTReader; - friend class ASTWriter; }; DiagStateMap DiagStatesByLoc; - /// \brief Keeps the DiagState that was active during each diagnostic 'push' + /// Keeps the DiagState that was active during each diagnostic 'push' /// so we can get back at it when we 'pop'. std::vector<DiagState *> DiagStateOnPushStack; @@ -328,41 +401,44 @@ private: void PushDiagStatePoint(DiagState *State, SourceLocation L); - /// \brief Finds the DiagStatePoint that contains the diagnostic state of + /// Finds the DiagStatePoint that contains the diagnostic state of /// the given source location. DiagState *GetDiagStateForLoc(SourceLocation Loc) const { return SourceMgr ? DiagStatesByLoc.lookup(*SourceMgr, Loc) : DiagStatesByLoc.getCurDiagState(); } - /// \brief Sticky flag set to \c true when an error is emitted. + /// Sticky flag set to \c true when an error is emitted. bool ErrorOccurred; - /// \brief Sticky flag set to \c true when an "uncompilable error" occurs. + /// Sticky flag set to \c true when an "uncompilable error" occurs. /// I.e. an error that was not upgraded from a warning by -Werror. bool UncompilableErrorOccurred; - /// \brief Sticky flag set to \c true when a fatal error is emitted. + /// Sticky flag set to \c true when a fatal error is emitted. bool FatalErrorOccurred; - /// \brief Indicates that an unrecoverable error has occurred. + /// Indicates that an unrecoverable error has occurred. bool UnrecoverableErrorOccurred; - /// \brief Counts for DiagnosticErrorTrap to check whether an error occurred + /// Counts for DiagnosticErrorTrap to check whether an error occurred /// during a parsing section, e.g. during parsing a function. unsigned TrapNumErrorsOccurred; unsigned TrapNumUnrecoverableErrorsOccurred; - /// \brief The level of the last diagnostic emitted. + /// The level of the last diagnostic emitted. /// /// This is used to emit continuation diagnostics with the same level as the /// diagnostic that they follow. DiagnosticIDs::Level LastDiagLevel; - unsigned NumWarnings; ///< Number of warnings reported - unsigned NumErrors; ///< Number of errors reported + /// Number of warnings reported + unsigned NumWarnings; - /// \brief A function pointer that converts an opaque diagnostic + /// Number of errors reported + unsigned NumErrors; + + /// A function pointer that converts an opaque diagnostic /// argument to a strings. /// /// This takes the modifiers and argument that was present in the diagnostic. @@ -372,28 +448,29 @@ private: /// avoid redundancy across arguments. /// /// This is a hack to avoid a layering violation between libbasic and libsema. - typedef void (*ArgToStringFnTy)( + using ArgToStringFnTy = void (*)( ArgumentKind Kind, intptr_t Val, StringRef Modifier, StringRef Argument, ArrayRef<ArgumentValue> PrevArgs, SmallVectorImpl<char> &Output, void *Cookie, ArrayRef<intptr_t> QualTypeVals); - void *ArgToStringCookie; + + void *ArgToStringCookie = nullptr; ArgToStringFnTy ArgToStringFn; - /// \brief ID of the "delayed" diagnostic, which is a (typically + /// ID of the "delayed" diagnostic, which is a (typically /// fatal) diagnostic that had to be delayed because it was found /// while emitting another diagnostic. unsigned DelayedDiagID; - /// \brief First string argument for the delayed diagnostic. + /// First string argument for the delayed diagnostic. std::string DelayedDiagArg1; - /// \brief Second string argument for the delayed diagnostic. + /// Second string argument for the delayed diagnostic. std::string DelayedDiagArg2; - /// \brief Optional flag value. + /// Optional flag value. /// /// Some flags accept values, for instance: -Wframe-larger-than=<value> and /// -Rpass=<value>. The content of this string is emitted after the flag name @@ -402,23 +479,28 @@ private: public: explicit DiagnosticsEngine(IntrusiveRefCntPtr<DiagnosticIDs> Diags, - DiagnosticOptions *DiagOpts, + IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts, DiagnosticConsumer *client = nullptr, bool ShouldOwnClient = true); DiagnosticsEngine(const DiagnosticsEngine &) = delete; DiagnosticsEngine &operator=(const DiagnosticsEngine &) = delete; ~DiagnosticsEngine(); + LLVM_DUMP_METHOD void dump() const { DiagStatesByLoc.dump(*SourceMgr); } + LLVM_DUMP_METHOD void dump(StringRef DiagName) const { + DiagStatesByLoc.dump(*SourceMgr, DiagName); + } + const IntrusiveRefCntPtr<DiagnosticIDs> &getDiagnosticIDs() const { return Diags; } - /// \brief Retrieve the diagnostic options. + /// Retrieve the diagnostic options. DiagnosticOptions &getDiagnosticOptions() const { return *DiagOpts; } - typedef llvm::iterator_range<DiagState::const_iterator> diag_mapping_range; + using diag_mapping_range = llvm::iterator_range<DiagState::const_iterator>; - /// \brief Get the current set of diagnostic mappings. + /// Get the current set of diagnostic mappings. diag_mapping_range getDiagnosticMappings() const { const DiagState &DS = *GetCurDiagState(); return diag_mapping_range(DS.begin(), DS.end()); @@ -427,18 +509,20 @@ public: DiagnosticConsumer *getClient() { return Client; } const DiagnosticConsumer *getClient() const { return Client; } - /// \brief Determine whether this \c DiagnosticsEngine object own its client. + /// Determine whether this \c DiagnosticsEngine object own its client. bool ownsClient() const { return Owner != nullptr; } - /// \brief Return the current diagnostic client along with ownership of that + /// Return the current diagnostic client along with ownership of that /// client. std::unique_ptr<DiagnosticConsumer> takeClient() { return std::move(Owner); } bool hasSourceManager() const { return SourceMgr != nullptr; } + SourceManager &getSourceManager() const { assert(SourceMgr && "SourceManager not set!"); return *SourceMgr; } + void setSourceManager(SourceManager *SrcMgr) { assert(DiagStatesByLoc.empty() && "Leftover diag state from a different SourceManager."); @@ -450,54 +534,54 @@ public: // how diagnostics are emitted. // - /// \brief Copies the current DiagMappings and pushes the new copy + /// Copies the current DiagMappings and pushes the new copy /// onto the top of the stack. void pushMappings(SourceLocation Loc); - /// \brief Pops the current DiagMappings off the top of the stack, + /// Pops the current DiagMappings off the top of the stack, /// causing the new top of the stack to be the active mappings. /// /// \returns \c true if the pop happens, \c false if there is only one /// DiagMapping on the stack. bool popMappings(SourceLocation Loc); - /// \brief Set the diagnostic client associated with this diagnostic object. + /// Set the diagnostic client associated with this diagnostic object. /// /// \param ShouldOwnClient true if the diagnostic object should take /// ownership of \c client. void setClient(DiagnosticConsumer *client, bool ShouldOwnClient = true); - /// \brief Specify a limit for the number of errors we should + /// Specify a limit for the number of errors we should /// emit before giving up. /// /// Zero disables the limit. void setErrorLimit(unsigned Limit) { ErrorLimit = Limit; } - /// \brief Specify the maximum number of template instantiation + /// Specify the maximum number of template instantiation /// notes to emit along with a given diagnostic. void setTemplateBacktraceLimit(unsigned Limit) { TemplateBacktraceLimit = Limit; } - /// \brief Retrieve the maximum number of template instantiation + /// Retrieve the maximum number of template instantiation /// notes to emit along with a given diagnostic. unsigned getTemplateBacktraceLimit() const { return TemplateBacktraceLimit; } - /// \brief Specify the maximum number of constexpr evaluation + /// Specify the maximum number of constexpr evaluation /// notes to emit along with a given diagnostic. void setConstexprBacktraceLimit(unsigned Limit) { ConstexprBacktraceLimit = Limit; } - /// \brief Retrieve the maximum number of constexpr evaluation + /// Retrieve the maximum number of constexpr evaluation /// notes to emit along with a given diagnostic. unsigned getConstexprBacktraceLimit() const { return ConstexprBacktraceLimit; } - /// \brief When set to true, any unmapped warnings are ignored. + /// When set to true, any unmapped warnings are ignored. /// /// If this and WarningsAsErrors are both set, then this one wins. void setIgnoreAllWarnings(bool Val) { @@ -507,7 +591,7 @@ public: return GetCurDiagState()->IgnoreAllWarnings; } - /// \brief When set to true, any unmapped ignored warnings are no longer + /// When set to true, any unmapped ignored warnings are no longer /// ignored. /// /// If this and IgnoreAllWarnings are both set, then that one wins. @@ -518,7 +602,7 @@ public: return GetCurDiagState()->EnableAllWarnings; } - /// \brief When set to true, any warnings reported are issued as errors. + /// When set to true, any warnings reported are issued as errors. void setWarningsAsErrors(bool Val) { GetCurDiagState()->WarningsAsErrors = Val; } @@ -526,15 +610,15 @@ public: return GetCurDiagState()->WarningsAsErrors; } - /// \brief When set to true, any error reported is made a fatal error. + /// When set to true, any error reported is made a fatal error. void setErrorsAsFatal(bool Val) { GetCurDiagState()->ErrorsAsFatal = Val; } bool getErrorsAsFatal() const { return GetCurDiagState()->ErrorsAsFatal; } - /// \brief When set to true (the default), suppress further diagnostics after + /// When set to true (the default), suppress further diagnostics after /// a fatal error. void setSuppressAfterFatalError(bool Val) { SuppressAfterFatalError = Val; } - /// \brief When set to true mask warnings that come from system headers. + /// When set to true mask warnings that come from system headers. void setSuppressSystemWarnings(bool Val) { GetCurDiagState()->SuppressSystemWarnings = Val; } @@ -542,7 +626,7 @@ public: return GetCurDiagState()->SuppressSystemWarnings; } - /// \brief Suppress all diagnostics, to silence the front end when we + /// Suppress all diagnostics, to silence the front end when we /// know that we don't want any more diagnostics to be passed along to the /// client void setSuppressAllDiagnostics(bool Val = true) { @@ -550,22 +634,22 @@ public: } bool getSuppressAllDiagnostics() const { return SuppressAllDiagnostics; } - /// \brief Set type eliding, to skip outputting same types occurring in + /// Set type eliding, to skip outputting same types occurring in /// template types. void setElideType(bool Val = true) { ElideType = Val; } bool getElideType() { return ElideType; } - /// \brief Set tree printing, to outputting the template difference in a + /// Set tree printing, to outputting the template difference in a /// tree format. void setPrintTemplateTree(bool Val = false) { PrintTemplateTree = Val; } bool getPrintTemplateTree() { return PrintTemplateTree; } - /// \brief Set color printing, so the type diffing will inject color markers + /// Set color printing, so the type diffing will inject color markers /// into the output. void setShowColors(bool Val = false) { ShowColors = Val; } bool getShowColors() { return ShowColors; } - /// \brief Specify which overload candidates to show when overload resolution + /// Specify which overload candidates to show when overload resolution /// fails. /// /// By default, we show all candidates. @@ -574,7 +658,7 @@ public: } OverloadsShown getShowOverloads() const { return ShowOverloads; } - /// \brief Pretend that the last diagnostic issued was ignored, so any + /// Pretend that the last diagnostic issued was ignored, so any /// subsequent notes will be suppressed, or restore a prior ignoring /// state after ignoring some diagnostics and their notes, possibly in /// the middle of another diagnostic. @@ -586,14 +670,14 @@ public: LastDiagLevel = Ignored ? DiagnosticIDs::Ignored : DiagnosticIDs::Warning; } - /// \brief Determine whether the previous diagnostic was ignored. This can + /// Determine whether the previous diagnostic was ignored. This can /// be used by clients that want to determine whether notes attached to a /// diagnostic will be suppressed. bool isLastDiagnosticIgnored() const { return LastDiagLevel == DiagnosticIDs::Ignored; } - /// \brief Controls whether otherwise-unmapped extension diagnostics are + /// Controls whether otherwise-unmapped extension diagnostics are /// mapped onto ignore/warning/error. /// /// This corresponds to the GCC -pedantic and -pedantic-errors option. @@ -604,7 +688,7 @@ public: return GetCurDiagState()->ExtBehavior; } - /// \brief Counter bumped when an __extension__ block is/ encountered. + /// Counter bumped when an __extension__ block is/ encountered. /// /// When non-zero, all extension diagnostics are entirely silenced, no /// matter how they are mapped. @@ -612,7 +696,7 @@ public: void DecrementAllExtensionsSilenced() { --AllExtensionsSilenced; } bool hasAllExtensionsSilenced() { return AllExtensionsSilenced != 0; } - /// \brief This allows the client to specify that certain warnings are + /// This allows the client to specify that certain warnings are /// ignored. /// /// Notes can never be mapped, errors can only be mapped to fatal, and @@ -622,7 +706,7 @@ public: /// take affect. It can be null if we are setting the latest state. void setSeverity(diag::kind Diag, diag::Severity Map, SourceLocation Loc); - /// \brief Change an entire diagnostic group (e.g. "unknown-pragmas") to + /// Change an entire diagnostic group (e.g. "unknown-pragmas") to /// have the specified mapping. /// /// \returns true (and ignores the request) if "Group" was unknown, false @@ -637,21 +721,21 @@ public: diag::Severity Map, SourceLocation Loc = SourceLocation()); - /// \brief Set the warning-as-error flag for the given diagnostic group. + /// Set the warning-as-error flag for the given diagnostic group. /// /// This function always only operates on the current diagnostic state. /// /// \returns True if the given group is unknown, false otherwise. bool setDiagnosticGroupWarningAsError(StringRef Group, bool Enabled); - /// \brief Set the error-as-fatal flag for the given diagnostic group. + /// Set the error-as-fatal flag for the given diagnostic group. /// /// This function always only operates on the current diagnostic state. /// /// \returns True if the given group is unknown, false otherwise. bool setDiagnosticGroupErrorAsFatal(StringRef Group, bool Enabled); - /// \brief Add the specified mapping to all diagnostics of the specified + /// Add the specified mapping to all diagnostics of the specified /// flavor. /// /// Mainly to be used by -Wno-everything to disable all warnings but allow @@ -661,14 +745,14 @@ public: bool hasErrorOccurred() const { return ErrorOccurred; } - /// \brief Errors that actually prevent compilation, not those that are + /// Errors that actually prevent compilation, not those that are /// upgraded from a warning by -Werror. bool hasUncompilableErrorOccurred() const { return UncompilableErrorOccurred; } bool hasFatalErrorOccurred() const { return FatalErrorOccurred; } - /// \brief Determine whether any kind of unrecoverable error has occurred. + /// Determine whether any kind of unrecoverable error has occurred. bool hasUnrecoverableErrorOccurred() const { return FatalErrorOccurred || UnrecoverableErrorOccurred; } @@ -679,7 +763,7 @@ public: this->NumWarnings = NumWarnings; } - /// \brief Return an ID for a diagnostic with the specified format string and + /// Return an ID for a diagnostic with the specified format string and /// level. /// /// If this is the first request for this diagnostic, it is registered and @@ -693,7 +777,7 @@ public: StringRef(FormatString, N - 1)); } - /// \brief Converts a diagnostic argument (as an intptr_t) into the string + /// Converts a diagnostic argument (as an intptr_t) into the string /// that represents it. void ConvertArgToString(ArgumentKind Kind, intptr_t Val, StringRef Modifier, StringRef Argument, @@ -709,13 +793,13 @@ public: ArgToStringCookie = Cookie; } - /// \brief Note that the prior diagnostic was emitted by some other + /// Note that the prior diagnostic was emitted by some other /// \c DiagnosticsEngine, and we may be attaching a note to that diagnostic. void notePriorDiagnosticFrom(const DiagnosticsEngine &Other) { LastDiagLevel = Other.LastDiagLevel; } - /// \brief Reset the state of the diagnostic object to its initial + /// Reset the state of the diagnostic object to its initial /// configuration. void Reset(); @@ -723,7 +807,7 @@ public: // DiagnosticsEngine classification and reporting interfaces. // - /// \brief Determine whether the diagnostic is known to be ignored. + /// Determine whether the diagnostic is known to be ignored. /// /// This can be used to opportunistically avoid expensive checks when it's /// known for certain that the diagnostic has been suppressed at the @@ -736,7 +820,7 @@ public: diag::Severity::Ignored; } - /// \brief Based on the way the client configured the DiagnosticsEngine + /// Based on the way the client configured the DiagnosticsEngine /// object, classify the specified diagnostic ID into a Level, consumable by /// the DiagnosticConsumer. /// @@ -750,7 +834,7 @@ public: return (Level)Diags->getDiagnosticLevel(DiagID, Loc, *this); } - /// \brief Issue the message to the client. + /// Issue the message to the client. /// /// This actually returns an instance of DiagnosticBuilder which emits the /// diagnostics (through @c ProcessDiag) when it is destroyed. @@ -763,10 +847,12 @@ public: void Report(const StoredDiagnostic &storedDiag); - /// \brief Determine whethere there is already a diagnostic in flight. - bool isDiagnosticInFlight() const { return CurDiagID != ~0U; } + /// Determine whethere there is already a diagnostic in flight. + bool isDiagnosticInFlight() const { + return CurDiagID != std::numeric_limits<unsigned>::max(); + } - /// \brief Set the "delayed" diagnostic that will be emitted once + /// Set the "delayed" diagnostic that will be emitted once /// the current diagnostic completes. /// /// If a diagnostic is already in-flight but the front end must @@ -790,38 +876,39 @@ public: void SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1 = "", StringRef Arg2 = ""); - /// \brief Clear out the current diagnostic. - void Clear() { CurDiagID = ~0U; } + /// Clear out the current diagnostic. + void Clear() { CurDiagID = std::numeric_limits<unsigned>::max(); } - /// \brief Return the value associated with this diagnostic flag. + /// Return the value associated with this diagnostic flag. StringRef getFlagValue() const { return FlagValue; } private: - /// \brief Report the delayed diagnostic. - void ReportDelayed(); - // This is private state used by DiagnosticBuilder. We put it here instead of // in DiagnosticBuilder in order to keep DiagnosticBuilder a small lightweight // object. This implementation choice means that we can only have one // diagnostic "in flight" at a time, but this seems to be a reasonable // tradeoff to keep these objects small. Assertions verify that only one // diagnostic is in flight at a time. - friend class DiagnosticIDs; - friend class DiagnosticBuilder; friend class Diagnostic; - friend class PartialDiagnostic; + friend class DiagnosticBuilder; friend class DiagnosticErrorTrap; + friend class DiagnosticIDs; + friend class PartialDiagnostic; - /// \brief The location of the current diagnostic that is in flight. + /// Report the delayed diagnostic. + void ReportDelayed(); + + /// The location of the current diagnostic that is in flight. SourceLocation CurDiagLoc; - /// \brief The ID of the current diagnostic that is in flight. + /// The ID of the current diagnostic that is in flight. /// - /// This is set to ~0U when there is no diagnostic in flight. + /// This is set to std::numeric_limits<unsigned>::max() when there is no + /// diagnostic in flight. unsigned CurDiagID; enum { - /// \brief The maximum number of arguments we can hold. + /// The maximum number of arguments we can hold. /// /// We currently only support up to 10 arguments (%0-%9). A single /// diagnostic with more than that almost certainly has to be simplified @@ -829,33 +916,33 @@ private: MaxArguments = 10, }; - /// \brief The number of entries in Arguments. + /// The number of entries in Arguments. signed char NumDiagArgs; - /// \brief Specifies whether an argument is in DiagArgumentsStr or + /// Specifies whether an argument is in DiagArgumentsStr or /// in DiagArguments. /// /// This is an array of ArgumentKind::ArgumentKind enum values, one for each /// argument. unsigned char DiagArgumentsKind[MaxArguments]; - /// \brief Holds the values of each string argument for the current + /// Holds the values of each string argument for the current /// diagnostic. /// /// This is only used when the corresponding ArgumentKind is ak_std_string. std::string DiagArgumentsStr[MaxArguments]; - /// \brief The values for the various substitution positions. + /// The values for the various substitution positions. /// /// This is used when the argument is not an std::string. The specific /// value is mangled into an intptr_t and the interpretation depends on /// exactly what sort of argument kind it is. intptr_t DiagArgumentsVal[MaxArguments]; - /// \brief The list of ranges added to this diagnostic. + /// The list of ranges added to this diagnostic. SmallVector<CharSourceRange, 8> DiagRanges; - /// \brief If valid, provides a hint with some code to insert, remove, + /// If valid, provides a hint with some code to insert, remove, /// or modify at a particular position. SmallVector<FixItHint, 8> DiagFixItHints; @@ -874,7 +961,7 @@ private: return Mapping; } - /// \brief Used to report a diagnostic that is finally fully formed. + /// Used to report a diagnostic that is finally fully formed. /// /// \returns true if the diagnostic was emitted, false if it was suppressed. bool ProcessDiag() { @@ -884,13 +971,16 @@ private: /// @name Diagnostic Emission /// @{ protected: + friend class ASTReader; + friend class ASTWriter; + // Sema requires access to the following functions because the current design // of SFINAE requires it to use its own SemaDiagnosticBuilder, which needs to // access us directly to ensure we minimize the emitted code for the common // Sema::Diag() patterns. friend class Sema; - /// \brief Emit the current diagnostic and clear the diagnostic state. + /// Emit the current diagnostic and clear the diagnostic state. /// /// \param Force Emit the diagnostic regardless of suppression settings. bool EmitCurrentDiagnostic(bool Force = false); @@ -900,12 +990,9 @@ protected: SourceLocation getCurrentDiagLoc() const { return CurDiagLoc; } /// @} - - friend class ASTReader; - friend class ASTWriter; }; -/// \brief RAII class that determines when any errors have occurred +/// RAII class that determines when any errors have occurred /// between the time the instance was created and the time it was /// queried. class DiagnosticErrorTrap { @@ -915,21 +1002,21 @@ class DiagnosticErrorTrap { public: explicit DiagnosticErrorTrap(DiagnosticsEngine &Diag) - : Diag(Diag) { reset(); } + : Diag(Diag) { reset(); } - /// \brief Determine whether any errors have occurred since this + /// Determine whether any errors have occurred since this /// object instance was created. bool hasErrorOccurred() const { return Diag.TrapNumErrorsOccurred > NumErrors; } - /// \brief Determine whether any unrecoverable errors have occurred since this + /// Determine whether any unrecoverable errors have occurred since this /// object instance was created. bool hasUnrecoverableErrorOccurred() const { return Diag.TrapNumUnrecoverableErrorsOccurred > NumUnrecoverableErrors; } - /// \brief Set to initial state of "no errors occurred". + /// Set to initial state of "no errors occurred". void reset() { NumErrors = Diag.TrapNumErrorsOccurred; NumUnrecoverableErrors = Diag.TrapNumUnrecoverableErrorsOccurred; @@ -940,7 +1027,7 @@ public: // DiagnosticBuilder //===----------------------------------------------------------------------===// -/// \brief A little helper class used to produce diagnostics. +/// A little helper class used to produce diagnostics. /// /// This is constructed by the DiagnosticsEngine::Report method, and /// allows insertion of extra information (arguments and source ranges) into @@ -953,22 +1040,23 @@ public: /// the common fields to registers, eliminating increments of the NumArgs field, /// for example. class DiagnosticBuilder { + friend class DiagnosticsEngine; + friend class PartialDiagnostic; + mutable DiagnosticsEngine *DiagObj = nullptr; mutable unsigned NumArgs = 0; - /// \brief Status variable indicating if this diagnostic is still active. + /// Status variable indicating if this diagnostic is still active. /// // NOTE: This field is redundant with DiagObj (IsActive iff (DiagObj == 0)), // but LLVM is not currently smart enough to eliminate the null check that // Emit() would end up with if we used that as our status variable. mutable bool IsActive = false; - /// \brief Flag indicating that this diagnostic is being emitted via a + /// Flag indicating that this diagnostic is being emitted via a /// call to ForceEmit. mutable bool IsForceEmit = false; - friend class DiagnosticsEngine; - DiagnosticBuilder() = default; explicit DiagnosticBuilder(DiagnosticsEngine *diagObj) @@ -978,24 +1066,22 @@ class DiagnosticBuilder { diagObj->DiagFixItHints.clear(); } - friend class PartialDiagnostic; - protected: void FlushCounts() { DiagObj->NumDiagArgs = NumArgs; } - /// \brief Clear out the current diagnostic. + /// Clear out the current diagnostic. void Clear() const { DiagObj = nullptr; IsActive = false; IsForceEmit = false; } - /// \brief Determine whether this diagnostic is still active. + /// Determine whether this diagnostic is still active. bool isActive() const { return IsActive; } - /// \brief Force the diagnostic builder to emit the diagnostic now. + /// Force the diagnostic builder to emit the diagnostic now. /// /// Once this function has been called, the DiagnosticBuilder object /// should not be used again before it is destroyed. @@ -1033,23 +1119,23 @@ public: DiagnosticBuilder &operator=(const DiagnosticBuilder &) = delete; - /// \brief Emits the diagnostic. + /// Emits the diagnostic. ~DiagnosticBuilder() { Emit(); } - /// \brief Retrieve an empty diagnostic builder. + /// Retrieve an empty diagnostic builder. static DiagnosticBuilder getEmpty() { - return DiagnosticBuilder(); + return {}; } - /// \brief Forces the diagnostic to be emitted. + /// Forces the diagnostic to be emitted. const DiagnosticBuilder &setForceEmit() const { IsForceEmit = true; return *this; } - /// \brief Conversion of DiagnosticBuilder to bool always returns \c true. + /// Conversion of DiagnosticBuilder to bool always returns \c true. /// /// This allows is to be used in boolean error contexts (where \c true is /// used to indicate that an error has occurred), like: @@ -1089,11 +1175,12 @@ public: }; struct AddFlagValue { - explicit AddFlagValue(StringRef V) : Val(V) {} StringRef Val; + + explicit AddFlagValue(StringRef V) : Val(V) {} }; -/// \brief Register a value for the flag in the current diagnostic. This +/// Register a value for the flag in the current diagnostic. This /// value will be shown as the suffix "=value" after the flag name. It is /// useful in cases where the diagnostic flag accepts values (e.g., /// -Rpass or -Wframe-larger-than). @@ -1199,14 +1286,15 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, /// A nullability kind paired with a bit indicating whether it used a /// context-sensitive keyword. -typedef std::pair<NullabilityKind, bool> DiagNullabilityKind; +using DiagNullabilityKind = std::pair<NullabilityKind, bool>; const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, DiagNullabilityKind nullability); inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc, unsigned DiagID) { - assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!"); + assert(CurDiagID == std::numeric_limits<unsigned>::max() && + "Multiple diagnostics in flight at once!"); CurDiagLoc = Loc; CurDiagID = DiagID; FlagValue.clear(); @@ -1231,7 +1319,7 @@ class Diagnostic { public: explicit Diagnostic(const DiagnosticsEngine *DO) : DiagObj(DO) {} Diagnostic(const DiagnosticsEngine *DO, StringRef storedDiagMessage) - : DiagObj(DO), StoredDiagMessage(storedDiagMessage) {} + : DiagObj(DO), StoredDiagMessage(storedDiagMessage) {} const DiagnosticsEngine *getDiags() const { return DiagObj; } unsigned getID() const { return DiagObj->CurDiagID; } @@ -1241,7 +1329,7 @@ public: unsigned getNumArgs() const { return DiagObj->NumDiagArgs; } - /// \brief Return the kind of the specified index. + /// Return the kind of the specified index. /// /// Based on the kind of argument, the accessors below can be used to get /// the value. @@ -1252,7 +1340,7 @@ public: return (DiagnosticsEngine::ArgumentKind)DiagObj->DiagArgumentsKind[Idx]; } - /// \brief Return the provided argument string specified by \p Idx. + /// Return the provided argument string specified by \p Idx. /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_std_string const std::string &getArgStdStr(unsigned Idx) const { assert(getArgKind(Idx) == DiagnosticsEngine::ak_std_string && @@ -1260,7 +1348,7 @@ public: return DiagObj->DiagArgumentsStr[Idx]; } - /// \brief Return the specified C string argument. + /// Return the specified C string argument. /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_c_string const char *getArgCStr(unsigned Idx) const { assert(getArgKind(Idx) == DiagnosticsEngine::ak_c_string && @@ -1268,7 +1356,7 @@ public: return reinterpret_cast<const char*>(DiagObj->DiagArgumentsVal[Idx]); } - /// \brief Return the specified signed integer argument. + /// Return the specified signed integer argument. /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_sint int getArgSInt(unsigned Idx) const { assert(getArgKind(Idx) == DiagnosticsEngine::ak_sint && @@ -1276,7 +1364,7 @@ public: return (int)DiagObj->DiagArgumentsVal[Idx]; } - /// \brief Return the specified unsigned integer argument. + /// Return the specified unsigned integer argument. /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_uint unsigned getArgUInt(unsigned Idx) const { assert(getArgKind(Idx) == DiagnosticsEngine::ak_uint && @@ -1284,7 +1372,7 @@ public: return (unsigned)DiagObj->DiagArgumentsVal[Idx]; } - /// \brief Return the specified IdentifierInfo argument. + /// Return the specified IdentifierInfo argument. /// \pre getArgKind(Idx) == DiagnosticsEngine::ak_identifierinfo const IdentifierInfo *getArgIdentifier(unsigned Idx) const { assert(getArgKind(Idx) == DiagnosticsEngine::ak_identifierinfo && @@ -1292,7 +1380,7 @@ public: return reinterpret_cast<IdentifierInfo*>(DiagObj->DiagArgumentsVal[Idx]); } - /// \brief Return the specified non-string argument in an opaque form. + /// Return the specified non-string argument in an opaque form. /// \pre getArgKind(Idx) != DiagnosticsEngine::ak_std_string intptr_t getRawArg(unsigned Idx) const { assert(getArgKind(Idx) != DiagnosticsEngine::ak_std_string && @@ -1300,7 +1388,7 @@ public: return DiagObj->DiagArgumentsVal[Idx]; } - /// \brief Return the number of source ranges associated with this diagnostic. + /// Return the number of source ranges associated with this diagnostic. unsigned getNumRanges() const { return DiagObj->DiagRanges.size(); } @@ -1311,7 +1399,7 @@ public: return DiagObj->DiagRanges[Idx]; } - /// \brief Return an array reference for this diagnostic's ranges. + /// Return an array reference for this diagnostic's ranges. ArrayRef<CharSourceRange> getRanges() const { return DiagObj->DiagRanges; } @@ -1329,20 +1417,20 @@ public: return DiagObj->DiagFixItHints; } - /// \brief Format this diagnostic into a string, substituting the + /// Format this diagnostic into a string, substituting the /// formal arguments into the %0 slots. /// /// The result is appended onto the \p OutStr array. void FormatDiagnostic(SmallVectorImpl<char> &OutStr) const; - /// \brief Format the given format-string into the output buffer using the + /// Format the given format-string into the output buffer using the /// arguments stored in this diagnostic. void FormatDiagnostic(const char *DiagStr, const char *DiagEnd, SmallVectorImpl<char> &OutStr) const; }; /** - * \brief Represents a diagnostic in a form that can be retained until its + * Represents a diagnostic in a form that can be retained until its * corresponding source manager is destroyed. */ class StoredDiagnostic { @@ -1363,7 +1451,7 @@ public: ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Fixits); - /// \brief Evaluates true when this object stores a diagnostic. + /// Evaluates true when this object stores a diagnostic. explicit operator bool() const { return !Message.empty(); } unsigned getID() const { return ID; } @@ -1373,7 +1461,8 @@ public: void setLocation(FullSourceLoc Loc) { this->Loc = Loc; } - typedef std::vector<CharSourceRange>::const_iterator range_iterator; + using range_iterator = std::vector<CharSourceRange>::const_iterator; + range_iterator range_begin() const { return Ranges.begin(); } range_iterator range_end() const { return Ranges.end(); } unsigned range_size() const { return Ranges.size(); } @@ -1382,7 +1471,8 @@ public: return llvm::makeArrayRef(Ranges); } - typedef std::vector<FixItHint>::const_iterator fixit_iterator; + using fixit_iterator = std::vector<FixItHint>::const_iterator; + fixit_iterator fixit_begin() const { return FixIts.begin(); } fixit_iterator fixit_end() const { return FixIts.end(); } unsigned fixit_size() const { return FixIts.size(); } @@ -1392,7 +1482,7 @@ public: } }; -/// \brief Abstract interface, implemented by clients of the front-end, which +/// Abstract interface, implemented by clients of the front-end, which /// formats and prints fully processed diagnostics. class DiagnosticConsumer { protected: @@ -1401,14 +1491,13 @@ protected: public: DiagnosticConsumer() = default; - virtual ~DiagnosticConsumer(); unsigned getNumErrors() const { return NumErrors; } unsigned getNumWarnings() const { return NumWarnings; } virtual void clear() { NumWarnings = NumErrors = 0; } - /// \brief Callback to inform the diagnostic client that processing + /// Callback to inform the diagnostic client that processing /// of a source file is beginning. /// /// Note that diagnostics may be emitted outside the processing of a source @@ -1422,25 +1511,25 @@ public: virtual void BeginSourceFile(const LangOptions &LangOpts, const Preprocessor *PP = nullptr) {} - /// \brief Callback to inform the diagnostic client that processing + /// Callback to inform the diagnostic client that processing /// of a source file has ended. /// /// The diagnostic client should assume that any objects made available via /// BeginSourceFile() are inaccessible. virtual void EndSourceFile() {} - /// \brief Callback to inform the diagnostic client that processing of all + /// Callback to inform the diagnostic client that processing of all /// source files has ended. virtual void finish() {} - /// \brief Indicates whether the diagnostics handled by this + /// Indicates whether the diagnostics handled by this /// DiagnosticConsumer should be included in the number of diagnostics /// reported by DiagnosticsEngine. /// /// The default implementation returns true. virtual bool IncludeInDiagnosticCounts() const; - /// \brief Handle this diagnostic, reporting it to the user or + /// Handle this diagnostic, reporting it to the user or /// capturing it to a log as needed. /// /// The default implementation just keeps track of the total number of @@ -1449,7 +1538,7 @@ public: const Diagnostic &Info); }; -/// \brief A diagnostic client that ignores all diagnostics. +/// A diagnostic client that ignores all diagnostics. class IgnoringDiagConsumer : public DiagnosticConsumer { virtual void anchor(); @@ -1459,7 +1548,7 @@ class IgnoringDiagConsumer : public DiagnosticConsumer { } }; -/// \brief Diagnostic consumer that forwards diagnostics along to an +/// Diagnostic consumer that forwards diagnostics along to an /// existing, already-initialized diagnostic consumer. /// class ForwardingDiagnosticConsumer : public DiagnosticConsumer { @@ -1467,7 +1556,6 @@ class ForwardingDiagnosticConsumer : public DiagnosticConsumer { public: ForwardingDiagnosticConsumer(DiagnosticConsumer &Target) : Target(Target) {} - ~ForwardingDiagnosticConsumer() override; void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, @@ -1485,6 +1573,7 @@ struct TemplateDiffTypes { unsigned PrintFromType : 1; unsigned ElideType : 1; unsigned ShowColors : 1; + // The printer sets this variable to true if the template diff was used. unsigned TemplateDiffUsed : 1; }; @@ -1493,13 +1582,12 @@ struct TemplateDiffTypes { /// attribute. The character itself will be not be printed. const char ToggleHighlight = 127; - /// ProcessWarningOptions - Initialize the diagnostic client and process the /// warning options specified on the command line. void ProcessWarningOptions(DiagnosticsEngine &Diags, const DiagnosticOptions &Opts, bool ReportDiags = true); -} // end namespace clang +} // namespace clang #endif // LLVM_CLANG_BASIC_DIAGNOSTIC_H diff --git a/include/clang/Basic/Diagnostic.td b/include/clang/Basic/Diagnostic.td index 52ccf350e651e..2a0f1e6385d37 100644 --- a/include/clang/Basic/Diagnostic.td +++ b/include/clang/Basic/Diagnostic.td @@ -39,6 +39,15 @@ def SFINAE_Suppress : SFINAEResponse; def SFINAE_Report : SFINAEResponse; def SFINAE_AccessControl : SFINAEResponse; +// Textual substitutions which may be performed on the text of diagnostics +class TextSubstitution<string Text> { + string Substitution = Text; + // TODO: These are only here to allow substitutions to be declared inline with + // diagnostics + string Component = ""; + string CategoryName = ""; +} + // Diagnostic Categories. These can be applied to groups or individual // diagnostics to specify a category. class DiagCategory<string Name> { diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td index 215580b2e9b66..4fa1db96cb897 100644 --- a/include/clang/Basic/DiagnosticASTKinds.td +++ b/include/clang/Basic/DiagnosticASTKinds.td @@ -273,6 +273,8 @@ def note_odr_objc_synthesize_ivar_here : Note< "property is synthesized to ivar %0 here">; // Importing C++ ASTs +def note_odr_friend : Note<"friend declared here">; +def note_odr_missing_friend : Note<"no corresponding friend here">; def err_odr_different_num_template_parameters : Error< "template parameter lists have a different number of parameters (%0 vs %1)">; def note_odr_template_parameter_list : Note< diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 82ca27b7345e3..61a73541d0b37 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -94,6 +94,9 @@ def remark_module_lock_failure : Remark< "could not acquire lock file for module '%0': %1">, InGroup<ModuleBuild>; def remark_module_lock_timeout : Remark< "timed out waiting to acquire lock file for module '%0'">, InGroup<ModuleBuild>; +def err_module_shadowed : Error<"import of shadowed module '%0'">, DefaultFatal; +def err_module_build_shadowed_submodule : Error< + "build a shadowed submodule '%0'">, DefaultFatal; def err_module_cycle : Error<"cyclic dependency in module '%0': %1">, DefaultFatal; def err_module_prebuilt : Error< @@ -165,6 +168,10 @@ def ext_clang_enable_if : Extension<"'enable_if' is a clang extension">, InGroup<GccCompat>; def ext_clang_diagnose_if : Extension<"'diagnose_if' is a clang extension">, InGroup<GccCompat>; +def err_too_large_for_fixed_point : Error< + "this value is too large for this fixed point type">; +def err_fixed_point_not_enabled : Error<"compile with " + "'-ffixed-point' to enable fixed point types">; // SEH def err_seh_expected_handler : Error< @@ -185,6 +192,7 @@ def note_invalid_subexpr_in_const_expr : Note< def err_target_unknown_triple : Error< "unknown target triple '%0', please use -triple or -arch">; def err_target_unknown_cpu : Error<"unknown target CPU '%0'">; +def note_valid_options : Note<"valid target CPU values are: %0">; def err_target_unsupported_cpu_for_micromips : Error< "micromips is not supported for target CPU '%0'">; def err_target_unknown_abi : Error<"unknown target ABI '%0'">; @@ -200,6 +208,10 @@ def err_target_unsupported_execute_only : Error< "execute only is not supported for the %0 sub-architecture">; def err_opt_not_valid_with_opt : Error< "option '%0' cannot be specified with '%1'">; +def err_opt_not_valid_without_opt : Error< + "option '%0' cannot be specified without '%1'">; +def err_opt_not_valid_on_target : Error< + "option '%0' cannot be specified on this target">; // Source manager def err_cannot_open_file : Error<"cannot open file '%0': %1">, DefaultFatal; @@ -226,6 +238,10 @@ def note_mt_message : Note<"[rewriter] %0">; def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">; def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">; +// OpenCL C++. +def err_openclcxx_not_supported : Error< + "'%0' is not supported in OpenCL C++">; + // OpenMP def err_omp_more_one_clause : Error< "directive '#pragma omp %0' cannot contain more than one '%1' clause%select{| with '%3' name modifier| with 'source' dependence}2">; diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index 41b5e42b44322..a6be0595e1ae9 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -11,6 +11,8 @@ let Component = "Driver" in { def err_drv_no_such_file : Error<"no such file or directory: '%0'">; def err_drv_unsupported_opt : Error<"unsupported option '%0'">; +def err_drv_unsupported_opt_with_suggestion + : Error<"unsupported option '%0', did you mean '%1'?">; def err_drv_unsupported_opt_for_target : Error< "unsupported option '%0' for target '%1'">; def err_drv_unsupported_option_argument : Error< @@ -22,6 +24,10 @@ def err_drv_unknown_stdin_type_clang_cl : Error< def err_drv_unknown_language : Error<"language not recognized: '%0'">; def err_drv_invalid_arch_name : Error< "invalid arch name '%0'">; +def err_drv_invalid_riscv_arch_name : Error< + "invalid arch name '%0', %1">; +def err_drv_invalid_riscv_ext_arch_name : Error< + "invalid arch name '%0', %1 '%2'">; def err_drv_cuda_bad_gpu_arch : Error<"Unsupported CUDA gpu architecture: %0">; def err_drv_no_cuda_installation : Error< "cannot find CUDA installation. Provide its path via --cuda-path, or pass " @@ -34,7 +40,8 @@ def err_drv_cuda_version_unsupported : Error< "but installation at %3 is %4. Use --cuda-path to specify a different CUDA " "install, pass a different GPU arch with --cuda-gpu-arch, or pass " "--no-cuda-version-check.">; -def err_drv_cuda_nvptx_host : Error<"unsupported use of NVPTX for host compilation.">; +def err_drv_cuda_host_arch : Error<"unsupported architecture '%0' for host compilation.">; +def err_drv_mix_cuda_hip : Error<"Mixed Cuda and HIP compilation is not supported.">; def err_drv_invalid_thread_model_for_target : Error< "invalid thread model '%0' in '%1' for this target">; def err_drv_invalid_linker_name : Error< @@ -112,6 +119,18 @@ def err_drv_invalid_argument_to_fdebug_prefix_map : Error< "invalid argument '%0' to -fdebug-prefix-map">; def err_drv_malformed_sanitizer_blacklist : Error< "malformed sanitizer blacklist: '%0'">; +def err_drv_duplicate_config : Error< + "no more than one option '--config' is allowed">; +def err_drv_config_file_not_exist : Error< + "configuration file '%0' does not exist">; +def err_drv_config_file_not_found : Error< + "configuration file '%0' cannot be found">; +def note_drv_config_file_searched_in : Note< + "was searched for in the directory: %0">; +def err_drv_cannot_read_config_file : Error< + "cannot read configuration file '%0'">; +def err_drv_nested_config_file: Error< + "option '--config' is not allowed inside configuration file">; def err_target_unsupported_arch : Error<"the target architecture '%0' is not supported by the target '%1'">; @@ -123,9 +142,14 @@ def err_arch_unsupported_isa def err_drv_I_dash_not_supported : Error< "'%0' not supported, please use -iquote instead">; def err_drv_unknown_argument : Error<"unknown argument: '%0'">; +def err_drv_unknown_argument_with_suggestion + : Error<"unknown argument '%0', did you mean '%1'?">; def warn_drv_unknown_argument_clang_cl : Warning< "unknown argument ignored in clang-cl: '%0'">, InGroup<UnknownArgument>; +def warn_drv_unknown_argument_clang_cl_with_suggestion : Warning< + "unknown argument ignored in clang-cl '%0' (did you mean '%1'?)">, + InGroup<UnknownArgument>; def warn_drv_ycyu_no_arg_clang_cl : Warning< "support for '%0' without a filename not implemented yet; flag ignored">, @@ -169,6 +193,8 @@ def err_drv_mg_requires_m_or_mm : Error< "option '-MG' requires '-M' or '-MM'">; def err_drv_unknown_objc_runtime : Error< "unknown or ill-formed Objective-C runtime '%0'">; +def err_drv_gnustep_objc_runtime_incompatible_binary : Error< + "GNUstep Objective-C runtime version %0 incompatible with target binary format">; def err_drv_emit_llvm_link : Error< "-emit-llvm cannot be used when linking">; def err_drv_optimization_remark_pattern : Error< @@ -184,6 +210,9 @@ def err_drv_expecting_fopenmp_with_fopenmp_targets : Error< def warn_drv_omp_offload_target_duplicate : Warning< "The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">, InGroup<OpenMPTarget>; +def warn_drv_omp_offload_target_missingbcruntime : Warning< + "No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.">, + InGroup<OpenMPTarget>; def err_drv_bitcode_unsupported_on_toolchain : Error< "-fembed-bitcode is not supported on versions of iOS prior to 6.0">; @@ -239,15 +268,12 @@ def warn_incompatible_sysroot : Warning<"using sysroot for '%0' but targeting '% InGroup<DiagGroup<"incompatible-sysroot">>; def warn_debug_compression_unavailable : Warning<"cannot compress debug sections (zlib not installed)">, InGroup<DiagGroup<"debug-compression-unavailable">>; -def warn_drv_enabling_rtti_with_exceptions : Warning< - "implicitly enabling rtti for exception handling">, - InGroup<DiagGroup<"rtti-for-exceptions">>; def warn_drv_disabling_vptr_no_rtti_default : Warning< "implicitly disabling vptr sanitizer because rtti wasn't enabled">, InGroup<AutoDisableVptrSanitizer>; def warn_drv_object_size_disabled_O0 : Warning< "the object size sanitizer has no effect at -O0, but is explicitly enabled: %0">, - InGroup<InvalidCommandLineArgument>; + InGroup<InvalidCommandLineArgument>, DefaultWarnNoWerror; def note_drv_command_failed_diag_msg : Note< "diagnostic msg: %0">; @@ -266,6 +292,9 @@ def err_analyzer_config_multiple_values : Error< def err_drv_invalid_hvx_length : Error< "-mhvx-length is not supported without a -mhvx/-mhvx= flag">; +def warn_drv_vectorize_needs_hvx : Warning< + "auto-vectorization requires HVX, use -mhvx to enable it">, + InGroup<OptionIgnored>; def err_drv_modules_validate_once_requires_timestamp : Error< "option '-fmodules-validate-once-per-build-session' requires " @@ -310,10 +339,16 @@ def warn_drv_unsupported_longcalls : Warning< "ignoring '-mlong-calls' option as it is not currently supported with " "%select{|the implicit usage of }0-mabicalls">, InGroup<OptionIgnored>; -def warn_drv_unsupported_abicalls : Warning< - "ignoring '-mabicalls' option as it cannot be used with " - "non position-independent code and the N64 ABI">, +def warn_drv_unsupported_pic_with_mabicalls : Warning< + "ignoring '%0' option as it cannot be used with " + "%select{implicit usage of|}1 -mabicalls and the N64 ABI">, InGroup<OptionIgnored>; +def err_drv_unsupported_noabicalls_pic : Error< + "position-independent code requires ‘-mabicalls’">; +def err_drv_unsupported_indirect_jump_opt : Error< + "'-mindirect-jump=%0' is unsupported with the '%1' architecture">; +def err_drv_unknown_indirect_jump_opt : Error< + "unknown '-mindirect-jump=' option '%0'">; def warn_drv_unable_to_find_directory_expected : Warning< "unable to find %0 directory, expected to be in '%1'">, @@ -342,4 +377,16 @@ def warn_drv_fine_grained_bitfield_accesses_ignored : Warning< def note_drv_verify_prefix_spelling : Note< "-verify prefixes must start with a letter and contain only alphanumeric" " characters, hyphens, and underscores">; + +def warn_drv_experimental_isel_incomplete : Warning< + "-fexperimental-isel support for the '%0' architecture is incomplete">, + InGroup<ExperimentalISel>; + +def warn_drv_experimental_isel_incomplete_opt : Warning< + "-fexperimental-isel support is incomplete for this architecture at the current optimization level">, + InGroup<ExperimentalISel>; + +def warn_drv_moutline_unsupported_opt : Warning< + "The '%0' architecture does not support -moutline; flag ignored">, + InGroup<OptionIgnored>; } diff --git a/include/clang/Basic/DiagnosticError.h b/include/clang/Basic/DiagnosticError.h index 6b4b073736a8d..3f7be46c9505e 100644 --- a/include/clang/Basic/DiagnosticError.h +++ b/include/clang/Basic/DiagnosticError.h @@ -15,7 +15,7 @@ namespace clang { -/// \brief Carries a Clang diagnostic in an llvm::Error. +/// Carries a Clang diagnostic in an llvm::Error. /// /// Users should emit the stored diagnostic using the DiagnosticsEngine. class DiagnosticError : public llvm::ErrorInfo<DiagnosticError> { diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td index b25181f256586..6add448871fe5 100644 --- a/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/include/clang/Basic/DiagnosticFrontendKinds.td @@ -118,6 +118,8 @@ def err_fe_invalid_alignment : Error< "invalid value '%1' in '%0'; alignment must be a power of 2">; def err_fe_invalid_wchar_type : Error<"invalid wchar_t type '%0'; must be one of 'char', 'short', 'int'">; +def err_fe_invalid_exception_model + : Error<"invalid exception model '%0' for target '%1'">; def warn_fe_serialized_diag_merge_failure : Warning< "unable to merge a subprocess's serialized diagnostics">, @@ -234,4 +236,9 @@ def err_invalid_vfs_overlay : Error< def warn_option_invalid_ocl_version : Warning< "OpenCL version %0 does not support the option '%1'">, InGroup<Deprecated>; + +def warn_stdlibcxx_not_found : Warning< + "include path for stdlibc++ headers not found; pass '-std=libc++' on the " + "command line to use the libc++ standard library instead">, + InGroup<DiagGroup<"stdlibcxx-not-found">>; } diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index c23183c81ac8b..7087db7f0fb89 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -31,6 +31,10 @@ def AutoDisableVptrSanitizer : DiagGroup<"auto-disable-vptr-sanitizer">; def Availability : DiagGroup<"availability">; def Section : DiagGroup<"section">; def AutoImport : DiagGroup<"auto-import">; +def FrameworkHdrQuotedInclude : DiagGroup<"quoted-include-in-framework-header">; +def FrameworkIncludePrivateFromPublic : + DiagGroup<"framework-include-private-from-public">; +def FrameworkHdrAtImport : DiagGroup<"atimport-in-framework-header">; def CXX14BinaryLiteral : DiagGroup<"c++14-binary-literal">; def CXXPre14CompatBinaryLiteral : DiagGroup<"c++98-c++11-compat-binary-literal">; def GNUBinaryLiteral : DiagGroup<"gnu-binary-literal">; @@ -116,6 +120,7 @@ def DeprecatedDynamicExceptionSpec def DeprecatedImplementations :DiagGroup<"deprecated-implementations">; def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">; def DeprecatedRegister : DiagGroup<"deprecated-register">; +def DeprecatedThisCapture : DiagGroup<"deprecated-this-capture">; def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings", [CXX11CompatDeprecatedWritableStr]>; // FIXME: Why is DeprecatedImplementations not in this group? @@ -124,6 +129,7 @@ def Deprecated : DiagGroup<"deprecated", [DeprecatedAttributes, DeprecatedDynamicExceptionSpec, DeprecatedIncrementBool, DeprecatedRegister, + DeprecatedThisCapture, DeprecatedWritableStr]>, DiagCategory<"Deprecations">; @@ -151,8 +157,10 @@ def Exceptions : DiagGroup<"exceptions">; def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">; def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">; def ExtraTokens : DiagGroup<"extra-tokens">; +def CXX98CompatExtraSemi : DiagGroup<"c++98-compat-extra-semi">; def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">; -def ExtraSemi : DiagGroup<"extra-semi", [CXX11ExtraSemi]>; +def ExtraSemi : DiagGroup<"extra-semi", [CXX98CompatExtraSemi, + CXX11ExtraSemi]>; def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">; def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">; @@ -196,6 +204,7 @@ def CXX98Compat : DiagGroup<"c++98-compat", def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic", [CXX98Compat, CXX98CompatBindToTemporaryCopy, + CXX98CompatExtraSemi, CXXPre14CompatPedantic, CXXPre17CompatPedantic, CXXPre2aCompatPedantic]>; @@ -263,6 +272,11 @@ def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">; def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">; def DanglingElse: DiagGroup<"dangling-else">; def DanglingField : DiagGroup<"dangling-field">; +def DanglingInitializerList : DiagGroup<"dangling-initializer-list">; +def ReturnStackAddress : DiagGroup<"return-stack-address">; +def Dangling : DiagGroup<"dangling", [DanglingField, + DanglingInitializerList, + ReturnStackAddress]>; def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">; def ExpansionToDefined : DiagGroup<"expansion-to-defined">; def FlagEnum : DiagGroup<"flag-enum">; @@ -282,6 +296,8 @@ def IncompatiblePointerTypes [IncompatiblePointerTypesDiscardsQualifiers, IncompatibleFunctionPointerTypes]>; def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">; +def IncompleteFrameworkModuleDeclaration + : DiagGroup<"incomplete-framework-module-declaration">; def NonModularIncludeInFrameworkModule : DiagGroup<"non-modular-include-in-framework-module">; def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module", @@ -380,7 +396,11 @@ def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">; def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">; def Packed : DiagGroup<"packed">; def Padded : DiagGroup<"padded">; + def PessimizingMove : DiagGroup<"pessimizing-move">; +def ReturnStdMoveInCXX11 : DiagGroup<"return-std-move-in-c++11">; +def ReturnStdMove : DiagGroup<"return-std-move">; + def PointerArith : DiagGroup<"pointer-arith">; def PoundWarning : DiagGroup<"#warnings">; def PoundPragmaMessage : DiagGroup<"#pragma-messages">, @@ -391,13 +411,13 @@ def RedeclaredClassMember : DiagGroup<"redeclared-class-member">; def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">; def RedundantMove : DiagGroup<"redundant-move">; def Register : DiagGroup<"register", [DeprecatedRegister]>; -def ReturnStackAddress : DiagGroup<"return-stack-address">; def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">; def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>; def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy", [CXX98CompatBindToTemporaryCopy]>; def SelfAssignmentField : DiagGroup<"self-assign-field">; -def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentField]>; +def SelfAssignmentOverloaded : DiagGroup<"self-assign-overloaded">; +def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentOverloaded, SelfAssignmentField]>; def SelfMove : DiagGroup<"self-move">; def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">; def Sentinel : DiagGroup<"sentinel">; @@ -426,6 +446,13 @@ def : DiagGroup<"synth">; def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">; def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">; def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">; +def MemsetTransposedArgs : DiagGroup<"memset-transposed-args">; +def DynamicClassMemaccess : DiagGroup<"dynamic-class-memaccess">; +def NonTrivialMemaccess : DiagGroup<"nontrivial-memaccess">; +def SuspiciousBzero : DiagGroup<"suspicious-bzero">; +def SuspiciousMemaccess : DiagGroup<"suspicious-memaccess", + [SizeofPointerMemaccess, DynamicClassMemaccess, + NonTrivialMemaccess, MemsetTransposedArgs, SuspiciousBzero]>; def StaticInInline : DiagGroup<"static-in-inline">; def StaticLocalInInline : DiagGroup<"static-local-in-inline">; def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">; @@ -435,13 +462,16 @@ def StringCompare : DiagGroup<"string-compare">; def StringPlusInt : DiagGroup<"string-plus-int">; def StringPlusChar : DiagGroup<"string-plus-char">; def StrncatSize : DiagGroup<"strncat-size">; +def TautologicalTypeLimitCompare : DiagGroup<"tautological-type-limit-compare">; def TautologicalUnsignedZeroCompare : DiagGroup<"tautological-unsigned-zero-compare">; def TautologicalUnsignedEnumZeroCompare : DiagGroup<"tautological-unsigned-enum-zero-compare">; +def TautologicalInRangeCompare : DiagGroup<"tautological-constant-in-range-compare", + [TautologicalTypeLimitCompare, + TautologicalUnsignedZeroCompare, + TautologicalUnsignedEnumZeroCompare]>; def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">; def TautologicalConstantCompare : DiagGroup<"tautological-constant-compare", - [TautologicalUnsignedZeroCompare, - TautologicalUnsignedEnumZeroCompare, - TautologicalOutOfRangeCompare]>; + [TautologicalOutOfRangeCompare]>; def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">; def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">; def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">; @@ -509,8 +539,13 @@ def UninitializedStaticSelfInit : DiagGroup<"static-self-init">; def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes, UninitializedStaticSelfInit]>; def IgnoredPragmaIntrinsic : DiagGroup<"ignored-pragma-intrinsic">; +// #pragma optimize is often used to avoid to work around MSVC codegen bugs or +// to disable inlining. It's not completely clear what alternative to suggest +// (#pragma clang optimize, noinline) so suggest nothing for now. +def IgnoredPragmaOptimize : DiagGroup<"ignored-pragma-optimize">; def UnknownPragmas : DiagGroup<"unknown-pragmas">; -def IgnoredPragmas : DiagGroup<"ignored-pragmas", [IgnoredPragmaIntrinsic]>; +def IgnoredPragmas : DiagGroup<"ignored-pragmas", + [IgnoredPragmaIntrinsic, IgnoredPragmaOptimize]>; def PragmaClangAttribute : DiagGroup<"pragma-clang-attribute">; def PragmaPackSuspiciousInclude : DiagGroup<"pragma-pack-suspicious-include">; def PragmaPack : DiagGroup<"pragma-pack", [PragmaPackSuspiciousInclude]>; @@ -712,7 +747,12 @@ def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">; def IntToPointerCast : DiagGroup<"int-to-pointer-cast", [IntToVoidPointerCast]>; -def Move : DiagGroup<"move", [PessimizingMove, RedundantMove, SelfMove]>; +def Move : DiagGroup<"move", [ + PessimizingMove, + RedundantMove, + ReturnStdMove, + SelfMove + ]>; def Extra : DiagGroup<"extra", [ MissingFieldInitializers, @@ -982,3 +1022,10 @@ def UnknownArgument : DiagGroup<"unknown-argument">; // A warning group for warnings about code that clang accepts when // compiling OpenCL C/C++ but which is not compatible with the SPIR spec. def SpirCompat : DiagGroup<"spir-compat">; + +// Warning for the experimental-isel options. +def ExperimentalISel : DiagGroup<"experimental-isel">; + +// A warning group specifically for warnings related to function +// multiversioning. +def FunctionMultiVersioning : DiagGroup<"function-multiversion">; diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h index b4ea85ba853cc..b610af953fba1 100644 --- a/include/clang/Basic/DiagnosticIDs.h +++ b/include/clang/Basic/DiagnosticIDs.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the Diagnostic IDs-related interfaces. +/// Defines the Diagnostic IDs-related interfaces. /// //===----------------------------------------------------------------------===// @@ -60,7 +60,7 @@ namespace clang { class CustomDiagInfo; - /// \brief All of the diagnostics that can be emitted by the frontend. + /// All of the diagnostics that can be emitted by the frontend. typedef unsigned kind; // Get typedefs for common diagnostics. @@ -158,25 +158,25 @@ public: } }; -/// \brief Used for handling and querying diagnostic IDs. +/// Used for handling and querying diagnostic IDs. /// /// Can be used and shared by multiple Diagnostics for multiple translation units. class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> { public: - /// \brief The level of the diagnostic, after it has been through mapping. + /// The level of the diagnostic, after it has been through mapping. enum Level { Ignored, Note, Remark, Warning, Error, Fatal }; private: - /// \brief Information for uniquing and looking up custom diags. + /// Information for uniquing and looking up custom diags. diag::CustomDiagInfo *CustomDiagInfo; public: DiagnosticIDs(); ~DiagnosticIDs(); - /// \brief Return an ID for a diagnostic with the specified format string and + /// Return an ID for a diagnostic with the specified format string and /// level. /// /// If this is the first request for this diagnostic, it is registered and @@ -191,31 +191,31 @@ public: // Diagnostic classification and reporting interfaces. // - /// \brief Given a diagnostic ID, return a description of the issue. + /// Given a diagnostic ID, return a description of the issue. StringRef getDescription(unsigned DiagID) const; - /// \brief Return true if the unmapped diagnostic levelof the specified + /// Return true if the unmapped diagnostic levelof the specified /// diagnostic ID is a Warning or Extension. /// /// This only works on builtin diagnostics, not custom ones, and is not /// legal to call on NOTEs. static bool isBuiltinWarningOrExtension(unsigned DiagID); - /// \brief Return true if the specified diagnostic is mapped to errors by + /// Return true if the specified diagnostic is mapped to errors by /// default. static bool isDefaultMappingAsError(unsigned DiagID); - /// \brief Determine whether the given built-in diagnostic ID is a Note. + /// Determine whether the given built-in diagnostic ID is a Note. static bool isBuiltinNote(unsigned DiagID); - /// \brief Determine whether the given built-in diagnostic ID is for an + /// Determine whether the given built-in diagnostic ID is for an /// extension of some sort. static bool isBuiltinExtensionDiag(unsigned DiagID) { bool ignored; return isBuiltinExtensionDiag(DiagID, ignored); } - /// \brief Determine whether the given built-in diagnostic ID is for an + /// Determine whether the given built-in diagnostic ID is for an /// extension of some sort, and whether it is enabled by default. /// /// This also returns EnabledByDefault, which is set to indicate whether the @@ -225,53 +225,53 @@ public: static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault); - /// \brief Return the lowest-level warning option that enables the specified + /// Return the lowest-level warning option that enables the specified /// diagnostic. /// /// If there is no -Wfoo flag that controls the diagnostic, this returns null. static StringRef getWarningOptionForDiag(unsigned DiagID); - /// \brief Return the category number that a specified \p DiagID belongs to, + /// Return the category number that a specified \p DiagID belongs to, /// or 0 if no category. static unsigned getCategoryNumberForDiag(unsigned DiagID); - /// \brief Return the number of diagnostic categories. + /// Return the number of diagnostic categories. static unsigned getNumberOfCategories(); - /// \brief Given a category ID, return the name of the category. + /// Given a category ID, return the name of the category. static StringRef getCategoryNameFromID(unsigned CategoryID); - /// \brief Return true if a given diagnostic falls into an ARC diagnostic + /// Return true if a given diagnostic falls into an ARC diagnostic /// category. static bool isARCDiagnostic(unsigned DiagID); - /// \brief Enumeration describing how the emission of a diagnostic should + /// Enumeration describing how the emission of a diagnostic should /// be treated when it occurs during C++ template argument deduction. enum SFINAEResponse { - /// \brief The diagnostic should not be reported, but it should cause + /// The diagnostic should not be reported, but it should cause /// template argument deduction to fail. /// /// The vast majority of errors that occur during template argument /// deduction fall into this category. SFINAE_SubstitutionFailure, - /// \brief The diagnostic should be suppressed entirely. + /// The diagnostic should be suppressed entirely. /// /// Warnings generally fall into this category. SFINAE_Suppress, - /// \brief The diagnostic should be reported. + /// The diagnostic should be reported. /// /// The diagnostic should be reported. Various fatal errors (e.g., /// template instantiation depth exceeded) fall into this category. SFINAE_Report, - /// \brief The diagnostic is an access-control diagnostic, which will be + /// The diagnostic is an access-control diagnostic, which will be /// substitution failures in some contexts and reported in others. SFINAE_AccessControl }; - /// \brief Determines whether the given built-in diagnostic ID is + /// Determines whether the given built-in diagnostic ID is /// for an error that is suppressed if it occurs during C++ template /// argument deduction. /// @@ -281,30 +281,30 @@ public: /// are not SFINAE errors. static SFINAEResponse getDiagnosticSFINAEResponse(unsigned DiagID); - /// \brief Get the string of all diagnostic flags. + /// Get the string of all diagnostic flags. /// /// \returns A list of all diagnostics flags as they would be written in a /// command line invocation including their `no-` variants. For example: /// `{"-Wempty-body", "-Wno-empty-body", ...}` static std::vector<std::string> getDiagnosticFlags(); - /// \brief Get the set of all diagnostic IDs in the group with the given name. + /// Get the set of all diagnostic IDs in the group with the given name. /// /// \param[out] Diags - On return, the diagnostics in the group. /// \returns \c true if the given group is unknown, \c false otherwise. bool getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group, SmallVectorImpl<diag::kind> &Diags) const; - /// \brief Get the set of all diagnostic IDs. + /// Get the set of all diagnostic IDs. static void getAllDiagnostics(diag::Flavor Flavor, std::vector<diag::kind> &Diags); - /// \brief Get the diagnostic option with the closest edit distance to the + /// Get the diagnostic option with the closest edit distance to the /// given group name. static StringRef getNearestOption(diag::Flavor Flavor, StringRef Group); private: - /// \brief Classify the specified diagnostic ID into a Level, consumable by + /// Classify the specified diagnostic ID into a Level, consumable by /// the DiagnosticClient. /// /// The classification is based on the way the client configured the @@ -320,17 +320,17 @@ private: getDiagnosticSeverity(unsigned DiagID, SourceLocation Loc, const DiagnosticsEngine &Diag) const LLVM_READONLY; - /// \brief Used to report a diagnostic that is finally fully formed. + /// Used to report a diagnostic that is finally fully formed. /// /// \returns \c true if the diagnostic was emitted, \c false if it was /// suppressed. bool ProcessDiag(DiagnosticsEngine &Diag) const; - /// \brief Used to emit a diagnostic that is finally fully formed, + /// Used to emit a diagnostic that is finally fully formed, /// ignoring suppression. void EmitDiag(DiagnosticsEngine &Diag, Level DiagLevel) const; - /// \brief Whether the diagnostic may leave the AST in a state where some + /// Whether the diagnostic may leave the AST in a state where some /// invariants can break. bool isUnrecoverable(unsigned DiagID) const; diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index c391470cb1c89..b5b5e8f654bca 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -404,6 +404,14 @@ def err_pp_invalid_directive : Error<"invalid preprocessing directive">; def err_pp_directive_required : Error< "%0 must be used within a preprocessing directive">; def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal; +def err_pp_through_header_not_found : Error< + "'%0' required for precompiled header not found">, DefaultFatal; +def err_pp_through_header_not_seen : Error< + "#include of '%0' not seen while attempting to " + "%select{create|use}1 precompiled header">, DefaultFatal; +def warn_pp_macro_def_mismatch_with_pch : Warning< + "definition of macro %0 does not match definition in precompiled header">, + InGroup<ClangClPch>; def err_pp_file_not_found_not_fatal : Error< "'%0' file not found with <angled> include; use \"quotes\" instead">; def err_pp_error_opening_file : Error< @@ -505,17 +513,12 @@ def warn_pragma_message : Warning<"%0">, def err_pragma_message : Error<"%0">; def warn_pragma_ignored : Warning<"unknown pragma ignored">, InGroup<UnknownPragmas>, DefaultIgnore; -def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">, - InGroup<UnknownPragmas>; def ext_on_off_switch_syntax : ExtWarn<"expected 'ON' or 'OFF' or 'DEFAULT' in pragma">, InGroup<UnknownPragmas>; def ext_pragma_syntax_eod : ExtWarn<"expected end of directive in pragma">, InGroup<UnknownPragmas>; -def warn_stdc_fenv_access_not_supported : - Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">, - InGroup<UnknownPragmas>; def warn_pragma_diagnostic_invalid : ExtWarn<"pragma diagnostic expected 'error', 'warning', 'ignored', 'fatal'," " 'push', or 'pop'">, @@ -699,6 +702,11 @@ def warn_mmap_mismatched_private_module_name : Warning< InGroup<PrivateModule>; def note_mmap_rename_top_level_private_module : Note< "rename '%0' to ensure it can be found by name">; +def warn_mmap_incomplete_framework_module_declaration : Warning< + "skipping '%0' because module declaration of '%1' lacks the 'framework' qualifier">, + InGroup<IncompleteFrameworkModuleDeclaration>; +def note_mmap_add_framework_keyword : Note< + "use 'framework module' to declare module '%0'">; def err_mmap_duplicate_header_attribute : Error< "header attribute '%0' specified multiple times">; @@ -714,6 +722,14 @@ def warn_mmap_redundant_export_as : Warning< def err_mmap_submodule_export_as : Error< "only top-level modules can be re-exported as public">; +def warn_quoted_include_in_framework_header : Warning< + "double-quoted include \"%0\" in framework header, " + "expected angle-bracketed instead" + >, InGroup<FrameworkHdrQuotedInclude>, DefaultIgnore; +def warn_framework_include_private_from_public : Warning< + "public framework header includes private framework header '%0'" + >, InGroup<FrameworkIncludePrivateFromPublic>; + def warn_auto_module_import : Warning< "treating #%select{include|import|include_next|__include_macros}0 as an " "import of module '%1'">, InGroup<AutoImport>, DefaultIgnore; diff --git a/include/clang/Basic/DiagnosticOptions.h b/include/clang/Basic/DiagnosticOptions.h index 3844eb63f0eaf..391e252eaddda 100644 --- a/include/clang/Basic/DiagnosticOptions.h +++ b/include/clang/Basic/DiagnosticOptions.h @@ -1,4 +1,4 @@ -//===--- DiagnosticOptions.h ------------------------------------*- C++ -*-===// +//===- DiagnosticOptions.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -18,14 +18,17 @@ namespace clang { -/// \brief Specifies which overload candidates to display when overload +/// Specifies which overload candidates to display when overload /// resolution fails. enum OverloadsShown : unsigned { - Ovl_All, ///< Show all overloads. - Ovl_Best ///< Show just the "best" overload candidates. + /// Show all overloads. + Ovl_All, + + /// Show just the "best" overload candidates. + Ovl_Best }; -/// \brief A bitmask representing the diagnostic levels used by +/// A bitmask representing the diagnostic levels used by /// VerifyDiagnosticConsumer. enum class DiagnosticLevelMask : unsigned { None = 0, @@ -57,7 +60,7 @@ inline DiagnosticLevelMask operator&(DiagnosticLevelMask LHS, raw_ostream& operator<<(raw_ostream& Out, DiagnosticLevelMask M); -/// \brief Options for controlling the compiler diagnostics engine. +/// Options for controlling the compiler diagnostics engine. class DiagnosticOptions : public RefCountedBase<DiagnosticOptions>{ public: enum TextDiagnosticFormat { Clang, MSVC, Vi }; @@ -86,10 +89,10 @@ protected: #include "clang/Basic/DiagnosticOptions.def" public: - /// \brief The file to log diagnostic output to. + /// The file to log diagnostic output to. std::string DiagnosticLogFile; - /// \brief The file to serialize diagnostics to (non-appending). + /// The file to serialize diagnostics to (non-appending). std::string DiagnosticSerializationFile; /// The list of -W... options used to alter the diagnostic mappings, with the @@ -119,8 +122,8 @@ public: } }; -typedef DiagnosticOptions::TextDiagnosticFormat TextDiagnosticFormat; +using TextDiagnosticFormat = DiagnosticOptions::TextDiagnosticFormat; -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_DIAGNOSTICOPTIONS_H diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 7936cdd96f80b..dd4c81922592f 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -39,7 +39,7 @@ def ext_empty_translation_unit : Extension< InGroup<DiagGroup<"empty-translation-unit">>; def warn_cxx98_compat_top_level_semi : Warning< "extra ';' outside of a function is incompatible with C++98">, - InGroup<CXX98CompatPedantic>, DefaultIgnore; + InGroup<CXX98CompatExtraSemi>, DefaultIgnore; def ext_extra_semi : Extension< "extra ';' %select{" "outside of a function|" @@ -173,6 +173,9 @@ def warn_attribute_on_function_definition : Warning< def warn_gcc_attribute_location : Warning< "GCC does not allow an attribute in this position on a function declaration">, InGroup<GccCompat>; +def warn_gcc_variable_decl_in_for_loop : Warning< + "GCC does not allow variable declarations in for loop initializers before " + "C99">, InGroup<GccCompat>; def warn_attribute_no_decl : Warning< "attribute %0 ignored, because it is not attached to a declaration">, InGroup<IgnoredAttributes>; @@ -248,6 +251,11 @@ def err_unexpected_at : Error<"unexpected '@' in program">; def err_atimport : Error< "use of '@import' when modules are disabled">; +def warn_atimport_in_framework_header : Warning< + "use of '@import' in framework header is discouraged, " + "including this header requires -fmodules">, + InGroup<FrameworkHdrAtImport>; + def err_invalid_reference_qualifier_application : Error< "'%0' qualifier may not be applied to a reference">; def err_illegal_decl_reference_to_reference : Error< @@ -575,7 +583,7 @@ def err_cxx11_attribute_forbids_arguments : Error< def err_attribute_requires_arguments : Error< "parentheses must be omitted if %0 attribute's argument list is empty">; def err_cxx11_attribute_forbids_ellipsis : Error< - "attribute '%0' cannot be used as an attribute pack">; + "attribute %0 cannot be used as an attribute pack">; def err_cxx11_attribute_repeated : Error< "attribute %0 cannot appear multiple times in an attribute specifier">; def warn_cxx14_compat_using_attribute_ns : Warning< @@ -633,6 +641,8 @@ def err_template_spec_syntax_non_template : Error< "<unused>|refers to a variable template|<unused>}1">; def err_id_after_template_in_nested_name_spec : Error< "expected template name after 'template' keyword in nested name specifier">; +def err_unexpected_template_in_unqualified_id : Error< + "'template' keyword not permitted here">; def err_two_right_angle_brackets_need_space : Error< "a space is required between consecutive right angle brackets (use '> >')">; def err_right_angle_bracket_equal_needs_space : Error< @@ -895,6 +905,12 @@ def warn_pragma_expected_rparen : Warning< "missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>; def warn_pragma_expected_identifier : Warning< "expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>; +def warn_pragma_expected_string : Warning< + "expected string literal in '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>; +def warn_pragma_missing_argument : Warning< + "missing argument to '#pragma %0'%select{|; expected %2}1">, InGroup<IgnoredPragmas>; +def warn_pragma_invalid_argument : Warning< + "unexpected argument '%0' to '#pragma %1'%select{|; expected %3}2">, InGroup<IgnoredPragmas>; // '#pragma clang section' related errors def err_pragma_expected_clang_section_name : Error< @@ -923,6 +939,8 @@ def warn_pragma_ms_struct : Warning< def warn_pragma_extra_tokens_at_eol : Warning< "extra tokens at end of '#pragma %0' - ignored">, InGroup<IgnoredPragmas>; +def warn_pragma_expected_comma : Warning< + "expected ',' in '#pragma %0'">, InGroup<IgnoredPragmas>; def warn_pragma_expected_punc : Warning< "expected ')' or ',' in '#pragma %0'">, InGroup<IgnoredPragmas>; def warn_pragma_expected_non_wide_string : Warning< @@ -960,6 +978,10 @@ def warn_pragma_pack_malformed : Warning< def warn_pragma_intrinsic_builtin : Warning< "%0 is not a recognized builtin%select{|; consider including <intrin.h> to access non-builtin intrinsics}1">, InGroup<IgnoredPragmaIntrinsic>; +// - #pragma optimize +def warn_pragma_optimize : Warning< + "'#pragma optimize' is not supported">, + InGroup<IgnoredPragmaOptimize>; // - #pragma unused def warn_pragma_unused_expected_var : Warning< "expected '#pragma unused' argument to be a variable name">, @@ -973,6 +995,12 @@ def warn_pragma_init_seg_unsupported_target : Warning< def err_pragma_fp_contract_scope : Error< "'#pragma fp_contract' can only appear at file scope or at the start of a " "compound statement">; +// - #pragma stdc unknown +def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">, + InGroup<UnknownPragmas>; +def warn_stdc_fenv_access_not_supported : + Warning<"pragma STDC FENV_ACCESS ON is not supported, ignoring pragma">, + InGroup<UnknownPragmas>; // - #pragma comment def err_pragma_comment_malformed : Error< "pragma comment requires parenthesized identifier and optional string">; @@ -1055,6 +1083,12 @@ def err_opencl_taking_function_address_parser : Error< def err_opencl_logical_exclusive_or : Error< "^^ is a reserved operator in OpenCL">; +// OpenCL C++. +def err_openclcxx_virtual_function : Error< + "virtual functions are not supported in OpenCL C++">; +def err_openclcxx_reserved : Error< + "'%0' is a reserved keyword in OpenCL C++">; + // OpenMP support. def warn_pragma_omp_ignored : Warning< "unexpected '#pragma omp ...' in program">, InGroup<SourceUsesOpenMP>, DefaultIgnore; @@ -1066,7 +1100,7 @@ def warn_pragma_expected_colon_r_paren : Warning< def err_omp_unknown_directive : Error< "expected an OpenMP directive">; def err_omp_unexpected_directive : Error< - "unexpected OpenMP directive '#pragma omp %0'">; + "unexpected OpenMP directive %select{|'#pragma omp %1'}0">; def err_omp_expected_punc : Error< "expected ',' or ')' in '%0' %select{clause|directive}1">; def err_omp_unexpected_clause : Error< @@ -1156,6 +1190,9 @@ def err_objc_parameterized_implementation : Error< def err_objc_type_args_after_protocols : Error< "protocol qualifiers must precede type arguments">; + +def note_meant_to_use_typename : Note< + "did you mean to use 'typename'?">; } let CategoryName = "Coroutines Issue" in { diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 01e819942f686..d0a2bec780527 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -203,6 +203,8 @@ def ext_imaginary_constant : Extension< def ext_integer_complex : Extension< "complex integer types are a GNU extension">, InGroup<GNUComplexInteger>; +def err_invalid_saturation_spec : Error<"'_Sat' specifier is only valid on " + "'_Fract' or '_Accum', not '%0'">; def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">; def err_invalid_width_spec : Error< "'%select{|short|long|long long}0 %1' is invalid">; @@ -272,6 +274,14 @@ def warn_mips_interrupt_attribute : Warning< "MIPS 'interrupt' attribute only applies to functions that have " "%select{no parameters|a 'void' return type}0">, InGroup<IgnoredAttributes>; +def warn_riscv_repeated_interrupt_attribute : Warning< + "repeated RISC-V 'interrupt' attribute">, InGroup<IgnoredAttributes>; +def note_riscv_repeated_interrupt_attribute : Note< + "repeated RISC-V 'interrupt' attribute is here">; +def warn_riscv_interrupt_attribute : Warning< + "RISC-V 'interrupt' attribute only applies to functions that have " + "%select{no parameters|a 'void' return type}0">, + InGroup<IgnoredAttributes>; def warn_unused_parameter : Warning<"unused parameter %0">, InGroup<UnusedParameter>, DefaultIgnore; def warn_unused_variable : Warning<"unused variable %0">, @@ -279,7 +289,7 @@ def warn_unused_variable : Warning<"unused variable %0">, def warn_unused_local_typedef : Warning< "unused %select{typedef|type alias}0 %1">, InGroup<UnusedLocalTypedef>, DefaultIgnore; -def warn_unused_property_backing_ivar : +def warn_unused_property_backing_ivar : Warning<"ivar %0 which backs the property is not " "referenced in this property's accessor">, InGroup<UnusedPropertyIvar>, DefaultIgnore; @@ -602,9 +612,12 @@ def warn_redecl_library_builtin : Warning< "incompatible redeclaration of library function %0">, InGroup<DiagGroup<"incompatible-library-redeclaration">>; def err_builtin_definition : Error<"definition of builtin function %0">; +def err_builtin_redeclare : Error<"cannot redeclare builtin function %0">; def err_arm_invalid_specialreg : Error<"invalid special register for builtin">; def err_invalid_cpu_supports : Error<"invalid cpu feature string for builtin">; def err_invalid_cpu_is : Error<"invalid cpu name for builtin">; +def err_invalid_cpu_specific_dispatch_value : Error< +"invalid option '%0' for %select{cpu_specific|cpu_dispatch}1">; def err_builtin_needs_feature : Error<"%0 needs target feature %1">; def err_function_needs_feature : Error<"always_inline function %1 requires target feature '%2', but would " @@ -612,11 +625,18 @@ def err_function_needs_feature "'%2'">; def warn_builtin_unknown : Warning<"use of unknown builtin %0">, InGroup<ImplicitFunctionDeclare>, DefaultError; +def warn_cstruct_memaccess : Warning< + "%select{destination for|source of|first operand of|second operand of}0 this " + "%1 call is a pointer to record %2 that is not trivial to " + "%select{primitive-default-initialize|primitive-copy}3">, + InGroup<NonTrivialMemaccess>; +def note_nontrivial_field : Note< + "field is non-trivial to %select{copy|default-initialize}0">; def warn_dyn_class_memaccess : Warning< "%select{destination for|source of|first operand of|second operand of}0 this " "%1 call is a pointer to %select{|class containing a }2dynamic class %3; " "vtable pointer will be %select{overwritten|copied|moved|compared}4">, - InGroup<DiagGroup<"dynamic-class-memaccess">>; + InGroup<DynamicClassMemaccess>; def note_bad_memaccess_silence : Note< "explicitly cast the pointer to silence this warning">; def warn_sizeof_pointer_expr_memaccess : Warning< @@ -645,7 +665,19 @@ def note_memsize_comparison_paren : Note< "did you mean to compare the result of %0 instead?">; def note_memsize_comparison_cast_silence : Note< "explicitly cast the argument to size_t to silence this warning">; - +def warn_suspicious_sizeof_memset : Warning< + "%select{'size' argument to memset is '0'|" + "setting buffer to a 'sizeof' expression}0" + "; did you mean to transpose the last two arguments?">, + InGroup<MemsetTransposedArgs>; +def note_suspicious_sizeof_memset_silence : Note< + "%select{parenthesize the third argument|" + "cast the second argument to 'int'}0 to silence">; +def warn_suspicious_bzero_size : Warning<"'size' argument to bzero is '0'">, + InGroup<SuspiciousBzero>; +def note_suspicious_bzero_size_silence : Note< + "parenthesize the second argument to silence">; + def warn_strncat_large_size : Warning< "the value of the size argument in 'strncat' is too large, might lead to a " "buffer overflow">, InGroup<StrncatSize>; @@ -751,7 +783,7 @@ def note_pragma_pack_pop_instead_reset : Note< "did you intend to use '#pragma pack (pop)' instead of '#pragma pack()'?">; // Follow the Microsoft implementation. def warn_pragma_pack_show : Warning<"value of #pragma pack(show) == %0">; -def warn_pragma_pack_pop_identifer_and_alignment : Warning< +def warn_pragma_pack_pop_identifier_and_alignment : Warning< "specifying both a name and alignment to 'pop' is undefined">; def warn_pragma_pop_failed : Warning<"#pragma %0(pop, ...) failed: %1">, InGroup<IgnoredPragmas>; @@ -759,6 +791,10 @@ def warn_cxx_ms_struct : Warning<"ms_struct may not produce Microsoft-compatible layouts for classes " "with base classes or virtual functions">, DefaultError, InGroup<IncompatibleMSStruct>; +def warn_npot_ms_struct : + Warning<"ms_struct may not produce Microsoft-compatible layouts with fundamental " + "data types with sizes that aren't a power of two">, + DefaultError, InGroup<IncompatibleMSStruct>; def err_section_conflict : Error<"%0 causes a section type conflict with %1">; def err_no_base_classes : Error<"invalid use of '__super', %0 has no base classes">; def err_invalid_super_scope : Error<"invalid use of '__super', " @@ -1027,7 +1063,7 @@ def warn_objc_pointer_masking : Warning< def warn_objc_pointer_masking_performSelector : Warning<warn_objc_pointer_masking.Text>, InGroup<ObjCPointerIntrospectPerformSelector>; def warn_objc_property_default_assign_on_object : Warning< - "default property attribute 'assign' not appropriate for non-GC object">, + "default property attribute 'assign' not appropriate for object">, InGroup<ObjCPropertyNoAttribute>; def warn_property_attr_mismatch : Warning< "property attribute in class extension does not match the primary class">, @@ -1325,7 +1361,7 @@ def err_invalid_member_in_interface : Error< "nested class }0%1 is not permitted within an interface type">; def err_invalid_base_in_interface : Error< "interface type cannot inherit from " - "%select{'struct|non-public 'interface|'class}0 %1'">; + "%select{struct|non-public interface|class}0 %1">; def err_abstract_type_in_decl : Error< "%select{return|parameter|variable|field|instance variable|" @@ -1582,6 +1618,8 @@ def err_not_integral_type_bitfield : Error< "bit-field %0 has non-integral type %1">; def err_not_integral_type_anon_bitfield : Error< "anonymous bit-field has non-integral type %0">; +def err_anon_bitfield_qualifiers : Error< + "anonymous bit-field cannot have qualifiers">; def err_member_function_initialization : Error< "initializer on function does not look like a pure-specifier">; def err_non_virtual_pure : Error< @@ -1589,24 +1627,35 @@ def err_non_virtual_pure : Error< def ext_pure_function_definition : ExtWarn< "function definition with pure-specifier is a Microsoft extension">, InGroup<MicrosoftPureDefinition>; -def err_implicit_object_parameter_init : Error< - "cannot initialize object parameter of type %0 with an expression " - "of type %1">; def err_qualified_member_of_unrelated : Error< "%q0 is not a member of class %1">; +def err_member_function_call_bad_cvr : Error< + "'this' argument to member function %0 has type %1, but function is not marked " + "%select{const|restrict|const or restrict|volatile|const or volatile|" + "volatile or restrict|const, volatile, or restrict}2">; +def err_member_function_call_bad_ref : Error< + "'this' argument to member function %0 is an %select{lvalue|rvalue}1, " + "but function has %select{non-const lvalue|rvalue}2 ref-qualifier">; +def err_member_function_call_bad_type : Error< + "cannot initialize object parameter of type %0 with an expression " + "of type %1">; + def warn_call_to_pure_virtual_member_function_from_ctor_dtor : Warning< "call to pure virtual member function %0 has undefined behavior; " "overrides of %0 in subclasses are not available in the " "%select{constructor|destructor}1 of %2">; +def select_special_member_kind : TextSubstitution< + "%select{default constructor|copy constructor|move constructor|" + "copy assignment operator|move assignment operator|destructor}0">; + def note_member_declared_at : Note<"member is declared here">; def note_ivar_decl : Note<"instance variable is declared here">; def note_bitfield_decl : Note<"bit-field is declared here">; def note_implicit_param_decl : Note<"%0 is an implicit parameter">; def note_member_synthesized_at : Note< - "in implicit %select{default constructor|copy constructor|move constructor|" - "copy assignment operator|move assignment operator|destructor}0 for %1 " + "in implicit %sub{select_special_member_kind}0 for %1 " "first required here">; def err_missing_default_ctor : Error< "%select{constructor for %1 must explicitly initialize the|" @@ -1615,16 +1664,14 @@ def err_missing_default_ctor : Error< "%select{base class|member}2 %3 %select{which|which|of %1}0 " "does not have a default constructor">; def note_due_to_dllexported_class : Note< - "due to '%0' being dllexported%select{|; try compiling in C++11 mode}1">; + "due to %0 being dllexported%select{|; try compiling in C++11 mode}1">; def err_illegal_union_or_anon_struct_member : Error< "%select{anonymous struct|union}0 member %1 has a non-trivial " - "%select{constructor|copy constructor|move constructor|copy assignment " - "operator|move assignment operator|destructor}2">; + "%sub{select_special_member_kind}2">; def warn_cxx98_compat_nontrivial_union_or_anon_struct_member : Warning< "%select{anonymous struct|union}0 member %1 with a non-trivial " - "%select{constructor|copy constructor|move constructor|copy assignment " - "operator|move assignment operator|destructor}2 is incompatible with C++98">, + "%sub{select_special_member_kind}2 is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; def note_nontrivial_virtual_dtor : Note< @@ -1643,8 +1690,7 @@ def note_nontrivial_no_copy : Note< "%select{base class|field|an object}0 of type %3">; def note_nontrivial_user_provided : Note< "because %select{base class of |field of |}0type %1 has a user-provided " - "%select{default constructor|copy constructor|move constructor|" - "copy assignment operator|move assignment operator|destructor}2">; + "%sub{select_special_member_kind}2">; def note_nontrivial_in_class_init : Note< "because field %0 has an initializer">; def note_nontrivial_param_type : Note< @@ -1711,9 +1757,7 @@ def err_covariant_return_type_class_type_more_qualified : Error< // C++ implicit special member functions def note_in_declaration_of_implicit_special_member : Note< - "while declaring the implicit " - "%select{default constructor|copy constructor|move constructor|" - "copy assignment operator|move assignment operator|destructor}1" + "while declaring the implicit %sub{select_special_member_kind}1" " for %0">; // C++ constructors @@ -1768,7 +1812,8 @@ def err_destructor_template : Error< // C++ initialization def err_init_conversion_failed : Error< - "cannot initialize %select{a variable|a parameter|return object|an " + "cannot initialize %select{a variable|a parameter|return object|" + "statement expression result|an " "exception object|a member subobject|an array element|a new value|a value|a " "base class|a constructor delegation|a vector element|a block element|a " "block element|a complex element|a lambda capture|a compound literal " @@ -1808,17 +1853,9 @@ def err_reference_bind_failed : Error< "type $|could not bind to %select{rvalue|lvalue}1 of incompatible type}0,2">; def err_reference_bind_init_list : Error< "reference to type %0 cannot bind to an initializer list">; -def warn_temporary_array_to_pointer_decay : Warning< - "pointer is initialized by a temporary array, which will be destroyed at the " - "end of the full-expression">, - InGroup<DiagGroup<"address-of-array-temporary">>; def err_init_list_bad_dest_type : Error< "%select{|non-aggregate }0type %1 cannot be initialized with an initializer " "list">; -def err_member_function_call_bad_cvr : Error<"member function %0 not viable: " - "'this' argument has type %1, but function is not marked " - "%select{const|restrict|const or restrict|volatile|const or volatile|" - "volatile or restrict|const, volatile, or restrict}2">; def err_reference_bind_to_bitfield : Error< "%select{non-const|volatile}0 reference cannot bind to " @@ -1907,34 +1944,29 @@ def warn_unsequenced_mod_mod : Warning< def warn_unsequenced_mod_use : Warning< "unsequenced modification and access to %0">, InGroup<Unsequenced>; +def select_initialized_entity_kind : TextSubstitution< + "%select{copying variable|copying parameter|" + "returning object|initializing statement expression result|" + "throwing object|copying member subobject|copying array element|" + "allocating object|copying temporary|initializing base subobject|" + "initializing vector element|capturing value}0">; + def err_temp_copy_no_viable : Error< - "no viable constructor %select{copying variable|copying parameter|" - "returning object|throwing object|copying member subobject|copying array " - "element|allocating object|copying temporary|initializing base subobject|" - "initializing vector element|capturing value}0 of type %1">; + "no viable constructor %sub{select_initialized_entity_kind}0 of type %1">; def ext_rvalue_to_reference_temp_copy_no_viable : Extension< - "no viable constructor %select{copying variable|copying parameter|" - "returning object|throwing object|copying member subobject|copying array " - "element|allocating object|copying temporary|initializing base subobject|" - "initializing vector element|capturing value}0 of type %1; C++98 requires a copy " - "constructor when binding a reference to a temporary">, + "no viable constructor %sub{select_initialized_entity_kind}0 of type %1; " + "C++98 requires a copy constructor when binding a reference to a temporary">, InGroup<BindToTemporaryCopy>; def err_temp_copy_ambiguous : Error< - "ambiguous constructor call when %select{copying variable|copying " - "parameter|returning object|throwing object|copying member subobject|copying " - "array element|allocating object|copying temporary|initializing base subobject|" - "initializing vector element|capturing value}0 of type %1">; + "ambiguous constructor call when %sub{select_initialized_entity_kind}0 " + "of type %1">; def err_temp_copy_deleted : Error< - "%select{copying variable|copying parameter|returning object|throwing " - "object|copying member subobject|copying array element|allocating object|" - "copying temporary|initializing base subobject|initializing vector element|" - "capturing value}0 of type %1 invokes deleted constructor">; + "%sub{select_initialized_entity_kind}0 of type %1 " + "invokes deleted constructor">; def err_temp_copy_incomplete : Error< "copying a temporary object of incomplete type %0">; def warn_cxx98_compat_temp_copy : Warning< - "%select{copying variable|copying parameter|returning object|throwing " - "object|copying member subobject|copying array element|allocating object|" - "copying temporary|initializing base subobject|initializing vector element}1 " + "%sub{select_initialized_entity_kind}1 " "of type %2 when binding a reference to a temporary would %select{invoke " "an inaccessible constructor|find no viable constructor|find ambiguous " "constructors|invoke a deleted constructor}0 in C++98">, @@ -2031,10 +2063,6 @@ def err_implied_std_initializer_list_not_found : Error< "not found; include <initializer_list>">; def err_malformed_std_initializer_list : Error< "std::initializer_list must be a class template with a single type parameter">; -def warn_dangling_std_initializer_list : Warning< - "array backing the initializer list will be destroyed at the end of " - "%select{the full-expression|the constructor}0">, - InGroup<DiagGroup<"dangling-initializer-list">>; def err_auto_init_list_from_c : Error< "cannot use __auto_type with initializer list in C">; def err_auto_bitfield : Error< @@ -2099,9 +2127,16 @@ def err_deduction_guide_explicit_mismatch : Error< def err_deduction_guide_specialized : Error<"deduction guide cannot be " "%select{explicitly instantiated|explicitly specialized}0">; def err_deduction_guide_template_not_deducible : Error< - "deduction guide template contains " - "%select{a template parameter|template parameters}0 that cannot be " - "deduced">; + "deduction guide template contains " + "%select{a template parameter|template parameters}0 that cannot be " + "deduced">; +def err_deduction_guide_wrong_access : Error< + "deduction guide has different access from the corresponding " + "member template">; +def note_deduction_guide_template_access : Note< + "member template declared %0 here">; +def note_deduction_guide_access : Note< + "deduction guide declared %0 by intervening access specifier">; // C++1y deduced return types def err_auto_fn_deduction_failure : Error< @@ -2363,6 +2398,8 @@ def note_non_literal_user_provided_dtor : Note< "%0 is not literal because it has a user-provided destructor">; def note_non_literal_nontrivial_dtor : Note< "%0 is not literal because it has a non-trivial destructor">; +def note_non_literal_lambda : Note< + "lambda closure types are non-literal types before C++17">; def warn_private_extern : Warning< "use of __private_extern__ on a declaration may not produce external symbol " "private to the linkage unit and is deprecated">, InGroup<PrivateExtern>; @@ -2403,6 +2440,9 @@ def err_template_different_associated_constraints : Error< def warn_cxx98_compat_unicode_type : Warning< "'%0' type specifier is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore; +def warn_cxx17_compat_unicode_type : Warning< + "'char8_t' type specifier is incompatible with C++ standards before C++20">, + InGroup<CXXPre2aCompat>, DefaultIgnore; // __make_integer_seq def err_integer_sequence_negative_length : Error< @@ -2441,8 +2481,8 @@ def err_attribute_requires_positive_integer : Error< def err_attribute_requires_opencl_version : Error< "%0 attribute requires OpenCL version %1%select{| or above}2">; def warn_unsupported_target_attribute - : Warning<"ignoring %select{unsupported|duplicate}0" - "%select{| architecture}1 '%2' in the target attribute string">, + : Warning<"%select{unsupported|duplicate}0%select{| architecture}1 '%2' in" + " the 'target' attribute string; 'target' attribute ignored">, InGroup<IgnoredAttributes>; def err_attribute_unsupported : Error<"%0 attribute is not supported for this target">; @@ -2546,6 +2586,9 @@ def err_attribute_address_space_too_high : Error< "address space is larger than the maximum supported (%0)">; def err_attribute_address_multiple_qualifiers : Error< "multiple address spaces specified for type">; +def warn_attribute_address_multiple_identical_qualifiers : Warning< + "multiple identical address spaces specified for type">, + InGroup<DuplicateDeclSpecifier>; def err_attribute_address_function_type : Error< "function type may not be qualified with an address space">; def err_as_qualified_auto_decl : Error< @@ -2639,11 +2682,19 @@ def err_only_annotate_after_access_spec : Error< "access specifier can only have annotation attributes">; def err_attribute_section_invalid_for_target : Error< - "argument to 'section' attribute is not valid for this target: %0">; + "argument to %select{'code_seg'|'section'}1 attribute is not valid for this target: %0">; def warn_mismatched_section : Warning< - "section does not match previous declaration">, InGroup<Section>; + "%select{codeseg|section}0 does not match previous declaration">, InGroup<Section>; def warn_attribute_section_on_redeclaration : Warning< "section attribute is specified on redeclared variable">, InGroup<Section>; +def err_mismatched_code_seg_base : Error< + "derived class must specify the same code segment as its base classes">; +def err_mismatched_code_seg_override : Error< + "overriding virtual function must specify the same code segment as its overridden function">; +def err_conflicting_codeseg_attribute : Error< + "conflicting code segment specifiers">; +def warn_duplicate_codeseg_attribute : Warning< + "duplicate code segment specifiers">, InGroup<Section>; def err_anonymous_property: Error< "anonymous property is not supported">; @@ -2683,6 +2734,9 @@ def warn_attribute_ignored : Warning<"%0 attribute ignored">, def warn_attribute_ignored_on_inline : Warning<"%0 attribute ignored on inline function">, InGroup<IgnoredAttributes>; +def warn_nocf_check_attribute_ignored : + Warning<"'nocf_check' attribute ignored; use -fcf-protection to enable the attribute">, + InGroup<IgnoredAttributes>; def warn_attribute_after_definition_ignored : Warning< "attribute %0 after definition is ignored">, InGroup<IgnoredAttributes>; @@ -2796,7 +2850,7 @@ def warn_alias_with_section : Warning< "%select{alias|ifunc}1 will not be in section '%0' but in the same section as the %select{aliasee|resolver}2">, InGroup<IgnoredAttributes>; def err_duplicate_mangled_name : Error< - "definition with same mangled name as another definition">; + "definition with same mangled name '%0' as another definition">; def err_cyclic_alias : Error< "%select{alias|ifunc}0 definition is part of a cycle">; def err_ifunc_resolver_return : Error< @@ -2821,8 +2875,7 @@ def warn_attribute_wrong_decl_type : Warning< "|types and namespaces" "|variables, functions and classes" "|kernel functions" - "|non-K&R-style functions" - "|variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members}1">, + "|non-K&R-style functions}1">, InGroup<IgnoredAttributes>; def err_attribute_wrong_decl_type : Error<warn_attribute_wrong_decl_type.Text>; def warn_type_attribute_wrong_type : Warning< @@ -2877,6 +2930,9 @@ def err_base_specifier_attribute : Error< def err_invalid_attribute_on_virtual_function : Error< "%0 attribute cannot be applied to virtual functions">; +def ext_cannot_use_trivial_abi : ExtWarn< + "'trivial_abi' cannot be applied to %0">, InGroup<IgnoredAttributes>; + // Availability attribute def warn_availability_unknown_platform : Warning< "unknown platform %0 in availability macro">, InGroup<Availability>; @@ -2896,6 +2952,10 @@ def warn_mismatched_availability_override_unavail : Warning< "%select{the protocol method it implements|its overridden method}1 is " "available">, InGroup<Availability>; +def warn_availability_on_static_initializer : Warning< + "ignoring availability attribute %select{on '+load' method|" + "with constructor attribute|with destructor attribute}0">, + InGroup<Availability>; def note_overridden_method : Note< "overridden method is here">; def note_protocol_method : Note< @@ -2970,11 +3030,11 @@ def warn_lock_exclusive_and_shared : Warning< def note_lock_exclusive_and_shared : Note< "the other acquisition of %0 '%1' is here">; def warn_variable_requires_any_lock : Warning< - "%select{reading|writing}1 variable '%0' requires holding " + "%select{reading|writing}1 variable %0 requires holding " "%select{any mutex|any mutex exclusively}1">, InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_var_deref_requires_any_lock : Warning< - "%select{reading|writing}1 the value pointed to by '%0' requires holding " + "%select{reading|writing}1 the value pointed to by %0 requires holding " "%select{any mutex|any mutex exclusively}1">, InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_fun_excludes_mutex : Warning< @@ -2998,25 +3058,25 @@ def warn_acquire_requires_negative_cap : Warning< // Thread safety warnings on pass by reference def warn_guarded_pass_by_reference : Warning< - "passing variable '%1' by reference requires holding %0 " + "passing variable %1 by reference requires holding %0 " "%select{'%2'|'%2' exclusively}3">, InGroup<ThreadSafetyReference>, DefaultIgnore; def warn_pt_guarded_pass_by_reference : Warning< - "passing the value that '%1' points to by reference requires holding %0 " + "passing the value that %1 points to by reference requires holding %0 " "%select{'%2'|'%2' exclusively}3">, InGroup<ThreadSafetyReference>, DefaultIgnore; // Imprecise thread safety warnings def warn_variable_requires_lock : Warning< - "%select{reading|writing}3 variable '%1' requires holding %0 " + "%select{reading|writing}3 variable %1 requires holding %0 " "%select{'%2'|'%2' exclusively}3">, InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_var_deref_requires_lock : Warning< - "%select{reading|writing}3 the value pointed to by '%1' requires " + "%select{reading|writing}3 the value pointed to by %1 requires " "holding %0 %select{'%2'|'%2' exclusively}3">, InGroup<ThreadSafetyAnalysis>, DefaultIgnore; def warn_fun_requires_lock : Warning< - "calling function '%1' requires holding %0 %select{'%2'|'%2' exclusively}3">, + "calling function %1 requires holding %0 %select{'%2'|'%2' exclusively}3">, InGroup<ThreadSafetyAnalysis>, DefaultIgnore; // Precise thread safety warnings @@ -3034,7 +3094,7 @@ def note_found_mutex_near_match : Note<"found near match '%0'">; // Verbose thread safety warnings def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, InGroup<ThreadSafetyVerbose>, DefaultIgnore; -def note_thread_warning_in_fun : Note<"Thread warning in function '%0'">; +def note_thread_warning_in_fun : Note<"Thread warning in function %0">; def note_guarded_by_declared_here : Note<"Guarded_by declared here.">; // Dummy warning that will trigger "beta" warnings from the analysis if enabled. @@ -3082,6 +3142,9 @@ def err_impcast_complex_scalar : Error< def warn_impcast_float_precision : Warning< "implicit conversion loses floating-point precision: %0 to %1">, InGroup<Conversion>, DefaultIgnore; +def warn_impcast_float_result_precision : Warning< + "implicit conversion when assigning computation result loses floating-point precision: %0 to %1">, + InGroup<Conversion>, DefaultIgnore; def warn_impcast_double_promotion : Warning< "implicit conversion increases floating-point precision: %0 to %1">, InGroup<DoublePromotion>, DefaultIgnore; @@ -3107,13 +3170,18 @@ def warn_impcast_bitfield_precision_constant : Warning< def warn_impcast_literal_float_to_integer : Warning< "implicit conversion from %0 to %1 changes value from %2 to %3">, InGroup<LiteralConversion>; +def warn_impcast_literal_float_to_integer_out_of_range : Warning< + "implicit conversion of out of range value from %0 to %1 is undefined">, + InGroup<LiteralConversion>; def warn_impcast_float_integer : Warning< "implicit conversion turns floating-point number into integer: %0 to %1">, InGroup<FloatConversion>, DefaultIgnore; def warn_impcast_float_to_integer : Warning< - "implicit conversion of out of range value from %0 to %1 changes value " - "from %2 to %3">, + "implicit conversion from %0 to %1 changes value from %2 to %3">, + InGroup<FloatOverflowConversion>, DefaultIgnore; +def warn_impcast_float_to_integer_out_of_range : Warning< + "implicit conversion of out of range value from %0 to %1 is undefined">, InGroup<FloatOverflowConversion>, DefaultIgnore; def warn_impcast_float_to_integer_zero : Warning< "implicit conversion from %0 to %1 changes non-zero value from %2 to %3">, @@ -3303,6 +3371,9 @@ def err_attribute_not_supported_in_lang : Error< "%0 attribute is not supported in %select{C|C++|Objective-C}1">; def err_attribute_not_supported_on_arch : Error<"%0 attribute is not supported on '%1'">; +def warn_gcc_ignores_type_attr : Warning< + "GCC does not allow the %0 attribute to be written on a type">, + InGroup<GccCompat>; // Clang-Specific Attributes def warn_attribute_iboutlet : Warning< @@ -3484,27 +3555,29 @@ def err_ovl_deleted_member_call : Error< def note_ovl_too_many_candidates : Note< "remaining %0 candidate%s0 omitted; " "pass -fshow-overloads=all to show them">; -def note_ovl_candidate : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "is the implicit default constructor|" - "is the implicit copy constructor|" - "is the implicit move constructor|" - "is the implicit copy assignment operator|" - "is the implicit move assignment operator|" - "inherited constructor|" - "inherited constructor }0%2" - "%select{| has different class%diff{ (expected $ but has $)|}4,5" - "| has different number of parameters (expected %4 but has %5)" - "| has type mismatch at %ordinal4 parameter" - "%diff{ (expected $ but has $)|}5,6" - "| has different return type%diff{ ($ expected but has $)|}4,5" + +def select_ovl_candidate_kind : TextSubstitution< + "%select{function|function|constructor|" + "constructor (the implicit default constructor)|" + "constructor (the implicit copy constructor)|" + "constructor (the implicit move constructor)|" + "function (the implicit copy assignment operator)|" + "function (the implicit move assignment operator)|" + "inherited constructor}0%select{| template| %2}1">; + +def note_ovl_candidate : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,3" + "%select{| has different class%diff{ (expected $ but has $)|}5,6" + "| has different number of parameters (expected %5 but has %6)" + "| has type mismatch at %ordinal5 parameter" + "%diff{ (expected $ but has $)|}6,7" + "| has different return type%diff{ ($ expected but has $)|}5,6" "| has different qualifiers (expected " "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}4 but found " + "|volatile and restrict|const, volatile, and restrict}5 but found " "%select{none|const|restrict|const and restrict|volatile|const and volatile" - "|volatile and restrict|const, volatile, and restrict}5)" - "| has different exception specification}3">; + "|volatile and restrict|const, volatile, and restrict}6)" + "| has different exception specification}4">; def note_ovl_candidate_inherited_constructor : Note< "constructor from base class %0 inherited here">; @@ -3518,6 +3591,9 @@ def note_ovl_candidate_bad_deduction : Note< "candidate template ignored: failed template argument deduction">; def note_ovl_candidate_incomplete_deduction : Note<"candidate template ignored: " "couldn't infer template argument %0">; +def note_ovl_candidate_incomplete_deduction_pack : Note<"candidate template ignored: " + "deduced too few arguments for expanded pack %0; no argument for %ordinal1 " + "expanded parameter in deduced argument pack %2">; def note_ovl_candidate_inconsistent_deduction : Note< "candidate template ignored: deduced conflicting %select{types|values|" "templates}0 for parameter %1%diff{ ($ vs. $)|}2,3">; @@ -3574,233 +3650,99 @@ def note_ovl_candidate_non_deduced_mismatch_qualified : Note< // Note that we don't treat templates differently for this diagnostic. def note_ovl_candidate_arity : Note<"candidate " - "%select{function|function|constructor|function|function|constructor|" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor}0 %select{|template }1" - "not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 " - "%plural{1:was|:were}4 provided">; + "%sub{select_ovl_candidate_kind}0,1,2 not viable: " + "requires%select{ at least| at most|}3 %4 argument%s4, but %5 " + "%plural{1:was|:were}5 provided">; def note_ovl_candidate_arity_one : Note<"candidate " - "%select{function|function|constructor|function|function|constructor|" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor}0 %select{|template }1not viable: " - "%select{requires at least|allows at most single|requires single}2 " - "argument %3, but %plural{0:no|:%4}4 arguments were provided">; + "%sub{select_ovl_candidate_kind}0,1,2 not viable: " + "%select{requires at least|allows at most single|requires single}3 " + "argument %4, but %plural{0:no|:%5}5 arguments were provided">; def note_ovl_candidate_deleted : Note< - "candidate %select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 has been " + "candidate %sub{select_ovl_candidate_kind}0,1,2 has been " "%select{explicitly made unavailable|explicitly deleted|" - "implicitly deleted}2">; + "implicitly deleted}3">; // Giving the index of the bad argument really clutters this message, and // it's relatively unimportant because 1) it's generally obvious which // argument(s) are of the given object type and 2) the fix is usually // to complete the type, which doesn't involve changes to the call line // anyway. If people complain, we can change it. -def note_ovl_candidate_bad_conv_incomplete : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 " - "not viable: cannot convert argument of incomplete type " - "%diff{$ to $|to parameter type}2,3 for " - "%select{%ordinal5 argument|object argument}4" +def note_ovl_candidate_bad_conv_incomplete : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "cannot convert argument of incomplete type " + "%diff{$ to $|to parameter type}3,4 for " + "%select{%ordinal6 argument|object argument}5" "%select{|; dereference the argument with *|" "; take the address of the argument with &|" "; remove *|" - "; remove &}6">; -def note_ovl_candidate_bad_list_argument : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 " - "not viable: cannot convert initializer list argument to %3">; -def note_ovl_candidate_bad_overload : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1" - " not viable: no overload of %3 matching %2 for %ordinal4 argument">; -def note_ovl_candidate_bad_conv : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1" - " not viable: no known conversion " - "%diff{from $ to $|from argument type to parameter type}2,3 for " - "%select{%ordinal5 argument|object argument}4" + "; remove &}7">; +def note_ovl_candidate_bad_list_argument : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "cannot convert initializer list argument to %4">; +def note_ovl_candidate_bad_overload : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "no overload of %4 matching %3 for %ordinal5 argument">; +def note_ovl_candidate_bad_conv : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "no known conversion " + "%diff{from $ to $|from argument type to parameter type}3,4 for " + "%select{%ordinal6 argument|object argument}5" "%select{|; dereference the argument with *|" "; take the address of the argument with &|" "; remove *|" - "; remove &}6">; -def note_ovl_candidate_bad_arc_conv : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1" - " not viable: cannot implicitly convert argument " - "%diff{of type $ to $|type to parameter type}2,3 for " - "%select{%ordinal5 argument|object argument}4 under ARC">; -def note_ovl_candidate_bad_lvalue : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1" - " not viable: expects an l-value for " - "%select{%ordinal3 argument|object argument}2">; -def note_ovl_candidate_bad_addrspace : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 not viable: " - "%select{%ordinal6|'this'}5 argument (%2) is in " - "address space %3, but parameter must be in address space %4">; -def note_ovl_candidate_bad_gc : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 not viable: " - "%select{%ordinal6|'this'}5 argument (%2) has %select{no|__weak|__strong}3 " - "ownership, but parameter has %select{no|__weak|__strong}4 ownership">; -def note_ovl_candidate_bad_ownership : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 not viable: " - "%select{%ordinal6|'this'}5 argument (%2) has " - "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}3 ownership," + "; remove &}7">; +def note_ovl_candidate_bad_arc_conv : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "cannot implicitly convert argument " + "%diff{of type $ to $|type to parameter type}3,4 for " + "%select{%ordinal6 argument|object argument}5 under ARC">; +def note_ovl_candidate_bad_lvalue : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "expects an l-value for " + "%select{%ordinal4 argument|object argument}3">; +def note_ovl_candidate_bad_addrspace : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "address space mismatch in %select{%ordinal6|'this'}5 argument (%3), " + "parameter type must be %4">; +def note_ovl_candidate_bad_gc : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "%select{%ordinal7|'this'}6 argument (%3) has %select{no|__weak|__strong}4 " + "ownership, but parameter has %select{no|__weak|__strong}5 ownership">; +def note_ovl_candidate_bad_ownership : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "%select{%ordinal7|'this'}6 argument (%3) has " + "%select{no|__unsafe_unretained|__strong|__weak|__autoreleasing}4 ownership," " but parameter has %select{no|__unsafe_unretained|__strong|__weak|" - "__autoreleasing}4 ownership">; -def note_ovl_candidate_bad_cvr_this : Note<"candidate " - "%select{|function|||function|||||" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)||}0 not viable: " - "'this' argument has type %2, but method is not marked " + "__autoreleasing}5 ownership">; +def note_ovl_candidate_bad_cvr_this : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "'this' argument has type %3, but method is not marked " "%select{const|restrict|const or restrict|volatile|const or volatile|" - "volatile or restrict|const, volatile, or restrict}3">; -def note_ovl_candidate_bad_cvr : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 not viable: " - "%ordinal4 argument (%2) would lose " + "volatile or restrict|const, volatile, or restrict}4">; +def note_ovl_candidate_bad_cvr : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "%ordinal5 argument (%3) would lose " "%select{const|restrict|const and restrict|volatile|const and volatile|" - "volatile and restrict|const, volatile, and restrict}3 qualifier" - "%select{||s||s|s|s}3">; -def note_ovl_candidate_bad_unaligned : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 not viable: " - "%ordinal4 argument (%2) would lose __unaligned qualifier">; -def note_ovl_candidate_bad_base_to_derived_conv : Note<"candidate " - "%select{function|function|constructor|" - "function |function |constructor |" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor }0%1 not viable: " - "cannot %select{convert from|convert from|bind}2 " - "%select{base class pointer|superclass|base class object of type}2 %3 to " - "%select{derived class pointer|subclass|derived class reference}2 %4 for " - "%ordinal5 argument">; + "volatile and restrict|const, volatile, and restrict}4 qualifier" + "%select{||s||s|s|s}4">; +def note_ovl_candidate_bad_unaligned : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "%ordinal5 argument (%3) would lose __unaligned qualifier">; +def note_ovl_candidate_bad_base_to_derived_conv : Note< + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " + "cannot %select{convert from|convert from|bind}3 " + "%select{base class pointer|superclass|base class object of type}3 %4 to " + "%select{derived class pointer|subclass|derived class reference}3 %5 for " + "%ordinal6 argument">; def note_ovl_candidate_bad_target : Note< - "candidate %select{function|function|constructor|" - "function|function|constructor|" - "constructor (the implicit default constructor)|" - "constructor (the implicit copy constructor)|" - "constructor (the implicit move constructor)|" - "function (the implicit copy assignment operator)|" - "function (the implicit move assignment operator)|" - "inherited constructor|" - "inherited constructor}0 not viable: " + "candidate %sub{select_ovl_candidate_kind}0,1,2 not viable: " "call to " - "%select{__device__|__global__|__host__|__host__ __device__|invalid}1 function from" - " %select{__device__|__global__|__host__|__host__ __device__|invalid}2 function">; + "%select{__device__|__global__|__host__|__host__ __device__|invalid}3 function from" + " %select{__device__|__global__|__host__|__host__ __device__|invalid}4 function">; def note_implicit_member_target_infer_collision : Note< - "implicit %select{" - "default constructor|" - "copy constructor|" - "move constructor|" - "copy assignment operator|" - "move assignment operator|" - "destructor}0 inferred target collision: call to both " + "implicit %sub{select_special_member_kind}0 inferred target collision: call to both " "%select{__device__|__global__|__host__|__host__ __device__}1 and " "%select{__device__|__global__|__host__|__host__ __device__}2 members">; @@ -3842,16 +3784,14 @@ def err_ovl_deleted_oper : Error< "overload resolution selected %select{unavailable|deleted}0 operator '%1'%2">; def err_ovl_deleted_special_oper : Error< "object of type %0 cannot be %select{constructed|copied|moved|assigned|" - "assigned|destroyed}1 because its %select{default constructor|" - "copy constructor|move constructor|copy assignment operator|" - "move assignment operator|destructor}1 is implicitly deleted">; + "assigned|destroyed}1 because its %sub{select_special_member_kind}1 is implicitly deleted">; def err_ovl_no_viable_subscript : Error<"no viable overloaded operator[] for type %0">; def err_ovl_no_oper : Error<"type %0 does not provide a %select{subscript|call}1 operator">; def err_ovl_unresolvable : Error< - "reference to overloaded function could not be resolved; " - "did you mean to call it%select{| with no arguments}0?">; + "reference to %select{overloaded|multiversioned}1 function could not be " + "resolved; did you mean to call it%select{| with no arguments}0?">; def err_bound_member_function : Error< "reference to non-static member function must be called" "%select{|; did you mean to call it with no arguments?}0">; @@ -3961,8 +3901,6 @@ def err_template_member_noparams : Error< "extraneous 'template<>' in declaration of member %0">; def err_template_tag_noparams : Error< "extraneous 'template<>' in declaration of %0 %1">; -def err_template_decl_ref : Error< - "cannot refer to %select{class|variable}0 template %1 without a template argument list">; // C++ Template Argument Lists def err_template_missing_args : Error< @@ -4130,42 +4068,20 @@ def note_explicit_specialization_declared_here : Note< "explicit specialization declared here">; def err_template_spec_decl_function_scope : Error< "explicit specialization of %0 in function scope">; -def err_template_spec_decl_class_scope : Error< - "explicit specialization of %0 in class scope">; def err_template_spec_decl_friend : Error< "cannot declare an explicit specialization in a friend">; -def err_template_spec_decl_out_of_scope_global : Error< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member function|" - "static data member|member class|member enumeration}0 " - "specialization of %1 must originally be declared in the global scope">; -def err_template_spec_decl_out_of_scope : Error< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member " - "function|static data member|member class|member enumeration}0 " - "specialization of %1 must originally be declared in namespace %2">; -def ext_template_spec_decl_out_of_scope : ExtWarn< - "first declaration of %select{class template|class template partial|" - "variable template|variable template partial|" - "function template|member function|static data member|member class|" - "member enumeration}0 specialization of %1 outside namespace %2 is a " - "C++11 extension">, InGroup<CXX11>; -def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning< - "%select{class template|class template partial|variable template|" - "variable template partial|function template|member " - "function|static data member|member class|member enumeration}0 " - "specialization of %1 outside namespace %2 is incompatible with C++98">, - InGroup<CXX98Compat>, DefaultIgnore; def err_template_spec_redecl_out_of_scope : Error< "%select{class template|class template partial|variable template|" "variable template partial|function template|member " "function|static data member|member class|member enumeration}0 " - "specialization of %1 not in a namespace enclosing %2">; + "specialization of %1 not in %select{a namespace enclosing %2|" + "class %2 or an enclosing namespace}3">; def ext_ms_template_spec_redecl_out_of_scope: ExtWarn< "%select{class template|class template partial|variable template|" "variable template partial|function template|member " "function|static data member|member class|member enumeration}0 " - "specialization of %1 outside namespace enclosing %2 " + "specialization of %1 not in %select{a namespace enclosing %2|" + "class %2 or an enclosing namespace}3 " "is a Microsoft extension">, InGroup<MicrosoftTemplate>; def err_template_spec_redecl_global_scope : Error< "%select{class template|class template partial|variable template|" @@ -4187,16 +4103,18 @@ def err_template_spec_default_arg : Error< def err_not_class_template_specialization : Error< "cannot specialize a %select{dependent template|template template " "parameter}0">; -def err_function_specialization_in_class : Error< - "cannot specialize a function %0 within class scope">; -def ext_function_specialization_in_class : ExtWarn< - "explicit specialization of %0 within class scope is a Microsoft extension">, - InGroup<MicrosoftTemplate>; def ext_explicit_specialization_storage_class : ExtWarn< "explicit specialization cannot have a storage class">; def err_explicit_specialization_inconsistent_storage_class : Error< "explicit specialization has extraneous, inconsistent storage class " "'%select{none|extern|static|__private_extern__|auto|register}0'">; +def err_dependent_function_template_spec_no_match : Error< + "no candidate function template was found for dependent" + " friend function template specialization">; +def note_dependent_function_template_spec_discard_reason : Note< + "candidate ignored: %select{not a function template" + "|not a member of the enclosing namespace;" + " did you mean to explicitly qualify the specialization?}0">; // C++ class template specializations and out-of-line definitions def err_template_spec_needs_header : Error< @@ -4493,6 +4411,8 @@ def note_using_value_decl_missing_typename : Note< def err_template_kw_refers_to_non_template : Error< "%0 following the 'template' keyword does not refer to a template">; +def note_template_kw_refers_to_non_template : Note< + "declared as a non-template here">; def err_template_kw_refers_to_class_template : Error< "'%0%1' instantiated to a class template, not a function template">; def note_referenced_class_template : Note< @@ -4554,6 +4474,9 @@ def err_pack_expansion_length_conflict : Error< def err_pack_expansion_length_conflict_multilevel : Error< "pack expansion contains parameter pack %0 that has a different " "length (%1 vs. %2) from outer parameter packs">; +def err_pack_expansion_length_conflict_partial : Error< + "pack expansion contains parameter pack %0 that has a different " + "length (at least %1 vs. %2) from outer parameter packs">; def err_pack_expansion_member_init : Error< "pack expansion for initialization of member %0">; @@ -5112,12 +5035,17 @@ def note_protected_by_objc_strong_init : Note< "jump bypasses initialization of __strong variable">; def note_protected_by_objc_weak_init : Note< "jump bypasses initialization of __weak variable">; +def note_protected_by_non_trivial_c_struct_init : Note< + "jump bypasses initialization of variable of non-trivial C struct type">; def note_enters_block_captures_cxx_obj : Note< "jump enters lifetime of block which captures a destructible C++ object">; def note_enters_block_captures_strong : Note< "jump enters lifetime of block which strongly captures a variable">; def note_enters_block_captures_weak : Note< "jump enters lifetime of block which weakly captures a variable">; +def note_enters_block_captures_non_trivial_c_struct : Note< + "jump enters lifetime of block which captures a C struct that is non-trivial " + "to destroy">; def note_exits_cleanup : Note< "jump exits scope of variable with __attribute__((cleanup))">; @@ -5158,6 +5086,9 @@ def note_exits_block_captures_strong : Note< "jump exits lifetime of block which strongly captures a variable">; def note_exits_block_captures_weak : Note< "jump exits lifetime of block which weakly captures a variable">; +def note_exits_block_captures_non_trivial_c_struct : Note< + "jump exits lifetime of block which captures a C struct that is non-trivial " + "to destroy">; def err_func_returning_qualified_void : ExtWarn< "function cannot return qualified void type %0">, @@ -5411,8 +5342,6 @@ def warn_block_capture_autoreleasing : Warning< "block captures an autoreleasing out-parameter, which may result in " "use-after-free bugs">, InGroup<BlockCaptureAutoReleasing>; -def note_declare_parameter_autoreleasing : Note< - "declare the parameter __autoreleasing explicitly to suppress this warning">; def note_declare_parameter_strong : Note< "declare the parameter __strong or capture a __block __strong variable to " "keep values alive across autorelease pools">; @@ -5601,9 +5530,12 @@ def warn_addition_in_bitshift : Warning< "operator '%0' has lower precedence than '%1'; " "'%1' will be evaluated first">, InGroup<ShiftOpParentheses>; -def warn_self_assignment : Warning< +def warn_self_assignment_builtin : Warning< "explicitly assigning value of variable of type %0 to itself">, InGroup<SelfAssignment>, DefaultIgnore; +def warn_self_assignment_overloaded : Warning< + "explicitly assigning value of variable of type %0 to itself">, + InGroup<SelfAssignmentOverloaded>, DefaultIgnore; def warn_self_move : Warning< "explicitly moving variable of type %0 to itself">, InGroup<SelfMove>, DefaultIgnore; @@ -5619,6 +5551,19 @@ def warn_pessimizing_move_on_initialization : Warning< InGroup<PessimizingMove>, DefaultIgnore; def note_remove_move : Note<"remove std::move call here">; +def warn_return_std_move : Warning< + "local variable %0 will be copied despite being %select{returned|thrown}1 by name">, + InGroup<ReturnStdMove>, DefaultIgnore; +def note_add_std_move : Note< + "call 'std::move' explicitly to avoid copying">; +def warn_return_std_move_in_cxx11 : Warning< + "prior to the resolution of a defect report against ISO C++11, " + "local variable %0 would have been copied despite being returned by name, " + "due to its not matching the function return type%diff{ ($ vs $)|}1,2">, + InGroup<ReturnStdMoveInCXX11>, DefaultIgnore; +def note_add_std_move_in_cxx11 : Note< + "call 'std::move' explicitly to avoid copying on older compilers">; + def warn_string_plus_int : Warning< "adding %0 to a string does not append to the string">, InGroup<StringPlusInt>; @@ -5797,6 +5742,13 @@ def err_array_init_wide_string_into_char : Error< "initializing char array with wide string literal">; def err_array_init_incompat_wide_string_into_wchar : Error< "initializing wide char array with incompatible wide string literal">; +def err_array_init_plain_string_into_char8_t : Error< + "initializing 'char8_t' array with plain string literal">; +def note_array_init_plain_string_into_char8_t : Note< + "add 'u8' prefix to form a 'char8_t' string literal">; +def err_array_init_utf8_string_into_char : Error< + "initialization of char array with UTF-8 string literal is not permitted " + "by '-fchar8_t'">; def err_array_init_different_type : Error< "cannot initialize array %diff{of type $ with array of type $|" "with different type of array}0,1">; @@ -5881,6 +5833,8 @@ def err_objc_object_assignment : Error< "cannot assign to class object (%0 invalid)">; def err_typecheck_invalid_operands : Error< "invalid operands to binary expression (%0 and %1)">; +def note_typecheck_invalid_operands_converted : Note< + "%select{first|second}0 operand was implicitly converted to type %1">; def err_typecheck_logical_vector_expr_gnu_cpp_restrict : Error< "logical expression with vector %select{type %1 and non-vector type %2|types" " %1 and %2}0 is only supported in C++">; @@ -5894,7 +5848,8 @@ def ext_typecheck_ordered_comparison_of_pointer_and_zero : Extension< def err_typecheck_ordered_comparison_of_pointer_and_zero : Error< "ordered comparison between pointer and zero (%0 and %1)">; def ext_typecheck_ordered_comparison_of_function_pointers : ExtWarn< - "ordered comparison of function pointers (%0 and %1)">; + "ordered comparison of function pointers (%0 and %1)">, + InGroup<DiagGroup<"ordered-compare-function-pointers">>; def ext_typecheck_comparison_of_fptr_to_void : Extension< "equality comparison between function pointer and void pointer (%0 and %1)">; def err_typecheck_comparison_of_fptr_to_void : Error< @@ -5942,15 +5897,15 @@ def note_typecheck_assign_const : Note< def warn_unsigned_always_true_comparison : Warning< "result of comparison of %select{%3|unsigned expression}0 %2 " "%select{unsigned expression|%3}0 is always %4">, - InGroup<TautologicalUnsignedZeroCompare>; + InGroup<TautologicalUnsignedZeroCompare>, DefaultIgnore; def warn_unsigned_enum_always_true_comparison : Warning< "result of comparison of %select{%3|unsigned enum expression}0 %2 " "%select{unsigned enum expression|%3}0 is always %4">, - InGroup<TautologicalUnsignedEnumZeroCompare>; + InGroup<TautologicalUnsignedEnumZeroCompare>, DefaultIgnore; def warn_tautological_constant_compare : Warning< "result of comparison %select{%3|%1}0 %2 " "%select{%1|%3}0 is always %4">, - InGroup<TautologicalConstantCompare>; + InGroup<TautologicalTypeLimitCompare>, DefaultIgnore; def warn_mixed_sign_comparison : Warning< "comparison of integers of different signs: %0 and %1">, @@ -6186,9 +6141,9 @@ def err_objc_object_catch : Error< def err_incomplete_type_objc_at_encode : Error< "'@encode' of incomplete type %0">; def warn_objc_circular_container : Warning< - "adding '%0' to '%1' might cause circular dependency in container">, + "adding %0 to %1 might cause circular dependency in container">, InGroup<DiagGroup<"objc-circular-container">>; -def note_objc_circular_container_declared_here : Note<"'%0' declared here">; +def note_objc_circular_container_declared_here : Note<"%0 declared here">; def warn_objc_unsafe_perform_selector : Warning< "%0 is incompatible with selectors that return a " "%select{struct|union|vector}1 type">, @@ -6260,6 +6215,12 @@ def err_bad_cxx_cast_bitfield : Error< def err_bad_cxx_cast_qualifiers_away : Error< "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" "functional-style cast}0 from %1 to %2 casts away qualifiers">; +def ext_bad_cxx_cast_qualifiers_away_incoherent : ExtWarn< + "ISO C++ does not allow " + "%select{const_cast|static_cast|reinterpret_cast|dynamic_cast|C-style cast|" + "functional-style cast}0 from %1 to %2 because it casts away qualifiers, " + "even though the source and destination types are unrelated">, + SFINAEFailure, InGroup<DiagGroup<"cast-qual-unrelated">>; def err_bad_const_cast_dest : Error< "%select{const_cast||||C-style cast|functional-style cast}0 to %2, " "which is not a reference, pointer-to-object, or pointer-to-data-member">; @@ -6440,6 +6401,8 @@ def err_bad_memptr_rhs : Error< def err_bad_memptr_lhs : Error< "left hand operand to %0 must be a %select{|pointer to }1class " "compatible with the right hand operand, but is %2">; +def err_memptr_incomplete : Error< + "member pointer has incomplete base type %0">; def warn_exception_caught_by_earlier_handler : Warning< "exception of type %0 will be caught by earlier handler">, InGroup<Exceptions>; @@ -6561,6 +6524,8 @@ let CategoryName = "Lambda Issue" in { "lambda expression in an unevaluated operand">; def err_lambda_in_constant_expression : Error< "a lambda expression may not appear inside of a constant expression">; + def err_lambda_in_invalid_context : Error< + "a lambda expression cannot appear in this context">; def err_lambda_return_init_list : Error< "cannot deduce lambda return type from initializer list">; def err_lambda_capture_default_arg : Error< @@ -6619,6 +6584,11 @@ let CategoryName = "Lambda Issue" in { def ext_equals_this_lambda_capture_cxx2a : ExtWarn< "explicit capture of 'this' with a capture default of '=' " "is a C++2a extension">, InGroup<CXX2a>; + def warn_deprecated_this_capture : Warning< + "implicit capture of 'this' with a capture default of '=' is deprecated">, + InGroup<DeprecatedThisCapture>, DefaultIgnore; + def note_deprecated_this_capture : Note< + "add an explicit capture of 'this' to capture '*this' by reference">; } def err_return_in_captured_stmt : Error< @@ -6688,9 +6658,9 @@ def err_not_tag_in_scope : Error< "no %select{struct|interface|union|class|enum}0 named %1 in %2">; def err_no_typeid_with_fno_rtti : Error< - "cannot use typeid with -fno-rtti">; + "use of typeid requires -frtti">; def err_no_dynamic_cast_with_fno_rtti : Error< - "cannot use dynamic_cast with -fno-rtti">; + "use of dynamic_cast requires -frtti">; def err_cannot_form_pointer_to_member_of_reference_type : Error< "cannot form a pointer-to-member to member %0 of reference type %1">; @@ -7055,6 +7025,8 @@ def err_atomic_builtin_must_be_pointer : Error< def err_atomic_builtin_must_be_pointer_intptr : Error< "address argument to atomic builtin must be a pointer to integer or pointer" " (%0 invalid)">; +def err_atomic_builtin_cannot_be_const : Error< + "address argument to atomic builtin cannot be const-qualified (%0 invalid)">; def err_atomic_builtin_must_be_pointer_intfltptr : Error< "address argument to atomic builtin must be a pointer to integer," " floating-point or pointer (%0 invalid)">; @@ -7079,6 +7051,8 @@ def err_atomic_op_needs_trivial_copy : Error< def err_atomic_op_needs_atomic_int_or_ptr : Error< "address argument to atomic operation must be a pointer to %select{|atomic }0" "integer or pointer (%1 invalid)">; +def err_atomic_op_needs_int32_or_ptr : Error< + "address argument to atomic operation must be a pointer to signed or unsigned 32-bit integer">; def err_atomic_op_bitwise_needs_atomic_int : Error< "address argument to bitwise atomic operation must be a pointer to " "%select{|atomic }0integer (%1 invalid)">; @@ -7087,6 +7061,9 @@ def warn_atomic_op_has_invalid_memory_order : Warning< InGroup<DiagGroup<"atomic-memory-ordering">>; def err_atomic_op_has_invalid_synch_scope : Error< "synchronization scope argument to atomic operation is invalid">; +def warn_atomic_op_misaligned : Warning< + "misaligned or large atomic operation may incur significant performance penalty">, + InGroup<DiagGroup<"atomic-alignment">>; def err_overflow_builtin_must_be_int : Error< "operand argument to overflow builtin must be an integer (%0 invalid)">; @@ -7137,7 +7114,7 @@ def err_va_arg_in_device : Error< "CUDA device code does not support va_arg">; def err_alias_not_supported_on_nvptx : Error<"CUDA does not support aliases">; def err_cuda_unattributed_constexpr_cannot_overload_device : Error< - "constexpr function '%0' without __host__ or __device__ attributes cannot " + "constexpr function %0 without __host__ or __device__ attributes cannot " "overload __device__ function with same signature. Add a __host__ " "attribute, or build with -fno-cuda-host-device-constexpr.">; def note_cuda_conflicting_device_function_declared_here : Note< @@ -7176,6 +7153,10 @@ def err_cannot_pass_objc_interface_to_vararg_format : Error< "cannot pass object with interface type %1 by value to variadic " "%select{function|block|method|constructor}2; expected type from format " "string was %3">; +def err_cannot_pass_non_trivial_c_struct_to_vararg : Error< + "cannot pass non-trivial C object of type %0 by value to variadic " + "%select{function|block|method|constructor}1">; + def err_cannot_pass_objc_interface_to_vararg : Error< "cannot pass object with interface type %0 by value through variadic " @@ -7623,6 +7604,11 @@ def err_destroying_operator_delete_not_usual : Error< "alignment parameter">; def note_implicit_delete_this_in_destructor_here : Note< "while checking implicit 'delete this' for virtual destructor">; +def err_builtin_operator_new_delete_not_usual : Error< + "call to '%select{__builtin_operator_new|__builtin_operator_delete}0' " + "selects non-usual %select{allocation|deallocation}0 function">; +def note_non_usual_function_declared_here : Note< + "non-usual %0 declared here">; // C++ literal operators def err_literal_operator_outside_namespace : Error< @@ -7705,9 +7691,8 @@ def err_defaulted_special_member_quals : Error< "an explicitly-defaulted %select{copy|move}0 assignment operator may not " "have 'const'%select{, 'constexpr'|}1 or 'volatile' qualifiers">; def err_defaulted_special_member_volatile_param : Error< - "the parameter for an explicitly-defaulted %select{<<ERROR>>|" - "copy constructor|move constructor|copy assignment operator|" - "move assignment operator|<<ERROR>>}0 may not be volatile">; + "the parameter for an explicitly-defaulted %sub{select_special_member_kind}0 " + "may not be volatile">; def err_defaulted_special_member_move_const_param : Error< "the parameter for an explicitly-defaulted move " "%select{constructor|assignment operator}0 may not be const">; @@ -7719,17 +7704,13 @@ def err_defaulted_copy_assign_not_ref : Error< "the parameter for an explicitly-defaulted copy assignment operator must be an " "lvalue reference type">; def err_incorrect_defaulted_exception_spec : Error< - "exception specification of explicitly defaulted %select{default constructor|" - "copy constructor|move constructor|copy assignment operator|move assignment " - "operator|destructor}0 does not match the " - "calculated one">; + "exception specification of explicitly defaulted " + "%sub{select_special_member_kind}0 does not match the calculated one">; def err_incorrect_defaulted_constexpr : Error< - "defaulted definition of %select{default constructor|copy constructor|" - "move constructor|copy assignment operator|move assignment operator}0 " + "defaulted definition of %sub{select_special_member_kind}0 " "is not constexpr">; def err_out_of_line_default_deletes : Error< - "defaulting this %select{default constructor|copy constructor|move " - "constructor|copy assignment operator|move assignment operator|destructor}0 " + "defaulting this %sub{select_special_member_kind}0 " "would delete it after its first declaration">; def warn_vbase_moved_multiple_times : Warning< "defaulted move assignment operator of %0 will move assign virtual base " @@ -7784,6 +7765,10 @@ def warn_format_argument_needs_cast : Warning< "%select{values of type|enum values with underlying type}2 '%0' should not " "be used as format arguments; add an explicit cast to %1 instead">, InGroup<Format>; +def warn_format_argument_needs_cast_pedantic : Warning< + "%select{values of type|enum values with underlying type}2 '%0' should not " + "be used as format arguments; add an explicit cast to %1 instead">, + InGroup<FormatPedantic>, DefaultIgnore; def warn_printf_positional_arg_exceeds_data_args : Warning < "data argument position '%0' exceeds the number of data arguments (%1)">, InGroup<Format>; @@ -7868,8 +7853,8 @@ def warn_null_ret : Warning< // CHECK: returning address/reference of stack memory def warn_ret_stack_addr_ref : Warning< - "%select{address of|reference to}0 stack memory associated with local " - "variable %1 returned">, + "%select{address of|reference to}0 stack memory associated with " + "%select{local variable|parameter}2 %1 returned">, InGroup<ReturnStackAddress>; def warn_ret_local_temp_addr_ref : Warning< "returning %select{address of|reference to}0 local temporary object">, @@ -7879,30 +7864,69 @@ def warn_ret_addr_label : Warning< InGroup<ReturnStackAddress>; def err_ret_local_block : Error< "returning block that lives on the local stack">; -def note_ref_var_local_bind : Note< - "binding reference variable %0 here">; +def note_local_var_initializer : Note< + "%select{via initialization of|binding reference}0 variable %1 here">; +def note_init_with_default_member_initalizer : Note< + "initializing field %0 with default member initializer">; // Check for initializing a member variable with the address or a reference to // a constructor parameter. def warn_bind_ref_member_to_parameter : Warning< - "binding reference member %0 to stack allocated parameter %1">, - InGroup<DanglingField>; + "binding reference member %0 to stack allocated " + "%select{variable|parameter}2 %1">, InGroup<DanglingField>; def warn_init_ptr_member_to_parameter_addr : Warning< - "initializing pointer member %0 with the stack address of parameter %1">, - InGroup<DanglingField>; -def warn_bind_ref_member_to_temporary : Warning< - "binding reference %select{|subobject of }1member %0 to a temporary value">, - InGroup<DanglingField>; + "initializing pointer member %0 with the stack address of " + "%select{variable|parameter}2 %1">, InGroup<DanglingField>; def note_ref_or_ptr_member_declared_here : Note< "%select{reference|pointer}0 member declared here">; -def note_ref_subobject_of_member_declared_here : Note< - "member with reference subobject declared here">; + +def err_dangling_member : Error< + "%select{reference|backing array for 'std::initializer_list'}2 " + "%select{|subobject of }1member %0 " + "%select{binds to|is}2 a temporary object " + "whose lifetime would be shorter than the lifetime of " + "the constructed object">; +def warn_dangling_member : Warning< + "%select{reference|backing array for 'std::initializer_list'}2 " + "%select{|subobject of }1member %0 " + "%select{binds to|is}2 a temporary object " + "whose lifetime is shorter than the lifetime of the constructed object">, + InGroup<DanglingField>; +def note_lifetime_extending_member_declared_here : Note< + "%select{%select{reference|'std::initializer_list'}0 member|" + "member with %select{reference|'std::initializer_list'}0 subobject}1 " + "declared here">; +def warn_dangling_variable : Warning< + "%select{temporary %select{whose address is used as value of|bound to}3 " + "%select{%select{|reference }3member of local variable|" + "local %select{variable|reference}3}1|" + "array backing " + "%select{initializer list subobject of local variable|" + "local initializer list}1}0 " + "%2 will be destroyed at the end of the full-expression">, + InGroup<Dangling>; +def warn_new_dangling_reference : Warning< + "temporary bound to reference member of allocated object " + "will be destroyed at the end of the full-expression">, + InGroup<DanglingField>; +def warn_new_dangling_initializer_list : Warning< + "array backing " + "%select{initializer list subobject of the allocated object|" + "the allocated initializer list}0 " + "will be destroyed at the end of the full-expression">, + InGroup<DanglingInitializerList>; +def warn_unsupported_lifetime_extension : Warning< + "sorry, lifetime extension of " + "%select{temporary|backing array of initializer list}0 created " + "by aggregate initialization using default member initializer " + "is not supported; lifetime of %select{temporary|backing array}0 " + "will end at the end of the full-expression">, InGroup<Dangling>; // For non-floating point, expressions of the form x == x or x != x // should result in a warning, since these always evaluate to a constant. // Array comparisons have similar warnings def warn_comparison_always : Warning< - "%select{self-|array }0comparison always evaluates to %select{false|true|a constant}1">, + "%select{self-|array }0comparison always evaluates to %select{a constant|%2}1">, InGroup<TautologicalCompare>; def warn_comparison_bitwise_always : Warning< "bitwise comparison always evaluates to %select{false|true}0">, @@ -7958,7 +7982,7 @@ def err_generic_sel_multi_match : Error< // Blocks def err_blocks_disable : Error<"blocks support disabled - compile with -fblocks" - " or %select{pick a deployment target that supports them|for OpenCL 2.0 or above}0">; + " or %select{pick a deployment target that supports them|for OpenCL 2.0}0">; def err_block_returning_array_function : Error< "block cannot return %select{array|function}0 type %1">; @@ -8197,7 +8221,10 @@ def err_altivec_empty_initializer : Error<"expected initializer">; def err_invalid_neon_type_code : Error< "incompatible constant for this __builtin_neon function">; def err_argument_invalid_range : Error< - "argument should be a value from %0 to %1">; + "argument value %0 is outside the valid range [%1, %2]">; +def warn_argument_invalid_range : Warning< + "argument value %0 is outside the valid range [%1, %2]">, DefaultError, + InGroup<DiagGroup<"argument-outside-range">>; def err_argument_not_multiple : Error< "argument should be a multiple of %0">; def warn_neon_vector_initializer_non_portable : Warning< @@ -8214,6 +8241,8 @@ def err_systemz_invalid_tabort_code : Error< "invalid transaction abort code">; def err_64_bit_builtin_32_bit_tgt : Error< "this builtin is only available on 64-bit targets">; +def err_32_bit_builtin_64_bit_tgt : Error< + "this builtin is only available on 32-bit targets">; def err_builtin_x64_aarch64_only : Error< "this builtin is only available on x86-64 and aarch64 targets">; def err_ppc_builtin_only_on_pwr7 : Error< @@ -8222,7 +8251,15 @@ def err_x86_builtin_invalid_rounding : Error< "invalid rounding argument">; def err_x86_builtin_invalid_scale : Error< "scale argument must be 1, 2, 4, or 8">; - +def err_hexagon_builtin_unsupported_cpu : Error< + "builtin is not supported on this CPU">; +def err_hexagon_builtin_requires_hvx : Error< + "builtin requires HVX">; +def err_hexagon_builtin_unsupported_hvx : Error< + "builtin is not supported on this version of HVX">; + +def err_builtin_target_unsupported : Error< + "builtin is not supported on this target">; def err_builtin_longjmp_unsupported : Error< "__builtin_longjmp is not supported for the current target">; def err_builtin_setjmp_unsupported : Error< @@ -8296,12 +8333,16 @@ def err_c99_array_usage_cxx : Error< "feature, not permitted in C++">; def err_type_unsupported : Error< "%0 is not supported on this target">; -def warn_nsconsumed_attribute_mismatch : Warning< +def err_nsconsumed_attribute_mismatch : Error< "overriding method has mismatched ns_consumed attribute on its" - " parameter">, InGroup<NSConsumedMismatch>; -def warn_nsreturns_retained_attribute_mismatch : Warning< + " parameter">; +def err_nsreturns_retained_attribute_mismatch : Error< "overriding method has mismatched ns_returns_%select{not_retained|retained}0" - " attributes">, InGroup<NSReturnsMismatch>; + " attributes">; +def warn_nsconsumed_attribute_mismatch : Warning< + err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>; +def warn_nsreturns_retained_attribute_mismatch : Warning< + err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>; def note_getter_unavailable : Note< "or because setter is declared here, but no getter method %0 is found">; @@ -8497,7 +8538,7 @@ def err_reference_pipe_type : Error < "pipes packet types cannot be of reference type">; def err_opencl_no_main : Error<"%select{function|kernel}0 cannot be called 'main'">; def err_opencl_kernel_attr : - Error<"attribute %0 can only be applied to a kernel function">; + Error<"attribute %0 can only be applied to an OpenCL kernel function">; def err_opencl_return_value_with_address_space : Error< "return value cannot be qualified with address space">; def err_opencl_constant_no_init : Error< @@ -8545,7 +8586,8 @@ def note_opencl_typedef_access_qualifier : Note< // OpenCL Section 6.8.g def err_opencl_unknown_type_specifier : Error< - "OpenCL version %0 does not support the '%1' %select{type qualifier|storage class specifier}2">; + "OpenCL %select{C|C++}0 version %1 does not support the '%2' " + "%select{type qualifier|storage class specifier}3">; // OpenCL v2.0 s6.12.5 Blocks restrictions def err_opencl_block_storage_type : Error< @@ -8635,8 +8677,8 @@ def err_omp_pointer_mapped_along_with_derived_section : Error< "pointer cannot be mapped along with a section derived from itself">; def err_omp_original_storage_is_shared_and_does_not_contain : Error< "original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage">; -def err_omp_same_pointer_derreferenced : Error< - "same pointer derreferenced in multiple different ways in map clause expressions">; +def err_omp_same_pointer_dereferenced : Error< + "same pointer dereferenced in multiple different ways in map clause expressions">; def note_omp_task_predetermined_firstprivate_here : Note< "predetermined as a firstprivate in a task construct here">; def err_omp_threadprivate_incomplete_type : Error< @@ -8972,6 +9014,9 @@ def err_omp_reduction_vla_unsupported : Error< "cannot generate code for reduction on %select{|array section, which requires a }0variable length array">; def err_omp_linear_distribute_var_non_loop_iteration : Error< "only loop iteration variables are allowed in 'linear' clause in distribute directives">; +def warn_omp_non_trivial_type_mapped : Warning< + "Non-trivial type %0 is mapped, only trivial types are guaranteed to be mapped correctly">, + InGroup<OpenMPTarget>; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { @@ -9072,9 +9117,9 @@ def note_equivalent_internal_linkage_decl : Note< "declared here%select{ in module '%1'|}0">; def note_redefinition_modules_same_file : Note< - "'%0' included multiple times, additional include site in header from module '%1'">; + "'%0' included multiple times, additional include site in header from module '%1'">; def note_redefinition_include_same_file : Note< - "'%0' included multiple times, additional include site here">; + "'%0' included multiple times, additional include site here">; } let CategoryName = "Coroutines Issue" in { @@ -9115,7 +9160,7 @@ def err_coroutine_promise_type_incomplete : Error< "this function cannot be a coroutine: %0 is an incomplete type">; def err_coroutine_type_missing_specialization : Error< "this function cannot be a coroutine: missing definition of " - "specialization %q0">; + "specialization %0">; def err_coroutine_promise_incompatible_return_functions : Error< "the coroutine promise type %0 declares both 'return_value' and 'return_void'">; def err_coroutine_promise_requires_return_function : Error< @@ -9320,8 +9365,67 @@ def ext_warn_gnu_final : ExtWarn< InGroup<GccCompat>; def warn_shadow_field : - Warning<"non-static data member '%0' of '%1' shadows member inherited from type '%2'">, + Warning<"non-static data member %0 of %1 shadows member inherited from " + "type %2">, InGroup<ShadowField>, DefaultIgnore; def note_shadow_field : Note<"declared here">; +def err_multiversion_required_in_redecl : Error< + "function declaration is missing %select{'target'|'cpu_specific' or " + "'cpu_dispatch'}0 attribute in a multiversioned function">; +def note_multiversioning_caused_here : Note< + "function multiversioning caused by this declaration">; +def err_multiversion_after_used : Error< + "function declaration cannot become a multiversioned function after first " + "usage">; +def err_bad_multiversion_option : Error< + "function multiversioning doesn't support %select{feature|architecture}0 " + "'%1'">; +def err_multiversion_duplicate : Error< + "multiversioned function redeclarations require identical target attributes">; +def err_multiversion_noproto : Error< + "multiversioned function must have a prototype">; +def err_multiversion_no_other_attrs : Error< + "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioning cannot be combined" + " with other attributes">; +def err_multiversion_diff : Error< + "multiversioned function declaration has a different %select{calling convention" + "|return type|constexpr specification|inline specification|storage class|" + "linkage}0">; +def err_multiversion_doesnt_support : Error< + "attribute '%select{target|cpu_specific|cpu_dispatch}0' multiversioned functions do not " + "yet support %select{function templates|virtual functions|" + "deduced return types|constructors|destructors|deleted functions|" + "defaulted functions|constexpr functions}1">; +def err_multiversion_not_allowed_on_main : Error< + "'main' cannot be a multiversioned function">; +def err_multiversion_not_supported : Error< + "function multiversioning is not supported on the current target">; +def err_multiversion_types_mixed : Error< + "multiversioning attributes cannot be combined">; +def err_cpu_dispatch_mismatch : Error< + "'cpu_dispatch' function redeclared with different CPUs">; +def err_cpu_specific_multiple_defs : Error< + "multiple 'cpu_specific' functions cannot specify the same CPU: %0">; +def warn_multiversion_duplicate_entries : Warning< + "CPU list contains duplicate entries; attribute ignored">, + InGroup<FunctionMultiVersioning>; +def warn_dispatch_body_ignored : Warning< + "body of cpu_dispatch function will be ignored">, + InGroup<FunctionMultiVersioning>; + +// three-way comparison operator diagnostics +def err_implied_comparison_category_type_not_found : Error< + "cannot deduce return type of 'operator<=>' because type '%0' was not found; " + "include <compare>">; +def err_spaceship_argument_narrowing : Error< + "argument to 'operator<=>' " + "%select{cannot be narrowed from type %1 to %2|" + "evaluates to %1, which cannot be narrowed to type %2}0">; +def err_std_compare_type_not_supported : Error< + "standard library implementation of %0 is not supported; " + "%select{member '%2' does not have expected form|" + "member '%2' is missing|" + "the type is not trivially copyable|" + "the type does not have the expected form}1">; } // end of sema component. diff --git a/include/clang/Basic/DiagnosticSerializationKinds.td b/include/clang/Basic/DiagnosticSerializationKinds.td index 250b49f2cac45..3a552e2f3db42 100644 --- a/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/include/clang/Basic/DiagnosticSerializationKinds.td @@ -38,8 +38,8 @@ def err_pch_targetopt_mismatch : Error< "PCH file was compiled for the %0 '%1' but the current translation " "unit is being compiled for target '%2'">; def err_pch_targetopt_feature_mismatch : Error< - "%select{AST file|current translation unit}0 was compiled with the target " - "feature'%1' but the %select{current translation unit is|AST file was}0 " + "%select{AST file was|current translation unit is}0 compiled with the target " + "feature '%1' but the %select{current translation unit is|AST file was}0 " "not">; def err_pch_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in " "PCH file but is currently %select{disabled|enabled}2">; @@ -168,11 +168,11 @@ def err_module_odr_violation_mismatch_decl : Error< "%select{definition in module '%2'|defined here}1 found " "%select{end of class|public access specifier|private access specifier|" "protected access specifier|static assert|field|method|type alias|typedef|" - "data member|friend declaration}3">; + "data member|friend declaration|function template}3">; def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found " "%select{end of class|public access specifier|private access specifier|" "protected access specifier|static assert|field|method|type alias|typedef|" - "data member|friend declaration}1">; + "data member|friend declaration|function template}1">; def err_module_odr_violation_mismatch_decl_diff : Error< "%q0 has different definitions in different modules; first difference is " @@ -192,6 +192,8 @@ def err_module_odr_violation_mismatch_decl_diff : Error< "%select{method %5|constructor|destructor}4 " "is %select{not deleted|deleted}6|" "%select{method %5|constructor|destructor}4 " + "is %select{not defaulted|defaulted}6|" + "%select{method %5|constructor|destructor}4 " "is %select{|pure }6%select{not virtual|virtual}7|" "%select{method %5|constructor|destructor}4 " "is %select{not static|static}6|" @@ -211,6 +213,16 @@ def err_module_odr_violation_mismatch_decl_diff : Error< "with %ordinal6 parameter with%select{out|}7 a default argument|" "%select{method %5|constructor|destructor}4 " "with %ordinal6 parameter with a default argument|" + "%select{method %5|constructor|destructor}4 " + "with %select{no |}6template arguments|" + "%select{method %5|constructor|destructor}4 " + "with %6 template argument%s6|" + "%select{method %5|constructor|destructor}4 " + "with %6 for %ordinal7 template argument|" + "%select{method %5|constructor|destructor}4 " + "with %select{no body|body}6|" + "%select{method %5|constructor|destructor}4 " + "with body|" "%select{typedef|type alias}4 name %5|" "%select{typedef|type alias}4 %5 with underlying type %6|" "data member with name %4|" @@ -221,6 +233,18 @@ def err_module_odr_violation_mismatch_decl_diff : Error< "friend %select{class|function}4|" "friend %4|" "friend function %4|" + "function template %4 with %5 template parameter%s5|" + "function template %4 with %ordinal5 template parameter being a " + "%select{type|non-type|template}6 template parameter|" + "function template %4 with %ordinal5 template parameter " + "%select{with no name|named %7}6|" + "function template %4 with %ordinal5 template parameter with " + "%select{no |}6default argument|" + "function template %4 with %ordinal5 template parameter with " + "default argument %6|" + "function template %4 with %ordinal5 template parameter with one type|" + "function template %4 with %ordinal5 template parameter %select{not |}6" + "being a template parameter pack|" "}3">; def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " @@ -239,6 +263,8 @@ def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " "%select{method %3|constructor|destructor}2 " "is %select{not deleted|deleted}4|" "%select{method %3|constructor|destructor}2 " + "is %select{not defaulted|defaulted}4|" + "%select{method %3|constructor|destructor}2 " "is %select{|pure }4%select{not virtual|virtual}5|" "%select{method %3|constructor|destructor}2 " "is %select{not static|static}4|" @@ -258,6 +284,16 @@ def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " "with %ordinal4 parameter with%select{out|}5 a default argument|" "%select{method %3|constructor|destructor}2 " "with %ordinal4 parameter with a different default argument|" + "%select{method %3|constructor|destructor}2 " + "with %select{no |}4template arguments|" + "%select{method %3|constructor|destructor}2 " + "with %4 template argument%s4|" + "%select{method %3|constructor|destructor}2 " + "with %4 for %ordinal5 template argument|" + "%select{method %3|constructor|destructor}2 " + "with %select{no body|body}4|" + "%select{method %3|constructor|destructor}2 " + "with different body|" "%select{typedef|type alias}2 name %3|" "%select{typedef|type alias}2 %3 with different underlying type %4|" "data member with name %2|" @@ -268,6 +304,18 @@ def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " "friend %select{class|function}2|" "friend %2|" "friend function %2|" + "function template %2 with %3 template parameter%s3|" + "function template %2 with %ordinal3 template paramter being a " + "%select{type|non-type|template}4 template parameter|" + "function template %2 with %ordinal3 template parameter " + "%select{with no name|named %5}4|" + "function template %2 with %ordinal3 template parameter with " + "%select{no |}4default argument|" + "function template %2 with %ordinal3 template parameter with " + "default argument %4|" + "function template %2 with %ordinal3 template parameter with different type|" + "function template %2 with %ordinal3 template parameter %select{not |}4" + "being a template parameter pack|" "}1">; def err_module_odr_violation_function : Error< @@ -293,6 +341,33 @@ def note_module_odr_violation_function : Note<"but in '%0' found " "a different body" "}1">; +def err_module_odr_violation_enum : Error< + "%q0 has different definitions in different modules; " + "%select{definition in module '%2'|defined here}1 " + "first difference is " + "%select{" + "enum that is %select{not scoped|scoped}4|" + "enum scoped with keyword %select{struct|class}4|" + "enum %select{without|with}4 specified type|" + "enum with specified type %4|" + "enum with %4 element%s4|" + "%ordinal4 element has name %5|" + "%ordinal4 element %5 %select{has|does not have}6 an initilizer|" + "%ordinal4 element %5 has an initializer|" + "}3">; + +def note_module_odr_violation_enum : Note<"but in '%0' found " + "%select{" + "enum that is %select{not scoped|scoped}2|" + "enum scoped with keyword %select{struct|class}2|" + "enum %select{without|with}2 specified type|" + "enum with specified type %2|" + "enum with %2 element%s2|" + "%ordinal2 element has name %3|" + "%ordinal2 element %3 %select{has|does not have}4 an initializer|" + "%ordinal2 element %3 has different initializer|" + "}1">; + def err_module_odr_violation_mismatch_decl_unknown : Error< "%q0 %select{with definition in module '%2'|defined here}1 has different " "definitions in different modules; first difference is this " diff --git a/include/clang/Basic/ExceptionSpecificationType.h b/include/clang/Basic/ExceptionSpecificationType.h index 132b5ba1e5a79..0c2c8e6d860af 100644 --- a/include/clang/Basic/ExceptionSpecificationType.h +++ b/include/clang/Basic/ExceptionSpecificationType.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the ExceptionSpecificationType enumeration and various +/// Defines the ExceptionSpecificationType enumeration and various /// utility functions. /// //===----------------------------------------------------------------------===// @@ -17,14 +17,16 @@ namespace clang { -/// \brief The various types of exception specifications that exist in C++11. +/// The various types of exception specifications that exist in C++11. enum ExceptionSpecificationType { EST_None, ///< no exception specification EST_DynamicNone, ///< throw() EST_Dynamic, ///< throw(T1, T2) EST_MSAny, ///< Microsoft throw(...) extension EST_BasicNoexcept, ///< noexcept - EST_ComputedNoexcept, ///< noexcept(expression) + EST_DependentNoexcept,///< noexcept(expression), value-dependent + EST_NoexceptFalse, ///< noexcept(expression), evals to 'false' + EST_NoexceptTrue, ///< noexcept(expression), evals to 'true' EST_Unevaluated, ///< not evaluated yet, for special member function EST_Uninstantiated, ///< not instantiated yet EST_Unparsed ///< not parsed yet @@ -34,15 +36,20 @@ inline bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType) { return ESpecType >= EST_DynamicNone && ESpecType <= EST_MSAny; } +inline bool isComputedNoexcept(ExceptionSpecificationType ESpecType) { + return ESpecType >= EST_DependentNoexcept && + ESpecType <= EST_NoexceptTrue; +} + inline bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType) { - return ESpecType == EST_BasicNoexcept || ESpecType == EST_ComputedNoexcept; + return ESpecType == EST_BasicNoexcept || isComputedNoexcept(ESpecType); } inline bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType) { return ESpecType == EST_Unevaluated || ESpecType == EST_Uninstantiated; } -/// \brief Possible results from evaluation of a noexcept expression. +/// Possible results from evaluation of a noexcept expression. enum CanThrowResult { CT_Cannot, CT_Dependent, diff --git a/include/clang/Basic/ExpressionTraits.h b/include/clang/Basic/ExpressionTraits.h index 0363a1d2c74c2..2983adde1ed65 100644 --- a/include/clang/Basic/ExpressionTraits.h +++ b/include/clang/Basic/ExpressionTraits.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines enumerations for expression traits intrinsics. +/// Defines enumerations for expression traits intrinsics. /// //===----------------------------------------------------------------------===// diff --git a/include/clang/Basic/Features.def b/include/clang/Basic/Features.def new file mode 100644 index 0000000000000..a0e0ce4560abe --- /dev/null +++ b/include/clang/Basic/Features.def @@ -0,0 +1,238 @@ +//===--- Features.def - Features and Extensions database --------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines features exposed via __has_feature and extensions exposed +// via __has_extension. Users of this file must either define the FEATURE or +// EXTENSION macros (or both) to make use of this information. Note that these +// macros expect the following declarations to be available for the Predicate: +// +// const LangOptions &LangOpts; +// const Preprocessor &PP; +// +// The Predicate field dictates the conditions under which the feature or +// extension will be made available. +//===----------------------------------------------------------------------===// + +#if !defined(FEATURE) && !defined(EXTENSION) +# error Define either the FEATURE or EXTENSION macro to handle features +#endif + +#ifndef FEATURE +#define FEATURE(Name, Predicate) +#endif + +#ifndef EXTENSION +#define EXTENSION(Name, Predicate) +#endif + +FEATURE(address_sanitizer, + LangOpts.Sanitize.hasOneOf(SanitizerKind::Address | + SanitizerKind::KernelAddress)) +FEATURE(hwaddress_sanitizer, + LangOpts.Sanitize.hasOneOf(SanitizerKind::HWAddress | + SanitizerKind::KernelHWAddress)) +FEATURE(assume_nonnull, true) +FEATURE(attribute_analyzer_noreturn, true) +FEATURE(attribute_availability, true) +FEATURE(attribute_availability_with_message, true) +FEATURE(attribute_availability_app_extension, true) +FEATURE(attribute_availability_with_version_underscores, true) +FEATURE(attribute_availability_tvos, true) +FEATURE(attribute_availability_watchos, true) +FEATURE(attribute_availability_with_strict, true) +FEATURE(attribute_availability_with_replacement, true) +FEATURE(attribute_availability_in_templates, true) +FEATURE(attribute_cf_returns_not_retained, true) +FEATURE(attribute_cf_returns_retained, true) +FEATURE(attribute_cf_returns_on_parameters, true) +FEATURE(attribute_deprecated_with_message, true) +FEATURE(attribute_deprecated_with_replacement, true) +FEATURE(attribute_ext_vector_type, true) +FEATURE(attribute_ns_returns_not_retained, true) +FEATURE(attribute_ns_returns_retained, true) +FEATURE(attribute_ns_consumes_self, true) +FEATURE(attribute_ns_consumed, true) +FEATURE(attribute_cf_consumed, true) +FEATURE(attribute_objc_ivar_unused, true) +FEATURE(attribute_objc_method_family, true) +FEATURE(attribute_overloadable, true) +FEATURE(attribute_unavailable_with_message, true) +FEATURE(attribute_unused_on_fields, true) +FEATURE(attribute_diagnose_if_objc, true) +FEATURE(blocks, LangOpts.Blocks) +FEATURE(c_thread_safety_attributes, true) +FEATURE(cxx_exceptions, LangOpts.CXXExceptions) +FEATURE(cxx_rtti, LangOpts.RTTI &&LangOpts.RTTIData) +FEATURE(enumerator_attributes, true) +FEATURE(nullability, true) +FEATURE(nullability_on_arrays, true) +FEATURE(memory_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Memory)) +FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread)) +FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow)) +FEATURE(efficiency_sanitizer, + LangOpts.Sanitize.hasOneOf(SanitizerKind::Efficiency)) +FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo)) +// Objective-C features +FEATURE(objc_arr, LangOpts.ObjCAutoRefCount) // FIXME: REMOVE? +FEATURE(objc_arc, LangOpts.ObjCAutoRefCount) +FEATURE(objc_arc_fields, true) +FEATURE(objc_arc_weak, LangOpts.ObjCWeak) +FEATURE(objc_default_synthesize_properties, LangOpts.ObjC2) +FEATURE(objc_fixed_enum, LangOpts.ObjC2) +FEATURE(objc_instancetype, LangOpts.ObjC2) +FEATURE(objc_kindof, LangOpts.ObjC2) +FEATURE(objc_modules, LangOpts.ObjC2 &&LangOpts.Modules) +FEATURE(objc_nonfragile_abi, LangOpts.ObjCRuntime.isNonFragile()) +FEATURE(objc_property_explicit_atomic, true) +FEATURE(objc_protocol_qualifier_mangling, true) +FEATURE(objc_weak_class, LangOpts.ObjCRuntime.hasWeakClassImport()) +FEATURE(ownership_holds, true) +FEATURE(ownership_returns, true) +FEATURE(ownership_takes, true) +FEATURE(objc_bool, true) +FEATURE(objc_subscripting, LangOpts.ObjCRuntime.isNonFragile()) +FEATURE(objc_array_literals, LangOpts.ObjC2) +FEATURE(objc_dictionary_literals, LangOpts.ObjC2) +FEATURE(objc_boxed_expressions, LangOpts.ObjC2) +FEATURE(objc_boxed_nsvalue_expressions, LangOpts.ObjC2) +FEATURE(arc_cf_code_audited, true) +FEATURE(objc_bridge_id, true) +FEATURE(objc_bridge_id_on_typedefs, true) +FEATURE(objc_generics, LangOpts.ObjC2) +FEATURE(objc_generics_variance, LangOpts.ObjC2) +FEATURE(objc_class_property, LangOpts.ObjC2) +// C11 features +FEATURE(c_alignas, LangOpts.C11) +FEATURE(c_alignof, LangOpts.C11) +FEATURE(c_atomic, LangOpts.C11) +FEATURE(c_generic_selections, LangOpts.C11) +FEATURE(c_static_assert, LangOpts.C11) +FEATURE(c_thread_local, LangOpts.C11 &&PP.getTargetInfo().isTLSSupported()) +// C++11 features +FEATURE(cxx_access_control_sfinae, LangOpts.CPlusPlus11) +FEATURE(cxx_alias_templates, LangOpts.CPlusPlus11) +FEATURE(cxx_alignas, LangOpts.CPlusPlus11) +FEATURE(cxx_alignof, LangOpts.CPlusPlus11) +FEATURE(cxx_atomic, LangOpts.CPlusPlus11) +FEATURE(cxx_attributes, LangOpts.CPlusPlus11) +FEATURE(cxx_auto_type, LangOpts.CPlusPlus11) +FEATURE(cxx_constexpr, LangOpts.CPlusPlus11) +FEATURE(cxx_constexpr_string_builtins, LangOpts.CPlusPlus11) +FEATURE(cxx_decltype, LangOpts.CPlusPlus11) +FEATURE(cxx_decltype_incomplete_return_types, LangOpts.CPlusPlus11) +FEATURE(cxx_default_function_template_args, LangOpts.CPlusPlus11) +FEATURE(cxx_defaulted_functions, LangOpts.CPlusPlus11) +FEATURE(cxx_delegating_constructors, LangOpts.CPlusPlus11) +FEATURE(cxx_deleted_functions, LangOpts.CPlusPlus11) +FEATURE(cxx_explicit_conversions, LangOpts.CPlusPlus11) +FEATURE(cxx_generalized_initializers, LangOpts.CPlusPlus11) +FEATURE(cxx_implicit_moves, LangOpts.CPlusPlus11) +FEATURE(cxx_inheriting_constructors, LangOpts.CPlusPlus11) +FEATURE(cxx_inline_namespaces, LangOpts.CPlusPlus11) +FEATURE(cxx_lambdas, LangOpts.CPlusPlus11) +FEATURE(cxx_local_type_template_args, LangOpts.CPlusPlus11) +FEATURE(cxx_nonstatic_member_init, LangOpts.CPlusPlus11) +FEATURE(cxx_noexcept, LangOpts.CPlusPlus11) +FEATURE(cxx_nullptr, LangOpts.CPlusPlus11) +FEATURE(cxx_override_control, LangOpts.CPlusPlus11) +FEATURE(cxx_range_for, LangOpts.CPlusPlus11) +FEATURE(cxx_raw_string_literals, LangOpts.CPlusPlus11) +FEATURE(cxx_reference_qualified_functions, LangOpts.CPlusPlus11) +FEATURE(cxx_rvalue_references, LangOpts.CPlusPlus11) +FEATURE(cxx_strong_enums, LangOpts.CPlusPlus11) +FEATURE(cxx_static_assert, LangOpts.CPlusPlus11) +FEATURE(cxx_thread_local, + LangOpts.CPlusPlus11 &&PP.getTargetInfo().isTLSSupported()) +FEATURE(cxx_trailing_return, LangOpts.CPlusPlus11) +FEATURE(cxx_unicode_literals, LangOpts.CPlusPlus11) +FEATURE(cxx_unrestricted_unions, LangOpts.CPlusPlus11) +FEATURE(cxx_user_literals, LangOpts.CPlusPlus11) +FEATURE(cxx_variadic_templates, LangOpts.CPlusPlus11) +// C++14 features +FEATURE(cxx_aggregate_nsdmi, LangOpts.CPlusPlus14) +FEATURE(cxx_binary_literals, LangOpts.CPlusPlus14) +FEATURE(cxx_contextual_conversions, LangOpts.CPlusPlus14) +FEATURE(cxx_decltype_auto, LangOpts.CPlusPlus14) +FEATURE(cxx_generic_lambdas, LangOpts.CPlusPlus14) +FEATURE(cxx_init_captures, LangOpts.CPlusPlus14) +FEATURE(cxx_relaxed_constexpr, LangOpts.CPlusPlus14) +FEATURE(cxx_return_type_deduction, LangOpts.CPlusPlus14) +FEATURE(cxx_variable_templates, LangOpts.CPlusPlus14) +// NOTE: For features covered by SD-6, it is preferable to provide *only* +// the SD-6 macro and not a __has_feature check. + +// C++ TSes +// FEATURE(cxx_runtime_arrays, LangOpts.CPlusPlusTSArrays) +// FEATURE(cxx_concepts, LangOpts.CPlusPlusTSConcepts) +// FIXME: Should this be __has_feature or __has_extension? +// FEATURE(raw_invocation_type, LangOpts.CPlusPlus) +// Type traits +// N.B. Additional type traits should not be added to the following list. +// Instead, they should be detected by has_extension. +FEATURE(has_nothrow_assign, LangOpts.CPlusPlus) +FEATURE(has_nothrow_copy, LangOpts.CPlusPlus) +FEATURE(has_nothrow_constructor, LangOpts.CPlusPlus) +FEATURE(has_trivial_assign, LangOpts.CPlusPlus) +FEATURE(has_trivial_copy, LangOpts.CPlusPlus) +FEATURE(has_trivial_constructor, LangOpts.CPlusPlus) +FEATURE(has_trivial_destructor, LangOpts.CPlusPlus) +FEATURE(has_virtual_destructor, LangOpts.CPlusPlus) +FEATURE(is_abstract, LangOpts.CPlusPlus) +FEATURE(is_base_of, LangOpts.CPlusPlus) +FEATURE(is_class, LangOpts.CPlusPlus) +FEATURE(is_constructible, LangOpts.CPlusPlus) +FEATURE(is_convertible_to, LangOpts.CPlusPlus) +FEATURE(is_empty, LangOpts.CPlusPlus) +FEATURE(is_enum, LangOpts.CPlusPlus) +FEATURE(is_final, LangOpts.CPlusPlus) +FEATURE(is_literal, LangOpts.CPlusPlus) +FEATURE(is_standard_layout, LangOpts.CPlusPlus) +FEATURE(is_pod, LangOpts.CPlusPlus) +FEATURE(is_polymorphic, LangOpts.CPlusPlus) +FEATURE(is_sealed, LangOpts.CPlusPlus &&LangOpts.MicrosoftExt) +FEATURE(is_trivial, LangOpts.CPlusPlus) +FEATURE(is_trivially_assignable, LangOpts.CPlusPlus) +FEATURE(is_trivially_constructible, LangOpts.CPlusPlus) +FEATURE(is_trivially_copyable, LangOpts.CPlusPlus) +FEATURE(is_union, LangOpts.CPlusPlus) +FEATURE(modules, LangOpts.Modules) +FEATURE(safe_stack, LangOpts.Sanitize.has(SanitizerKind::SafeStack)) +FEATURE(shadow_call_stack, + LangOpts.Sanitize.has(SanitizerKind::ShadowCallStack)) +FEATURE(tls, PP.getTargetInfo().isTLSSupported()) +FEATURE(underlying_type, LangOpts.CPlusPlus) + +// C11 features supported by other languages as extensions. +EXTENSION(c_alignas, true) +EXTENSION(c_alignof, true) +EXTENSION(c_atomic, true) +EXTENSION(c_generic_selections, true) +EXTENSION(c_static_assert, true) +EXTENSION(c_thread_local, PP.getTargetInfo().isTLSSupported()) +// C++11 features supported by other languages as extensions. +EXTENSION(cxx_atomic, LangOpts.CPlusPlus) +EXTENSION(cxx_deleted_functions, LangOpts.CPlusPlus) +EXTENSION(cxx_explicit_conversions, LangOpts.CPlusPlus) +EXTENSION(cxx_inline_namespaces, LangOpts.CPlusPlus) +EXTENSION(cxx_local_type_template_args, LangOpts.CPlusPlus) +EXTENSION(cxx_nonstatic_member_init, LangOpts.CPlusPlus) +EXTENSION(cxx_override_control, LangOpts.CPlusPlus) +EXTENSION(cxx_range_for, LangOpts.CPlusPlus) +EXTENSION(cxx_reference_qualified_functions, LangOpts.CPlusPlus) +EXTENSION(cxx_rvalue_references, LangOpts.CPlusPlus) +EXTENSION(cxx_variadic_templates, LangOpts.CPlusPlus) +// C++14 features supported by other languages as extensions. +EXTENSION(cxx_binary_literals, true) +EXTENSION(cxx_init_captures, LangOpts.CPlusPlus11) +EXTENSION(cxx_variable_templates, LangOpts.CPlusPlus) +// Miscellaneous language extensions +EXTENSION(overloadable_unmarked, true) + +#undef EXTENSION +#undef FEATURE diff --git a/include/clang/Basic/FileManager.h b/include/clang/Basic/FileManager.h index b817dd20c3013..ab5dfca716397 100644 --- a/include/clang/Basic/FileManager.h +++ b/include/clang/Basic/FileManager.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::FileManager interface and associated types. +/// Defines the clang::FileManager interface and associated types. /// //===----------------------------------------------------------------------===// @@ -40,7 +40,7 @@ namespace clang { class FileSystemStatCache; -/// \brief Cached information about one directory (either on disk or in +/// Cached information about one directory (either on disk or in /// the virtual file system). class DirectoryEntry { friend class FileManager; @@ -51,7 +51,7 @@ public: StringRef getName() const { return Name; } }; -/// \brief Cached information about one file (either on disk +/// Cached information about one file (either on disk /// or in the virtual file system). /// /// If the 'File' member is valid, then this FileEntry has an open file @@ -70,7 +70,7 @@ class FileEntry { bool InPCH; bool IsValid; // Is this \c FileEntry initialized and valid? - /// \brief The open file, if it is owned by the \p FileEntry. + /// The open file, if it is owned by the \p FileEntry. mutable std::unique_ptr<vfs::File> File; public: @@ -90,12 +90,12 @@ public: bool isInPCH() const { return InPCH; } time_t getModificationTime() const { return ModTime; } - /// \brief Return the directory the file lives in. + /// Return the directory the file lives in. const DirectoryEntry *getDir() const { return Dir; } bool operator<(const FileEntry &RHS) const { return UniqueID < RHS.UniqueID; } - /// \brief Check whether the file is a named pipe (and thus can't be opened by + /// Check whether the file is a named pipe (and thus can't be opened by /// the native FileManager methods). bool isNamedPipe() const { return IsNamedPipe; } @@ -106,7 +106,7 @@ public: struct FileData; -/// \brief Implements support for file system lookup, file system caching, +/// Implements support for file system lookup, file system caching, /// and directory search management. /// /// This also handles more advanced properties, such as uniquing files based @@ -117,21 +117,21 @@ class FileManager : public RefCountedBase<FileManager> { IntrusiveRefCntPtr<vfs::FileSystem> FS; FileSystemOptions FileSystemOpts; - /// \brief Cache for existing real directories. + /// Cache for existing real directories. std::map<llvm::sys::fs::UniqueID, DirectoryEntry> UniqueRealDirs; - /// \brief Cache for existing real files. + /// Cache for existing real files. std::map<llvm::sys::fs::UniqueID, FileEntry> UniqueRealFiles; - /// \brief The virtual directories that we have allocated. + /// The virtual directories that we have allocated. /// /// For each virtual file (e.g. foo/bar/baz.cpp), we add all of its parent /// directories (foo/ and foo/bar/) here. SmallVector<std::unique_ptr<DirectoryEntry>, 4> VirtualDirectoryEntries; - /// \brief The virtual files that we have allocated. + /// The virtual files that we have allocated. SmallVector<std::unique_ptr<FileEntry>, 4> VirtualFileEntries; - /// \brief A cache that maps paths to directory entries (either real or + /// A cache that maps paths to directory entries (either real or /// virtual) we have looked up /// /// The actual Entries for real directories/files are @@ -141,19 +141,19 @@ class FileManager : public RefCountedBase<FileManager> { /// llvm::StringMap<DirectoryEntry*, llvm::BumpPtrAllocator> SeenDirEntries; - /// \brief A cache that maps paths to file entries (either real or + /// A cache that maps paths to file entries (either real or /// virtual) we have looked up. /// /// \see SeenDirEntries llvm::StringMap<FileEntry*, llvm::BumpPtrAllocator> SeenFileEntries; - /// \brief The canonical names of directories. + /// The canonical names of directories. llvm::DenseMap<const DirectoryEntry *, llvm::StringRef> CanonicalDirNames; - /// \brief Storage for canonical names that we have computed. + /// Storage for canonical names that we have computed. llvm::BumpPtrAllocator CanonicalNameStorage; - /// \brief Each FileEntry we create is assigned a unique ID #. + /// Each FileEntry we create is assigned a unique ID #. /// unsigned NextFileUID; @@ -176,7 +176,7 @@ public: IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr); ~FileManager(); - /// \brief Installs the provided FileSystemStatCache object within + /// Installs the provided FileSystemStatCache object within /// the FileManager. /// /// Ownership of this object is transferred to the FileManager. @@ -190,13 +190,13 @@ public: void addStatCache(std::unique_ptr<FileSystemStatCache> statCache, bool AtBeginning = false); - /// \brief Removes the specified FileSystemStatCache object from the manager. + /// Removes the specified FileSystemStatCache object from the manager. void removeStatCache(FileSystemStatCache *statCache); - /// \brief Removes all FileSystemStatCache objects from the manager. + /// Removes all FileSystemStatCache objects from the manager. void clearStatCaches(); - /// \brief Lookup, cache, and verify the specified directory (real or + /// Lookup, cache, and verify the specified directory (real or /// virtual). /// /// This returns NULL if the directory doesn't exist. @@ -206,7 +206,7 @@ public: const DirectoryEntry *getDirectory(StringRef DirName, bool CacheFailure = true); - /// \brief Lookup, cache, and verify the specified file (real or + /// Lookup, cache, and verify the specified file (real or /// virtual). /// /// This returns NULL if the file doesn't exist. @@ -218,7 +218,7 @@ public: const FileEntry *getFile(StringRef Filename, bool OpenFile = false, bool CacheFailure = true); - /// \brief Returns the current file system options + /// Returns the current file system options FileSystemOptions &getFileSystemOpts() { return FileSystemOpts; } const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; } @@ -226,22 +226,22 @@ public: return FS; } - /// \brief Retrieve a file entry for a "virtual" file that acts as + /// Retrieve a file entry for a "virtual" file that acts as /// if there were a file with the given name on disk. /// /// The file itself is not accessed. const FileEntry *getVirtualFile(StringRef Filename, off_t Size, time_t ModificationTime); - /// \brief Open the specified file as a MemoryBuffer, returning a new + /// Open the specified file as a MemoryBuffer, returning a new /// MemoryBuffer if successful, otherwise returning null. llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> getBufferForFile(const FileEntry *Entry, bool isVolatile = false, bool ShouldCloseOpenFile = true); llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> - getBufferForFile(StringRef Filename); + getBufferForFile(StringRef Filename, bool isVolatile = false); - /// \brief Get the 'stat' information for the given \p Path. + /// Get the 'stat' information for the given \p Path. /// /// If the path is relative, it will be resolved against the WorkingDir of the /// FileManager's FileSystemOptions. @@ -250,10 +250,10 @@ public: bool getNoncachedStatValue(StringRef Path, vfs::Status &Result); - /// \brief Remove the real file \p Entry from the cache. + /// Remove the real file \p Entry from the cache. void invalidateCache(const FileEntry *Entry); - /// \brief If path is not absolute and FileSystemOptions set the working + /// If path is not absolute and FileSystemOptions set the working /// directory, the path is modified to be relative to the given /// working directory. /// \returns true if \c path changed. @@ -264,17 +264,17 @@ public: /// \returns true if \c Path changed to absolute. bool makeAbsolutePath(SmallVectorImpl<char> &Path) const; - /// \brief Produce an array mapping from the unique IDs assigned to each + /// Produce an array mapping from the unique IDs assigned to each /// file to the corresponding FileEntry pointer. void GetUniqueIDMapping( SmallVectorImpl<const FileEntry *> &UIDToFiles) const; - /// \brief Modifies the size and modification time of a previously created + /// Modifies the size and modification time of a previously created /// FileEntry. Use with caution. static void modifyFileEntry(FileEntry *File, off_t Size, time_t ModificationTime); - /// \brief Retrieve the canonical name for a given directory. + /// Retrieve the canonical name for a given directory. /// /// This is a very expensive operation, despite its results being cached, /// and should only be used when the physical layout of the file system is diff --git a/include/clang/Basic/FileSystemOptions.h b/include/clang/Basic/FileSystemOptions.h index 38f1346312489..8b8b13bb56869 100644 --- a/include/clang/Basic/FileSystemOptions.h +++ b/include/clang/Basic/FileSystemOptions.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::FileSystemOptions interface. +/// Defines the clang::FileSystemOptions interface. /// //===----------------------------------------------------------------------===// @@ -19,10 +19,10 @@ namespace clang { -/// \brief Keeps track of options that affect how file operations are performed. +/// Keeps track of options that affect how file operations are performed. class FileSystemOptions { public: - /// \brief If set, paths are resolved as if the working directory was + /// If set, paths are resolved as if the working directory was /// set to the value of WorkingDir. std::string WorkingDir; }; diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h index 75f986b59bddc..45aded527c1bd 100644 --- a/include/clang/Basic/FileSystemStatCache.h +++ b/include/clang/Basic/FileSystemStatCache.h @@ -1,4 +1,4 @@ -//===--- FileSystemStatCache.h - Caching for 'stat' calls -------*- C++ -*-===// +//===- FileSystemStatCache.h - Caching for 'stat' calls ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines the FileSystemStatCache interface. -/// +/// Defines the FileSystemStatCache interface. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_FILESYSTEMSTATCACHE_H @@ -17,48 +17,61 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Allocator.h" #include "llvm/Support/FileSystem.h" +#include <cstdint> +#include <ctime> #include <memory> +#include <string> +#include <utility> namespace clang { namespace vfs { + class File; class FileSystem; -} + +} // namespace vfs // FIXME: should probably replace this with vfs::Status struct FileData { std::string Name; - uint64_t Size; - time_t ModTime; + uint64_t Size = 0; + time_t ModTime = 0; llvm::sys::fs::UniqueID UniqueID; - bool IsDirectory; - bool IsNamedPipe; - bool InPCH; - bool IsVFSMapped; // FIXME: remove this when files support multiple names - FileData() - : Size(0), ModTime(0), IsDirectory(false), IsNamedPipe(false), - InPCH(false), IsVFSMapped(false) {} + bool IsDirectory = false; + bool IsNamedPipe = false; + bool InPCH = false; + + // FIXME: remove this when files support multiple names + bool IsVFSMapped = false; + + FileData() = default; }; -/// \brief Abstract interface for introducing a FileManager cache for 'stat' +/// Abstract interface for introducing a FileManager cache for 'stat' /// system calls, which is used by precompiled and pretokenized headers to /// improve performance. class FileSystemStatCache { virtual void anchor(); + protected: std::unique_ptr<FileSystemStatCache> NextStatCache; public: - virtual ~FileSystemStatCache() {} + virtual ~FileSystemStatCache() = default; enum LookupResult { - CacheExists, ///< We know the file exists and its cached stat data. - CacheMissing ///< We know that the file doesn't exist. + /// We know the file exists and its cached stat data. + CacheExists, + + /// We know that the file doesn't exist. + CacheMissing }; - /// \brief Get the 'stat' information for the specified path, using the cache + /// Get the 'stat' information for the specified path, using the cache /// to accelerate it if possible. /// /// \returns \c true if the path does not exist or \c false if it exists. @@ -72,16 +85,16 @@ public: std::unique_ptr<vfs::File> *F, FileSystemStatCache *Cache, vfs::FileSystem &FS); - /// \brief Sets the next stat call cache in the chain of stat caches. + /// Sets the next stat call cache in the chain of stat caches. /// Takes ownership of the given stat cache. void setNextStatCache(std::unique_ptr<FileSystemStatCache> Cache) { NextStatCache = std::move(Cache); } - /// \brief Retrieve the next stat call cache in the chain. + /// Retrieve the next stat call cache in the chain. FileSystemStatCache *getNextStatCache() { return NextStatCache.get(); } - /// \brief Retrieve the next stat call cache in the chain, transferring + /// Retrieve the next stat call cache in the chain, transferring /// ownership of this cache (and, transitively, all of the remaining caches) /// to the caller. std::unique_ptr<FileSystemStatCache> takeNextStatCache() { @@ -107,16 +120,16 @@ protected: } }; -/// \brief A stat "cache" that can be used by FileManager to keep +/// A stat "cache" that can be used by FileManager to keep /// track of the results of stat() calls that occur throughout the /// execution of the front end. class MemorizeStatCalls : public FileSystemStatCache { public: - /// \brief The set of stat() calls that have been seen. + /// The set of stat() calls that have been seen. llvm::StringMap<FileData, llvm::BumpPtrAllocator> StatCalls; - typedef llvm::StringMap<FileData, llvm::BumpPtrAllocator>::const_iterator - iterator; + using iterator = + llvm::StringMap<FileData, llvm::BumpPtrAllocator>::const_iterator; iterator begin() const { return StatCalls.begin(); } iterator end() const { return StatCalls.end(); } @@ -126,6 +139,6 @@ public: vfs::FileSystem &FS) override; }; -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_FILESYSTEMSTATCACHE_H diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index 8e3c15afbfcd4..f43df5c64829d 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // /// \file -/// \brief Defines the clang::IdentifierInfo, clang::IdentifierTable, and +/// Defines the clang::IdentifierInfo, clang::IdentifierTable, and /// clang::Selector interfaces. // //===----------------------------------------------------------------------===// @@ -39,7 +39,7 @@ class LangOptions; class MultiKeywordSelector; class SourceLocation; -/// \brief A simple pair of identifier info and location. +/// A simple pair of identifier info and location. using IdentifierLocPair = std::pair<IdentifierInfo *, SourceLocation>; /// One of these records is kept for each identifier that @@ -89,7 +89,7 @@ public: IdentifierInfo(const IdentifierInfo &) = delete; IdentifierInfo &operator=(const IdentifierInfo &) = delete; - /// \brief Return true if this is the identifier for the specified string. + /// Return true if this is the identifier for the specified string. /// /// This is intended to be used for string literals only: II->isStr("foo"). template <std::size_t StrLen> @@ -98,7 +98,13 @@ public: memcmp(getNameStart(), Str, StrLen-1) == 0; } - /// \brief Return the beginning of the actual null-terminated string for this + /// Return true if this is the identifier for the specified StringRef. + bool isStr(llvm::StringRef Str) const { + llvm::StringRef ThisStr(getNameStart(), getLength()); + return ThisStr == Str; + } + + /// Return the beginning of the actual null-terminated string for this /// identifier. const char *getNameStart() const { if (Entry) return Entry->getKeyData(); @@ -112,7 +118,7 @@ public: return ((const actualtype*) this)->second; } - /// \brief Efficiently return the length of this identifier info. + /// Efficiently return the length of this identifier info. unsigned getLength() const { if (Entry) return Entry->getKeyLength(); // FIXME: This is gross. It would be best not to embed specific details @@ -126,12 +132,12 @@ public: return (((unsigned) p[0]) | (((unsigned) p[1]) << 8)) - 1; } - /// \brief Return the actual identifier string. + /// Return the actual identifier string. StringRef getName() const { return StringRef(getNameStart(), getLength()); } - /// \brief Return true if this identifier is \#defined to some other value. + /// Return true if this identifier is \#defined to some other value. /// \note The current definition may be in a module and not currently visible. bool hasMacroDefinition() const { return HasMacro; @@ -147,7 +153,7 @@ public: RecomputeNeedsHandleIdentifier(); } } - /// \brief Returns true if this identifier was \#defined to some value at any + /// Returns true if this identifier was \#defined to some value at any /// moment. In this case there should be an entry for the identifier in the /// macro history table in Preprocessor. bool hadMacroDefinition() const { @@ -159,10 +165,10 @@ public: /// tokens. tok::TokenKind getTokenID() const { return (tok::TokenKind)TokenID; } - /// \brief True if revertTokenIDToIdentifier() was called. + /// True if revertTokenIDToIdentifier() was called. bool hasRevertedTokenIDToIdentifier() const { return RevertedTokenID; } - /// \brief Revert TokenID to tok::identifier; used for GNU libstdc++ 4.2 + /// Revert TokenID to tok::identifier; used for GNU libstdc++ 4.2 /// compatibility. /// /// TokenID is normally read-only but there are 2 instances where we revert it @@ -179,12 +185,12 @@ public: RevertedTokenID = false; } - /// \brief Return the preprocessor keyword ID for this identifier. + /// Return the preprocessor keyword ID for this identifier. /// /// For example, "define" will return tok::pp_define. tok::PPKeywordKind getPPKeywordID() const; - /// \brief Return the Objective-C keyword ID for the this identifier. + /// Return the Objective-C keyword ID for the this identifier. /// /// For example, 'class' will return tok::objc_class if ObjC is enabled. tok::ObjCKeywordKind getObjCKeywordID() const { @@ -195,19 +201,19 @@ public: } void setObjCKeywordID(tok::ObjCKeywordKind ID) { ObjCOrBuiltinID = ID; } - /// \brief True if setNotBuiltin() was called. + /// True if setNotBuiltin() was called. bool hasRevertedBuiltin() const { return ObjCOrBuiltinID == tok::NUM_OBJC_KEYWORDS; } - /// \brief Revert the identifier to a non-builtin identifier. We do this if + /// Revert the identifier to a non-builtin identifier. We do this if /// the name of a known builtin library function is used to declare that /// function, but an unexpected type is specified. void revertBuiltin() { setBuiltinID(0); } - /// \brief Return a value indicating whether this is a builtin function. + /// Return a value indicating whether this is a builtin function. /// /// 0 is not-built-in. 1+ are specific builtin functions. unsigned getBuiltinID() const { @@ -261,7 +267,7 @@ public: RecomputeNeedsHandleIdentifier(); } - /// \brief Return true if this token has been poisoned. + /// Return true if this token has been poisoned. bool isPoisoned() const { return IsPoisoned; } /// isCPlusPlusOperatorKeyword/setIsCPlusPlusOperatorKeyword controls whether @@ -271,10 +277,10 @@ public: } bool isCPlusPlusOperatorKeyword() const { return IsCPPOperatorKeyword; } - /// \brief Return true if this token is a keyword in the specified language. + /// Return true if this token is a keyword in the specified language. bool isKeyword(const LangOptions &LangOpts) const; - /// \brief Return true if this token is a C++ keyword in the specified + /// Return true if this token is a C++ keyword in the specified /// language. bool isCPlusPlusKeyword(const LangOptions &LangOpts) const; @@ -284,48 +290,48 @@ public: T *getFETokenInfo() const { return static_cast<T*>(FETokenInfo); } void setFETokenInfo(void *T) { FETokenInfo = T; } - /// \brief Return true if the Preprocessor::HandleIdentifier must be called + /// Return true if the Preprocessor::HandleIdentifier must be called /// on a token of this identifier. /// /// If this returns false, we know that HandleIdentifier will not affect /// the token. bool isHandleIdentifierCase() const { return NeedsHandleIdentifier; } - /// \brief Return true if the identifier in its current state was loaded + /// Return true if the identifier in its current state was loaded /// from an AST file. bool isFromAST() const { return IsFromAST; } void setIsFromAST() { IsFromAST = true; } - /// \brief Determine whether this identifier has changed since it was loaded + /// Determine whether this identifier has changed since it was loaded /// from an AST file. bool hasChangedSinceDeserialization() const { return ChangedAfterLoad; } - /// \brief Note that this identifier has changed since it was loaded from + /// Note that this identifier has changed since it was loaded from /// an AST file. void setChangedSinceDeserialization() { ChangedAfterLoad = true; } - /// \brief Determine whether the frontend token information for this + /// Determine whether the frontend token information for this /// identifier has changed since it was loaded from an AST file. bool hasFETokenInfoChangedSinceDeserialization() const { return FEChangedAfterLoad; } - /// \brief Note that the frontend token information for this identifier has + /// Note that the frontend token information for this identifier has /// changed since it was loaded from an AST file. void setFETokenInfoChangedSinceDeserialization() { FEChangedAfterLoad = true; } - /// \brief Determine whether the information for this identifier is out of + /// Determine whether the information for this identifier is out of /// date with respect to the external source. bool isOutOfDate() const { return OutOfDate; } - /// \brief Set whether the information for this identifier is out of + /// Set whether the information for this identifier is out of /// date with respect to the external source. void setOutOfDate(bool OOD) { OutOfDate = OOD; @@ -335,10 +341,10 @@ public: RecomputeNeedsHandleIdentifier(); } - /// \brief Determine whether this is the contextual keyword \c import. + /// Determine whether this is the contextual keyword \c import. bool isModulesImport() const { return IsModulesImport; } - /// \brief Set whether this identifier is the contextual keyword \c import. + /// Set whether this identifier is the contextual keyword \c import. void setModulesImport(bool I) { IsModulesImport = I; if (I) @@ -360,7 +366,7 @@ public: return getName().startswith("<#") && getName().endswith("#>"); } - /// \brief Provide less than operator for lexicographical sorting. + /// Provide less than operator for lexicographical sorting. bool operator<(const IdentifierInfo &RHS) const { return getName() < RHS.getName(); } @@ -379,7 +385,7 @@ private: } }; -/// \brief An RAII object for [un]poisoning an identifier within a scope. +/// An RAII object for [un]poisoning an identifier within a scope. /// /// \p II is allowed to be null, in which case objects of this type have /// no effect. @@ -400,7 +406,7 @@ public: } }; -/// \brief An iterator that walks over all of the known identifiers +/// An iterator that walks over all of the known identifiers /// in the lookup table. /// /// Since this iterator uses an abstract interface via virtual @@ -420,7 +426,7 @@ public: virtual ~IdentifierIterator(); - /// \brief Retrieve the next string in the identifier table and + /// Retrieve the next string in the identifier table and /// advances the iterator for the following string. /// /// \returns The next string in the identifier table. If there is @@ -428,19 +434,19 @@ public: virtual StringRef Next() = 0; }; -/// \brief Provides lookups to, and iteration over, IdentiferInfo objects. +/// Provides lookups to, and iteration over, IdentiferInfo objects. class IdentifierInfoLookup { public: virtual ~IdentifierInfoLookup(); - /// \brief Return the IdentifierInfo for the specified named identifier. + /// Return the IdentifierInfo for the specified named identifier. /// /// Unlike the version in IdentifierTable, this returns a pointer instead /// of a reference. If the pointer is null then the IdentifierInfo cannot /// be found. virtual IdentifierInfo* get(StringRef Name) = 0; - /// \brief Retrieve an iterator into the set of all identifiers + /// Retrieve an iterator into the set of all identifiers /// known to this identifier lookup source. /// /// This routine provides access to all of the identifiers known to @@ -453,7 +459,7 @@ public: virtual IdentifierIterator *getIdentifiers(); }; -/// \brief Implements an efficient mapping from strings to IdentifierInfo nodes. +/// Implements an efficient mapping from strings to IdentifierInfo nodes. /// /// This has no other purpose, but this is an extremely performance-critical /// piece of the code, as each occurrence of every identifier goes through @@ -467,17 +473,20 @@ class IdentifierTable { IdentifierInfoLookup* ExternalLookup; public: - /// \brief Create the identifier table, populating it with info about the + /// Create the identifier table. + explicit IdentifierTable(IdentifierInfoLookup *ExternalLookup = nullptr); + + /// Create the identifier table, populating it with info about the /// language keywords for the language specified by \p LangOpts. - IdentifierTable(const LangOptions &LangOpts, - IdentifierInfoLookup* externalLookup = nullptr); + explicit IdentifierTable(const LangOptions &LangOpts, + IdentifierInfoLookup *ExternalLookup = nullptr); - /// \brief Set the external identifier lookup mechanism. + /// Set the external identifier lookup mechanism. void setExternalIdentifierLookup(IdentifierInfoLookup *IILookup) { ExternalLookup = IILookup; } - /// \brief Retrieve the external identifier lookup object, if any. + /// Retrieve the external identifier lookup object, if any. IdentifierInfoLookup *getExternalIdentifierLookup() const { return ExternalLookup; } @@ -486,7 +495,7 @@ public: return HashTable.getAllocator(); } - /// \brief Return the identifier token info for the specified named + /// Return the identifier token info for the specified named /// identifier. IdentifierInfo &get(StringRef Name) { auto &Entry = *HashTable.insert(std::make_pair(Name, nullptr)).first; @@ -519,7 +528,7 @@ public: return II; } - /// \brief Gets an IdentifierInfo for the given name without consulting + /// Gets an IdentifierInfo for the given name without consulting /// external sources. /// /// This is a version of get() meant for external sources that want to @@ -554,14 +563,16 @@ public: iterator end() const { return HashTable.end(); } unsigned size() const { return HashTable.size(); } - /// \brief Print some statistics to stderr that indicate how well the + /// Print some statistics to stderr that indicate how well the /// hashing is doing. void PrintStats() const; + /// Populate the identifier table with info about the language keywords + /// for the language specified by \p LangOpts. void AddKeywords(const LangOptions &LangOpts); }; -/// \brief A family of Objective-C methods. +/// A family of Objective-C methods. /// /// These families have no inherent meaning in the language, but are /// nonetheless central enough in the existing implementations to @@ -579,7 +590,7 @@ public: /// explicitly change or remove a method's family. Therefore the /// method's family should be considered the single source of truth. enum ObjCMethodFamily { - /// \brief No particular method family. + /// No particular method family. OMF_None, // Selectors in these families may have arbitrary arity, may be @@ -611,10 +622,10 @@ enum ObjCMethodFamily { /// InvalidObjCMethodFamily. enum { ObjCMethodFamilyBitWidth = 4 }; -/// \brief An invalid value of ObjCMethodFamily. +/// An invalid value of ObjCMethodFamily. enum { InvalidObjCMethodFamily = (1 << ObjCMethodFamilyBitWidth) - 1 }; -/// \brief A family of Objective-C methods. +/// A family of Objective-C methods. /// /// These are family of methods whose result type is initially 'id', but /// but are candidate for the result type to be changed to 'instancetype'. @@ -633,7 +644,7 @@ enum ObjCStringFormatFamily { SFF_CFString }; -/// \brief Smart pointer class that efficiently represents Objective-C method +/// Smart pointer class that efficiently represents Objective-C method /// names. /// /// This class will either point to an IdentifierInfo or a @@ -706,7 +717,7 @@ public: return reinterpret_cast<void*>(InfoPtr); } - /// \brief Determine whether this is the empty selector. + /// Determine whether this is the empty selector. bool isNull() const { return InfoPtr == 0; } // Predicates to identify the selector type. @@ -720,7 +731,7 @@ public: unsigned getNumArgs() const; - /// \brief Retrieve the identifier at a given position in the selector. + /// Retrieve the identifier at a given position in the selector. /// /// Note that the identifier pointer returned may be NULL. Clients that only /// care about the text of the identifier string, and not the specific, @@ -735,7 +746,7 @@ public: /// no corresponding identifier. IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const; - /// \brief Retrieve the name at a given position in the selector. + /// Retrieve the name at a given position in the selector. /// /// \param argIndex The index for which we want to retrieve the name. /// This index shall be less than \c getNumArgs() unless this is a keyword @@ -745,14 +756,16 @@ public: /// name was supplied. StringRef getNameForSlot(unsigned argIndex) const; - /// \brief Derive the full selector name (e.g. "foo:bar:") and return + /// Derive the full selector name (e.g. "foo:bar:") and return /// it as an std::string. std::string getAsString() const; - /// \brief Prints the full selector name (e.g. "foo:bar:"). + /// Prints the full selector name (e.g. "foo:bar:"). void print(llvm::raw_ostream &OS) const; - /// \brief Derive the conventional family of this method. + void dump() const; + + /// Derive the conventional family of this method. ObjCMethodFamily getMethodFamily() const { return getMethodFamilyImpl(*this); } @@ -772,7 +785,7 @@ public: static ObjCInstanceTypeFamily getInstTypeMethodFamily(Selector sel); }; -/// \brief This table allows us to fully hide how we implement +/// This table allows us to fully hide how we implement /// multi-keyword caching. class SelectorTable { // Actually a SelectorTableImpl @@ -784,7 +797,7 @@ public: SelectorTable &operator=(const SelectorTable &) = delete; ~SelectorTable(); - /// \brief Can create any sort of selector. + /// Can create any sort of selector. /// /// \p NumArgs indicates whether this is a no argument selector "foo", a /// single argument selector "foo:" or multi-argument "foo:bar:". @@ -798,22 +811,25 @@ public: return Selector(ID, 0); } - /// \brief Return the total amount of memory allocated for managing selectors. + /// Return the total amount of memory allocated for managing selectors. size_t getTotalMemory() const; - /// \brief Return the default setter name for the given identifier. + /// Return the default setter name for the given identifier. /// /// This is "set" + \p Name where the initial character of \p Name /// has been capitalized. static SmallString<64> constructSetterName(StringRef Name); - /// \brief Return the default setter selector for the given identifier. + /// Return the default setter selector for the given identifier. /// /// This is "set" + \p Name where the initial character of \p Name /// has been capitalized. static Selector constructSetterSelector(IdentifierTable &Idents, SelectorTable &SelTable, const IdentifierInfo *Name); + + /// Return the property name for the given setter selector. + static std::string getPropertyNameFromSetterSelector(Selector Sel); }; /// DeclarationNameExtra - Common base of the MultiKeywordSelector, diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h index e60284d1b4459..8a432db911daf 100644 --- a/include/clang/Basic/LLVM.h +++ b/include/clang/Basic/LLVM.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // /// \file -/// \brief Forward-declares and imports various common LLVM datatypes that +/// Forward-declares and imports various common LLVM datatypes that /// clang wants to use unqualified. /// //===----------------------------------------------------------------------===// @@ -28,6 +28,7 @@ namespace llvm { // ADT's. class StringRef; class Twine; + class VersionTuple; template<typename T> class ArrayRef; template<typename T> class MutableArrayRef; template<typename T> class OwningArrayRef; @@ -60,17 +61,18 @@ namespace clang { using llvm::cast_or_null; // ADT's. - using llvm::None; - using llvm::Optional; - using llvm::StringRef; - using llvm::Twine; using llvm::ArrayRef; using llvm::MutableArrayRef; + using llvm::None; + using llvm::Optional; using llvm::OwningArrayRef; + using llvm::SaveAndRestore; using llvm::SmallString; using llvm::SmallVector; using llvm::SmallVectorImpl; - using llvm::SaveAndRestore; + using llvm::StringRef; + using llvm::Twine; + using llvm::VersionTuple; // Error handling. using llvm::Expected; diff --git a/include/clang/Basic/Lambda.h b/include/clang/Basic/Lambda.h index 1c19f1dcc8b1c..675854e67e7ad 100644 --- a/include/clang/Basic/Lambda.h +++ b/include/clang/Basic/Lambda.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines several types used to describe C++ lambda expressions +/// Defines several types used to describe C++ lambda expressions /// that are shared between the parser and AST. /// //===----------------------------------------------------------------------===// @@ -19,14 +19,14 @@ namespace clang { -/// \brief The default, if any, capture method for a lambda expression. +/// The default, if any, capture method for a lambda expression. enum LambdaCaptureDefault { LCD_None, LCD_ByCopy, LCD_ByRef }; -/// \brief The different capture forms in a lambda introducer +/// The different capture forms in a lambda introducer /// /// C++11 allows capture of \c this, or of local variables by copy or /// by reference. C++1y also allows "init-capture", where the initializer diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def index ca3a0e349d62f..fc38af5b03f6e 100644 --- a/include/clang/Basic/LangOptions.def +++ b/include/clang/Basic/LangOptions.def @@ -106,6 +106,7 @@ LANGOPT(LineComment , 1, 0, "'//' comments") LANGOPT(Bool , 1, 0, "bool, true, and false keywords") LANGOPT(Half , 1, 0, "half keyword") LANGOPT(WChar , 1, CPlusPlus, "wchar_t keyword") +LANGOPT(Char8 , 1, 0, "char8_t keyword") LANGOPT(DeclSpecKeyword , 1, 0, "__declspec keyword") BENIGN_LANGOPT(DollarIdents , 1, 1, "'$' in identifiers") BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode") @@ -153,6 +154,7 @@ COMPATIBLE_LANGOPT(ModulesTS , 1, 0, "C++ Modules TS") BENIGN_ENUM_LANGOPT(CompilingModule, CompilingModuleKind, 2, CMK_None, "compiling a module interface") BENIGN_LANGOPT(CompilingPCH, 1, 0, "building a pch") +BENIGN_LANGOPT(BuildingPCHWithObjectFile, 1, 0, "building a pch which has a corresponding object file") COMPATIBLE_LANGOPT(ModulesDeclUse , 1, 0, "require declaration of module uses") BENIGN_LANGOPT(ModulesSearchAll , 1, 1, "searching even non-imported modules to find unresolved references") COMPATIBLE_LANGOPT(ModulesStrictDeclUse, 1, 0, "requiring declaration of module uses and all headers to be in modules") @@ -188,21 +190,27 @@ ENUM_LANGOPT(DefaultCallingConv, DefaultCallingConvention, 3, DCC_None, "default LANGOPT(ShortEnums , 1, 0, "short enum types") LANGOPT(OpenCL , 1, 0, "OpenCL") -LANGOPT(OpenCLVersion , 32, 0, "OpenCL version") +LANGOPT(OpenCLVersion , 32, 0, "OpenCL C version") +LANGOPT(OpenCLCPlusPlus , 1, 0, "OpenCL C++") +LANGOPT(OpenCLCPlusPlusVersion , 32, 0, "OpenCL C++ version") LANGOPT(NativeHalfType , 1, 0, "Native half type support") LANGOPT(NativeHalfArgsAndReturns, 1, 0, "Native half args and returns") LANGOPT(HalfArgsAndReturns, 1, 0, "half args and returns") LANGOPT(CUDA , 1, 0, "CUDA") +LANGOPT(HIP , 1, 0, "HIP") LANGOPT(OpenMP , 32, 0, "OpenMP support and version of OpenMP (31, 40 or 45)") +LANGOPT(OpenMPSimd , 1, 0, "Use SIMD only OpenMP support.") LANGOPT(OpenMPUseTLS , 1, 0, "Use TLS for threadprivates or runtime calls") LANGOPT(OpenMPIsDevice , 1, 0, "Generate code only for OpenMP target device") +LANGOPT(OpenMPCUDAMode , 1, 0, "Generate code for OpenMP pragmas in SIMT/SPMD mode") +LANGOPT(OpenMPHostCXXExceptions , 1, 0, "C++ exceptions handling in the host code.") LANGOPT(RenderScript , 1, 0, "RenderScript") LANGOPT(CUDAIsDevice , 1, 0, "compiling for CUDA device") LANGOPT(CUDAAllowVariadicFunctions, 1, 0, "allowing variadic functions in CUDA device code") LANGOPT(CUDAHostDeviceConstexpr, 1, 1, "treating unattributed constexpr functions as __host__ __device__") -LANGOPT(CUDADeviceFlushDenormalsToZero, 1, 0, "flushing denormals to zero") LANGOPT(CUDADeviceApproxTranscendentals, 1, 0, "using approximate transcendental functions") +LANGOPT(CUDARelocatableDeviceCode, 1, 0, "generate relocatable device code") LANGOPT(SizedDeallocation , 1, 0, "sized deallocation") LANGOPT(AlignedAllocation , 1, 0, "aligned allocation") @@ -225,7 +233,7 @@ BENIGN_LANGOPT(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and su BENIGN_LANGOPT(SpellChecking , 1, 1, "spell-checking") LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants") LANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math") -/// \brief FP_CONTRACT mode (on/off/fast). +/// FP_CONTRACT mode (on/off/fast). ENUM_LANGOPT(DefaultFPContractMode, FPContractModeKind, 2, FPC_Off, "FP contraction type") LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment") LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility") @@ -233,11 +241,16 @@ LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting") LANGOPT(ObjCWeakRuntime , 1, 0, "__weak support in the ARC runtime") LANGOPT(ObjCWeak , 1, 0, "Objective-C __weak in ARC and MRC files") LANGOPT(ObjCSubscriptingLegacyRuntime , 1, 0, "Subscripting support in legacy ObjectiveC runtime") +LANGOPT(CFProtectionBranch , 1, 0, "Control-Flow Branch Protection enabled") LANGOPT(FakeAddressSpaceMap , 1, 0, "OpenCL fake address space map") ENUM_LANGOPT(AddressSpaceMapMangling , AddrSpaceMapMangling, 2, ASMM_Target, "OpenCL address space map mangling mode") LANGOPT(IncludeDefaultHeader, 1, 0, "Include default header file for OpenCL") BENIGN_LANGOPT(DelayedTemplateParsing , 1, 0, "delayed template parsing") LANGOPT(BlocksRuntimeOptional , 1, 0, "optional blocks runtime") +LANGOPT( + CompleteMemberPointers, 1, 0, + "Require member pointer base types to be complete at the point where the " + "type's inheritance model would be determined under the Microsoft ABI") ENUM_LANGOPT(GC, GCMode, 2, NonGC, "Objective-C Garbage Collection mode") ENUM_LANGOPT(ValueVisibilityMode, Visibility, 3, DefaultVisibility, @@ -276,10 +289,25 @@ LANGOPT(XRayInstrument, 1, 0, "controls whether to do XRay instrumentation") LANGOPT(XRayAlwaysEmitCustomEvents, 1, 0, "controls whether to always emit intrinsic calls to " "__xray_customevent(...) builtin.") +LANGOPT(XRayAlwaysEmitTypedEvents, 1, 0, + "controls whether to always emit intrinsic calls to " + "__xray_typedevent(...) builtin.") + +LANGOPT(ForceEmitVTables, 1, 0, "whether to emit all vtables") BENIGN_LANGOPT(AllowEditorPlaceholders, 1, 0, "allow editor placeholders in source") +ENUM_LANGOPT(ClangABICompat, ClangABI, 4, ClangABI::Latest, + "version of Clang that we should attempt to be ABI-compatible " + "with") + +COMPATIBLE_VALUE_LANGOPT(FunctionAlignment, 5, 0, "Default alignment for functions") + +LANGOPT(FixedPoint, 1, 0, "fixed point types") +LANGOPT(PaddingOnUnsignedFixedPoint, 1, 0, + "unsigned fixed point types having one extra padding bit") + #undef LANGOPT #undef COMPATIBLE_LANGOPT #undef BENIGN_LANGOPT @@ -289,4 +317,3 @@ BENIGN_LANGOPT(AllowEditorPlaceholders, 1, 0, #undef VALUE_LANGOPT #undef COMPATIBLE_VALUE_LANGOPT #undef BENIGN_VALUE_LANGOPT - diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h index f7a43adefad0c..f3a6292e5adea 100644 --- a/include/clang/Basic/LangOptions.h +++ b/include/clang/Basic/LangOptions.h @@ -1,4 +1,4 @@ -//===--- LangOptions.h - C Language Family Language Options -----*- C++ -*-===// +//===- LangOptions.h - C Language Family Language Options -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines the clang::LangOptions interface. -/// +/// Defines the clang::LangOptions interface. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_LANGOPTIONS_H @@ -20,6 +20,8 @@ #include "clang/Basic/ObjCRuntime.h" #include "clang/Basic/Sanitizers.h" #include "clang/Basic/Visibility.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Triple.h" #include <string> #include <vector> @@ -43,26 +45,36 @@ protected: #include "clang/Basic/LangOptions.def" }; -/// \brief Keeps track of the various options that can be +/// Keeps track of the various options that can be /// enabled, which controls the dialect of C or C++ that is accepted. class LangOptions : public LangOptionsBase { public: - typedef clang::Visibility Visibility; + using Visibility = clang::Visibility; enum GCMode { NonGC, GCOnly, HybridGC }; enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq }; enum SignedOverflowBehaviorTy { - SOB_Undefined, // Default C standard behavior. - SOB_Defined, // -fwrapv - SOB_Trapping // -ftrapv + // Default C standard behavior. + SOB_Undefined, + + // -fwrapv + SOB_Defined, + + // -ftrapv + SOB_Trapping }; // FIXME: Unify with TUKind. enum CompilingModuleKind { - CMK_None, ///< Not compiling a module interface at all. - CMK_ModuleMap, ///< Compiling a module from a module map. - CMK_ModuleInterface ///< Compiling a C++ modules TS module interface unit. + /// Not compiling a module interface at all. + CMK_None, + + /// Compiling a module from a module map. + CMK_ModuleMap, + + /// Compiling a C++ modules TS module interface unit. + CMK_ModuleInterface }; enum PragmaMSPointersToMembersKind { @@ -90,69 +102,109 @@ public: MSVC2015 = 19 }; + /// Clang versions with different platform ABI conformance. + enum class ClangABI { + /// Attempt to be ABI-compatible with code generated by Clang 3.8.x + /// (SVN r257626). This causes <1 x long long> to be passed in an + /// integer register instead of an SSE register on x64_64. + Ver3_8, + + /// Attempt to be ABI-compatible with code generated by Clang 4.0.x + /// (SVN r291814). This causes move operations to be ignored when + /// determining whether a class type can be passed or returned directly. + Ver4, + + /// Attempt to be ABI-compatible with code generated by Clang 6.0.x + /// (SVN r321711). This causes determination of whether a type is + /// standard-layout to ignore collisions between empty base classes + /// and between base classes and member subobjects, which affects + /// whether we reuse base class tail padding in some ABIs. + Ver6, + + /// Conform to the underlying platform's C and C++ ABIs as closely + /// as we can. + Latest + }; + enum FPContractModeKind { - FPC_Off, // Form fused FP ops only where result will not be affected. - FPC_On, // Form fused FP ops according to FP_CONTRACT rules. - FPC_Fast // Aggressively fuse FP ops (E.g. FMA). + // Form fused FP ops only where result will not be affected. + FPC_Off, + + // Form fused FP ops according to FP_CONTRACT rules. + FPC_On, + + // Aggressively fuse FP ops (E.g. FMA). + FPC_Fast }; public: - /// \brief Set of enabled sanitizers. + /// Set of enabled sanitizers. SanitizerSet Sanitize; - /// \brief Paths to blacklist files specifying which objects + /// Paths to blacklist files specifying which objects /// (files, functions, variables) should not be instrumented. std::vector<std::string> SanitizerBlacklistFiles; - /// \brief Paths to the XRay "always instrument" files specifying which + /// Paths to the XRay "always instrument" files specifying which /// objects (files, functions, variables) should be imbued with the XRay /// "always instrument" attribute. + /// WARNING: This is a deprecated field and will go away in the future. std::vector<std::string> XRayAlwaysInstrumentFiles; - /// \brief Paths to the XRay "never instrument" files specifying which + /// Paths to the XRay "never instrument" files specifying which /// objects (files, functions, variables) should be imbued with the XRay /// "never instrument" attribute. + /// WARNING: This is a deprecated field and will go away in the future. std::vector<std::string> XRayNeverInstrumentFiles; + /// Paths to the XRay attribute list files, specifying which objects + /// (files, functions, variables) should be imbued with the appropriate XRay + /// attribute(s). + std::vector<std::string> XRayAttrListFiles; + clang::ObjCRuntime ObjCRuntime; std::string ObjCConstantStringClass; - /// \brief The name of the handler function to be called when -ftrapv is + /// The name of the handler function to be called when -ftrapv is /// specified. /// /// If none is specified, abort (GCC-compatible behaviour). std::string OverflowHandler; - /// \brief The name of the current module, of which the main source file + /// The module currently being compiled as speficied by -fmodule-name. + std::string ModuleName; + + /// The name of the current module, of which the main source file /// is a part. If CompilingModule is set, we are compiling the interface /// of this module, otherwise we are compiling an implementation file of - /// it. + /// it. This starts as ModuleName in case -fmodule-name is provided and + /// changes during compilation to reflect the current module. std::string CurrentModule; - /// \brief The names of any features to enable in module 'requires' decls + /// The names of any features to enable in module 'requires' decls /// in addition to the hard-coded list in Module.cpp and the target features. /// /// This list is sorted. std::vector<std::string> ModuleFeatures; - /// \brief Options for parsing comments. + /// Options for parsing comments. CommentOptions CommentOpts; - /// \brief A list of all -fno-builtin-* function names (e.g., memset). + /// A list of all -fno-builtin-* function names (e.g., memset). std::vector<std::string> NoBuiltinFuncs; - /// \brief Triples of the OpenMP targets that the host code codegen should + /// Triples of the OpenMP targets that the host code codegen should /// take into account in order to generate accurate offloading descriptors. std::vector<llvm::Triple> OMPTargetTriples; - /// \brief Name of the IR file that contains the result of the OpenMP target + /// Name of the IR file that contains the result of the OpenMP target /// host code generation. std::string OMPHostIRFile; - /// \brief Indicates whether the front-end is explicitly told that the + /// Indicates whether the front-end is explicitly told that the /// input is a header file (i.e. -x c-header). - bool IsHeaderFile; + bool IsHeaderFile = false; LangOptions(); @@ -186,15 +238,15 @@ public: return MSCompatibilityVersion >= MajorVersion * 10000000U; } - /// \brief Reset all of the options that are not considered when building a + /// Reset all of the options that are not considered when building a /// module. void resetNonModularOptions(); - /// \brief Is this a libc/libm function that is no longer recognized as a + /// Is this a libc/libm function that is no longer recognized as a /// builtin because a -fno-builtin-* option has been specified? bool isNoBuiltinFunc(StringRef Name) const; - /// \brief True if any ObjC types may have non-trivial lifetime qualifiers. + /// True if any ObjC types may have non-trivial lifetime qualifiers. bool allowsNonTrivialObjCLifetimeQualifiers() const { return ObjCAutoRefCount || ObjCWeak; } @@ -202,9 +254,12 @@ public: bool assumeFunctionsAreConvergent() const { return (CUDA && CUDAIsDevice) || OpenCL; } + + /// Return the OpenCL C or C++ version as a VersionTuple. + VersionTuple getOpenCLVersionTuple() const; }; -/// \brief Floating point control options +/// Floating point control options class FPOptions { public: FPOptions() : fp_contract(LangOptions::FPC_Off) {} @@ -219,15 +274,19 @@ public: bool allowFPContractWithinStatement() const { return fp_contract == LangOptions::FPC_On; } + bool allowFPContractAcrossStatement() const { return fp_contract == LangOptions::FPC_Fast; } + void setAllowFPContractWithinStatement() { fp_contract = LangOptions::FPC_On; } + void setAllowFPContractAcrossStatement() { fp_contract = LangOptions::FPC_Fast; } + void setDisallowFPContract() { fp_contract = LangOptions::FPC_Off; } /// Used to serialize this. @@ -238,17 +297,19 @@ private: unsigned fp_contract : 2; }; -/// \brief Describes the kind of translation unit being processed. +/// Describes the kind of translation unit being processed. enum TranslationUnitKind { - /// \brief The translation unit is a complete translation unit. + /// The translation unit is a complete translation unit. TU_Complete, - /// \brief The translation unit is a prefix to a translation unit, and is + + /// The translation unit is a prefix to a translation unit, and is /// not complete. TU_Prefix, - /// \brief The translation unit is a module. + + /// The translation unit is a module. TU_Module }; -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_LANGOPTIONS_H diff --git a/include/clang/Basic/Linkage.h b/include/clang/Basic/Linkage.h index 6ec8763f24910..94dcfd445b0b7 100644 --- a/include/clang/Basic/Linkage.h +++ b/include/clang/Basic/Linkage.h @@ -1,4 +1,4 @@ -//===--- Linkage.h - Linkage enumeration and utilities ----------*- C++ -*-===// +//===- Linkage.h - Linkage enumeration and utilities ------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,33 +6,32 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines the Linkage enumeration and various utility functions. -/// +/// Defines the Linkage enumeration and various utility functions. +// //===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_BASIC_LINKAGE_H #define LLVM_CLANG_BASIC_LINKAGE_H -#include <assert.h> -#include <stdint.h> #include <utility> namespace clang { -/// \brief Describes the different kinds of linkage +/// Describes the different kinds of linkage /// (C++ [basic.link], C99 6.2.2) that an entity may have. enum Linkage : unsigned char { - /// \brief No linkage, which means that the entity is unique and + /// No linkage, which means that the entity is unique and /// can only be referred to from within its scope. NoLinkage = 0, - /// \brief Internal linkage, which indicates that the entity can + /// Internal linkage, which indicates that the entity can /// be referred to from within the translation unit (but not other /// translation units). InternalLinkage, - /// \brief External linkage within a unique namespace. + /// External linkage within a unique namespace. /// /// From the language perspective, these entities have external /// linkage. However, since they reside in an anonymous namespace, @@ -41,27 +40,27 @@ enum Linkage : unsigned char { /// point of view. UniqueExternalLinkage, - /// \brief No linkage according to the standard, but is visible from other + /// No linkage according to the standard, but is visible from other /// translation units because of types defined in a inline function. VisibleNoLinkage, - /// \brief Internal linkage according to the Modules TS, but can be referred + /// Internal linkage according to the Modules TS, but can be referred /// to from other translation units indirectly through inline functions and /// templates in the module interface. ModuleInternalLinkage, - /// \brief Module linkage, which indicates that the entity can be referred + /// Module linkage, which indicates that the entity can be referred /// to from other translation units within the same module, and indirectly /// from arbitrary other translation units through inline functions and /// templates in the module interface. ModuleLinkage, - /// \brief External linkage, which indicates that the entity can + /// External linkage, which indicates that the entity can /// be referred to from other translation units. ExternalLinkage }; -/// \brief Describes the different kinds of language linkage +/// Describes the different kinds of language linkage /// (C++ [dcl.link]) that an entity may have. enum LanguageLinkage { CLanguageLinkage, @@ -69,7 +68,7 @@ enum LanguageLinkage { NoLanguageLinkage }; -/// \brief A more specific kind of linkage than enum Linkage. +/// A more specific kind of linkage than enum Linkage. /// /// This is relevant to CodeGen and AST file reading. enum GVALinkage { @@ -105,7 +104,7 @@ inline bool isExternalFormalLinkage(Linkage L) { return getFormalLinkage(L) == ExternalLinkage; } -/// \brief Compute the minimum linkage given two linkages. +/// Compute the minimum linkage given two linkages. /// /// The linkage can be interpreted as a pair formed by the formal linkage and /// a boolean for external visibility. This is just what getFormalLinkage and @@ -125,6 +124,6 @@ inline Linkage minLinkage(Linkage L1, Linkage L2) { return L1 < L2 ? L1 : L2; } -} // end namespace clang +} // namespace clang #endif // LLVM_CLANG_BASIC_LINKAGE_H diff --git a/include/clang/Basic/MacroBuilder.h b/include/clang/Basic/MacroBuilder.h index 9a9eaa24983ca..b2edc972fee22 100644 --- a/include/clang/Basic/MacroBuilder.h +++ b/include/clang/Basic/MacroBuilder.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::MacroBuilder utility class. +/// Defines the clang::MacroBuilder utility class. /// //===----------------------------------------------------------------------===// diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h index 6631721e35314..4aebda1887c45 100644 --- a/include/clang/Basic/Module.h +++ b/include/clang/Basic/Module.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // /// \file -/// \brief Defines the clang::Module class, which describes a module in the +/// Defines the clang::Module class, which describes a module in the /// source code. // //===----------------------------------------------------------------------===// @@ -48,7 +48,7 @@ namespace clang { class LangOptions; class TargetInfo; -/// \brief Describes the name of a module. +/// Describes the name of a module. using ModuleId = SmallVector<std::pair<std::string, SourceLocation>, 2>; /// The signature of a module, which is a hash of the AST content. @@ -61,76 +61,76 @@ struct ASTFileSignature : std::array<uint32_t, 5> { } }; -/// \brief Describes a module or submodule. +/// Describes a module or submodule. class Module { public: - /// \brief The name of this module. + /// The name of this module. std::string Name; - /// \brief The location of the module definition. + /// The location of the module definition. SourceLocation DefinitionLoc; enum ModuleKind { - /// \brief This is a module that was defined by a module map and built out + /// This is a module that was defined by a module map and built out /// of header files. ModuleMapModule, - /// \brief This is a C++ Modules TS module interface unit. + /// This is a C++ Modules TS module interface unit. ModuleInterfaceUnit, - /// \brief This is a fragment of the global module within some C++ Modules + /// This is a fragment of the global module within some C++ Modules /// TS module. GlobalModuleFragment, }; - /// \brief The kind of this module. + /// The kind of this module. ModuleKind Kind = ModuleMapModule; - /// \brief The parent of this module. This will be NULL for the top-level + /// The parent of this module. This will be NULL for the top-level /// module. Module *Parent; - /// \brief The build directory of this module. This is the directory in + /// The build directory of this module. This is the directory in /// which the module is notionally built, and relative to which its headers /// are found. const DirectoryEntry *Directory = nullptr; - /// \brief The presumed file name for the module map defining this module. + /// The presumed file name for the module map defining this module. /// Only non-empty when building from preprocessed source. std::string PresumedModuleMapFile; - /// \brief The umbrella header or directory. + /// The umbrella header or directory. llvm::PointerUnion<const DirectoryEntry *, const FileEntry *> Umbrella; - /// \brief The module signature. + /// The module signature. ASTFileSignature Signature; - /// \brief The name of the umbrella entry, as written in the module map. + /// The name of the umbrella entry, as written in the module map. std::string UmbrellaAsWritten; - /// \brief The module through which entities defined in this module will + /// The module through which entities defined in this module will /// eventually be exposed, for use in "private" modules. std::string ExportAsModule; private: - /// \brief The submodules of this module, indexed by name. + /// The submodules of this module, indexed by name. std::vector<Module *> SubModules; - /// \brief A mapping from the submodule name to the index into the + /// A mapping from the submodule name to the index into the /// \c SubModules vector at which that submodule resides. llvm::StringMap<unsigned> SubModuleIndex; - /// \brief The AST file if this is a top-level module which has a + /// The AST file if this is a top-level module which has a /// corresponding serialized AST file, or null otherwise. const FileEntry *ASTFile = nullptr; - /// \brief The top-level headers associated with this module. + /// The top-level headers associated with this module. llvm::SmallSetVector<const FileEntry *, 2> TopHeaders; - /// \brief top-level header filenames that aren't resolved to FileEntries yet. + /// top-level header filenames that aren't resolved to FileEntries yet. std::vector<std::string> TopHeaderNames; - /// \brief Cache of modules visible to lookup in this module. + /// Cache of modules visible to lookup in this module. mutable llvm::DenseSet<const Module*> VisibleModulesCache; /// The ID used when referencing this module within a VisibleModuleSet. @@ -146,7 +146,7 @@ public: }; static const int NumHeaderKinds = HK_Excluded + 1; - /// \brief Information about a header directive as found in the module map + /// Information about a header directive as found in the module map /// file. struct Header { std::string NameAsWritten; @@ -155,7 +155,7 @@ public: explicit operator bool() { return Entry; } }; - /// \brief Information about a directory name as found in the module map + /// Information about a directory name as found in the module map /// file. struct DirectoryName { std::string NameAsWritten; @@ -164,10 +164,10 @@ public: explicit operator bool() { return Entry; } }; - /// \brief The headers that are part of this module. + /// The headers that are part of this module. SmallVector<Header, 2> Headers[5]; - /// \brief Stored information about a header directive that was found in the + /// Stored information about a header directive that was found in the /// module map file but has not been resolved to a file. struct UnresolvedHeaderDirective { HeaderKind Kind = HK_Normal; @@ -183,191 +183,202 @@ public: /// yet attempted to resolve to a file on the file system. SmallVector<UnresolvedHeaderDirective, 1> UnresolvedHeaders; - /// \brief Headers that are mentioned in the module map file but could not be + /// Headers that are mentioned in the module map file but could not be /// found on the file system. SmallVector<UnresolvedHeaderDirective, 1> MissingHeaders; - /// \brief An individual requirement: a feature name and a flag indicating + /// An individual requirement: a feature name and a flag indicating /// the required state of that feature. using Requirement = std::pair<std::string, bool>; - /// \brief The set of language features required to use this module. + /// The set of language features required to use this module. /// /// If any of these requirements are not available, the \c IsAvailable bit /// will be false to indicate that this (sub)module is not available. SmallVector<Requirement, 2> Requirements; - /// \brief Whether this module is missing a feature from \c Requirements. + /// A module with the same name that shadows this module. + Module *ShadowingModule = nullptr; + + /// Whether this module is missing a feature from \c Requirements. unsigned IsMissingRequirement : 1; - /// \brief Whether we tried and failed to load a module file for this module. + /// Whether we tried and failed to load a module file for this module. unsigned HasIncompatibleModuleFile : 1; - /// \brief Whether this module is available in the current translation unit. + /// Whether this module is available in the current translation unit. /// /// If the module is missing headers or does not meet all requirements then /// this bit will be 0. unsigned IsAvailable : 1; - /// \brief Whether this module was loaded from a module file. + /// Whether this module was loaded from a module file. unsigned IsFromModuleFile : 1; - /// \brief Whether this is a framework module. + /// Whether this is a framework module. unsigned IsFramework : 1; - /// \brief Whether this is an explicit submodule. + /// Whether this is an explicit submodule. unsigned IsExplicit : 1; - /// \brief Whether this is a "system" module (which assumes that all + /// Whether this is a "system" module (which assumes that all /// headers in it are system headers). unsigned IsSystem : 1; - /// \brief Whether this is an 'extern "C"' module (which implicitly puts all + /// Whether this is an 'extern "C"' module (which implicitly puts all /// headers in it within an 'extern "C"' block, and allows the module to be /// imported within such a block). unsigned IsExternC : 1; - /// \brief Whether this is an inferred submodule (module * { ... }). + /// Whether this is an inferred submodule (module * { ... }). unsigned IsInferred : 1; - /// \brief Whether we should infer submodules for this module based on + /// Whether we should infer submodules for this module based on /// the headers. /// /// Submodules can only be inferred for modules with an umbrella header. unsigned InferSubmodules : 1; - /// \brief Whether, when inferring submodules, the inferred submodules + /// Whether, when inferring submodules, the inferred submodules /// should be explicit. unsigned InferExplicitSubmodules : 1; - /// \brief Whether, when inferring submodules, the inferr submodules should + /// Whether, when inferring submodules, the inferr submodules should /// export all modules they import (e.g., the equivalent of "export *"). unsigned InferExportWildcard : 1; - /// \brief Whether the set of configuration macros is exhaustive. + /// Whether the set of configuration macros is exhaustive. /// /// When the set of configuration macros is exhaustive, meaning /// that no identifier not in this list should affect how the module is /// built. unsigned ConfigMacrosExhaustive : 1; - /// \brief Whether files in this module can only include non-modular headers + /// Whether files in this module can only include non-modular headers /// and headers from used modules. unsigned NoUndeclaredIncludes : 1; - /// \brief Describes the visibility of the various names within a + /// Whether this module came from a "private" module map, found next + /// to a regular (public) module map. + unsigned ModuleMapIsPrivate : 1; + + /// Describes the visibility of the various names within a /// particular module. enum NameVisibilityKind { - /// \brief All of the names in this module are hidden. + /// All of the names in this module are hidden. Hidden, - /// \brief All of the names in this module are visible. + /// All of the names in this module are visible. AllVisible }; - /// \brief The visibility of names within this particular module. + /// The visibility of names within this particular module. NameVisibilityKind NameVisibility; - /// \brief The location of the inferred submodule. + /// The location of the inferred submodule. SourceLocation InferredSubmoduleLoc; - /// \brief The set of modules imported by this module, and on which this + /// The set of modules imported by this module, and on which this /// module depends. llvm::SmallSetVector<Module *, 2> Imports; - /// \brief Describes an exported module. + /// Describes an exported module. /// /// The pointer is the module being re-exported, while the bit will be true /// to indicate that this is a wildcard export. using ExportDecl = llvm::PointerIntPair<Module *, 1, bool>; - /// \brief The set of export declarations. + /// The set of export declarations. SmallVector<ExportDecl, 2> Exports; - /// \brief Describes an exported module that has not yet been resolved + /// Describes an exported module that has not yet been resolved /// (perhaps because the module it refers to has not yet been loaded). struct UnresolvedExportDecl { - /// \brief The location of the 'export' keyword in the module map file. + /// The location of the 'export' keyword in the module map file. SourceLocation ExportLoc; - /// \brief The name of the module. + /// The name of the module. ModuleId Id; - /// \brief Whether this export declaration ends in a wildcard, indicating + /// Whether this export declaration ends in a wildcard, indicating /// that all of its submodules should be exported (rather than the named /// module itself). bool Wildcard; }; - /// \brief The set of export declarations that have yet to be resolved. + /// The set of export declarations that have yet to be resolved. SmallVector<UnresolvedExportDecl, 2> UnresolvedExports; - /// \brief The directly used modules. + /// The directly used modules. SmallVector<Module *, 2> DirectUses; - /// \brief The set of use declarations that have yet to be resolved. + /// The set of use declarations that have yet to be resolved. SmallVector<ModuleId, 2> UnresolvedDirectUses; - /// \brief A library or framework to link against when an entity from this + /// A library or framework to link against when an entity from this /// module is used. struct LinkLibrary { LinkLibrary() = default; LinkLibrary(const std::string &Library, bool IsFramework) : Library(Library), IsFramework(IsFramework) {} - /// \brief The library to link against. + /// The library to link against. /// /// This will typically be a library or framework name, but can also /// be an absolute path to the library or framework. std::string Library; - /// \brief Whether this is a framework rather than a library. + /// Whether this is a framework rather than a library. bool IsFramework = false; }; - /// \brief The set of libraries or frameworks to link against when + /// The set of libraries or frameworks to link against when /// an entity from this module is used. llvm::SmallVector<LinkLibrary, 2> LinkLibraries; - /// \brief The set of "configuration macros", which are macros that + /// Autolinking uses the framework name for linking purposes + /// when this is false and the export_as name otherwise. + bool UseExportAsModuleLinkName = false; + + /// The set of "configuration macros", which are macros that /// (intentionally) change how this module is built. std::vector<std::string> ConfigMacros; - /// \brief An unresolved conflict with another module. + /// An unresolved conflict with another module. struct UnresolvedConflict { - /// \brief The (unresolved) module id. + /// The (unresolved) module id. ModuleId Id; - /// \brief The message provided to the user when there is a conflict. + /// The message provided to the user when there is a conflict. std::string Message; }; - /// \brief The list of conflicts for which the module-id has not yet been + /// The list of conflicts for which the module-id has not yet been /// resolved. std::vector<UnresolvedConflict> UnresolvedConflicts; - /// \brief A conflict between two modules. + /// A conflict between two modules. struct Conflict { - /// \brief The module that this module conflicts with. + /// The module that this module conflicts with. Module *Other; - /// \brief The message provided to the user when there is a conflict. + /// The message provided to the user when there is a conflict. std::string Message; }; - /// \brief The list of conflicts. + /// The list of conflicts. std::vector<Conflict> Conflicts; - /// \brief Construct a new module or submodule. + /// Construct a new module or submodule. Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, bool IsFramework, bool IsExplicit, unsigned VisibilityID); ~Module(); - /// \brief Determine whether this module is available for use within the + /// Determine whether this module is available for use within the /// current translation unit. bool isAvailable() const { return IsAvailable; } - /// \brief Determine whether this module is available for use within the + /// Determine whether this module is available for use within the /// current translation unit. /// /// \param LangOpts The language options used for the current @@ -375,22 +386,29 @@ public: /// /// \param Target The target options used for the current translation unit. /// - /// \param Req If this module is unavailable, this parameter - /// will be set to one of the requirements that is not met for use of - /// this module. + /// \param Req If this module is unavailable because of a missing requirement, + /// this parameter will be set to one of the requirements that is not met for + /// use of this module. + /// + /// \param MissingHeader If this module is unavailable because of a missing + /// header, this parameter will be set to one of the missing headers. + /// + /// \param ShadowingModule If this module is unavailable because it is + /// shadowed, this parameter will be set to the shadowing module. bool isAvailable(const LangOptions &LangOpts, const TargetInfo &Target, Requirement &Req, - UnresolvedHeaderDirective &MissingHeader) const; + UnresolvedHeaderDirective &MissingHeader, + Module *&ShadowingModule) const; - /// \brief Determine whether this module is a submodule. + /// Determine whether this module is a submodule. bool isSubModule() const { return Parent != nullptr; } - /// \brief Determine whether this module is a submodule of the given other + /// Determine whether this module is a submodule of the given other /// module. bool isSubModuleOf(const Module *Other) const; - /// \brief Determine whether this module is a part of a framework, + /// Determine whether this module is a part of a framework, /// either because it is a framework module or because it is a submodule /// of a framework module. bool isPartOfFramework() const { @@ -401,7 +419,7 @@ public: return false; } - /// \brief Determine whether this module is a subframework of another + /// Determine whether this module is a subframework of another /// framework. bool isSubFramework() const { return IsFramework && Parent && Parent->isPartOfFramework(); @@ -416,51 +434,51 @@ public: Parent->SubModules.push_back(this); } - /// \brief Retrieve the full name of this module, including the path from + /// Retrieve the full name of this module, including the path from /// its top-level module. /// \param AllowStringLiterals If \c true, components that might not be /// lexically valid as identifiers will be emitted as string literals. std::string getFullModuleName(bool AllowStringLiterals = false) const; - /// \brief Whether the full name of this module is equal to joining + /// Whether the full name of this module is equal to joining /// \p nameParts with "."s. /// /// This is more efficient than getFullModuleName(). bool fullModuleNameIs(ArrayRef<StringRef> nameParts) const; - /// \brief Retrieve the top-level module for this (sub)module, which may + /// Retrieve the top-level module for this (sub)module, which may /// be this module. Module *getTopLevelModule() { return const_cast<Module *>( const_cast<const Module *>(this)->getTopLevelModule()); } - /// \brief Retrieve the top-level module for this (sub)module, which may + /// Retrieve the top-level module for this (sub)module, which may /// be this module. const Module *getTopLevelModule() const; - /// \brief Retrieve the name of the top-level module. + /// Retrieve the name of the top-level module. StringRef getTopLevelModuleName() const { return getTopLevelModule()->Name; } - /// \brief The serialized AST file for this module, if one was created. + /// The serialized AST file for this module, if one was created. const FileEntry *getASTFile() const { return getTopLevelModule()->ASTFile; } - /// \brief Set the serialized AST file for the top-level module of this module. + /// Set the serialized AST file for the top-level module of this module. void setASTFile(const FileEntry *File) { assert((File == nullptr || getASTFile() == nullptr || getASTFile() == File) && "file path changed"); getTopLevelModule()->ASTFile = File; } - /// \brief Retrieve the directory for which this module serves as the + /// Retrieve the directory for which this module serves as the /// umbrella. DirectoryName getUmbrellaDir() const; - /// \brief Retrieve the header that serves as the umbrella header for this + /// Retrieve the header that serves as the umbrella header for this /// module. Header getUmbrellaHeader() const { if (auto *E = Umbrella.dyn_cast<const FileEntry *>()) @@ -468,31 +486,31 @@ public: return Header{}; } - /// \brief Determine whether this module has an umbrella directory that is + /// Determine whether this module has an umbrella directory that is /// not based on an umbrella header. bool hasUmbrellaDir() const { return Umbrella && Umbrella.is<const DirectoryEntry *>(); } - /// \brief Add a top-level header associated with this module. + /// Add a top-level header associated with this module. void addTopHeader(const FileEntry *File) { assert(File); TopHeaders.insert(File); } - /// \brief Add a top-level header filename associated with this module. + /// Add a top-level header filename associated with this module. void addTopHeaderFilename(StringRef Filename) { TopHeaderNames.push_back(Filename); } - /// \brief The top-level headers associated with this module. + /// The top-level headers associated with this module. ArrayRef<const FileEntry *> getTopHeaders(FileManager &FileMgr); - /// \brief Determine whether this module has declared its intention to + /// Determine whether this module has declared its intention to /// directly use another module. bool directlyUses(const Module *Requested) const; - /// \brief Add the given feature requirement to the list of features + /// Add the given feature requirement to the list of features /// required by this module. /// /// \param Feature The feature that is required by this module (and @@ -510,15 +528,15 @@ public: const LangOptions &LangOpts, const TargetInfo &Target); - /// \brief Mark this module and all of its submodules as unavailable. + /// Mark this module and all of its submodules as unavailable. void markUnavailable(bool MissingRequirement = false); - /// \brief Find the submodule with the given name. + /// Find the submodule with the given name. /// /// \returns The submodule if found, or NULL otherwise. Module *findSubmodule(StringRef Name) const; - /// \brief Determine whether the specified module would be visible to + /// Determine whether the specified module would be visible to /// a lookup at the end of this module. /// /// FIXME: This may return incorrect results for (submodules of) the @@ -547,7 +565,7 @@ public: return llvm::make_range(submodule_begin(), submodule_end()); } - /// \brief Appends this module's list of exported modules to \p Exported. + /// Appends this module's list of exported modules to \p Exported. /// /// This provides a subset of immediately imported modules (the ones that are /// directly exported), not the complete set of exported modules. @@ -557,17 +575,17 @@ public: return "<module-includes>"; } - /// \brief Print the module map for this module to the given stream. + /// Print the module map for this module to the given stream. void print(raw_ostream &OS, unsigned Indent = 0) const; - /// \brief Dump the contents of this module to the given output stream. + /// Dump the contents of this module to the given output stream. void dump() const; private: void buildVisibleModulesCache() const; }; -/// \brief A set of visible modules. +/// A set of visible modules. class VisibleModuleSet { public: VisibleModuleSet() = default; @@ -587,34 +605,34 @@ public: return *this; } - /// \brief Get the current visibility generation. Incremented each time the + /// Get the current visibility generation. Incremented each time the /// set of visible modules changes in any way. unsigned getGeneration() const { return Generation; } - /// \brief Determine whether a module is visible. + /// Determine whether a module is visible. bool isVisible(const Module *M) const { return getImportLoc(M).isValid(); } - /// \brief Get the location at which the import of a module was triggered. + /// Get the location at which the import of a module was triggered. SourceLocation getImportLoc(const Module *M) const { return M->getVisibilityID() < ImportLocs.size() ? ImportLocs[M->getVisibilityID()] : SourceLocation(); } - /// \brief A callback to call when a module is made visible (directly or + /// A callback to call when a module is made visible (directly or /// indirectly) by a call to \ref setVisible. using VisibleCallback = llvm::function_ref<void(Module *M)>; - /// \brief A callback to call when a module conflict is found. \p Path + /// A callback to call when a module conflict is found. \p Path /// consists of a sequence of modules from the conflicting module to the one /// made visible, where each was exported by the next. using ConflictCallback = llvm::function_ref<void(ArrayRef<Module *> Path, Module *Conflict, StringRef Message)>; - /// \brief Make a specific module visible. + /// Make a specific module visible. void setVisible(Module *M, SourceLocation Loc, VisibleCallback Vis = [](Module *) {}, ConflictCallback Cb = [](ArrayRef<Module *>, Module *, diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h index 8dc259c7ab66f..d5f4f50fe36f5 100644 --- a/include/clang/Basic/ObjCRuntime.h +++ b/include/clang/Basic/ObjCRuntime.h @@ -1,4 +1,4 @@ -//===--- ObjCRuntime.h - Objective-C Runtime Configuration ------*- C++ -*-===// +//===- ObjCRuntime.h - Objective-C Runtime Configuration --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,25 +6,28 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines types useful for describing an Objective-C runtime. -/// +/// Defines types useful for describing an Objective-C runtime. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_OBJCRUNTIME_H #define LLVM_CLANG_BASIC_OBJCRUNTIME_H -#include "clang/Basic/VersionTuple.h" +#include "clang/Basic/LLVM.h" +#include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/VersionTuple.h" +#include <string> namespace clang { -/// \brief The basic abstraction for the target Objective-C runtime. +/// The basic abstraction for the target Objective-C runtime. class ObjCRuntime { public: - /// \brief The basic Objective-C runtimes that we know about. + /// The basic Objective-C runtimes that we know about. enum Kind { /// 'macosx' is the Apple-provided NeXT-derived runtime on Mac OS /// X platforms that use the non-fragile ABI; the version is a @@ -57,15 +60,14 @@ public: }; private: - Kind TheKind; + Kind TheKind = MacOSX; VersionTuple Version; public: /// A bogus initialization of the runtime. - ObjCRuntime() : TheKind(MacOSX) {} - + ObjCRuntime() = default; ObjCRuntime(Kind kind, const VersionTuple &version) - : TheKind(kind), Version(version) {} + : TheKind(kind), Version(version) {} void set(Kind kind, VersionTuple version) { TheKind = kind; @@ -75,7 +77,7 @@ public: Kind getKind() const { return TheKind; } const VersionTuple &getVersion() const { return Version; } - /// \brief Does this runtime follow the set of implied behaviors for a + /// Does this runtime follow the set of implied behaviors for a /// "non-fragile" ABI? bool isNonFragile() const { switch (getKind()) { @@ -113,7 +115,7 @@ public: return true; } - /// \brief Is this runtime basically of the GNU family of runtimes? + /// Is this runtime basically of the GNU family of runtimes? bool isGNUFamily() const { switch (getKind()) { case FragileMacOSX: @@ -129,14 +131,14 @@ public: llvm_unreachable("bad kind"); } - /// \brief Is this runtime basically of the NeXT family of runtimes? + /// Is this runtime basically of the NeXT family of runtimes? bool isNeXTFamily() const { // For now, this is just the inverse of isGNUFamily(), but that's // not inherently true. return !isGNUFamily(); } - /// \brief Does this runtime allow ARC at all? + /// Does this runtime allow ARC at all? bool allowsARC() const { switch (getKind()) { case FragileMacOSX: @@ -152,7 +154,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime natively provide the ARC entrypoints? + /// Does this runtime natively provide the ARC entrypoints? /// /// ARC cannot be directly supported on a platform that does not provide /// these entrypoints, although it may be supportable via a stub @@ -171,7 +173,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime supports optimized setter entrypoints? + /// Does this runtime supports optimized setter entrypoints? bool hasOptimizedSetter() const { switch (getKind()) { case MacOSX: @@ -182,9 +184,8 @@ public: return true; case GNUstep: return getVersion() >= VersionTuple(1, 7); - default: - return false; + return false; } } @@ -193,7 +194,7 @@ public: return hasNativeWeak(); } - /// \brief Does this runtime natively provide ARC-compliant 'weak' + /// Does this runtime natively provide ARC-compliant 'weak' /// entrypoints? bool hasNativeWeak() const { // Right now, this is always equivalent to whether the runtime @@ -201,14 +202,14 @@ public: return hasNativeARC(); } - /// \brief Does this runtime directly support the subscripting methods? + /// Does this runtime directly support the subscripting methods? /// /// This is really a property of the library, not the runtime. bool hasSubscripting() const { switch (getKind()) { case FragileMacOSX: return false; - case MacOSX: return getVersion() >= VersionTuple(10, 8); - case iOS: return getVersion() >= VersionTuple(6); + case MacOSX: return getVersion() >= VersionTuple(10, 11); + case iOS: return getVersion() >= VersionTuple(9); case WatchOS: return true; // This is really a lie, because some implementations and versions @@ -221,12 +222,12 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime allow sizeof or alignof on object types? + /// Does this runtime allow sizeof or alignof on object types? bool allowsSizeofAlignof() const { return isFragile(); } - /// \brief Does this runtime allow pointer arithmetic on objects? + /// Does this runtime allow pointer arithmetic on objects? /// /// This covers +, -, ++, --, and (if isSubscriptPointerArithmetic() /// yields true) []. @@ -245,12 +246,12 @@ public: llvm_unreachable("bad kind"); } - /// \brief Is subscripting pointer arithmetic? + /// Is subscripting pointer arithmetic? bool isSubscriptPointerArithmetic() const { return allowsPointerArithmetic(); } - /// \brief Does this runtime provide an objc_terminate function? + /// Does this runtime provide an objc_terminate function? /// /// This is used in handlers for exceptions during the unwind process; /// without it, abort() must be used in pure ObjC files. @@ -267,7 +268,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime support weakly importing classes? + /// Does this runtime support weakly importing classes? bool hasWeakClassImport() const { switch (getKind()) { case MacOSX: return true; @@ -281,7 +282,7 @@ public: llvm_unreachable("bad kind"); } - /// \brief Does this runtime use zero-cost exceptions? + /// Does this runtime use zero-cost exceptions? bool hasUnwindExceptions() const { switch (getKind()) { case MacOSX: return true; @@ -320,7 +321,6 @@ public: return getVersion() >= VersionTuple(2); case GNUstep: return false; - default: return false; } @@ -340,7 +340,7 @@ public: } } - /// \brief Try to parse an Objective-C runtime specification from the given + /// Try to parse an Objective-C runtime specification from the given /// string. /// /// \return true on error. @@ -360,6 +360,6 @@ public: raw_ostream &operator<<(raw_ostream &out, const ObjCRuntime &value); -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_OBJCRUNTIME_H diff --git a/include/clang/Basic/OpenCLExtensions.def b/include/clang/Basic/OpenCLExtensions.def index c3319d2d808b9..13cb12e7c5811 100644 --- a/include/clang/Basic/OpenCLExtensions.def +++ b/include/clang/Basic/OpenCLExtensions.def @@ -53,6 +53,9 @@ OPENCLEXT_INTERNAL(cl_khr_icd, 100, ~0U) OPENCLEXT_INTERNAL(cl_khr_gl_event, 110, ~0U) OPENCLEXT_INTERNAL(cl_khr_d3d10_sharing, 110, ~0U) +// EMBEDDED_PROFILE +OPENCLEXT_INTERNAL(cles_khr_int64, 110, ~0U) + // OpenCL 1.2. OPENCLEXT_INTERNAL(cl_khr_context_abort, 120, ~0U) OPENCLEXT_INTERNAL(cl_khr_d3d11_sharing, 120, ~0U) diff --git a/include/clang/Basic/OpenCLOptions.h b/include/clang/Basic/OpenCLOptions.h index cc850f0b0b24a..cc4e9922dca03 100644 --- a/include/clang/Basic/OpenCLOptions.h +++ b/include/clang/Basic/OpenCLOptions.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::OpenCLOptions class. +/// Defines the clang::OpenCLOptions class. /// //===----------------------------------------------------------------------===// @@ -19,7 +19,7 @@ namespace clang { -/// \brief OpenCL supported extensions and optional core features +/// OpenCL supported extensions and optional core features class OpenCLOptions { struct Info { bool Supported; // Is this option supported @@ -67,7 +67,7 @@ public: OptMap[Ext].Enabled = V; } - /// \brief Enable or disable support for OpenCL extensions + /// Enable or disable support for OpenCL extensions /// \param Ext name of the extension optionally prefixed with /// '+' or '-' /// \param V used when \p Ext is not prefixed by '+' or '-' diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index 6a0bed7ab15fc..4ed7053b679b2 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// /// \file -/// \brief This file defines the list of supported OpenMP directives and +/// This file defines the list of supported OpenMP directives and /// clauses. /// //===----------------------------------------------------------------------===// diff --git a/include/clang/Basic/OpenMPKinds.h b/include/clang/Basic/OpenMPKinds.h index e00333153f9b0..c47973e53a8a7 100644 --- a/include/clang/Basic/OpenMPKinds.h +++ b/include/clang/Basic/OpenMPKinds.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines some OpenMP-specific enums and functions. +/// Defines some OpenMP-specific enums and functions. /// //===----------------------------------------------------------------------===// @@ -19,7 +19,7 @@ namespace clang { -/// \brief OpenMP directives. +/// OpenMP directives. enum OpenMPDirectiveKind { #define OPENMP_DIRECTIVE(Name) \ OMPD_##Name, @@ -29,7 +29,7 @@ enum OpenMPDirectiveKind { OMPD_unknown }; -/// \brief OpenMP clauses. +/// OpenMP clauses. enum OpenMPClauseKind { #define OPENMP_CLAUSE(Name, Class) \ OMPC_##Name, @@ -39,7 +39,7 @@ enum OpenMPClauseKind { OMPC_unknown }; -/// \brief OpenMP attributes for 'default' clause. +/// OpenMP attributes for 'default' clause. enum OpenMPDefaultClauseKind { #define OPENMP_DEFAULT_KIND(Name) \ OMPC_DEFAULT_##Name, @@ -47,7 +47,7 @@ enum OpenMPDefaultClauseKind { OMPC_DEFAULT_unknown }; -/// \brief OpenMP attributes for 'proc_bind' clause. +/// OpenMP attributes for 'proc_bind' clause. enum OpenMPProcBindClauseKind { #define OPENMP_PROC_BIND_KIND(Name) \ OMPC_PROC_BIND_##Name, @@ -55,7 +55,7 @@ enum OpenMPProcBindClauseKind { OMPC_PROC_BIND_unknown }; -/// \brief OpenMP attributes for 'schedule' clause. +/// OpenMP attributes for 'schedule' clause. enum OpenMPScheduleClauseKind { #define OPENMP_SCHEDULE_KIND(Name) \ OMPC_SCHEDULE_##Name, @@ -63,7 +63,7 @@ enum OpenMPScheduleClauseKind { OMPC_SCHEDULE_unknown }; -/// \brief OpenMP modifiers for 'schedule' clause. +/// OpenMP modifiers for 'schedule' clause. enum OpenMPScheduleClauseModifier { OMPC_SCHEDULE_MODIFIER_unknown = OMPC_SCHEDULE_unknown, #define OPENMP_SCHEDULE_MODIFIER(Name) \ @@ -72,7 +72,7 @@ enum OpenMPScheduleClauseModifier { OMPC_SCHEDULE_MODIFIER_last }; -/// \brief OpenMP attributes for 'depend' clause. +/// OpenMP attributes for 'depend' clause. enum OpenMPDependClauseKind { #define OPENMP_DEPEND_KIND(Name) \ OMPC_DEPEND_##Name, @@ -80,7 +80,7 @@ enum OpenMPDependClauseKind { OMPC_DEPEND_unknown }; -/// \brief OpenMP attributes for 'linear' clause. +/// OpenMP attributes for 'linear' clause. enum OpenMPLinearClauseKind { #define OPENMP_LINEAR_KIND(Name) \ OMPC_LINEAR_##Name, @@ -88,7 +88,7 @@ enum OpenMPLinearClauseKind { OMPC_LINEAR_unknown }; -/// \brief OpenMP mapping kind for 'map' clause. +/// OpenMP mapping kind for 'map' clause. enum OpenMPMapClauseKind { #define OPENMP_MAP_KIND(Name) \ OMPC_MAP_##Name, @@ -96,14 +96,14 @@ enum OpenMPMapClauseKind { OMPC_MAP_unknown }; -/// \brief OpenMP attributes for 'dist_schedule' clause. +/// OpenMP attributes for 'dist_schedule' clause. enum OpenMPDistScheduleClauseKind { #define OPENMP_DIST_SCHEDULE_KIND(Name) OMPC_DIST_SCHEDULE_##Name, #include "clang/Basic/OpenMPKinds.def" OMPC_DIST_SCHEDULE_unknown }; -/// \brief OpenMP attributes for 'defaultmap' clause. +/// OpenMP attributes for 'defaultmap' clause. enum OpenMPDefaultmapClauseKind { #define OPENMP_DEFAULTMAP_KIND(Name) \ OMPC_DEFAULTMAP_##Name, @@ -111,7 +111,7 @@ enum OpenMPDefaultmapClauseKind { OMPC_DEFAULTMAP_unknown }; -/// \brief OpenMP modifiers for 'defaultmap' clause. +/// OpenMP modifiers for 'defaultmap' clause. enum OpenMPDefaultmapClauseModifier { OMPC_DEFAULTMAP_MODIFIER_unknown = OMPC_DEFAULTMAP_unknown, #define OPENMP_DEFAULTMAP_MODIFIER(Name) \ @@ -139,39 +139,39 @@ const char *getOpenMPSimpleClauseTypeName(OpenMPClauseKind Kind, unsigned Type); bool isAllowedClauseForDirective(OpenMPDirectiveKind DKind, OpenMPClauseKind CKind); -/// \brief Checks if the specified directive is a directive with an associated +/// Checks if the specified directive is a directive with an associated /// loop construct. /// \param DKind Specified directive. /// \return true - the directive is a loop-associated directive like 'omp simd' /// or 'omp for' directive, otherwise - false. bool isOpenMPLoopDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a worksharing directive. +/// Checks if the specified directive is a worksharing directive. /// \param DKind Specified directive. /// \return true - the directive is a worksharing directive like 'omp for', /// otherwise - false. bool isOpenMPWorksharingDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a taskloop directive. +/// Checks if the specified directive is a taskloop directive. /// \param DKind Specified directive. /// \return true - the directive is a worksharing directive like 'omp taskloop', /// otherwise - false. bool isOpenMPTaskLoopDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a parallel-kind directive. +/// Checks if the specified directive is a parallel-kind directive. /// \param DKind Specified directive. /// \return true - the directive is a parallel-like directive like 'omp /// parallel', otherwise - false. bool isOpenMPParallelDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a target code offload directive. +/// Checks if the specified directive is a target code offload directive. /// \param DKind Specified directive. /// \return true - the directive is a target code offload directive like /// 'omp target', 'omp target parallel', 'omp target xxx' /// otherwise - false. bool isOpenMPTargetExecutionDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a target data offload directive. +/// Checks if the specified directive is a target data offload directive. /// \param DKind Specified directive. /// \return true - the directive is a target data offload directive like /// 'omp target data', 'omp target update', 'omp target enter data', @@ -193,13 +193,13 @@ bool isOpenMPNestingTeamsDirective(OpenMPDirectiveKind DKind); /// \return true - the directive is a teams-like directive, otherwise - false. bool isOpenMPTeamsDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a simd directive. +/// Checks if the specified directive is a simd directive. /// \param DKind Specified directive. /// \return true - the directive is a simd directive like 'omp simd', /// otherwise - false. bool isOpenMPSimdDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified directive is a distribute directive. +/// Checks if the specified directive is a distribute directive. /// \param DKind Specified directive. /// \return true - the directive is a distribute-directive like 'omp /// distribute', @@ -214,13 +214,13 @@ bool isOpenMPDistributeDirective(OpenMPDirectiveKind DKind); /// otherwise - false. bool isOpenMPNestingDistributeDirective(OpenMPDirectiveKind DKind); -/// \brief Checks if the specified clause is one of private clauses like +/// Checks if the specified clause is one of private clauses like /// 'private', 'firstprivate', 'reduction' etc.. /// \param Kind Clause kind. /// \return true - the clause is a private clause, otherwise - false. bool isOpenMPPrivate(OpenMPClauseKind Kind); -/// \brief Checks if the specified clause is one of threadprivate clauses like +/// Checks if the specified clause is one of threadprivate clauses like /// 'threadprivate', 'copyin' or 'copyprivate'. /// \param Kind Clause kind. /// \return true - the clause is a threadprivate clause, otherwise - false. diff --git a/include/clang/Basic/OperatorKinds.h b/include/clang/Basic/OperatorKinds.h index 7120baeef675a..b0064cfb4e5a7 100644 --- a/include/clang/Basic/OperatorKinds.h +++ b/include/clang/Basic/OperatorKinds.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines an enumeration for C++ overloaded operators. +/// Defines an enumeration for C++ overloaded operators. /// //===----------------------------------------------------------------------===// @@ -17,7 +17,7 @@ namespace clang { -/// \brief Enumeration specifying the different kinds of C++ overloaded +/// Enumeration specifying the different kinds of C++ overloaded /// operators. enum OverloadedOperatorKind : int { OO_None, ///< Not an overloaded operator @@ -27,7 +27,7 @@ enum OverloadedOperatorKind : int { NUM_OVERLOADED_OPERATORS }; -/// \brief Retrieve the spelling of the given overloaded operator, without +/// Retrieve the spelling of the given overloaded operator, without /// the preceding "operator" keyword. const char *getOperatorSpelling(OverloadedOperatorKind Operator); diff --git a/include/clang/Basic/OperatorPrecedence.h b/include/clang/Basic/OperatorPrecedence.h index 94978f81e543a..4389e3bbd2576 100644 --- a/include/clang/Basic/OperatorPrecedence.h +++ b/include/clang/Basic/OperatorPrecedence.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines and computes precedence levels for binary/ternary operators. +/// Defines and computes precedence levels for binary/ternary operators. /// //===----------------------------------------------------------------------===// @@ -44,7 +44,7 @@ namespace prec { }; } -/// \brief Return the precedence of the specified binary operator token. +/// Return the precedence of the specified binary operator token. prec::Level getBinOpPrecedence(tok::TokenKind Kind, bool GreaterThanIsOperator, bool CPlusPlus11); diff --git a/include/clang/Basic/PartialDiagnostic.h b/include/clang/Basic/PartialDiagnostic.h index b2f14afe5695a..9727af86f6494 100644 --- a/include/clang/Basic/PartialDiagnostic.h +++ b/include/clang/Basic/PartialDiagnostic.h @@ -1,4 +1,4 @@ -//===--- PartialDiagnostic.h - Diagnostic "closures" ------------*- C++ -*-===// +//===- PartialDiagnostic.h - Diagnostic "closures" --------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,25 +6,32 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Implements a partial diagnostic that can be emitted anwyhere +/// Implements a partial diagnostic that can be emitted anwyhere /// in a DiagnosticBuilder stream. -/// +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_PARTIALDIAGNOSTIC_H #define LLVM_CLANG_BASIC_PARTIALDIAGNOSTIC_H #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/LLVM.h" #include "clang/Basic/SourceLocation.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/DataTypes.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include <cassert> +#include <cstdint> +#include <string> +#include <type_traits> +#include <utility> namespace clang { +class DeclContext; +class IdentifierInfo; + class PartialDiagnostic { public: enum { @@ -36,10 +43,8 @@ public: }; struct Storage { - Storage() : NumDiagArgs(0) { } - enum { - /// \brief The maximum number of arguments we can hold. We + /// The maximum number of arguments we can hold. We /// currently only support up to 10 arguments (%0-%9). /// /// A single diagnostic with more than that almost certainly has to @@ -47,33 +52,35 @@ public: MaxArguments = PartialDiagnostic::MaxArguments }; - /// \brief The number of entries in Arguments. - unsigned char NumDiagArgs; + /// The number of entries in Arguments. + unsigned char NumDiagArgs = 0; - /// \brief Specifies for each argument whether it is in DiagArgumentsStr + /// Specifies for each argument whether it is in DiagArgumentsStr /// or in DiagArguments. unsigned char DiagArgumentsKind[MaxArguments]; - /// \brief The values for the various substitution positions. + /// The values for the various substitution positions. /// /// This is used when the argument is not an std::string. The specific value /// is mangled into an intptr_t and the interpretation depends on exactly /// what sort of argument kind it is. intptr_t DiagArgumentsVal[MaxArguments]; - /// \brief The values for the various substitution positions that have + /// The values for the various substitution positions that have /// string arguments. std::string DiagArgumentsStr[MaxArguments]; - /// \brief The list of ranges added to this diagnostic. + /// The list of ranges added to this diagnostic. SmallVector<CharSourceRange, 8> DiagRanges; - /// \brief If valid, provides a hint with some code to insert, remove, or + /// If valid, provides a hint with some code to insert, remove, or /// modify at a particular position. SmallVector<FixItHint, 6> FixItHints; + + Storage() = default; }; - /// \brief An allocator for Storage objects, which uses a small cache to + /// An allocator for Storage objects, which uses a small cache to /// objects, used to reduce malloc()/free() traffic for partial diagnostics. class StorageAllocator { static const unsigned NumCached = 16; @@ -85,7 +92,7 @@ public: StorageAllocator(); ~StorageAllocator(); - /// \brief Allocate new storage. + /// Allocate new storage. Storage *Allocate() { if (NumFreeListEntries == 0) return new Storage; @@ -97,7 +104,7 @@ public: return Result; } - /// \brief Free the given storage object. + /// Free the given storage object. void Deallocate(Storage *S) { if (S >= Cached && S <= Cached + NumCached) { FreeList[NumFreeListEntries++] = S; @@ -113,16 +120,16 @@ private: // in the sense that its bits can be safely memcpy'ed and destructed // in the new location. - /// \brief The diagnostic ID. - mutable unsigned DiagID; + /// The diagnostic ID. + mutable unsigned DiagID = 0; - /// \brief Storage for args and ranges. - mutable Storage *DiagStorage; + /// Storage for args and ranges. + mutable Storage *DiagStorage = nullptr; - /// \brief Allocator used to allocate storage for this diagnostic. - StorageAllocator *Allocator; + /// Allocator used to allocate storage for this diagnostic. + StorageAllocator *Allocator = nullptr; - /// \brief Retrieve storage for this particular diagnostic. + /// Retrieve storage for this particular diagnostic. Storage *getStorage() const { if (DiagStorage) return DiagStorage; @@ -176,17 +183,16 @@ private: public: struct NullDiagnostic {}; - /// \brief Create a null partial diagnostic, which cannot carry a payload, + + /// Create a null partial diagnostic, which cannot carry a payload, /// and only exists to be swapped with a real partial diagnostic. - PartialDiagnostic(NullDiagnostic) - : DiagID(0), DiagStorage(nullptr), Allocator(nullptr) { } + PartialDiagnostic(NullDiagnostic) {} PartialDiagnostic(unsigned DiagID, StorageAllocator &Allocator) - : DiagID(DiagID), DiagStorage(nullptr), Allocator(&Allocator) { } + : DiagID(DiagID), Allocator(&Allocator) {} PartialDiagnostic(const PartialDiagnostic &Other) - : DiagID(Other.DiagID), DiagStorage(nullptr), Allocator(Other.Allocator) - { + : DiagID(Other.DiagID), Allocator(Other.Allocator) { if (Other.DiagStorage) { DiagStorage = getStorage(); *DiagStorage = *Other.DiagStorage; @@ -194,22 +200,20 @@ public: } PartialDiagnostic(PartialDiagnostic &&Other) - : DiagID(Other.DiagID), DiagStorage(Other.DiagStorage), - Allocator(Other.Allocator) { + : DiagID(Other.DiagID), DiagStorage(Other.DiagStorage), + Allocator(Other.Allocator) { Other.DiagStorage = nullptr; } PartialDiagnostic(const PartialDiagnostic &Other, Storage *DiagStorage) - : DiagID(Other.DiagID), DiagStorage(DiagStorage), - Allocator(reinterpret_cast<StorageAllocator *>(~uintptr_t(0))) - { + : DiagID(Other.DiagID), DiagStorage(DiagStorage), + Allocator(reinterpret_cast<StorageAllocator *>(~uintptr_t(0))) { if (Other.DiagStorage) *this->DiagStorage = *Other.DiagStorage; } PartialDiagnostic(const Diagnostic &Other, StorageAllocator &Allocator) - : DiagID(Other.getID()), DiagStorage(nullptr), Allocator(&Allocator) - { + : DiagID(Other.getID()), Allocator(&Allocator) { // Copy arguments. for (unsigned I = 0, N = Other.getNumArgs(); I != N; ++I) { if (Other.getArgKind(I) == DiagnosticsEngine::ak_std_string) @@ -320,7 +324,7 @@ public: Diags.Clear(); } - /// \brief Clear out this partial diagnostic, giving it a new diagnostic ID + /// Clear out this partial diagnostic, giving it a new diagnostic ID /// and removing all of its arguments, ranges, and fix-it hints. void Reset(unsigned DiagID = 0) { this->DiagID = DiagID; @@ -402,7 +406,6 @@ public: PD.AddFixItHint(Hint); return PD; } - }; inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, @@ -411,9 +414,10 @@ inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, return DB; } -/// \brief A partial diagnostic along with the source location where this +/// A partial diagnostic along with the source location where this /// diagnostic occurs. -typedef std::pair<SourceLocation, PartialDiagnostic> PartialDiagnosticAt; +using PartialDiagnosticAt = std::pair<SourceLocation, PartialDiagnostic>; + +} // namespace clang -} // end namespace clang -#endif +#endif // LLVM_CLANG_BASIC_PARTIALDIAGNOSTIC_H diff --git a/include/clang/Basic/PlistSupport.h b/include/clang/Basic/PlistSupport.h index 61de82450cf78..be92bbfde1853 100644 --- a/include/clang/Basic/PlistSupport.h +++ b/include/clang/Basic/PlistSupport.h @@ -1,4 +1,4 @@ -//===---------- PlistSupport.h - Plist Output Utilities ---------*- C++ -*-===// +//===- PlistSupport.h - Plist Output Utilities ------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -10,12 +10,20 @@ #ifndef LLVM_CLANG_BASIC_PLISTSUPPORT_H #define LLVM_CLANG_BASIC_PLISTSUPPORT_H +#include "clang/Basic/LLVM.h" +#include "clang/Basic/SourceLocation.h" #include "clang/Basic/SourceManager.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/raw_ostream.h" +#include <cassert> +#include <cstdint> namespace clang { namespace markup { -typedef llvm::DenseMap<FileID, unsigned> FIDMap; + +using FIDMap = llvm::DenseMap<FileID, unsigned>; inline void AddFID(FIDMap &FIDs, SmallVectorImpl<FileID> &V, const SourceManager &SM, SourceLocation L) { @@ -112,7 +120,8 @@ inline void EmitRange(raw_ostream &o, const SourceManager &SM, EmitLocation(o, SM, R.getEnd(), FM, indent + 1); Indent(o, indent) << "</array>\n"; } -} -} -#endif +} // namespace markup +} // namespace clang + +#endif // LLVM_CLANG_BASIC_PLISTSUPPORT_H diff --git a/include/clang/Basic/PrettyStackTrace.h b/include/clang/Basic/PrettyStackTrace.h index 6badae5c03496..e652f52055d6a 100644 --- a/include/clang/Basic/PrettyStackTrace.h +++ b/include/clang/Basic/PrettyStackTrace.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the PrettyStackTraceEntry class, which is used to make +/// Defines the PrettyStackTraceEntry class, which is used to make /// crashes give more contextual information about what the program was doing /// when it crashed. /// diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def index 30d5cc8166dc6..5a36822a63035 100644 --- a/include/clang/Basic/Sanitizers.def +++ b/include/clang/Basic/Sanitizers.def @@ -44,8 +44,12 @@ SANITIZER("address", Address) // Kernel AddressSanitizer (KASan) SANITIZER("kernel-address", KernelAddress) +// Hardware-assisted AddressSanitizer SANITIZER("hwaddress", HWAddress) +// Kernel Hardware-assisted AddressSanitizer (KHWASan) +SANITIZER("kernel-hwaddress", KernelHWAddress) + // MemorySanitizer SANITIZER("memory", Memory) @@ -100,16 +104,20 @@ SANITIZER("dataflow", DataFlow) SANITIZER("cfi-cast-strict", CFICastStrict) SANITIZER("cfi-derived-cast", CFIDerivedCast) SANITIZER("cfi-icall", CFIICall) +SANITIZER("cfi-mfcall", CFIMFCall) SANITIZER("cfi-unrelated-cast", CFIUnrelatedCast) SANITIZER("cfi-nvcall", CFINVCall) SANITIZER("cfi-vcall", CFIVCall) SANITIZER_GROUP("cfi", CFI, - CFIDerivedCast | CFIICall | CFIUnrelatedCast | CFINVCall | - CFIVCall) + CFIDerivedCast | CFIICall | CFIMFCall | CFIUnrelatedCast | + CFINVCall | CFIVCall) // Safe Stack SANITIZER("safe-stack", SafeStack) +// Shadow Call Stack +SANITIZER("shadow-call-stack", ShadowCallStack) + // -fsanitize=undefined includes all the sanitizers which have low overhead, no // ABI or address space layout implications, and only catch undefined behavior. SANITIZER_GROUP("undefined", Undefined, diff --git a/include/clang/Basic/Sanitizers.h b/include/clang/Basic/Sanitizers.h index 1b936c7d115cf..469d9e2e95917 100644 --- a/include/clang/Basic/Sanitizers.h +++ b/include/clang/Basic/Sanitizers.h @@ -1,4 +1,4 @@ -//===--- Sanitizers.h - C Language Family Language Options ------*- C++ -*-===// +//===- Sanitizers.h - C Language Family Language Options --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,10 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines the clang::SanitizerKind enum. -/// +/// Defines the clang::SanitizerKind enum. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_SANITIZERS_H @@ -18,10 +18,12 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/MathExtras.h" +#include <cassert> +#include <cstdint> namespace clang { -typedef uint64_t SanitizerMask; +using SanitizerMask = uint64_t; namespace SanitizerKind { @@ -43,19 +45,19 @@ enum SanitizerOrdinal : uint64_t { const SanitizerMask ID##Group = 1ULL << SO_##ID##Group; #include "clang/Basic/Sanitizers.def" -} +} // namespace SanitizerKind struct SanitizerSet { - /// \brief Check if a certain (single) sanitizer is enabled. + /// Check if a certain (single) sanitizer is enabled. bool has(SanitizerMask K) const { assert(llvm::isPowerOf2_64(K)); return Mask & K; } - /// \brief Check if one or more sanitizers are enabled. + /// Check if one or more sanitizers are enabled. bool hasOneOf(SanitizerMask K) const { return Mask & K; } - /// \brief Enable or disable a certain (single) sanitizer. + /// Enable or disable a certain (single) sanitizer. void set(SanitizerMask K, bool Value) { assert(llvm::isPowerOf2_64(K)); Mask = Value ? (Mask | K) : (Mask & ~K); @@ -64,10 +66,10 @@ struct SanitizerSet { /// Disable the sanitizers specified in \p K. void clear(SanitizerMask K = SanitizerKind::All) { Mask &= ~K; } - /// \brief Returns true if at least one sanitizer is enabled. + /// Returns true if at least one sanitizer is enabled. bool empty() const { return Mask == 0; } - /// \brief Bitmask of enabled sanitizers. + /// Bitmask of enabled sanitizers. SanitizerMask Mask = 0; }; @@ -85,6 +87,6 @@ inline SanitizerMask getPPTransparentSanitizers() { SanitizerKind::Nullability | SanitizerKind::Undefined; } -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_BASIC_SANITIZERS_H diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index 7418b50f9d83b..f174f83abf4a0 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -1,4 +1,4 @@ -//===--- SourceLocation.h - Compact identifier for Source Files -*- C++ -*-===// +//===- SourceLocation.h - Compact identifier for Source Files ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -6,38 +6,39 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -/// +// /// \file -/// \brief Defines the clang::SourceLocation class and associated facilities. -/// +/// Defines the clang::SourceLocation class and associated facilities. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_SOURCELOCATION_H #define LLVM_CLANG_BASIC_SOURCELOCATION_H #include "clang/Basic/LLVM.h" -#include "llvm/Support/Compiler.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/PointerLikeTypeTraits.h" #include <cassert> -#include <functional> +#include <cstdint> #include <string> #include <utility> namespace llvm { - class MemoryBuffer; - template <typename T> struct DenseMapInfo; - template <typename T> struct isPodLike; -} + +template <typename T> struct DenseMapInfo; +template <typename T> struct isPodLike; + +} // namespace llvm namespace clang { class SourceManager; -/// \brief An opaque identifier used by SourceManager which refers to a +/// An opaque identifier used by SourceManager which refers to a /// source file (MemoryBuffer) along with its \#include path and \#line data. /// class FileID { - /// \brief A mostly-opaque identifier, where 0 is "invalid", >0 is + /// A mostly-opaque identifier, where 0 is "invalid", >0 is /// this module, and <-1 is something loaded from another module. int ID = 0; @@ -56,20 +57,20 @@ public: unsigned getHashValue() const { return static_cast<unsigned>(ID); } private: - friend class SourceManager; friend class ASTWriter; friend class ASTReader; + friend class SourceManager; static FileID get(int V) { FileID F; F.ID = V; return F; } + int getOpaqueValue() const { return ID; } }; - -/// \brief Encodes a location in the source. The SourceManager can decode this +/// Encodes a location in the source. The SourceManager can decode this /// to get at the full include stack, line and column information. /// /// Technically, a source location is simply an offset into the manager's view @@ -85,10 +86,12 @@ private: /// /// It is important that this type remains small. It is currently 32 bits wide. class SourceLocation { - unsigned ID = 0; - friend class SourceManager; friend class ASTReader; friend class ASTWriter; + friend class SourceManager; + + unsigned ID = 0; + enum : unsigned { MacroIDBit = 1U << 31 }; @@ -97,7 +100,7 @@ public: bool isFileID() const { return (ID & MacroIDBit) == 0; } bool isMacroID() const { return (ID & MacroIDBit) != 0; } - /// \brief Return true if this is a valid SourceLocation object. + /// Return true if this is a valid SourceLocation object. /// /// Invalid SourceLocations are often used when events have no corresponding /// location in the source (e.g. a diagnostic is required for a command line @@ -106,7 +109,7 @@ public: bool isInvalid() const { return ID == 0; } private: - /// \brief Return the offset into the manager's global input view. + /// Return the offset into the manager's global input view. unsigned getOffset() const { return ID & ~MacroIDBit; } @@ -124,9 +127,9 @@ private: L.ID = MacroIDBit | ID; return L; } -public: - /// \brief Return a source location with the specified offset from this +public: + /// Return a source location with the specified offset from this /// SourceLocation. SourceLocation getLocWithOffset(int Offset) const { assert(((getOffset()+Offset) & MacroIDBit) == 0 && "offset overflow"); @@ -135,14 +138,14 @@ public: return L; } - /// \brief When a SourceLocation itself cannot be used, this returns + /// When a SourceLocation itself cannot be used, this returns /// an (opaque) 32-bit integer encoding for it. /// /// This should only be passed to SourceLocation::getFromRawEncoding, it /// should not be inspected directly. unsigned getRawEncoding() const { return ID; } - /// \brief Turn a raw encoding of a SourceLocation object into + /// Turn a raw encoding of a SourceLocation object into /// a real SourceLocation. /// /// \see getRawEncoding. @@ -152,7 +155,7 @@ public: return X; } - /// \brief When a SourceLocation itself cannot be used, this returns + /// When a SourceLocation itself cannot be used, this returns /// an (opaque) pointer encoding for it. /// /// This should only be passed to SourceLocation::getFromPtrEncoding, it @@ -163,7 +166,7 @@ public: return (void*)(uintptr_t)getRawEncoding(); } - /// \brief Turn a pointer encoding of a SourceLocation object back + /// Turn a pointer encoding of a SourceLocation object back /// into a real SourceLocation. static SourceLocation getFromPtrEncoding(const void *Encoding) { return getFromRawEncoding((unsigned)(uintptr_t)Encoding); @@ -191,7 +194,7 @@ inline bool operator<(const SourceLocation &LHS, const SourceLocation &RHS) { return LHS.getRawEncoding() < RHS.getRawEncoding(); } -/// \brief A trivial tuple used to represent a source range. +/// A trivial tuple used to represent a source range. class SourceRange { SourceLocation B; SourceLocation E; @@ -219,7 +222,7 @@ public: } }; -/// \brief Represents a character-granular source range. +/// Represents a character-granular source range. /// /// The underlying SourceRange can either specify the starting/ending character /// of the range, or it can specify the start of the range and the start of the @@ -245,11 +248,12 @@ public: static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E) { return getTokenRange(SourceRange(B, E)); } + static CharSourceRange getCharRange(SourceLocation B, SourceLocation E) { return getCharRange(SourceRange(B, E)); } - /// \brief Return true if the end of this range specifies the start of + /// Return true if the end of this range specifies the start of /// the last token. Return false if the end of this range specifies the last /// character in the range. bool isTokenRange() const { return IsTokenRange; } @@ -261,12 +265,13 @@ public: void setBegin(SourceLocation b) { Range.setBegin(b); } void setEnd(SourceLocation e) { Range.setEnd(e); } + void setTokenRange(bool TR) { IsTokenRange = TR; } bool isValid() const { return Range.isValid(); } bool isInvalid() const { return !isValid(); } }; -/// \brief Represents an unpacked "presumed" location which can be presented +/// Represents an unpacked "presumed" location which can be presented /// to the user. /// /// A 'presumed' location can be modified by \#line and GNU line marker @@ -274,23 +279,23 @@ public: /// /// You can get a PresumedLoc from a SourceLocation with SourceManager. class PresumedLoc { - const char *Filename; + const char *Filename = nullptr; unsigned Line, Col; SourceLocation IncludeLoc; public: - PresumedLoc() : Filename(nullptr) {} + PresumedLoc() = default; PresumedLoc(const char *FN, unsigned Ln, unsigned Co, SourceLocation IL) : Filename(FN), Line(Ln), Col(Co), IncludeLoc(IL) {} - /// \brief Return true if this object is invalid or uninitialized. + /// Return true if this object is invalid or uninitialized. /// /// This occurs when created with invalid source locations or when walking /// off the top of a \#include stack. bool isInvalid() const { return Filename == nullptr; } bool isValid() const { return Filename != nullptr; } - /// \brief Return the presumed filename of this location. + /// Return the presumed filename of this location. /// /// This can be affected by \#line etc. const char *getFilename() const { @@ -298,7 +303,7 @@ public: return Filename; } - /// \brief Return the presumed line number of this location. + /// Return the presumed line number of this location. /// /// This can be affected by \#line etc. unsigned getLine() const { @@ -306,7 +311,7 @@ public: return Line; } - /// \brief Return the presumed column number of this location. + /// Return the presumed column number of this location. /// /// This cannot be affected by \#line, but is packaged here for convenience. unsigned getColumn() const { @@ -314,7 +319,7 @@ public: return Col; } - /// \brief Return the presumed include location of this location. + /// Return the presumed include location of this location. /// /// This can be affected by GNU linemarker directives. SourceLocation getIncludeLoc() const { @@ -325,18 +330,18 @@ public: class FileEntry; -/// \brief A SourceLocation and its associated SourceManager. +/// A SourceLocation and its associated SourceManager. /// /// This is useful for argument passing to functions that expect both objects. class FullSourceLoc : public SourceLocation { const SourceManager *SrcMgr = nullptr; public: - /// \brief Creates a FullSourceLoc where isValid() returns \c false. + /// Creates a FullSourceLoc where isValid() returns \c false. FullSourceLoc() = default; explicit FullSourceLoc(SourceLocation Loc, const SourceManager &SM) - : SourceLocation(Loc), SrcMgr(&SM) {} + : SourceLocation(Loc), SrcMgr(&SM) {} bool hasManager() const { bool hasSrcMgr = SrcMgr != nullptr; @@ -355,7 +360,6 @@ public: FullSourceLoc getExpansionLoc() const; FullSourceLoc getSpellingLoc() const; FullSourceLoc getFileLoc() const; - std::pair<FullSourceLoc, FullSourceLoc> getImmediateExpansionRange() const; PresumedLoc getPresumedLoc(bool UseLineDirectives = true) const; bool isMacroArgExpansion(FullSourceLoc *StartLoc = nullptr) const; FullSourceLoc getImmediateMacroCallerLoc() const; @@ -373,15 +377,13 @@ public: unsigned getLineNumber(bool *Invalid = nullptr) const; unsigned getColumnNumber(bool *Invalid = nullptr) const; - std::pair<FullSourceLoc, FullSourceLoc> getExpansionRange() const; - const FileEntry *getFileEntry() const; - /// \brief Return a StringRef to the source buffer data for the + /// Return a StringRef to the source buffer data for the /// specified FileID. StringRef getBufferData(bool *Invalid = nullptr) const; - /// \brief Decompose the specified location into a raw FileID + Offset pair. + /// Decompose the specified location into a raw FileID + Offset pair. /// /// The first element is the FileID, the second is the offset from the /// start of the buffer of the location. @@ -389,12 +391,12 @@ public: bool isInSystemHeader() const; - /// \brief Determines the order of 2 source locations in the translation unit. + /// Determines the order of 2 source locations in the translation unit. /// /// \returns true if this source location comes before 'Loc', false otherwise. bool isBeforeInTranslationUnitThan(SourceLocation Loc) const; - /// \brief Determines the order of 2 source locations in the translation unit. + /// Determines the order of 2 source locations in the translation unit. /// /// \returns true if this source location comes before 'Loc', false otherwise. bool isBeforeInTranslationUnitThan(FullSourceLoc Loc) const { @@ -403,44 +405,43 @@ public: return isBeforeInTranslationUnitThan((SourceLocation)Loc); } - /// \brief Comparison function class, useful for sorting FullSourceLocs. + /// Comparison function class, useful for sorting FullSourceLocs. struct BeforeThanCompare { bool operator()(const FullSourceLoc& lhs, const FullSourceLoc& rhs) const { return lhs.isBeforeInTranslationUnitThan(rhs); } }; - /// \brief Prints information about this FullSourceLoc to stderr. + /// Prints information about this FullSourceLoc to stderr. /// /// This is useful for debugging. void dump() const; - friend inline bool + friend bool operator==(const FullSourceLoc &LHS, const FullSourceLoc &RHS) { return LHS.getRawEncoding() == RHS.getRawEncoding() && LHS.SrcMgr == RHS.SrcMgr; } - friend inline bool + friend bool operator!=(const FullSourceLoc &LHS, const FullSourceLoc &RHS) { return !(LHS == RHS); } - }; - - -} // end namespace clang +} // namespace clang namespace llvm { + /// Define DenseMapInfo so that FileID's can be used as keys in DenseMap and /// DenseSets. template <> struct DenseMapInfo<clang::FileID> { - static inline clang::FileID getEmptyKey() { - return clang::FileID(); + static clang::FileID getEmptyKey() { + return {}; } - static inline clang::FileID getTombstoneKey() { + + static clang::FileID getTombstoneKey() { return clang::FileID::getSentinel(); } @@ -461,15 +462,17 @@ namespace llvm { // Teach SmallPtrSet how to handle SourceLocation. template<> struct PointerLikeTypeTraits<clang::SourceLocation> { - static inline void *getAsVoidPointer(clang::SourceLocation L) { + enum { NumLowBitsAvailable = 0 }; + + static void *getAsVoidPointer(clang::SourceLocation L) { return L.getPtrEncoding(); } - static inline clang::SourceLocation getFromVoidPointer(void *P) { + + static clang::SourceLocation getFromVoidPointer(void *P) { return clang::SourceLocation::getFromRawEncoding((unsigned)(uintptr_t)P); } - enum { NumLowBitsAvailable = 0 }; }; -} // end namespace llvm +} // namespace llvm -#endif +#endif // LLVM_CLANG_BASIC_SOURCELOCATION_H diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 397ad2e77fb5e..99c36f4cdfcc8 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // /// \file -/// \brief Defines the SourceManager interface. +/// Defines the SourceManager interface. /// /// There are three different types of locations in a %file: a spelling /// location, an expansion location, and a presumed location. @@ -35,6 +35,7 @@ #ifndef LLVM_CLANG_BASIC_SOURCEMANAGER_H #define LLVM_CLANG_BASIC_SOURCEMANAGER_H +#include "clang/Basic/Diagnostic.h" #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/ArrayRef.h" @@ -60,15 +61,14 @@ namespace clang { class ASTReader; class ASTWriter; -class DiagnosticsEngine; class LineTableInfo; class SourceManager; -/// \brief Public enums and private classes that are part of the +/// Public enums and private classes that are part of the /// SourceManager implementation. namespace SrcMgr { - /// \brief Indicates whether a file or directory holds normal user code, + /// Indicates whether a file or directory holds normal user code, /// system code, or system code which is implicitly 'extern "C"' in C++ mode. /// /// Entire directories can be tagged with this (this is maintained by @@ -89,19 +89,19 @@ namespace SrcMgr { return CK == C_User_ModuleMap || CK == C_System_ModuleMap; } - /// \brief One instance of this struct is kept for every file loaded or used. + /// One instance of this struct is kept for every file loaded or used. /// /// This object owns the MemoryBuffer object. - class LLVM_ALIGNAS(8) ContentCache { + class alignas(8) ContentCache { enum CCFlags { - /// \brief Whether the buffer is invalid. + /// Whether the buffer is invalid. InvalidFlag = 0x01, - /// \brief Whether the buffer should not be freed on destruction. + /// Whether the buffer should not be freed on destruction. DoNotFreeFlag = 0x02 }; - /// \brief The actual buffer containing the characters from the input + /// The actual buffer containing the characters from the input /// file. /// /// This is owned by the ContentCache object. The bits indicate @@ -109,7 +109,7 @@ namespace SrcMgr { mutable llvm::PointerIntPair<llvm::MemoryBuffer *, 2> Buffer; public: - /// \brief Reference to the file entry representing this ContentCache. + /// Reference to the file entry representing this ContentCache. /// /// This reference does not own the FileEntry object. /// @@ -117,35 +117,35 @@ namespace SrcMgr { /// an imaginary text buffer. const FileEntry *OrigEntry; - /// \brief References the file which the contents were actually loaded from. + /// References the file which the contents were actually loaded from. /// /// Can be different from 'Entry' if we overridden the contents of one file /// with the contents of another file. const FileEntry *ContentsEntry; - /// \brief A bump pointer allocated array of offsets for each source line. + /// A bump pointer allocated array of offsets for each source line. /// /// This is lazily computed. This is owned by the SourceManager /// BumpPointerAllocator object. unsigned *SourceLineCache = nullptr; - /// \brief The number of lines in this ContentCache. + /// The number of lines in this ContentCache. /// /// This is only valid if SourceLineCache is non-null. unsigned NumLines = 0; - /// \brief Indicates whether the buffer itself was provided to override + /// Indicates whether the buffer itself was provided to override /// the actual file contents. /// /// When true, the original entry may be a virtual file that does not /// exist. unsigned BufferOverridden : 1; - /// \brief True if this content cache was initially created for a source + /// True if this content cache was initially created for a source /// file considered as a system one. unsigned IsSystemFile : 1; - /// \brief True if this file may be transient, that is, if it might not + /// True if this file may be transient, that is, if it might not /// exist at some later point in time when this content entry is used, /// after serialization and deserialization. unsigned IsTransient : 1; @@ -176,7 +176,7 @@ namespace SrcMgr { ~ContentCache(); - /// \brief Returns the memory buffer for the associated content. + /// Returns the memory buffer for the associated content. /// /// \param Diag Object through which diagnostics will be emitted if the /// buffer cannot be retrieved. @@ -190,7 +190,7 @@ namespace SrcMgr { SourceLocation Loc = SourceLocation(), bool *Invalid = nullptr) const; - /// \brief Returns the size of the content encapsulated by this + /// Returns the size of the content encapsulated by this /// ContentCache. /// /// This can be the size of the source file or the size of an @@ -198,7 +198,7 @@ namespace SrcMgr { /// file this size is retrieved from the file's FileEntry. unsigned getSize() const; - /// \brief Returns the number of bytes actually mapped for this + /// Returns the number of bytes actually mapped for this /// ContentCache. /// /// This can be 0 if the MemBuffer was not actually expanded. @@ -208,20 +208,20 @@ namespace SrcMgr { /// this content cache. This is used for performance analysis. llvm::MemoryBuffer::BufferKind getMemoryBufferKind() const; - /// \brief Get the underlying buffer, returning NULL if the buffer is not + /// Get the underlying buffer, returning NULL if the buffer is not /// yet available. llvm::MemoryBuffer *getRawBuffer() const { return Buffer.getPointer(); } - /// \brief Replace the existing buffer (which will be deleted) + /// Replace the existing buffer (which will be deleted) /// with the given buffer. void replaceBuffer(llvm::MemoryBuffer *B, bool DoNotFree = false); - /// \brief Determine whether the buffer itself is invalid. + /// Determine whether the buffer itself is invalid. bool isBufferInvalid() const { return Buffer.getInt() & InvalidFlag; } - /// \brief Determine whether the buffer should be freed. + /// Determine whether the buffer should be freed. bool shouldFreeBuffer() const { return (Buffer.getInt() & DoNotFreeFlag) == 0; } @@ -232,7 +232,7 @@ namespace SrcMgr { static_assert(alignof(ContentCache) >= 8, "ContentCache must be 8-byte aligned."); - /// \brief Information about a FileID, basically just the logical file + /// Information about a FileID, basically just the logical file /// that it represents and include stack information. /// /// Each FileInfo has include stack information, indicating where it came @@ -246,26 +246,26 @@ namespace SrcMgr { friend class clang::ASTWriter; friend class clang::ASTReader; - /// \brief The location of the \#include that brought in this file. + /// The location of the \#include that brought in this file. /// /// This is an invalid SLOC for the main file (top of the \#include chain). unsigned IncludeLoc; // Really a SourceLocation - /// \brief Number of FileIDs (files and macros) that were created during + /// Number of FileIDs (files and macros) that were created during /// preprocessing of this \#include, including this SLocEntry. /// /// Zero means the preprocessor didn't provide such info for this SLocEntry. unsigned NumCreatedFIDs : 31; - /// \brief Whether this FileInfo has any \#line directives. + /// Whether this FileInfo has any \#line directives. unsigned HasLineDirectives : 1; - /// \brief The content cache and the characteristic of the file. + /// The content cache and the characteristic of the file. llvm::PointerIntPair<const ContentCache*, 3, CharacteristicKind> ContentAndKind; public: - /// \brief Return a FileInfo object. + /// Return a FileInfo object. static FileInfo get(SourceLocation IL, const ContentCache *Con, CharacteristicKind FileCharacter) { FileInfo X; @@ -285,28 +285,28 @@ namespace SrcMgr { return ContentAndKind.getPointer(); } - /// \brief Return whether this is a system header or not. + /// Return whether this is a system header or not. CharacteristicKind getFileCharacteristic() const { return ContentAndKind.getInt(); } - /// \brief Return true if this FileID has \#line directives in it. + /// Return true if this FileID has \#line directives in it. bool hasLineDirectives() const { return HasLineDirectives; } - /// \brief Set the flag that indicates that this FileID has + /// Set the flag that indicates that this FileID has /// line table entries associated with it. void setHasLineDirectives() { HasLineDirectives = true; } }; - /// \brief Each ExpansionInfo encodes the expansion location - where + /// Each ExpansionInfo encodes the expansion location - where /// the token was ultimately expanded, and the SpellingLoc - where the actual /// character data for the token came from. class ExpansionInfo { // Really these are all SourceLocations. - /// \brief Where the spelling for the token can be found. + /// Where the spelling for the token can be found. unsigned SpellingLoc; /// In a macro expansion, ExpansionLocStart and ExpansionLocEnd @@ -317,9 +317,13 @@ namespace SrcMgr { /// invalid location. unsigned ExpansionLocStart, ExpansionLocEnd; + /// Whether the expansion range is a token range. + bool ExpansionIsTokenRange; + public: SourceLocation getSpellingLoc() const { - return SourceLocation::getFromRawEncoding(SpellingLoc); + SourceLocation SpellLoc = SourceLocation::getFromRawEncoding(SpellingLoc); + return SpellLoc.isInvalid() ? getExpansionLocStart() : SpellLoc; } SourceLocation getExpansionLocStart() const { @@ -332,8 +336,14 @@ namespace SrcMgr { return EndLoc.isInvalid() ? getExpansionLocStart() : EndLoc; } - std::pair<SourceLocation,SourceLocation> getExpansionLocRange() const { - return std::make_pair(getExpansionLocStart(), getExpansionLocEnd()); + bool isExpansionTokenRange() const { + return ExpansionIsTokenRange; + } + + CharSourceRange getExpansionLocRange() const { + return CharSourceRange( + SourceRange(getExpansionLocStart(), getExpansionLocEnd()), + isExpansionTokenRange()); } bool isMacroArgExpansion() const { @@ -352,22 +362,24 @@ namespace SrcMgr { getExpansionLocStart() != getExpansionLocEnd(); } - /// \brief Return a ExpansionInfo for an expansion. + /// Return a ExpansionInfo for an expansion. /// /// Start and End specify the expansion range (where the macro is /// expanded), and SpellingLoc specifies the spelling location (where /// the characters from the token come from). All three can refer to /// normal File SLocs or expansion locations. static ExpansionInfo create(SourceLocation SpellingLoc, - SourceLocation Start, SourceLocation End) { + SourceLocation Start, SourceLocation End, + bool ExpansionIsTokenRange = true) { ExpansionInfo X; X.SpellingLoc = SpellingLoc.getRawEncoding(); X.ExpansionLocStart = Start.getRawEncoding(); X.ExpansionLocEnd = End.getRawEncoding(); + X.ExpansionIsTokenRange = ExpansionIsTokenRange; return X; } - /// \brief Return a special ExpansionInfo for the expansion of + /// Return a special ExpansionInfo for the expansion of /// a macro argument into a function-like macro's body. /// /// ExpansionLoc specifies the expansion location (where the macro is @@ -389,13 +401,24 @@ namespace SrcMgr { static ExpansionInfo createForMacroArg(SourceLocation SpellingLoc, SourceLocation ExpansionLoc) { // We store an intentionally invalid source location for the end of the - // expansion range to mark that this is a macro argument ion rather than - // a normal one. + // expansion range to mark that this is a macro argument location rather + // than a normal one. return create(SpellingLoc, ExpansionLoc, SourceLocation()); } + + /// Return a special ExpansionInfo representing a token that ends + /// prematurely. This is used to model a '>>' token that has been split + /// into '>' tokens and similar cases. Unlike for the other forms of + /// expansion, the expansion range in this case is a character range, not + /// a token range. + static ExpansionInfo createForTokenSplit(SourceLocation SpellingLoc, + SourceLocation Start, + SourceLocation End) { + return create(SpellingLoc, Start, End, false); + } }; - /// \brief This is a discriminated union of FileInfo and ExpansionInfo. + /// This is a discriminated union of FileInfo and ExpansionInfo. /// /// SourceManager keeps an array of these objects, and they are uniquely /// identified by the FileID datatype. @@ -446,44 +469,44 @@ namespace SrcMgr { } // namespace SrcMgr -/// \brief External source of source location entries. +/// External source of source location entries. class ExternalSLocEntrySource { public: virtual ~ExternalSLocEntrySource(); - /// \brief Read the source location entry with index ID, which will always be + /// Read the source location entry with index ID, which will always be /// less than -1. /// /// \returns true if an error occurred that prevented the source-location /// entry from being loaded. virtual bool ReadSLocEntry(int ID) = 0; - /// \brief Retrieve the module import location and name for the given ID, if + /// Retrieve the module import location and name for the given ID, if /// in fact it was loaded from a module (rather than, say, a precompiled /// header). virtual std::pair<SourceLocation, StringRef> getModuleImportLoc(int ID) = 0; }; -/// \brief Holds the cache used by isBeforeInTranslationUnit. +/// Holds the cache used by isBeforeInTranslationUnit. /// /// The cache structure is complex enough to be worth breaking out of /// SourceManager. class InBeforeInTUCacheEntry { - /// \brief The FileID's of the cached query. + /// The FileID's of the cached query. /// /// If these match up with a subsequent query, the result can be reused. FileID LQueryFID, RQueryFID; - /// \brief True if LQueryFID was created before RQueryFID. + /// True if LQueryFID was created before RQueryFID. /// /// This is used to compare macro expansion locations. bool IsLQFIDBeforeRQFID; - /// \brief The file found in common between the two \#include traces, i.e., + /// The file found in common between the two \#include traces, i.e., /// the nearest common ancestor of the \#include tree. FileID CommonFID; - /// \brief The offset of the previous query in CommonFID. + /// The offset of the previous query in CommonFID. /// /// Usually, this represents the location of the \#include for QueryFID, but /// if LQueryFID is a parent of RQueryFID (or vice versa) then these can be a @@ -491,7 +514,7 @@ class InBeforeInTUCacheEntry { unsigned LCommonOffset, RCommonOffset; public: - /// \brief Return true if the currently cached values match up with + /// Return true if the currently cached values match up with /// the specified LHS/RHS query. /// /// If not, we can't use the cache. @@ -499,7 +522,7 @@ public: return LQueryFID == LHS && RQueryFID == RHS; } - /// \brief If the cache is valid, compute the result given the + /// If the cache is valid, compute the result given the /// specified offsets in the LHS/RHS FileID's. bool getCachedResult(unsigned LOffset, unsigned ROffset) const { // If one of the query files is the common file, use the offset. Otherwise, @@ -518,7 +541,7 @@ public: return LOffset < ROffset; } - /// \brief Set up a new query. + /// Set up a new query. void setQueryFIDs(FileID LHS, FileID RHS, bool isLFIDBeforeRFID) { assert(LHS != RHS); LQueryFID = LHS; @@ -539,12 +562,12 @@ public: } }; -/// \brief The stack used when building modules on demand, which is used +/// The stack used when building modules on demand, which is used /// to provide a link between the source managers of the different compiler /// instances. using ModuleBuildStack = ArrayRef<std::pair<std::string, FullSourceLoc>>; -/// \brief This class handles loading and caching of source files into memory. +/// This class handles loading and caching of source files into memory. /// /// This object owns the MemoryBuffer objects for all of the loaded /// files and assigns unique FileID's for each unique \#include chain. @@ -557,14 +580,14 @@ using ModuleBuildStack = ArrayRef<std::pair<std::string, FullSourceLoc>>; /// where the expanded token came from and the expansion location specifies /// where it was expanded. class SourceManager : public RefCountedBase<SourceManager> { - /// \brief DiagnosticsEngine object. + /// DiagnosticsEngine object. DiagnosticsEngine &Diag; FileManager &FileMgr; mutable llvm::BumpPtrAllocator ContentCacheAlloc; - /// \brief Memoized information about all of the files tracked by this + /// Memoized information about all of the files tracked by this /// SourceManager. /// /// This map allows us to merge ContentCache entries based @@ -572,29 +595,29 @@ class SourceManager : public RefCountedBase<SourceManager> { /// non-null, FileEntry pointers. llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*> FileInfos; - /// \brief True if the ContentCache for files that are overridden by other + /// True if the ContentCache for files that are overridden by other /// files, should report the original file name. Defaults to true. bool OverridenFilesKeepOriginalName = true; - /// \brief True if non-system source files should be treated as volatile + /// True if non-system source files should be treated as volatile /// (likely to change while trying to use them). Defaults to false. bool UserFilesAreVolatile; - /// \brief True if all files read during this compilation should be treated + /// True if all files read during this compilation should be treated /// as transient (may not be present in later compilations using a module /// file created from this compilation). Defaults to false. bool FilesAreTransient = false; struct OverriddenFilesInfoTy { - /// \brief Files that have been overridden with the contents from another + /// Files that have been overridden with the contents from another /// file. llvm::DenseMap<const FileEntry *, const FileEntry *> OverriddenFiles; - /// \brief Files that were overridden with a memory buffer. + /// Files that were overridden with a memory buffer. llvm::DenseSet<const FileEntry *> OverriddenFilesWithBuffer; }; - /// \brief Lazily create the object keeping overridden files info, since + /// Lazily create the object keeping overridden files info, since /// it is uncommonly used. std::unique_ptr<OverriddenFilesInfoTy> OverriddenFilesInfo; @@ -604,77 +627,77 @@ class SourceManager : public RefCountedBase<SourceManager> { return *OverriddenFilesInfo; } - /// \brief Information about various memory buffers that we have read in. + /// Information about various memory buffers that we have read in. /// /// All FileEntry* within the stored ContentCache objects are NULL, /// as they do not refer to a file. std::vector<SrcMgr::ContentCache*> MemBufferInfos; - /// \brief The table of SLocEntries that are local to this module. + /// The table of SLocEntries that are local to this module. /// /// Positive FileIDs are indexes into this table. Entry 0 indicates an invalid /// expansion. SmallVector<SrcMgr::SLocEntry, 0> LocalSLocEntryTable; - /// \brief The table of SLocEntries that are loaded from other modules. + /// The table of SLocEntries that are loaded from other modules. /// /// Negative FileIDs are indexes into this table. To get from ID to an index, /// use (-ID - 2). mutable SmallVector<SrcMgr::SLocEntry, 0> LoadedSLocEntryTable; - /// \brief The starting offset of the next local SLocEntry. + /// The starting offset of the next local SLocEntry. /// /// This is LocalSLocEntryTable.back().Offset + the size of that entry. unsigned NextLocalOffset; - /// \brief The starting offset of the latest batch of loaded SLocEntries. + /// The starting offset of the latest batch of loaded SLocEntries. /// /// This is LoadedSLocEntryTable.back().Offset, except that that entry might /// not have been loaded, so that value would be unknown. unsigned CurrentLoadedOffset; - /// \brief The highest possible offset is 2^31-1, so CurrentLoadedOffset + /// The highest possible offset is 2^31-1, so CurrentLoadedOffset /// starts at 2^31. static const unsigned MaxLoadedOffset = 1U << 31U; - /// \brief A bitmap that indicates whether the entries of LoadedSLocEntryTable + /// A bitmap that indicates whether the entries of LoadedSLocEntryTable /// have already been loaded from the external source. /// /// Same indexing as LoadedSLocEntryTable. llvm::BitVector SLocEntryLoaded; - /// \brief An external source for source location entries. + /// An external source for source location entries. ExternalSLocEntrySource *ExternalSLocEntries = nullptr; - /// \brief A one-entry cache to speed up getFileID. + /// A one-entry cache to speed up getFileID. /// /// LastFileIDLookup records the last FileID looked up or created, because it /// is very common to look up many tokens from the same file. mutable FileID LastFileIDLookup; - /// \brief Holds information for \#line directives. + /// Holds information for \#line directives. /// /// This is referenced by indices from SLocEntryTable. LineTableInfo *LineTable = nullptr; - /// \brief These ivars serve as a cache used in the getLineNumber + /// These ivars serve as a cache used in the getLineNumber /// method which is used to speedup getLineNumber calls to nearby locations. mutable FileID LastLineNoFileIDQuery; mutable SrcMgr::ContentCache *LastLineNoContentCache; mutable unsigned LastLineNoFilePos; mutable unsigned LastLineNoResult; - /// \brief The file ID for the main source file of the translation unit. + /// The file ID for the main source file of the translation unit. FileID MainFileID; - /// \brief The file ID for the precompiled preamble there is one. + /// The file ID for the precompiled preamble there is one. FileID PreambleFileID; // Statistics for -print-stats. mutable unsigned NumLinearScans = 0; mutable unsigned NumBinaryProbes = 0; - /// \brief Associates a FileID with its "included/expanded in" decomposed + /// Associates a FileID with its "included/expanded in" decomposed /// location. /// /// Used to cache results from and speed-up \c getDecomposedIncludedLoc @@ -702,14 +725,14 @@ class SourceManager : public RefCountedBase<SourceManager> { mutable std::unique_ptr<SrcMgr::ContentCache> FakeContentCacheForRecovery; - /// \brief Lazily computed map of macro argument chunks to their expanded + /// Lazily computed map of macro argument chunks to their expanded /// source location. using MacroArgsMap = std::map<unsigned, SourceLocation>; mutable llvm::DenseMap<FileID, std::unique_ptr<MacroArgsMap>> MacroArgsCacheMap; - /// \brief The stack of modules being built, which is used to detect + /// The stack of modules being built, which is used to detect /// cycles in the module dependency graph as modules are being built, as /// well as to describe why we're rebuilding a particular module. /// @@ -735,29 +758,29 @@ public: FileManager &getFileManager() const { return FileMgr; } - /// \brief Set true if the SourceManager should report the original file name + /// Set true if the SourceManager should report the original file name /// for contents of files that were overridden by other files. Defaults to /// true. void setOverridenFilesKeepOriginalName(bool value) { OverridenFilesKeepOriginalName = value; } - /// \brief True if non-system source files should be treated as volatile + /// True if non-system source files should be treated as volatile /// (likely to change while trying to use them). bool userFilesAreVolatile() const { return UserFilesAreVolatile; } - /// \brief Retrieve the module build stack. + /// Retrieve the module build stack. ModuleBuildStack getModuleBuildStack() const { return StoredModuleBuildStack; } - /// \brief Set the module build stack. + /// Set the module build stack. void setModuleBuildStack(ModuleBuildStack stack) { StoredModuleBuildStack.clear(); StoredModuleBuildStack.append(stack.begin(), stack.end()); } - /// \brief Push an entry to the module build stack. + /// Push an entry to the module build stack. void pushModuleBuildStack(StringRef moduleName, FullSourceLoc importLoc) { StoredModuleBuildStack.push_back(std::make_pair(moduleName.str(),importLoc)); } @@ -766,28 +789,28 @@ public: // MainFileID creation and querying methods. //===--------------------------------------------------------------------===// - /// \brief Returns the FileID of the main source file. + /// Returns the FileID of the main source file. FileID getMainFileID() const { return MainFileID; } - /// \brief Set the file ID for the main source file. + /// Set the file ID for the main source file. void setMainFileID(FileID FID) { MainFileID = FID; } - /// \brief Set the file ID for the precompiled preamble. + /// Set the file ID for the precompiled preamble. void setPreambleFileID(FileID Preamble) { assert(PreambleFileID.isInvalid() && "PreambleFileID already set!"); PreambleFileID = Preamble; } - /// \brief Get the file ID for the precompiled preamble if there is one. + /// Get the file ID for the precompiled preamble if there is one. FileID getPreambleFileID() const { return PreambleFileID; } //===--------------------------------------------------------------------===// // Methods to create new FileID's and macro expansions. //===--------------------------------------------------------------------===// - /// \brief Create a new FileID that represents the specified file + /// Create a new FileID that represents the specified file /// being \#included from the specified IncludePosition. /// /// This translates NULL into standard input. @@ -800,7 +823,7 @@ public: return createFileID(IR, IncludePos, FileCharacter, LoadedID, LoadedOffset); } - /// \brief Create a new FileID that represents the specified memory buffer. + /// Create a new FileID that represents the specified memory buffer. /// /// This does no caching of the buffer and takes ownership of the /// MemoryBuffer, so only pass a MemoryBuffer to this once. @@ -815,7 +838,7 @@ public: enum UnownedTag { Unowned }; - /// \brief Create a new FileID that represents the specified memory buffer. + /// Create a new FileID that represents the specified memory buffer. /// /// This does no caching of the buffer and takes ownership of the /// MemoryBuffer, so only pass a MemoryBuffer to this once. @@ -827,7 +850,7 @@ public: IncludeLoc, FileCharacter, LoadedID, LoadedOffset); } - /// \brief Get the FileID for \p SourceFile if it exists. Otherwise, create a + /// Get the FileID for \p SourceFile if it exists. Otherwise, create a /// new FileID for the \p SourceFile. FileID getOrCreateFileID(const FileEntry *SourceFile, SrcMgr::CharacteristicKind FileCharacter) { @@ -836,7 +859,7 @@ public: FileCharacter); } - /// \brief Return a new SourceLocation that encodes the + /// Return a new SourceLocation that encodes the /// fact that a token from SpellingLoc should actually be referenced from /// ExpansionLoc, and that it represents the expansion of a macro argument /// into the function-like macro body. @@ -844,24 +867,31 @@ public: SourceLocation ExpansionLoc, unsigned TokLength); - /// \brief Return a new SourceLocation that encodes the fact + /// Return a new SourceLocation that encodes the fact /// that a token from SpellingLoc should actually be referenced from /// ExpansionLoc. SourceLocation createExpansionLoc(SourceLocation Loc, SourceLocation ExpansionLocStart, SourceLocation ExpansionLocEnd, unsigned TokLength, + bool ExpansionIsTokenRange = true, int LoadedID = 0, unsigned LoadedOffset = 0); - /// \brief Retrieve the memory buffer associated with the given file. + /// Return a new SourceLocation that encodes that the token starting + /// at \p TokenStart ends prematurely at \p TokenEnd. + SourceLocation createTokenSplitLoc(SourceLocation SpellingLoc, + SourceLocation TokenStart, + SourceLocation TokenEnd); + + /// Retrieve the memory buffer associated with the given file. /// /// \param Invalid If non-NULL, will be set \c true if an error /// occurs while retrieving the memory buffer. llvm::MemoryBuffer *getMemoryBufferForFile(const FileEntry *File, bool *Invalid = nullptr); - /// \brief Override the contents of the given source file by providing an + /// Override the contents of the given source file by providing an /// already-allocated buffer. /// /// \param SourceFile the source file whose contents will be overridden. @@ -878,7 +908,7 @@ public: overrideFileContents(SourceFile, Buffer.release(), /*DoNotFree*/ false); } - /// \brief Override the given source file with another one. + /// Override the given source file with another one. /// /// \param SourceFile the source file which will be overridden. /// @@ -887,7 +917,7 @@ public: void overrideFileContents(const FileEntry *SourceFile, const FileEntry *NewFile); - /// \brief Returns true if the file contents have been overridden. + /// Returns true if the file contents have been overridden. bool isFileOverridden(const FileEntry *File) const { if (OverriddenFilesInfo) { if (OverriddenFilesInfo->OverriddenFilesWithBuffer.count(File)) @@ -899,16 +929,16 @@ public: return false; } - /// \brief Disable overridding the contents of a file, previously enabled + /// Disable overridding the contents of a file, previously enabled /// with #overrideFileContents. /// /// This should be called before parsing has begun. void disableFileContentsOverride(const FileEntry *File); - /// \brief Specify that a file is transient. + /// Specify that a file is transient. void setFileIsTransient(const FileEntry *SourceFile); - /// \brief Specify that all files that are read during this compilation are + /// Specify that all files that are read during this compilation are /// transient. void setAllFilesAreTransient(bool Transient) { FilesAreTransient = Transient; @@ -918,7 +948,7 @@ public: // FileID manipulation methods. //===--------------------------------------------------------------------===// - /// \brief Return the buffer for the specified FileID. + /// Return the buffer for the specified FileID. /// /// If there is an error opening this buffer the first time, this /// manufactures a temporary buffer and returns a non-empty error string. @@ -952,7 +982,7 @@ public: Invalid); } - /// \brief Returns the FileEntry record for the provided FileID. + /// Returns the FileEntry record for the provided FileID. const FileEntry *getFileEntryForID(FileID FID) const { bool MyInvalid = false; const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &MyInvalid); @@ -965,7 +995,7 @@ public: return Content->OrigEntry; } - /// \brief Returns the FileEntry record for the provided SLocEntry. + /// Returns the FileEntry record for the provided SLocEntry. const FileEntry *getFileEntryForSLocEntry(const SrcMgr::SLocEntry &sloc) const { const SrcMgr::ContentCache *Content = sloc.getFile().getContentCache(); @@ -974,14 +1004,14 @@ public: return Content->OrigEntry; } - /// \brief Return a StringRef to the source buffer data for the + /// Return a StringRef to the source buffer data for the /// specified FileID. /// /// \param FID The file ID whose contents will be returned. /// \param Invalid If non-NULL, will be set true if an error occurred. StringRef getBufferData(FileID FID, bool *Invalid = nullptr) const; - /// \brief Get the number of FileIDs (files and macros) that were created + /// Get the number of FileIDs (files and macros) that were created /// during preprocessing of \p FID, including it. unsigned getNumCreatedFIDsForFileID(FileID FID) const { bool Invalid = false; @@ -992,7 +1022,7 @@ public: return Entry.getFile().NumCreatedFIDs; } - /// \brief Set the number of FileIDs (files and macros) that were created + /// Set the number of FileIDs (files and macros) that were created /// during preprocessing of \p FID, including it. void setNumCreatedFIDsForFileID(FileID FID, unsigned NumFIDs) const { bool Invalid = false; @@ -1008,7 +1038,7 @@ public: // SourceLocation manipulation methods. //===--------------------------------------------------------------------===// - /// \brief Return the FileID for a SourceLocation. + /// Return the FileID for a SourceLocation. /// /// This is a very hot method that is used for all SourceManager queries /// that start with a SourceLocation object. It is responsible for finding @@ -1024,14 +1054,14 @@ public: return getFileIDSlow(SLocOffset); } - /// \brief Return the filename of the file containing a SourceLocation. + /// Return the filename of the file containing a SourceLocation. StringRef getFilename(SourceLocation SpellingLoc) const { if (const FileEntry *F = getFileEntryForID(getFileID(SpellingLoc))) return F->getName(); return StringRef(); } - /// \brief Return the source location corresponding to the first byte of + /// Return the source location corresponding to the first byte of /// the specified file. SourceLocation getLocForStartOfFile(FileID FID) const { bool Invalid = false; @@ -1043,7 +1073,7 @@ public: return SourceLocation::getFileLoc(FileOffset); } - /// \brief Return the source location corresponding to the last byte of the + /// Return the source location corresponding to the last byte of the /// specified file. SourceLocation getLocForEndOfFile(FileID FID) const { bool Invalid = false; @@ -1055,7 +1085,7 @@ public: return SourceLocation::getFileLoc(FileOffset + getFileIDSize(FID)); } - /// \brief Returns the include location if \p FID is a \#include'd file + /// Returns the include location if \p FID is a \#include'd file /// otherwise it returns an invalid location. SourceLocation getIncludeLoc(FileID FID) const { bool Invalid = false; @@ -1066,7 +1096,7 @@ public: return Entry.getFile().getIncludeLoc(); } - // \brief Returns the import location if the given source location is + // Returns the import location if the given source location is // located within a module, or an invalid location if the source location // is within the current translation unit. std::pair<SourceLocation, StringRef> @@ -1081,7 +1111,7 @@ public: return ExternalSLocEntries->getModuleImportLoc(FID.ID); } - /// \brief Given a SourceLocation object \p Loc, return the expansion + /// Given a SourceLocation object \p Loc, return the expansion /// location referenced by the ID. SourceLocation getExpansionLoc(SourceLocation Loc) const { // Handle the non-mapped case inline, defer to out of line code to handle @@ -1090,7 +1120,7 @@ public: return getExpansionLocSlowCase(Loc); } - /// \brief Given \p Loc, if it is a macro location return the expansion + /// Given \p Loc, if it is a macro location return the expansion /// location or the spelling location, depending on if it comes from a /// macro argument or not. SourceLocation getFileLoc(SourceLocation Loc) const { @@ -1098,26 +1128,35 @@ public: return getFileLocSlowCase(Loc); } - /// \brief Return the start/end of the expansion information for an + /// Return the start/end of the expansion information for an /// expansion location. /// /// \pre \p Loc is required to be an expansion location. - std::pair<SourceLocation,SourceLocation> - getImmediateExpansionRange(SourceLocation Loc) const; + CharSourceRange getImmediateExpansionRange(SourceLocation Loc) const; - /// \brief Given a SourceLocation object, return the range of + /// Given a SourceLocation object, return the range of /// tokens covered by the expansion in the ultimate file. - std::pair<SourceLocation,SourceLocation> - getExpansionRange(SourceLocation Loc) const; + CharSourceRange getExpansionRange(SourceLocation Loc) const; - /// \brief Given a SourceRange object, return the range of - /// tokens covered by the expansion in the ultimate file. - SourceRange getExpansionRange(SourceRange Range) const { - return SourceRange(getExpansionRange(Range.getBegin()).first, - getExpansionRange(Range.getEnd()).second); + /// Given a SourceRange object, return the range of + /// tokens or characters covered by the expansion in the ultimate file. + CharSourceRange getExpansionRange(SourceRange Range) const { + SourceLocation Begin = getExpansionRange(Range.getBegin()).getBegin(); + CharSourceRange End = getExpansionRange(Range.getEnd()); + return CharSourceRange(SourceRange(Begin, End.getEnd()), + End.isTokenRange()); + } + + /// Given a CharSourceRange object, return the range of + /// tokens or characters covered by the expansion in the ultimate file. + CharSourceRange getExpansionRange(CharSourceRange Range) const { + CharSourceRange Expansion = getExpansionRange(Range.getAsRange()); + if (Expansion.getEnd() == Range.getEnd()) + Expansion.setTokenRange(Range.isTokenRange()); + return Expansion; } - /// \brief Given a SourceLocation object, return the spelling + /// Given a SourceLocation object, return the spelling /// location referenced by the ID. /// /// This is the place where the characters that make up the lexed token @@ -1129,7 +1168,7 @@ public: return getSpellingLocSlowCase(Loc); } - /// \brief Given a SourceLocation object, return the spelling location + /// Given a SourceLocation object, return the spelling location /// referenced by the ID. /// /// This is the first level down towards the place where the characters @@ -1137,7 +1176,19 @@ public: /// be used by clients. SourceLocation getImmediateSpellingLoc(SourceLocation Loc) const; - /// \brief Decompose the specified location into a raw FileID + Offset pair. + /// Form a SourceLocation from a FileID and Offset pair. + SourceLocation getComposedLoc(FileID FID, unsigned Offset) const { + bool Invalid = false; + const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid); + if (Invalid) + return SourceLocation(); + + unsigned GlobalOffset = Entry.getOffset() + Offset; + return Entry.isFile() ? SourceLocation::getFileLoc(GlobalOffset) + : SourceLocation::getMacroLoc(GlobalOffset); + } + + /// Decompose the specified location into a raw FileID + Offset pair. /// /// The first element is the FileID, the second is the offset from the /// start of the buffer of the location. @@ -1150,7 +1201,7 @@ public: return std::make_pair(FID, Loc.getOffset()-E.getOffset()); } - /// \brief Decompose the specified location into a raw FileID + Offset pair. + /// Decompose the specified location into a raw FileID + Offset pair. /// /// If the location is an expansion record, walk through it until we find /// the final location expanded. @@ -1169,7 +1220,7 @@ public: return getDecomposedExpansionLocSlowCase(E); } - /// \brief Decompose the specified location into a raw FileID + Offset pair. + /// Decompose the specified location into a raw FileID + Offset pair. /// /// If the location is an expansion record, walk through it until we find /// its spelling record. @@ -1187,11 +1238,11 @@ public: return getDecomposedSpellingLocSlowCase(E, Offset); } - /// \brief Returns the "included/expanded in" decomposed location of the given + /// Returns the "included/expanded in" decomposed location of the given /// FileID. std::pair<FileID, unsigned> getDecomposedIncludedLoc(FileID FID) const; - /// \brief Returns the offset from the start of the file that the + /// Returns the offset from the start of the file that the /// specified SourceLocation represents. /// /// This is not very meaningful for a macro ID. @@ -1199,7 +1250,7 @@ public: return getDecomposedLoc(SpellingLoc).second; } - /// \brief Tests whether the given source location represents a macro + /// Tests whether the given source location represents a macro /// argument's expansion into the function-like macro definition. /// /// \param StartLoc If non-null and function returns true, it is set to the @@ -1211,14 +1262,14 @@ public: bool isMacroArgExpansion(SourceLocation Loc, SourceLocation *StartLoc = nullptr) const; - /// \brief Tests whether the given source location represents the expansion of + /// Tests whether the given source location represents the expansion of /// a macro body. /// /// This is equivalent to testing whether the location is part of a macro /// expansion but not the expansion of an argument to a function-like macro. bool isMacroBodyExpansion(SourceLocation Loc) const; - /// \brief Returns true if the given MacroID location points at the beginning + /// Returns true if the given MacroID location points at the beginning /// of the immediate macro expansion. /// /// \param MacroBegin If non-null and function returns true, it is set to the @@ -1226,7 +1277,7 @@ public: bool isAtStartOfImmediateMacroExpansion(SourceLocation Loc, SourceLocation *MacroBegin = nullptr) const; - /// \brief Returns true if the given MacroID location points at the character + /// Returns true if the given MacroID location points at the character /// end of the immediate macro expansion. /// /// \param MacroEnd If non-null and function returns true, it is set to the @@ -1235,7 +1286,7 @@ public: isAtEndOfImmediateMacroExpansion(SourceLocation Loc, SourceLocation *MacroEnd = nullptr) const; - /// \brief Returns true if \p Loc is inside the [\p Start, +\p Length) + /// Returns true if \p Loc is inside the [\p Start, +\p Length) /// chunk of the source location address space. /// /// If it's true and \p RelativeOffset is non-null, it will be set to the @@ -1260,7 +1311,7 @@ public: return false; } - /// \brief Return true if both \p LHS and \p RHS are in the local source + /// Return true if both \p LHS and \p RHS are in the local source /// location address space or the loaded one. /// /// If it's true and \p RelativeOffset is non-null, it will be set to the @@ -1284,14 +1335,14 @@ public: // Queries about the code at a SourceLocation. //===--------------------------------------------------------------------===// - /// \brief Return a pointer to the start of the specified location + /// Return a pointer to the start of the specified location /// in the appropriate spelling MemoryBuffer. /// /// \param Invalid If non-NULL, will be set \c true if an error occurs. const char *getCharacterData(SourceLocation SL, bool *Invalid = nullptr) const; - /// \brief Return the column # for the specified file position. + /// Return the column # for the specified file position. /// /// This is significantly cheaper to compute than the line number. This /// returns zero if the column number isn't known. This may only be called @@ -1306,7 +1357,7 @@ public: unsigned getPresumedColumnNumber(SourceLocation Loc, bool *Invalid = nullptr) const; - /// \brief Given a SourceLocation, return the spelling line number + /// Given a SourceLocation, return the spelling line number /// for the position indicated. /// /// This requires building and caching a table of line offsets for the @@ -1317,14 +1368,14 @@ public: unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const; unsigned getPresumedLineNumber(SourceLocation Loc, bool *Invalid = nullptr) const; - /// \brief Return the filename or buffer identifier of the buffer the + /// Return the filename or buffer identifier of the buffer the /// location is in. /// /// Note that this name does not respect \#line directives. Use /// getPresumedLoc for normal clients. StringRef getBufferName(SourceLocation Loc, bool *Invalid = nullptr) const; - /// \brief Return the file characteristic of the specified source + /// Return the file characteristic of the specified source /// location, indicating whether this is a normal file, a system /// header, or an "implicit extern C" system header. /// @@ -1336,7 +1387,7 @@ public: /// considered to be from a system header. SrcMgr::CharacteristicKind getFileCharacteristic(SourceLocation Loc) const; - /// \brief Returns the "presumed" location of a SourceLocation specifies. + /// Returns the "presumed" location of a SourceLocation specifies. /// /// A "presumed location" can be modified by \#line or GNU line marker /// directives. This provides a view on the data that a user should see @@ -1352,7 +1403,7 @@ public: PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives = true) const; - /// \brief Returns whether the PresumedLoc for a given SourceLocation is + /// Returns whether the PresumedLoc for a given SourceLocation is /// in the main file. /// /// This computes the "presumed" location for a SourceLocation, then checks @@ -1361,7 +1412,7 @@ public: /// account. bool isInMainFile(SourceLocation Loc) const; - /// \brief Returns true if the spelling locations for both SourceLocations + /// Returns true if the spelling locations for both SourceLocations /// are part of the same file buffer. /// /// This check ignores line marker directives. @@ -1369,7 +1420,7 @@ public: return getFileID(Loc1) == getFileID(Loc2); } - /// \brief Returns true if the spelling location for the given location + /// Returns true if the spelling location for the given location /// is in the main file buffer. /// /// This check ignores line marker directives. @@ -1377,25 +1428,25 @@ public: return getFileID(Loc) == getMainFileID(); } - /// \brief Returns if a SourceLocation is in a system header. + /// Returns if a SourceLocation is in a system header. bool isInSystemHeader(SourceLocation Loc) const { return isSystem(getFileCharacteristic(Loc)); } - /// \brief Returns if a SourceLocation is in an "extern C" system header. + /// Returns if a SourceLocation is in an "extern C" system header. bool isInExternCSystemHeader(SourceLocation Loc) const { return getFileCharacteristic(Loc) == SrcMgr::C_ExternCSystem; } - /// \brief Returns whether \p Loc is expanded from a macro in a system header. + /// Returns whether \p Loc is expanded from a macro in a system header. bool isInSystemMacro(SourceLocation loc) const { return loc.isMacroID() && isInSystemHeader(getSpellingLoc(loc)); } - /// \brief The size of the SLocEntry that \p FID represents. + /// The size of the SLocEntry that \p FID represents. unsigned getFileIDSize(FileID FID) const; - /// \brief Given a specific FileID, returns true if \p Loc is inside that + /// Given a specific FileID, returns true if \p Loc is inside that /// FileID chunk and sets relative offset (offset of \p Loc from beginning /// of FileID) to \p relativeOffset. bool isInFileID(SourceLocation Loc, FileID FID, @@ -1414,10 +1465,10 @@ public: // Line Table Manipulation Routines //===--------------------------------------------------------------------===// - /// \brief Return the uniqued ID for the specified filename. + /// Return the uniqued ID for the specified filename. unsigned getLineTableFilenameID(StringRef Str); - /// \brief Add a line note to the line table for the FileID and offset + /// Add a line note to the line table for the FileID and offset /// specified by Loc. /// /// If FilenameID is -1, it is considered to be unspecified. @@ -1425,17 +1476,17 @@ public: bool IsFileEntry, bool IsFileExit, SrcMgr::CharacteristicKind FileKind); - /// \brief Determine if the source manager has a line table. + /// Determine if the source manager has a line table. bool hasLineTable() const { return LineTable != nullptr; } - /// \brief Retrieve the stored line table. + /// Retrieve the stored line table. LineTableInfo &getLineTable(); //===--------------------------------------------------------------------===// // Queries for performance analysis. //===--------------------------------------------------------------------===// - /// \brief Return the total amount of physical memory allocated by the + /// Return the total amount of physical memory allocated by the /// ContentCache allocator. size_t getContentCacheSize() const { return ContentCacheAlloc.getTotalMemory(); @@ -1449,11 +1500,11 @@ public: : malloc_bytes(malloc_bytes), mmap_bytes(mmap_bytes) {} }; - /// \brief Return the amount of memory used by memory buffers, breaking down + /// Return the amount of memory used by memory buffers, breaking down /// by heap-backed versus mmap'ed memory. MemoryBufferSizes getMemoryBufferSizes() const; - /// \brief Return the amount of memory used for various side tables and + /// Return the amount of memory used for various side tables and /// data structures in the SourceManager. size_t getDataStructureSizes() const; @@ -1461,25 +1512,25 @@ public: // Other miscellaneous methods. //===--------------------------------------------------------------------===// - /// \brief Get the source location for the given file:line:col triplet. + /// Get the source location for the given file:line:col triplet. /// /// If the source file is included multiple times, the source location will /// be based upon the first inclusion. SourceLocation translateFileLineCol(const FileEntry *SourceFile, unsigned Line, unsigned Col) const; - /// \brief Get the FileID for the given file. + /// Get the FileID for the given file. /// /// If the source file is included multiple times, the FileID will be the /// first inclusion. FileID translateFile(const FileEntry *SourceFile) const; - /// \brief Get the source location in \p FID for the given line:col. + /// Get the source location in \p FID for the given line:col. /// Returns null location if \p FID is not a file SLocEntry. SourceLocation translateLineCol(FileID FID, unsigned Line, unsigned Col) const; - /// \brief If \p Loc points inside a function macro argument, the returned + /// If \p Loc points inside a function macro argument, the returned /// location will be the macro location in which the argument was expanded. /// If a macro argument is used multiple times, the expanded location will /// be at the first expansion of the argument. @@ -1490,12 +1541,12 @@ public: /// where 'foo' was expanded into. SourceLocation getMacroArgExpandedLocation(SourceLocation Loc) const; - /// \brief Determines the order of 2 source locations in the translation unit. + /// Determines the order of 2 source locations in the translation unit. /// /// \returns true if LHS source location comes before RHS, false otherwise. bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const; - /// \brief Determines whether the two decomposed source location is in the + /// Determines whether the two decomposed source location is in the /// same translation unit. As a byproduct, it also calculates the order /// of the source locations in case they are in the same TU. /// @@ -1506,13 +1557,13 @@ public: isInTheSameTranslationUnit(std::pair<FileID, unsigned> &LOffs, std::pair<FileID, unsigned> &ROffs) const; - /// \brief Determines the order of 2 source locations in the "source location + /// Determines the order of 2 source locations in the "source location /// address space". bool isBeforeInSLocAddrSpace(SourceLocation LHS, SourceLocation RHS) const { return isBeforeInSLocAddrSpace(LHS, RHS.getOffset()); } - /// \brief Determines the order of a source location and a source location + /// Determines the order of a source location and a source location /// offset in the "source location address space". /// /// Note that we always consider source locations loaded from @@ -1544,25 +1595,25 @@ public: return FileInfos.find(File) != FileInfos.end(); } - /// \brief Print statistics to stderr. + /// Print statistics to stderr. void PrintStats() const; void dump() const; - /// \brief Get the number of local SLocEntries we have. + /// Get the number of local SLocEntries we have. unsigned local_sloc_entry_size() const { return LocalSLocEntryTable.size(); } - /// \brief Get a local SLocEntry. This is exposed for indexing. + /// Get a local SLocEntry. This is exposed for indexing. const SrcMgr::SLocEntry &getLocalSLocEntry(unsigned Index, bool *Invalid = nullptr) const { assert(Index < LocalSLocEntryTable.size() && "Invalid index"); return LocalSLocEntryTable[Index]; } - /// \brief Get the number of loaded SLocEntries we have. + /// Get the number of loaded SLocEntries we have. unsigned loaded_sloc_entry_size() const { return LoadedSLocEntryTable.size();} - /// \brief Get a loaded SLocEntry. This is exposed for indexing. + /// Get a loaded SLocEntry. This is exposed for indexing. const SrcMgr::SLocEntry &getLoadedSLocEntry(unsigned Index, bool *Invalid = nullptr) const { assert(Index < LoadedSLocEntryTable.size() && "Invalid index"); @@ -1588,7 +1639,7 @@ public: ExternalSLocEntries = Source; } - /// \brief Allocate a number of loaded SLocEntries, which will be actually + /// Allocate a number of loaded SLocEntries, which will be actually /// loaded on demand from the external source. /// /// NumSLocEntries will be allocated, which occupy a total of TotalSize space @@ -1597,23 +1648,23 @@ public: std::pair<int, unsigned> AllocateLoadedSLocEntries(unsigned NumSLocEntries, unsigned TotalSize); - /// \brief Returns true if \p Loc came from a PCH/Module. + /// Returns true if \p Loc came from a PCH/Module. bool isLoadedSourceLocation(SourceLocation Loc) const { return Loc.getOffset() >= CurrentLoadedOffset; } - /// \brief Returns true if \p Loc did not come from a PCH/Module. + /// Returns true if \p Loc did not come from a PCH/Module. bool isLocalSourceLocation(SourceLocation Loc) const { return Loc.getOffset() < NextLocalOffset; } - /// \brief Returns true if \p FID came from a PCH/Module. + /// Returns true if \p FID came from a PCH/Module. bool isLoadedFileID(FileID FID) const { assert(FID.ID != -1 && "Using FileID sentinel value"); return FID.ID < 0; } - /// \brief Returns true if \p FID did not come from a PCH/Module. + /// Returns true if \p FID did not come from a PCH/Module. bool isLocalFileID(FileID FID) const { return !isLoadedFileID(FID); } @@ -1631,9 +1682,12 @@ public: // Otherwise, the caller of the macro is located where this macro is // expanded (while the spelling is part of the macro definition). - return getImmediateExpansionRange(Loc).first; + return getImmediateExpansionRange(Loc).getBegin(); } + /// \return Location of the top-level macro caller. + SourceLocation getTopMacroCallerLoc(SourceLocation Loc) const; + private: friend class ASTReader; friend class ASTWriter; @@ -1643,7 +1697,7 @@ private: const SrcMgr::SLocEntry &loadSLocEntry(unsigned Index, bool *Invalid) const; - /// \brief Get the entry with the given unwrapped FileID. + /// Get the entry with the given unwrapped FileID. const SrcMgr::SLocEntry &getSLocEntryByID(int ID, bool *Invalid = nullptr) const { assert(ID != -1 && "Using FileID sentinel value"); @@ -1664,7 +1718,7 @@ private: int LoadedID = 0, unsigned LoadedOffset = 0); - /// \brief Return true if the specified FileID contains the + /// Return true if the specified FileID contains the /// specified SourceLocation offset. This is a very hot method. inline bool isOffsetInFileID(FileID FID, unsigned SLocOffset) const { const SrcMgr::SLocEntry &Entry = getSLocEntry(FID); @@ -1684,15 +1738,15 @@ private: return SLocOffset < getSLocEntryByID(FID.ID+1).getOffset(); } - /// \brief Returns the previous in-order FileID or an invalid FileID if there + /// Returns the previous in-order FileID or an invalid FileID if there /// is no previous one. FileID getPreviousFileID(FileID FID) const; - /// \brief Returns the next in-order FileID or an invalid FileID if there is + /// Returns the next in-order FileID or an invalid FileID if there is /// no next one. FileID getNextFileID(FileID FID) const; - /// \brief Create a new fileID for the specified ContentCache and + /// Create a new fileID for the specified ContentCache and /// include position. /// /// This works regardless of whether the ContentCache corresponds to a @@ -1706,7 +1760,7 @@ private: getOrCreateContentCache(const FileEntry *SourceFile, bool isSystemFile = false); - /// \brief Create a new ContentCache for the specified memory buffer. + /// Create a new ContentCache for the specified memory buffer. const SrcMgr::ContentCache * createMemBufferContentCache(llvm::MemoryBuffer *Buf, bool DoNotFree); @@ -1731,11 +1785,11 @@ private: unsigned ExpansionLength) const; }; -/// \brief Comparison function object. +/// Comparison function object. template<typename T> class BeforeThanCompare; -/// \brief Compare two source locations. +/// Compare two source locations. template<> class BeforeThanCompare<SourceLocation> { SourceManager &SM; @@ -1748,7 +1802,7 @@ public: } }; -/// \brief Compare two non-overlapping source ranges. +/// Compare two non-overlapping source ranges. template<> class BeforeThanCompare<SourceRange> { SourceManager &SM; @@ -1761,6 +1815,28 @@ public: } }; +/// SourceManager and necessary depdencies (e.g. VFS, FileManager) for a single +/// in-memorty file. +class SourceManagerForFile { +public: + /// Creates SourceManager and necessary depdencies (e.g. VFS, FileManager). + /// The main file in the SourceManager will be \p FileName with \p Content. + SourceManagerForFile(StringRef FileName, StringRef Content); + + SourceManager &get() { + assert(SourceMgr); + return *SourceMgr; + } + +private: + // The order of these fields are important - they should be in the same order + // as they are created in `createSourceManagerForFile` so that they can be + // deleted in the reverse order as they are created. + std::unique_ptr<FileManager> FileMgr; + std::unique_ptr<DiagnosticsEngine> Diagnostics; + std::unique_ptr<SourceManager> SourceMgr; +}; + } // namespace clang #endif // LLVM_CLANG_BASIC_SOURCEMANAGER_H diff --git a/include/clang/Basic/SourceManagerInternals.h b/include/clang/Basic/SourceManagerInternals.h index edd910e704128..68873be594d4b 100644 --- a/include/clang/Basic/SourceManagerInternals.h +++ b/include/clang/Basic/SourceManagerInternals.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// // /// \file -/// \brief Defines implementation details of the clang::SourceManager class. +/// Defines implementation details of the clang::SourceManager class. // //===----------------------------------------------------------------------===// @@ -31,20 +31,20 @@ namespace clang { //===----------------------------------------------------------------------===// struct LineEntry { - /// \brief The offset in this file that the line entry occurs at. + /// The offset in this file that the line entry occurs at. unsigned FileOffset; - /// \brief The presumed line number of this line entry: \#line 4. + /// The presumed line number of this line entry: \#line 4. unsigned LineNo; - /// \brief The ID of the filename identified by this line entry: + /// The ID of the filename identified by this line entry: /// \#line 4 "foo.c". This is -1 if not specified. int FilenameID; - /// \brief Set the 0 if no flags, 1 if a system header, + /// Set the 0 if no flags, 1 if a system header, SrcMgr::CharacteristicKind FileKind; - /// \brief The offset of the virtual include stack location, + /// The offset of the virtual include stack location, /// which is manipulated by GNU linemarker directives. /// /// If this is 0 then there is no virtual \#includer. @@ -77,9 +77,9 @@ inline bool operator<(unsigned Offset, const LineEntry &E) { return Offset < E.FileOffset; } -/// \brief Used to hold and unique data used to represent \#line information. +/// Used to hold and unique data used to represent \#line information. class LineTableInfo { - /// \brief Map used to assign unique IDs to filenames in \#line directives. + /// Map used to assign unique IDs to filenames in \#line directives. /// /// This allows us to unique the filenames that /// frequently reoccur and reference them with indices. FilenameIDs holds @@ -88,7 +88,7 @@ class LineTableInfo { llvm::StringMap<unsigned, llvm::BumpPtrAllocator> FilenameIDs; std::vector<llvm::StringMapEntry<unsigned>*> FilenamesByID; - /// \brief Map from FileIDs to a list of line entries (sorted by the offset + /// Map from FileIDs to a list of line entries (sorted by the offset /// at which they occur in the file). std::map<FileID, std::vector<LineEntry>> LineEntries; @@ -113,7 +113,7 @@ public: unsigned EntryExit, SrcMgr::CharacteristicKind FileKind); - /// \brief Find the line entry nearest to FID that is before it. + /// Find the line entry nearest to FID that is before it. /// /// If there is no line entry before \p Offset in \p FID, returns null. const LineEntry *FindNearestLineEntry(FileID FID, unsigned Offset); @@ -124,7 +124,7 @@ public: iterator begin() { return LineEntries.begin(); } iterator end() { return LineEntries.end(); } - /// \brief Add a new line entry that has already been encoded into + /// Add a new line entry that has already been encoded into /// the internal representation of the line table. void AddEntry(FileID FID, const std::vector<LineEntry> &Entries); }; diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h index 377534baab06b..303b77e448053 100644 --- a/include/clang/Basic/Specifiers.h +++ b/include/clang/Basic/Specifiers.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines various enumerations that describe declaration and +/// Defines various enumerations that describe declaration and /// type specifiers. /// //===----------------------------------------------------------------------===// @@ -21,7 +21,7 @@ #include "llvm/Support/ErrorHandling.h" namespace clang { - /// \brief Specifies the width of a type, e.g., short, long, or long long. + /// Specifies the width of a type, e.g., short, long, or long long. enum TypeSpecifierWidth { TSW_unspecified, TSW_short, @@ -29,7 +29,7 @@ namespace clang { TSW_longlong }; - /// \brief Specifies the signedness of a type, e.g., signed or unsigned. + /// Specifies the signedness of a type, e.g., signed or unsigned. enum TypeSpecifierSign { TSS_unspecified, TSS_signed, @@ -41,18 +41,21 @@ namespace clang { TSP_pipe }; - /// \brief Specifies the kind of type. + /// Specifies the kind of type. enum TypeSpecifierType { TST_unspecified, TST_void, TST_char, TST_wchar, // C++ wchar_t + TST_char8, // C++20 char8_t (proposed) TST_char16, // C++11 char16_t TST_char32, // C++11 char32_t TST_int, TST_int128, TST_half, // OpenCL half, ARM NEON __fp16 TST_Float16, // C11 extension ISO/IEC TS 18661-3 + TST_Accum, // ISO/IEC JTC1 SC22 WG14 N1169 Extension + TST_Fract, TST_float, TST_double, TST_float128, @@ -80,7 +83,7 @@ namespace clang { TST_error // erroneous type }; - /// \brief Structure that packs information about the type specifiers that + /// Structure that packs information about the type specifiers that /// were written in a particular type specifier sequence. struct WrittenBuiltinSpecs { static_assert(TST_error < 1 << 6, "Type bitfield not wide enough for TST"); @@ -90,7 +93,7 @@ namespace clang { unsigned ModeAttr : 1; }; - /// \brief A C++ access specifier (public, private, protected), plus the + /// A C++ access specifier (public, private, protected), plus the /// special value "none" which means different things in different contexts. enum AccessSpecifier { AS_public, @@ -99,24 +102,24 @@ namespace clang { AS_none }; - /// \brief The categorization of expression values, currently following the + /// The categorization of expression values, currently following the /// C++11 scheme. enum ExprValueKind { - /// \brief An r-value expression (a pr-value in the C++11 taxonomy) + /// An r-value expression (a pr-value in the C++11 taxonomy) /// produces a temporary value. VK_RValue, - /// \brief An l-value expression is a reference to an object with + /// An l-value expression is a reference to an object with /// independent storage. VK_LValue, - /// \brief An x-value expression is a reference to an object with + /// An x-value expression is a reference to an object with /// independent storage but which can be "moved", i.e. /// efficiently cannibalized for its resources. VK_XValue }; - /// \brief A further classification of the kind of object referenced by an + /// A further classification of the kind of object referenced by an /// l-value or x-value. enum ExprObjectKind { /// An ordinary object is located at an address in memory. @@ -138,7 +141,7 @@ namespace clang { OK_ObjCSubscript }; - /// \brief Describes the kind of template specialization that a + /// Describes the kind of template specialization that a /// particular template specialization declaration represents. enum TemplateSpecializationKind { /// This template specialization was formed from a template-id but @@ -161,14 +164,14 @@ namespace clang { TSK_ExplicitInstantiationDefinition }; - /// \brief Determine whether this template specialization kind refers + /// Determine whether this template specialization kind refers /// to an instantiation of an entity (as opposed to a non-template or /// an explicit specialization). inline bool isTemplateInstantiation(TemplateSpecializationKind Kind) { return Kind != TSK_Undeclared && Kind != TSK_ExplicitSpecialization; } - /// \brief True if this template specialization kind is an explicit + /// True if this template specialization kind is an explicit /// specialization, explicit instantiation declaration, or explicit /// instantiation definition. inline bool isTemplateExplicitInstantiationOrSpecialization( @@ -186,7 +189,7 @@ namespace clang { llvm_unreachable("bad template specialization kind"); } - /// \brief Thread storage-class-specifier. + /// Thread storage-class-specifier. enum ThreadStorageClassSpecifier { TSCS_unspecified, /// GNU __thread. @@ -199,7 +202,7 @@ namespace clang { TSCS__Thread_local }; - /// \brief Storage classes. + /// Storage classes. enum StorageClass { // These are legal on both functions and variables. SC_None, @@ -212,24 +215,24 @@ namespace clang { SC_Register }; - /// \brief Checks whether the given storage class is legal for functions. + /// Checks whether the given storage class is legal for functions. inline bool isLegalForFunction(StorageClass SC) { return SC <= SC_PrivateExtern; } - /// \brief Checks whether the given storage class is legal for variables. + /// Checks whether the given storage class is legal for variables. inline bool isLegalForVariable(StorageClass SC) { return true; } - /// \brief In-class initialization styles for non-static data members. + /// In-class initialization styles for non-static data members. enum InClassInitStyle { ICIS_NoInit, ///< No in-class initializer. ICIS_CopyInit, ///< Copy initialization. ICIS_ListInit ///< Direct list-initialization. }; - /// \brief CallingConv - Specifies the calling convention that a function uses. + /// CallingConv - Specifies the calling convention that a function uses. enum CallingConv { CC_C, // __attribute__((cdecl)) CC_X86StdCall, // __attribute__((stdcall)) @@ -250,7 +253,7 @@ namespace clang { CC_PreserveAll, // __attribute__((preserve_all)) }; - /// \brief Checks whether the given calling convention supports variadic + /// Checks whether the given calling convention supports variadic /// calls. Unprototyped calls also use the variadic call rules. inline bool supportsVariadicCall(CallingConv CC) { switch (CC) { @@ -269,7 +272,7 @@ namespace clang { } } - /// \brief The storage duration for an object (per C++ [basic.stc]). + /// The storage duration for an object (per C++ [basic.stc]). enum StorageDuration { SD_FullExpression, ///< Full-expression storage duration (for temporaries). SD_Automatic, ///< Automatic storage duration (most local variables). @@ -291,11 +294,17 @@ namespace clang { Unspecified }; + /// Return true if \p L has a weaker nullability annotation than \p R. The + /// ordering is: Unspecified < Nullable < NonNull. + inline bool hasWeakerNullability(NullabilityKind L, NullabilityKind R) { + return uint8_t(L) > uint8_t(R); + } + /// Retrieve the spelling of the given nullability kind. llvm::StringRef getNullabilitySpelling(NullabilityKind kind, bool isContextSensitive = false); - /// \brief Kinds of parameter ABI. + /// Kinds of parameter ABI. enum class ParameterABI { /// This parameter uses ordinary ABI rules for its type. Ordinary, diff --git a/include/clang/Basic/Stack.h b/include/clang/Basic/Stack.h new file mode 100644 index 0000000000000..15a37c6d5949f --- /dev/null +++ b/include/clang/Basic/Stack.h @@ -0,0 +1,27 @@ +//===--- Stack.h - Utilities for dealing with stack space -------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// Defines utilities for dealing with stack allocation and stack space. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_BASIC_STACK_H +#define LLVM_CLANG_BASIC_STACK_H + +#include <cstddef> + +namespace clang { + /// The amount of stack space that Clang would like to be provided with. + /// If less than this much is available, we may be unable to reach our + /// template instantiation depth limit and other similar limits. + constexpr size_t DesiredStackSize = 8 << 20; +} // end namespace clang + +#endif // LLVM_CLANG_BASIC_STACK_H diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index 0d21845fbf8b1..506da07203385 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -57,6 +57,7 @@ def Expr : Stmt<1>; def PredefinedExpr : DStmt<Expr>; def DeclRefExpr : DStmt<Expr>; def IntegerLiteral : DStmt<Expr>; +def FixedPointLiteral : DStmt<Expr>; def FloatingLiteral : DStmt<Expr>; def ImaginaryLiteral : DStmt<Expr>; def StringLiteral : DStmt<Expr>; diff --git a/include/clang/Basic/SyncScope.h b/include/clang/Basic/SyncScope.h index 09ac0052185af..db4461eda0134 100644 --- a/include/clang/Basic/SyncScope.h +++ b/include/clang/Basic/SyncScope.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Provides definitions for the atomic synchronization scopes. +/// Provides definitions for the atomic synchronization scopes. /// //===----------------------------------------------------------------------===// @@ -22,7 +22,7 @@ namespace clang { -/// \brief Defines synch scope values used internally by clang. +/// Defines synch scope values used internally by clang. /// /// The enum values start from 0 and are contiguous. They are mainly used for /// enumerating all supported synch scope values and mapping them to LLVM @@ -62,36 +62,36 @@ inline llvm::StringRef getAsString(SyncScope S) { llvm_unreachable("Invalid synch scope"); } -/// \brief Defines the kind of atomic scope models. +/// Defines the kind of atomic scope models. enum class AtomicScopeModelKind { None, OpenCL }; -/// \brief Defines the interface for synch scope model. +/// Defines the interface for synch scope model. class AtomicScopeModel { public: virtual ~AtomicScopeModel() {} - /// \brief Maps language specific synch scope values to internal + /// Maps language specific synch scope values to internal /// SyncScope enum. virtual SyncScope map(unsigned S) const = 0; - /// \brief Check if the compile-time constant synch scope value + /// Check if the compile-time constant synch scope value /// is valid. virtual bool isValid(unsigned S) const = 0; - /// \brief Get all possible synch scope values that might be + /// Get all possible synch scope values that might be /// encountered at runtime for the current language. virtual ArrayRef<unsigned> getRuntimeValues() const = 0; - /// \brief If atomic builtin function is called with invalid + /// If atomic builtin function is called with invalid /// synch scope value at runtime, it will fall back to a valid /// synch scope value returned by this function. virtual unsigned getFallBackValue() const = 0; - /// \brief Create an atomic scope model by AtomicScopeModelKind. + /// Create an atomic scope model by AtomicScopeModelKind. /// \return an empty std::unique_ptr for AtomicScopeModelKind::None. static std::unique_ptr<AtomicScopeModel> create(AtomicScopeModelKind K); }; -/// \brief Defines the synch scope model for OpenCL. +/// Defines the synch scope model for OpenCL. class AtomicScopeOpenCLModel : public AtomicScopeModel { public: /// The enum values match the pre-defined macros diff --git a/include/clang/Basic/TargetBuiltins.h b/include/clang/Basic/TargetBuiltins.h index 8f4f5e9a74dd8..75a3811007cc5 100644 --- a/include/clang/Basic/TargetBuiltins.h +++ b/include/clang/Basic/TargetBuiltins.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Enumerates target-specific builtins in their own namespaces within +/// Enumerates target-specific builtins in their own namespaces within /// namespace ::clang. /// //===----------------------------------------------------------------------===// @@ -31,7 +31,7 @@ namespace clang { }; } - /// \brief ARM builtins + /// ARM builtins namespace ARM { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -42,7 +42,7 @@ namespace clang { }; } - /// \brief AArch64 builtins + /// AArch64 builtins namespace AArch64 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, @@ -53,7 +53,7 @@ namespace clang { }; } - /// \brief PPC builtins + /// PPC builtins namespace PPC { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -63,7 +63,7 @@ namespace clang { }; } - /// \brief NVPTX builtins + /// NVPTX builtins namespace NVPTX { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -73,7 +73,7 @@ namespace clang { }; } - /// \brief AMDGPU builtins + /// AMDGPU builtins namespace AMDGPU { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, @@ -83,7 +83,7 @@ namespace clang { }; } - /// \brief X86 builtins + /// X86 builtins namespace X86 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, @@ -97,7 +97,7 @@ namespace clang { }; } - /// \brief Flags to identify the types for overloaded Neon builtins. + /// Flags to identify the types for overloaded Neon builtins. /// /// These must be kept in sync with the flags in utils/TableGen/NeonEmitter.h. class NeonTypeFlags { @@ -140,7 +140,7 @@ namespace clang { bool isQuad() const { return (Flags & QuadFlag) != 0; } }; - /// \brief Hexagon builtins + /// Hexagon builtins namespace Hexagon { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -150,7 +150,7 @@ namespace clang { }; } - /// \brief Nios2 builtins + /// Nios2 builtins namespace Nios2 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, @@ -160,7 +160,7 @@ namespace clang { }; } - /// \brief MIPS builtins + /// MIPS builtins namespace Mips { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -170,7 +170,7 @@ namespace clang { }; } - /// \brief XCore builtins + /// XCore builtins namespace XCore { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -180,7 +180,7 @@ namespace clang { }; } - /// \brief Le64 builtins + /// Le64 builtins namespace Le64 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, @@ -190,7 +190,7 @@ namespace clang { }; } - /// \brief SystemZ builtins + /// SystemZ builtins namespace SystemZ { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, @@ -200,7 +200,7 @@ namespace clang { }; } - /// \brief WebAssembly builtins + /// WebAssembly builtins namespace WebAssembly { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin-1, diff --git a/include/clang/Basic/TargetCXXABI.h b/include/clang/Basic/TargetCXXABI.h index 7fb1f826b0f64..455121a98f338 100644 --- a/include/clang/Basic/TargetCXXABI.h +++ b/include/clang/Basic/TargetCXXABI.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the TargetCXXABI class, which abstracts details of the +/// Defines the TargetCXXABI class, which abstracts details of the /// C++ ABI that we're targeting. /// //===----------------------------------------------------------------------===// @@ -20,10 +20,10 @@ namespace clang { -/// \brief The basic abstraction for the target C++ ABI. +/// The basic abstraction for the target C++ ABI. class TargetCXXABI { public: - /// \brief The basic C++ ABI kind. + /// The basic C++ ABI kind. enum Kind { /// The generic Itanium ABI is the standard ABI of most open-source /// and Unix-like platforms. It is the primary ABI targeted by @@ -131,7 +131,7 @@ public: Kind getKind() const { return TheKind; } - /// \brief Does this ABI generally fall into the Itanium family of ABIs? + /// Does this ABI generally fall into the Itanium family of ABIs? bool isItaniumFamily() const { switch (getKind()) { case GenericAArch64: @@ -150,7 +150,7 @@ public: llvm_unreachable("bad ABI kind"); } - /// \brief Is this ABI an MSVC-compatible ABI? + /// Is this ABI an MSVC-compatible ABI? bool isMicrosoft() const { switch (getKind()) { case GenericAArch64: @@ -169,7 +169,7 @@ public: llvm_unreachable("bad ABI kind"); } - /// \brief Are member functions differently aligned? + /// Are member functions differently aligned? /// /// Many Itanium-style C++ ABIs require member functions to be aligned, so /// that a pointer to such a function is guaranteed to have a zero in the @@ -199,13 +199,6 @@ public: llvm_unreachable("bad ABI kind"); } - /// \brief Is the default C++ member function calling convention - /// the same as the default calling convention? - bool isMemberFunctionCCDefault() const { - // Right now, this is always false for Microsoft. - return !isMicrosoft(); - } - /// Are arguments to a call destroyed left to right in the callee? /// This is a fundamental language change, since it implies that objects /// passed by value do *not* live to the end of the full expression. @@ -217,25 +210,25 @@ public: return isMicrosoft(); } - /// \brief Does this ABI have different entrypoints for complete-object + /// Does this ABI have different entrypoints for complete-object /// and base-subobject constructors? bool hasConstructorVariants() const { return isItaniumFamily(); } - /// \brief Does this ABI allow virtual bases to be primary base classes? + /// Does this ABI allow virtual bases to be primary base classes? bool hasPrimaryVBases() const { return isItaniumFamily(); } - /// \brief Does this ABI use key functions? If so, class data such as the + /// Does this ABI use key functions? If so, class data such as the /// vtable is emitted with strong linkage by the TU containing the key /// function. bool hasKeyFunctions() const { return isItaniumFamily(); } - /// \brief Can an out-of-line inline function serve as a key function? + /// Can an out-of-line inline function serve as a key function? /// /// This flag is only useful in ABIs where type data (for example, /// vtables and type_info objects) are emitted only after processing diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index 6ba58779114f5..ec5c59b239069 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::TargetInfo interface. +/// Defines the clang::TargetInfo interface. /// //===----------------------------------------------------------------------===// @@ -20,7 +20,6 @@ #include "clang/Basic/Specifiers.h" #include "clang/Basic/TargetCXXABI.h" #include "clang/Basic/TargetOptions.h" -#include "clang/Basic/VersionTuple.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/Optional.h" @@ -30,6 +29,7 @@ #include "llvm/ADT/Triple.h" #include "llvm/IR/DataLayout.h" #include "llvm/Support/DataTypes.h" +#include "llvm/Support/VersionTuple.h" #include <cassert> #include <string> #include <vector> @@ -49,7 +49,7 @@ class SourceManager; namespace Builtin { struct Info; } -/// \brief Exposes information about the current target. +/// Exposes information about the current target. /// class TargetInfo : public RefCountedBase<TargetInfo> { std::shared_ptr<TargetOptions> TargetOpts; @@ -61,6 +61,8 @@ protected: bool TLSSupported; bool VLASupported; bool NoAsmVariants; // True if {|} are normal characters. + bool HasLegalHalfType; // True if the backend supports operations on the half + // LLVM IR type. bool HasFloat128; unsigned char PointerWidth, PointerAlign; unsigned char BoolWidth, BoolAlign; @@ -72,6 +74,33 @@ protected: unsigned char LargeArrayMinWidth, LargeArrayAlign; unsigned char LongWidth, LongAlign; unsigned char LongLongWidth, LongLongAlign; + + // Fixed point bit widths + unsigned char ShortAccumWidth, ShortAccumAlign; + unsigned char AccumWidth, AccumAlign; + unsigned char LongAccumWidth, LongAccumAlign; + unsigned char ShortFractWidth, ShortFractAlign; + unsigned char FractWidth, FractAlign; + unsigned char LongFractWidth, LongFractAlign; + + // If true, unsigned fixed point types have the same number of fractional bits + // as their signed counterparts, forcing the unsigned types to have one extra + // bit of padding. Otherwise, unsigned fixed point types have + // one more fractional bit than its corresponding signed type. This is false + // by default. + bool PaddingOnUnsignedFixedPoint; + + // Fixed point integral and fractional bit sizes + // Saturated types share the same integral/fractional bits as their + // corresponding unsaturated types. + // For simplicity, the fractional bits in a _Fract type will be one less the + // width of that _Fract type. This leaves all signed _Fract types having no + // padding and unsigned _Fract types will only have 1 bit of padding after the + // sign if PaddingOnUnsignedFixedPoint is set. + unsigned char ShortAccumScale; + unsigned char AccumScale; + unsigned char LongAccumScale; + unsigned char SuitableAlign; unsigned char DefaultAlignForAttributeAligned; unsigned char MinGlobalAlign; @@ -107,7 +136,7 @@ protected: } public: - /// \brief Construct a target for the given options. + /// Construct a target for the given options. /// /// \param Opts - The options to use to initialize the target. The target may /// modify the options to canonicalize the target feature information to match @@ -118,7 +147,7 @@ public: virtual ~TargetInfo(); - /// \brief Retrieve the target options. + /// Retrieve the target options. TargetOptions &getTargetOpts() const { assert(TargetOpts && "Missing target options"); return *TargetOpts; @@ -147,7 +176,7 @@ public: Float128 }; - /// \brief The different kinds of __builtin_va_list types defined by + /// The different kinds of __builtin_va_list types defined by /// the target implementation. enum BuiltinVaListKind { /// typedef char* __builtin_va_list; @@ -193,7 +222,7 @@ protected: WIntType, Char16Type, Char32Type, Int64Type, SigAtomicType, ProcessIDType; - /// \brief Whether Objective-C's built-in boolean type should be signed char. + /// Whether Objective-C's built-in boolean type should be signed char. /// /// Otherwise, when this flag is not set, the normal built-in boolean type is /// used. @@ -206,7 +235,7 @@ protected: /// boundary. unsigned UseBitFieldTypeAlignment : 1; - /// \brief Whether zero length bitfields (e.g., int : 0;) force alignment of + /// Whether zero length bitfields (e.g., int : 0;) force alignment of /// the next bitfield. /// /// If the alignment of the zero length bitfield is greater than the member @@ -214,14 +243,14 @@ protected: /// zero-length bitfield. unsigned UseZeroLengthBitfieldAlignment : 1; - /// \brief Whether explicit bit field alignment attributes are honored. + /// Whether explicit bit field alignment attributes are honored. unsigned UseExplicitBitFieldAlignment : 1; /// If non-zero, specifies a fixed alignment value for bitfields that follow /// zero length bitfield, regardless of the zero length bitfield type. unsigned ZeroLengthBitfieldBoundary; - /// \brief Specify if mangling based on address space map should be used or + /// Specify if mangling based on address space map should be used or /// not for language specific address spaces bool UseAddrSpaceMapMangling; @@ -283,30 +312,30 @@ public: } } - /// \brief Return the width (in bits) of the specified integer type enum. + /// Return the width (in bits) of the specified integer type enum. /// /// For example, SignedInt -> getIntWidth(). unsigned getTypeWidth(IntType T) const; - /// \brief Return integer type with specified width. + /// Return integer type with specified width. virtual IntType getIntTypeByWidth(unsigned BitWidth, bool IsSigned) const; - /// \brief Return the smallest integer type with at least the specified width. + /// Return the smallest integer type with at least the specified width. virtual IntType getLeastIntTypeByWidth(unsigned BitWidth, bool IsSigned) const; - /// \brief Return floating point type with specified width. + /// Return floating point type with specified width. RealType getRealTypeByWidth(unsigned BitWidth) const; - /// \brief Return the alignment (in bits) of the specified integer type enum. + /// Return the alignment (in bits) of the specified integer type enum. /// /// For example, SignedInt -> getIntAlign(). unsigned getTypeAlign(IntType T) const; - /// \brief Returns true if the type is signed; false otherwise. + /// Returns true if the type is signed; false otherwise. static bool isTypeSigned(IntType T); - /// \brief Return the width of pointers on this target, for the + /// Return the width of pointers on this target, for the /// specified address space. uint64_t getPointerWidth(unsigned AddrSpace) const { return AddrSpace == 0 ? PointerWidth : getPointerWidthV(AddrSpace); @@ -315,29 +344,29 @@ public: return AddrSpace == 0 ? PointerAlign : getPointerAlignV(AddrSpace); } - /// \brief Return the maximum width of pointers on this target. + /// Return the maximum width of pointers on this target. virtual uint64_t getMaxPointerWidth() const { return PointerWidth; } - /// \brief Get integer value for null pointer. + /// Get integer value for null pointer. /// \param AddrSpace address space of pointee in source language. virtual uint64_t getNullPointerValue(LangAS AddrSpace) const { return 0; } - /// \brief Return the size of '_Bool' and C++ 'bool' for this target, in bits. + /// Return the size of '_Bool' and C++ 'bool' for this target, in bits. unsigned getBoolWidth() const { return BoolWidth; } - /// \brief Return the alignment of '_Bool' and C++ 'bool' for this target. + /// Return the alignment of '_Bool' and C++ 'bool' for this target. unsigned getBoolAlign() const { return BoolAlign; } unsigned getCharWidth() const { return 8; } // FIXME unsigned getCharAlign() const { return 8; } // FIXME - /// \brief Return the size of 'signed short' and 'unsigned short' for this + /// Return the size of 'signed short' and 'unsigned short' for this /// target, in bits. unsigned getShortWidth() const { return 16; } // FIXME - /// \brief Return the alignment of 'signed short' and 'unsigned short' for + /// Return the alignment of 'signed short' and 'unsigned short' for /// this target. unsigned getShortAlign() const { return 16; } // FIXME @@ -356,19 +385,135 @@ public: unsigned getLongLongWidth() const { return LongLongWidth; } unsigned getLongLongAlign() const { return LongLongAlign; } - /// \brief Determine whether the __int128 type is supported on this target. + /// getShortAccumWidth/Align - Return the size of 'signed short _Accum' and + /// 'unsigned short _Accum' for this target, in bits. + unsigned getShortAccumWidth() const { return ShortAccumWidth; } + unsigned getShortAccumAlign() const { return ShortAccumAlign; } + + /// getAccumWidth/Align - Return the size of 'signed _Accum' and + /// 'unsigned _Accum' for this target, in bits. + unsigned getAccumWidth() const { return AccumWidth; } + unsigned getAccumAlign() const { return AccumAlign; } + + /// getLongAccumWidth/Align - Return the size of 'signed long _Accum' and + /// 'unsigned long _Accum' for this target, in bits. + unsigned getLongAccumWidth() const { return LongAccumWidth; } + unsigned getLongAccumAlign() const { return LongAccumAlign; } + + /// getShortFractWidth/Align - Return the size of 'signed short _Fract' and + /// 'unsigned short _Fract' for this target, in bits. + unsigned getShortFractWidth() const { return ShortFractWidth; } + unsigned getShortFractAlign() const { return ShortFractAlign; } + + /// getFractWidth/Align - Return the size of 'signed _Fract' and + /// 'unsigned _Fract' for this target, in bits. + unsigned getFractWidth() const { return FractWidth; } + unsigned getFractAlign() const { return FractAlign; } + + /// getLongFractWidth/Align - Return the size of 'signed long _Fract' and + /// 'unsigned long _Fract' for this target, in bits. + unsigned getLongFractWidth() const { return LongFractWidth; } + unsigned getLongFractAlign() const { return LongFractAlign; } + + /// getShortAccumScale/IBits - Return the number of fractional/integral bits + /// in a 'signed short _Accum' type. + unsigned getShortAccumScale() const { return ShortAccumScale; } + unsigned getShortAccumIBits() const { + return ShortAccumWidth - ShortAccumScale - 1; + } + + /// getAccumScale/IBits - Return the number of fractional/integral bits + /// in a 'signed _Accum' type. + unsigned getAccumScale() const { return AccumScale; } + unsigned getAccumIBits() const { return AccumWidth - AccumScale - 1; } + + /// getLongAccumScale/IBits - Return the number of fractional/integral bits + /// in a 'signed long _Accum' type. + unsigned getLongAccumScale() const { return LongAccumScale; } + unsigned getLongAccumIBits() const { + return LongAccumWidth - LongAccumScale - 1; + } + + /// getUnsignedShortAccumScale/IBits - Return the number of + /// fractional/integral bits in a 'unsigned short _Accum' type. + unsigned getUnsignedShortAccumScale() const { + return PaddingOnUnsignedFixedPoint ? ShortAccumScale : ShortAccumScale + 1; + } + unsigned getUnsignedShortAccumIBits() const { + return PaddingOnUnsignedFixedPoint + ? getShortAccumIBits() + : ShortAccumWidth - getUnsignedShortAccumScale(); + } + + /// getUnsignedAccumScale/IBits - Return the number of fractional/integral + /// bits in a 'unsigned _Accum' type. + unsigned getUnsignedAccumScale() const { + return PaddingOnUnsignedFixedPoint ? AccumScale : AccumScale + 1; + } + unsigned getUnsignedAccumIBits() const { + return PaddingOnUnsignedFixedPoint ? getAccumIBits() + : AccumWidth - getUnsignedAccumScale(); + } + + /// getUnsignedLongAccumScale/IBits - Return the number of fractional/integral + /// bits in a 'unsigned long _Accum' type. + unsigned getUnsignedLongAccumScale() const { + return PaddingOnUnsignedFixedPoint ? LongAccumScale : LongAccumScale + 1; + } + unsigned getUnsignedLongAccumIBits() const { + return PaddingOnUnsignedFixedPoint + ? getLongAccumIBits() + : LongAccumWidth - getUnsignedLongAccumScale(); + } + + /// getShortFractScale - Return the number of fractional bits + /// in a 'signed short _Fract' type. + unsigned getShortFractScale() const { return ShortFractWidth - 1; } + + /// getFractScale - Return the number of fractional bits + /// in a 'signed _Fract' type. + unsigned getFractScale() const { return FractWidth - 1; } + + /// getLongFractScale - Return the number of fractional bits + /// in a 'signed long _Fract' type. + unsigned getLongFractScale() const { return LongFractWidth - 1; } + + /// getUnsignedShortFractScale - Return the number of fractional bits + /// in a 'unsigned short _Fract' type. + unsigned getUnsignedShortFractScale() const { + return PaddingOnUnsignedFixedPoint ? getShortFractScale() + : getShortFractScale() + 1; + } + + /// getUnsignedFractScale - Return the number of fractional bits + /// in a 'unsigned _Fract' type. + unsigned getUnsignedFractScale() const { + return PaddingOnUnsignedFixedPoint ? getFractScale() : getFractScale() + 1; + } + + /// getUnsignedLongFractScale - Return the number of fractional bits + /// in a 'unsigned long _Fract' type. + unsigned getUnsignedLongFractScale() const { + return PaddingOnUnsignedFixedPoint ? getLongFractScale() + : getLongFractScale() + 1; + } + + /// Determine whether the __int128 type is supported on this target. virtual bool hasInt128Type() const { - return getPointerWidth(0) >= 64; + return (getPointerWidth(0) >= 64) || getTargetOpts().ForceEnableInt128; } // FIXME - /// \brief Determine whether the __float128 type is supported on this target. + /// Determine whether _Float16 is supported on this target. + virtual bool hasLegalHalfType() const { return HasLegalHalfType; } + + /// Determine whether the __float128 type is supported on this target. virtual bool hasFloat128Type() const { return HasFloat128; } - /// \brief Return the alignment that is suitable for storing any + /// Return the alignment that is suitable for storing any /// object with a fundamental alignment requirement. unsigned getSuitableAlign() const { return SuitableAlign; } - /// \brief Return the default alignment for __attribute__((aligned)) on + /// Return the default alignment for __attribute__((aligned)) on /// this target, to be used if no alignment value is specified. unsigned getDefaultAlignForAttributeAligned() const { return DefaultAlignForAttributeAligned; @@ -431,11 +576,11 @@ public: return *Float128Format; } - /// \brief Return true if the 'long double' type should be mangled like + /// Return true if the 'long double' type should be mangled like /// __float128. virtual bool useFloat128ManglingForLongDouble() const { return false; } - /// \brief Return the value for the C99 FLT_EVAL_METHOD macro. + /// Return the value for the C99 FLT_EVAL_METHOD macro. virtual unsigned getFloatEvalMethod() const { return 0; } // getLargeArrayMinWidth/Align - Return the minimum array size that is @@ -443,16 +588,16 @@ public: unsigned getLargeArrayMinWidth() const { return LargeArrayMinWidth; } unsigned getLargeArrayAlign() const { return LargeArrayAlign; } - /// \brief Return the maximum width lock-free atomic operation which will + /// Return the maximum width lock-free atomic operation which will /// ever be supported for the given target unsigned getMaxAtomicPromoteWidth() const { return MaxAtomicPromoteWidth; } - /// \brief Return the maximum width lock-free atomic operation which can be + /// Return the maximum width lock-free atomic operation which can be /// inlined given the supported features of the given target. unsigned getMaxAtomicInlineWidth() const { return MaxAtomicInlineWidth; } - /// \brief Set the maximum inline or promote width lock-free atomic operation + /// Set the maximum inline or promote width lock-free atomic operation /// for the given target. virtual void setMaxAtomicWidth() {} - /// \brief Returns true if the given target supports lock-free atomic + /// Returns true if the given target supports lock-free atomic /// operations at the specified width and alignment. virtual bool hasBuiltinAtomic(uint64_t AtomicSizeInBits, uint64_t AlignmentInBits) const { @@ -462,14 +607,14 @@ public: llvm::isPowerOf2_64(AtomicSizeInBits / getCharWidth())); } - /// \brief Return the maximum vector alignment supported for the given target. + /// Return the maximum vector alignment supported for the given target. unsigned getMaxVectorAlign() const { return MaxVectorAlign; } - /// \brief Return default simd alignment for the given target. Generally, this + /// Return default simd alignment for the given target. Generally, this /// value is type-specific, but this alignment can be used for most of the /// types for the given target. unsigned getSimdDefaultAlign() const { return SimdDefaultAlign; } - /// \brief Return the size of intmax_t and uintmax_t for this target, in bits. + /// Return the size of intmax_t and uintmax_t for this target, in bits. unsigned getIntMaxTWidth() const { return getTypeWidth(IntMaxType); } @@ -477,7 +622,7 @@ public: // Return the size of unwind_word for this target. virtual unsigned getUnwindWordWidth() const { return getPointerWidth(0); } - /// \brief Return the "preferred" register width on this target. + /// Return the "preferred" register width on this target. virtual unsigned getRegisterWidth() const { // Currently we assume the register width on the target matches the pointer // width, we can introduce a new variable for this if/when some target wants @@ -485,12 +630,12 @@ public: return PointerWidth; } - /// \brief Returns the name of the mcount instrumentation function. + /// Returns the name of the mcount instrumentation function. const char *getMCountName() const { return MCountName; } - /// \brief Check if the Objective-C built-in boolean type should be signed + /// Check if the Objective-C built-in boolean type should be signed /// char. /// /// Otherwise, if this returns false, the normal built-in boolean type @@ -502,58 +647,58 @@ public: UseSignedCharForObjCBool = false; } - /// \brief Check whether the alignment of bit-field types is respected + /// Check whether the alignment of bit-field types is respected /// when laying out structures. bool useBitFieldTypeAlignment() const { return UseBitFieldTypeAlignment; } - /// \brief Check whether zero length bitfields should force alignment of + /// Check whether zero length bitfields should force alignment of /// the next member. bool useZeroLengthBitfieldAlignment() const { return UseZeroLengthBitfieldAlignment; } - /// \brief Get the fixed alignment value in bits for a member that follows + /// Get the fixed alignment value in bits for a member that follows /// a zero length bitfield. unsigned getZeroLengthBitfieldBoundary() const { return ZeroLengthBitfieldBoundary; } - /// \brief Check whether explicit bitfield alignment attributes should be + /// Check whether explicit bitfield alignment attributes should be // honored, as in "__attribute__((aligned(2))) int b : 1;". bool useExplicitBitFieldAlignment() const { return UseExplicitBitFieldAlignment; } - /// \brief Check whether this target support '\#pragma options align=mac68k'. + /// Check whether this target support '\#pragma options align=mac68k'. bool hasAlignMac68kSupport() const { return HasAlignMac68kSupport; } - /// \brief Return the user string for the specified integer type enum. + /// Return the user string for the specified integer type enum. /// /// For example, SignedShort -> "short". static const char *getTypeName(IntType T); - /// \brief Return the constant suffix for the specified integer type enum. + /// Return the constant suffix for the specified integer type enum. /// /// For example, SignedLong -> "L". const char *getTypeConstantSuffix(IntType T) const; - /// \brief Return the printf format modifier for the specified + /// Return the printf format modifier for the specified /// integer type enum. /// /// For example, SignedLong -> "l". static const char *getTypeFormatModifier(IntType T); - /// \brief Check whether the given real type should use the "fpret" flavor of + /// Check whether the given real type should use the "fpret" flavor of /// Objective-C message passing on this target. bool useObjCFPRetForRealType(RealType T) const { return RealTypeUsesObjCFPRet & (1 << T); } - /// \brief Check whether _Complex long double should use the "fp2ret" flavor + /// Check whether _Complex long double should use the "fp2ret" flavor /// of Objective-C message passing on this target. bool useObjCFP2RetForComplexLongDouble() const { return ComplexLongDoubleUsesFP2Ret; @@ -567,7 +712,7 @@ public: return true; } - /// \brief Specify if mangling based on address space map should be used or + /// Specify if mangling based on address space map should be used or /// not for language specific address spaces bool useAddressSpaceMapMangling() const { return UseAddrSpaceMapMangling; @@ -575,7 +720,7 @@ public: ///===---- Other target property query methods --------------------------===// - /// \brief Appends the target-specific \#define values for this + /// Appends the target-specific \#define values for this /// target set to the specified buffer. virtual void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const = 0; @@ -593,7 +738,7 @@ public: /// idea to avoid optimizing based on that undef behavior. virtual bool isCLZForZeroUndef() const { return true; } - /// \brief Returns the kind of __builtin_va_list type that should be used + /// Returns the kind of __builtin_va_list type that should be used /// with this target. virtual BuiltinVaListKind getBuiltinVaListKind() const = 0; @@ -604,28 +749,34 @@ public: /// Returns true for RenderScript. bool isRenderScriptTarget() const { return IsRenderScriptTarget; } - /// \brief Returns whether the passed in string is a valid clobber in an + /// Returns whether the passed in string is a valid clobber in an /// inline asm statement. /// /// This is used by Sema. bool isValidClobber(StringRef Name) const; - /// \brief Returns whether the passed in string is a valid register name + /// Returns whether the passed in string is a valid register name /// according to GCC. /// /// This is used by Sema for inline asm statements. - bool isValidGCCRegisterName(StringRef Name) const; + virtual bool isValidGCCRegisterName(StringRef Name) const; - /// \brief Returns the "normalized" GCC register name. + /// Returns the "normalized" GCC register name. /// /// ReturnCannonical true will return the register name without any additions /// such as "{}" or "%" in it's canonical form, for example: /// ReturnCanonical = true and Name = "rax", will return "ax". StringRef getNormalizedGCCRegisterName(StringRef Name, bool ReturnCanonical = false) const; - - virtual StringRef getConstraintRegister(const StringRef &Constraint, - const StringRef &Expression) const { + + /// 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. + virtual StringRef getConstraintRegister(StringRef Constraint, + StringRef Expression) const { return ""; } @@ -663,11 +814,11 @@ public: bool allowsRegister() const { return (Flags & CI_AllowsRegister) != 0; } bool allowsMemory() const { return (Flags & CI_AllowsMemory) != 0; } - /// \brief Return true if this output operand has a matching + /// Return true if this output operand has a matching /// (tied) input operand. bool hasMatchingInput() const { return (Flags & CI_HasMatchingInput) != 0; } - /// \brief Return true if this input operand is a matching + /// Return true if this input operand is a matching /// constraint that ties it to an output operand. /// /// If this returns true then getTiedOperand will indicate which output @@ -711,7 +862,7 @@ public: ImmRange.Max = INT_MAX; } - /// \brief Indicate that this is an input operand that is tied to + /// Indicate that this is an input operand that is tied to /// the specified output operand. /// /// Copy over the various constraint information from the output. @@ -723,7 +874,7 @@ public: } }; - /// \brief Validate register name used for global register variables. + /// 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 @@ -777,16 +928,16 @@ public: return std::string(1, *Constraint); } - /// \brief Returns a string of target-specific clobbers, in LLVM format. + /// Returns a string of target-specific clobbers, in LLVM format. virtual const char *getClobbers() const = 0; - /// \brief Returns true if NaN encoding is IEEE 754-2008. + /// Returns true if NaN encoding is IEEE 754-2008. /// Only MIPS allows a different encoding. virtual bool isNan2008() const { return true; } - /// \brief Returns the target triple of the primary target. + /// Returns the target triple of the primary target. const llvm::Triple &getTriple() const { return Triple; } @@ -806,7 +957,7 @@ public: const unsigned RegNum; }; - /// \brief Does this target support "protected" visibility? + /// Does this target support "protected" visibility? /// /// Any target which dynamic libraries will naturally support /// something like "default" (meaning that the symbol is visible @@ -818,7 +969,7 @@ public: /// either; the entire thing is pretty badly mangled. virtual bool hasProtectedVisibility() const { return true; } - /// \brief An optional hook that targets can implement to perform semantic + /// An optional hook that targets can implement to perform semantic /// checking on attribute((section("foo"))) specifiers. /// /// In this case, "foo" is passed in to be checked. If the section @@ -833,18 +984,18 @@ public: return ""; } - /// \brief Set forced language options. + /// Set forced language options. /// /// Apply changes to the target information with respect to certain /// language options which change the target configuration and adjust /// the language based on the target options where applicable. virtual void adjust(LangOptions &Opts); - /// \brief Adjust target options based on codegen options. + /// Adjust target options based on codegen options. virtual void adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const {} - /// \brief Initialize the map with the default set of target features for the + /// Initialize the map with the default set of target features for the /// CPU this should include all legal feature strings on the target. /// /// \return False on error (invalid features). @@ -852,41 +1003,44 @@ public: DiagnosticsEngine &Diags, StringRef CPU, const std::vector<std::string> &FeatureVec) const; - /// \brief Get the ABI currently in use. + /// Get the ABI currently in use. virtual StringRef getABI() const { return StringRef(); } - /// \brief Get the C++ ABI currently in use. + /// Get the C++ ABI currently in use. TargetCXXABI getCXXABI() const { return TheCXXABI; } - /// \brief Target the specified CPU. + /// Target the specified CPU. /// /// \return False on error (invalid CPU name). virtual bool setCPU(const std::string &Name) { return false; } + /// Fill a SmallVectorImpl with the valid values to setCPU. + virtual void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const {} + /// brief Determine whether this TargetInfo supports the given CPU name. virtual bool isValidCPUName(StringRef Name) const { return true; } - /// \brief Use the specified ABI. + /// Use the specified ABI. /// /// \return False on error (invalid ABI name). virtual bool setABI(const std::string &Name) { return false; } - /// \brief Use the specified unit for FP math. + /// Use the specified unit for FP math. /// /// \return False on error (invalid unit name). virtual bool setFPMath(StringRef Name) { return false; } - /// \brief Enable or disable a specific target feature; + /// Enable or disable a specific target feature; /// the feature name must be valid. virtual void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name, @@ -894,12 +1048,12 @@ public: Features[Name] = Enabled; } - /// \brief Determine whether this TargetInfo supports the given feature. + /// Determine whether this TargetInfo supports the given feature. virtual bool isValidFeatureName(StringRef Feature) const { return true; } - /// \brief Perform initialization based on the user configured + /// Perform initialization based on the user configured /// set of features (e.g., +sse4). /// /// The list is guaranteed to have at most one entry per feature. @@ -915,31 +1069,62 @@ public: return true; } - /// \brief Determine whether the given target has the given feature. + /// Determine whether the given target has the given feature. virtual bool hasFeature(StringRef Feature) const { return false; } - // \brief Validate the contents of the __builtin_cpu_supports(const char*) + /// Identify whether this taret supports multiversioning of functions, + /// which requires support for cpu_supports and cpu_is functionality. + virtual bool supportsMultiVersioning() const { return false; } + + // Validate the contents of the __builtin_cpu_supports(const char*) // argument. virtual bool validateCpuSupports(StringRef Name) const { return false; } - // \brief Validate the contents of the __builtin_cpu_is(const char*) + // Return the target-specific priority for features/cpus/vendors so + // that they can be properly sorted for checking. + virtual unsigned multiVersionSortPriority(StringRef Name) const { + return 0; + } + + // Validate the contents of the __builtin_cpu_is(const char*) // argument. virtual bool validateCpuIs(StringRef Name) const { return false; } - // \brief Returns maximal number of args passed in registers. + // Validate a cpu_dispatch/cpu_specific CPU option, which is a different list + // from cpu_is, since it checks via features rather than CPUs directly. + virtual bool validateCPUSpecificCPUDispatch(StringRef Name) const { + return false; + } + + // Get the character to be added for mangling purposes for cpu_specific. + virtual char CPUSpecificManglingCharacter(StringRef Name) const { + llvm_unreachable( + "cpu_specific Multiversioning not implemented on this target"); + } + + // Get a list of the features that make up the CPU option for + // cpu_specific/cpu_dispatch so that it can be passed to llvm as optimization + // options. + virtual void getCPUSpecificCPUDispatchFeatures( + StringRef Name, llvm::SmallVectorImpl<StringRef> &Features) const { + llvm_unreachable( + "cpu_specific Multiversioning not implemented on this target"); + } + + // Returns maximal number of args passed in registers. unsigned getRegParmMax() const { assert(RegParmMax < 7 && "RegParmMax value is larger than AST can handle"); return RegParmMax; } - /// \brief Whether the target supports thread-local storage. + /// Whether the target supports thread-local storage. bool isTLSSupported() const { return TLSSupported; } - /// \brief Return the maximum alignment (in bits) of a TLS variable + /// Return the maximum alignment (in bits) of a TLS variable /// /// Gets the maximum alignment (in bits) of a TLS variable on this target. /// Returns zero if there is no such constraint. @@ -947,17 +1132,17 @@ public: return MaxTLSAlign; } - /// \brief Whether target supports variable-length arrays. + /// Whether target supports variable-length arrays. bool isVLASupported() const { return VLASupported; } - /// \brief Whether the target supports SEH __try. + /// Whether the target supports SEH __try. bool isSEHTrySupported() const { return getTriple().isOSWindows() && (getTriple().getArch() == llvm::Triple::x86 || getTriple().getArch() == llvm::Triple::x86_64); } - /// \brief Return true if {|} are normal characters in the asm string. + /// Return true if {|} are normal characters in the asm string. /// /// If this returns false (the default), then {abc|xyz} is syntax /// that says that when compiling for asm variant #0, "abc" should be @@ -967,7 +1152,7 @@ public: return NoAsmVariants; } - /// \brief Return the register number that __builtin_eh_return_regno would + /// Return the register number that __builtin_eh_return_regno would /// return with the specified argument. /// This corresponds with TargetLowering's getExceptionPointerRegister /// and getExceptionSelectorRegister in the backend. @@ -975,14 +1160,14 @@ public: return -1; } - /// \brief Return the section to use for C++ static initialization functions. + /// Return the section to use for C++ static initialization functions. virtual const char *getStaticInitSectionSpecifier() const { return nullptr; } const LangASMap &getAddressSpaceMap() const { return *AddrSpaceMap; } - /// \brief Return an AST address space which can be used opportunistically + /// Return an AST address space which can be used opportunistically /// for constant global memory. It must be possible to convert pointers into /// this address space to LangAS::Default. If no such address space exists, /// this may return None, and such optimizations will be disabled. @@ -990,11 +1175,11 @@ public: return LangAS::Default; } - /// \brief Retrieve the name of the platform as it is used in the + /// Retrieve the name of the platform as it is used in the /// availability attribute. StringRef getPlatformName() const { return PlatformName; } - /// \brief Retrieve the minimum desired version of the platform, to + /// Retrieve the minimum desired version of the platform, to /// which the program should be compiled. VersionTuple getPlatformMinVersion() const { return PlatformMinVersion; } @@ -1007,7 +1192,7 @@ public: CCMT_NonMember }; - /// \brief Gets the default calling convention for the given target and + /// Gets the default calling convention for the given target and /// declaration context. virtual CallingConv getDefaultCallingConv(CallingConvMethodType MT) const { // Not all targets will specify an explicit calling convention that we can @@ -1022,7 +1207,7 @@ public: CCCR_Ignore, }; - /// \brief Determines whether a given calling convention is valid for the + /// 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). @@ -1035,31 +1220,47 @@ public: } } + enum CallingConvKind { + CCK_Default, + CCK_ClangABI4OrPS4, + CCK_MicrosoftWin64 + }; + + virtual CallingConvKind getCallingConvKind(bool ClangABICompat4) const; + /// Controls if __builtin_longjmp / __builtin_setjmp can be lowered to /// llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp. virtual bool hasSjLjLowering() const { return false; } - /// \brief Whether target allows to overalign ABI-specified preferred alignment + /// Check if the target supports CFProtection branch. + virtual bool + checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const; + + /// Check if the target supports CFProtection branch. + virtual bool + checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const; + + /// Whether target allows to overalign ABI-specified preferred alignment virtual bool allowsLargerPreferedTypeAlignment() const { return true; } - /// \brief Set supported OpenCL extensions and optional core features. + /// Set supported OpenCL extensions and optional core features. virtual void setSupportedOpenCLOpts() {} - /// \brief Set supported OpenCL extensions as written on command line + /// Set supported OpenCL extensions as written on command line virtual void setOpenCLExtensionOpts() { for (const auto &Ext : getTargetOpts().OpenCLExtensionsAsWritten) { getTargetOpts().SupportedOpenCLOptions.support(Ext); } } - /// \brief Get supported OpenCL extensions and optional core features. + /// Get supported OpenCL extensions and optional core features. OpenCLOptions &getSupportedOpenCLOpts() { return getTargetOpts().SupportedOpenCLOptions; } - /// \brief Get const supported OpenCL extensions and optional core features. + /// Get const supported OpenCL extensions and optional core features. const OpenCLOptions &getSupportedOpenCLOpts() const { return getTargetOpts().SupportedOpenCLOptions; } @@ -1075,7 +1276,7 @@ public: OCLTK_Sampler, }; - /// \brief Get address space for OpenCL type. + /// Get address space for OpenCL type. virtual LangAS getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const; /// \returns Target specific vtbl ptr address space. @@ -1093,7 +1294,7 @@ public: return None; } - /// \brief Check the target is valid after it is fully initialized. + /// Check the target is valid after it is fully initialized. virtual bool validateTarget(DiagnosticsEngine &Diags) const { return true; } @@ -1113,6 +1314,11 @@ protected: virtual ArrayRef<AddlRegName> getGCCAddlRegNames() const { return None; } + + private: + // Assert the values for the fractional and integral bits for each fixed point + // type follow the restrictions given in clause 6.2.6.3 of N1169. + void CheckFixedPointBits() const; }; } // end namespace clang diff --git a/include/clang/Basic/TargetOptions.h b/include/clang/Basic/TargetOptions.h index 60becfb8ee76e..31a6742879154 100644 --- a/include/clang/Basic/TargetOptions.h +++ b/include/clang/Basic/TargetOptions.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::TargetOptions class. +/// Defines the clang::TargetOptions class. /// //===----------------------------------------------------------------------===// @@ -22,7 +22,7 @@ namespace clang { -/// \brief Options for controlling the target. +/// Options for controlling the target. class TargetOptions { public: /// The name of the target triple to compile for. @@ -47,7 +47,7 @@ public: /// If given, the version string of the linker in use. std::string LinkerVersion; - /// \brief The list of target specific features to enable or disable, as written on the command line. + /// The list of target specific features to enable or disable, as written on the command line. std::vector<std::string> FeaturesAsWritten; /// The list of target specific features to enable or disable -- this should @@ -57,9 +57,16 @@ public: /// Supported OpenCL extensions and optional core features. OpenCLOptions SupportedOpenCLOptions; - /// \brief The list of OpenCL extensions to enable or disable, as written on + /// The list of OpenCL extensions to enable or disable, as written on /// the command line. std::vector<std::string> OpenCLExtensionsAsWritten; + + /// If given, enables support for __int128_t and __uint128_t types. + bool ForceEnableInt128 = false; + + /// \brief If enabled, use 32-bit pointers for accessing const/local/shared + /// address space. + bool NVPTXUseShortPointers = false; }; } // end namespace clang diff --git a/include/clang/Basic/TemplateKinds.h b/include/clang/Basic/TemplateKinds.h index ac99ad185f330..3b68cba73655b 100644 --- a/include/clang/Basic/TemplateKinds.h +++ b/include/clang/Basic/TemplateKinds.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::TemplateNameKind enum. +/// Defines the clang::TemplateNameKind enum. /// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_TEMPLATEKINDS_H @@ -16,7 +16,7 @@ namespace clang { -/// \brief Specifies the kind of template name that an identifier refers to. +/// Specifies the kind of template name that an identifier refers to. /// Be careful when changing this: this enumeration is used in diagnostics. enum TemplateNameKind { /// The name does not refer to a template. diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 6ae8821a834d0..30cb022f1cba5 100644 --- a/include/clang/Basic/TokenKinds.def +++ b/include/clang/Basic/TokenKinds.def @@ -249,8 +249,10 @@ PUNCTUATOR(caretcaret, "^^") // KEYMS - This is a keyword if Microsoft extensions are enabled // KEYNOMS18 - This is a keyword that must never be enabled under // MSVC <= v18. -// KEYOPENCL - This is a keyword in OpenCL -// KEYNOOPENCL - This is a keyword that is not supported in OpenCL +// KEYOPENCLC - This is a keyword in OpenCL C +// KEYOPENCLCXX - This is a keyword in OpenCL C++ +// KEYNOOPENCL - This is a keyword that is not supported in OpenCL C +// nor in OpenCL C++. // KEYALTIVEC - This is a keyword in AltiVec // KEYZVECTOR - This is a keyword for the System z vector extensions, // which are heavily based on AltiVec @@ -260,6 +262,7 @@ PUNCTUATOR(caretcaret, "^^") // BOOLSUPPORT - This is a keyword if 'bool' is a built-in type // HALFSUPPORT - This is a keyword if 'half' is a built-in type // WCHARSUPPORT - This is a keyword if 'wchar_t' is a built-in type +// CHAR8SUPPORT - This is a keyword if 'char8_t' is a built-in type // KEYWORD(auto , KEYALL) KEYWORD(break , KEYALL) @@ -380,9 +383,17 @@ KEYWORD(co_yield , KEYCOROUTINES) MODULES_KEYWORD(module) MODULES_KEYWORD(import) +// C++ char8_t proposal +KEYWORD(char8_t , CHAR8SUPPORT) + // C11 Extension KEYWORD(_Float16 , KEYALL) +// ISO/IEC JTC1 SC22 WG14 N1169 Extension +KEYWORD(_Accum , KEYNOCXX) +KEYWORD(_Fract , KEYNOCXX) +KEYWORD(_Sat , KEYNOCXX) + // GNU Extensions (in impl-reserved namespace) KEYWORD(_Decimal32 , KEYALL) KEYWORD(_Decimal64 , KEYALL) @@ -398,7 +409,6 @@ TYPE_TRAIT_2(__builtin_types_compatible_p, TypeCompatible, KEYNOCXX) KEYWORD(__builtin_va_arg , KEYALL) KEYWORD(__extension__ , KEYALL) KEYWORD(__float128 , KEYALL) -ALIAS("_Float128", __float128 , KEYNOCXX) KEYWORD(__imag , KEYALL) KEYWORD(__int128 , KEYALL) KEYWORD(__label__ , KEYALL) @@ -415,6 +425,7 @@ KEYWORD(typeof , KEYGNU) KEYWORD(__FUNCDNAME__ , KEYMS) KEYWORD(__FUNCSIG__ , KEYMS) KEYWORD(L__FUNCTION__ , KEYMS) +KEYWORD(L__FUNCSIG__ , KEYMS) TYPE_TRAIT_1(__is_interface_class, IsInterfaceClass, KEYMS) TYPE_TRAIT_1(__is_sealed, IsSealed, KEYMS) @@ -464,6 +475,7 @@ TYPE_TRAIT_1(__has_unique_object_representations, TYPE_TRAIT_N(__is_trivially_constructible, IsTriviallyConstructible, KEYCXX) TYPE_TRAIT_1(__is_trivially_copyable, IsTriviallyCopyable, KEYCXX) TYPE_TRAIT_2(__is_trivially_assignable, IsTriviallyAssignable, KEYCXX) +TYPE_TRAIT_2(__reference_binds_to_temporary, ReferenceBindsToTemporary, KEYCXX) KEYWORD(__underlying_type , KEYCXX) // Embarcadero Expression Traits @@ -521,36 +533,36 @@ KEYWORD(__unaligned , KEYMS) KEYWORD(__super , KEYMS) // OpenCL address space qualifiers -KEYWORD(__global , KEYOPENCL) -KEYWORD(__local , KEYOPENCL) -KEYWORD(__constant , KEYOPENCL) -KEYWORD(__private , KEYOPENCL) -KEYWORD(__generic , KEYOPENCL) -ALIAS("global", __global , KEYOPENCL) -ALIAS("local", __local , KEYOPENCL) -ALIAS("constant", __constant , KEYOPENCL) -ALIAS("private", __private , KEYOPENCL) -ALIAS("generic", __generic , KEYOPENCL) +KEYWORD(__global , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__local , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__constant , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__private , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__generic , KEYOPENCLC | KEYOPENCLCXX) +ALIAS("global", __global , KEYOPENCLC) +ALIAS("local", __local , KEYOPENCLC) +ALIAS("constant", __constant , KEYOPENCLC) +ALIAS("private", __private , KEYOPENCLC) +ALIAS("generic", __generic , KEYOPENCLC) // OpenCL function qualifiers -KEYWORD(__kernel , KEYOPENCL) -ALIAS("kernel", __kernel , KEYOPENCL) +KEYWORD(__kernel , KEYOPENCLC | KEYOPENCLCXX) +ALIAS("kernel", __kernel , KEYOPENCLC | KEYOPENCLCXX) // OpenCL access qualifiers -KEYWORD(__read_only , KEYOPENCL) -KEYWORD(__write_only , KEYOPENCL) -KEYWORD(__read_write , KEYOPENCL) -ALIAS("read_only", __read_only , KEYOPENCL) -ALIAS("write_only", __write_only , KEYOPENCL) -ALIAS("read_write", __read_write , KEYOPENCL) +KEYWORD(__read_only , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__write_only , KEYOPENCLC | KEYOPENCLCXX) +KEYWORD(__read_write , KEYOPENCLC | KEYOPENCLCXX) +ALIAS("read_only", __read_only , KEYOPENCLC | KEYOPENCLCXX) +ALIAS("write_only", __write_only , KEYOPENCLC | KEYOPENCLCXX) +ALIAS("read_write", __read_write , KEYOPENCLC | KEYOPENCLCXX) // OpenCL builtins -KEYWORD(__builtin_astype , KEYOPENCL) -KEYWORD(vec_step , KEYOPENCL|KEYALTIVEC|KEYZVECTOR) -#define GENERIC_IMAGE_TYPE(ImgType, Id) KEYWORD(ImgType##_t, KEYOPENCL) +KEYWORD(__builtin_astype , KEYOPENCLC) +KEYWORD(vec_step , KEYOPENCLC | KEYALTIVEC | KEYZVECTOR) +#define GENERIC_IMAGE_TYPE(ImgType, Id) KEYWORD(ImgType##_t, KEYOPENCLC) #include "clang/Basic/OpenCLImageTypes.def" // OpenMP Type Traits KEYWORD(__builtin_omp_required_simd_align, KEYALL) -KEYWORD(pipe , KEYOPENCL) +KEYWORD(pipe , KEYOPENCLC) // Borland Extensions. KEYWORD(__pascal , KEYALL) diff --git a/include/clang/Basic/TokenKinds.h b/include/clang/Basic/TokenKinds.h index f4ecb3eb306f1..fb4b5252b70bc 100644 --- a/include/clang/Basic/TokenKinds.h +++ b/include/clang/Basic/TokenKinds.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::TokenKind enum and support functions. +/// Defines the clang::TokenKind enum and support functions. /// //===----------------------------------------------------------------------===// @@ -21,14 +21,14 @@ namespace clang { namespace tok { -/// \brief Provides a simple uniform namespace for tokens from all C languages. +/// Provides a simple uniform namespace for tokens from all C languages. enum TokenKind : unsigned short { #define TOK(X) X, #include "clang/Basic/TokenKinds.def" NUM_TOKENS }; -/// \brief Provides a namespace for preprocessor keywords which start with a +/// Provides a namespace for preprocessor keywords which start with a /// '#' at the beginning of the line. enum PPKeywordKind { #define PPKEYWORD(X) pp_##X, @@ -36,7 +36,7 @@ enum PPKeywordKind { NUM_PP_KEYWORDS }; -/// \brief Provides a namespace for Objective-C keywords which start with +/// Provides a namespace for Objective-C keywords which start with /// an '@'. enum ObjCKeywordKind { #define OBJC1_AT_KEYWORD(X) objc_##X, @@ -45,18 +45,18 @@ enum ObjCKeywordKind { NUM_OBJC_KEYWORDS }; -/// \brief Defines the possible values of an on-off-switch (C99 6.10.6p2). +/// Defines the possible values of an on-off-switch (C99 6.10.6p2). enum OnOffSwitch { OOS_ON, OOS_OFF, OOS_DEFAULT }; -/// \brief Determines the name of a token as used within the front end. +/// Determines the name of a token as used within the front end. /// /// The name of a token will be an internal name (such as "l_square") /// and should not be used as part of diagnostic messages. const char *getTokenName(TokenKind Kind) LLVM_READNONE; -/// \brief Determines the spelling of simple punctuation tokens like +/// Determines the spelling of simple punctuation tokens like /// '!' or '%', and returns NULL for literal and annotation tokens. /// /// This routine only retrieves the "simple" spelling of the token, @@ -65,16 +65,16 @@ const char *getTokenName(TokenKind Kind) LLVM_READNONE; /// Preprocessor::getSpelling(). const char *getPunctuatorSpelling(TokenKind Kind) LLVM_READNONE; -/// \brief Determines the spelling of simple keyword and contextual keyword +/// Determines the spelling of simple keyword and contextual keyword /// tokens like 'int' and 'dynamic_cast'. Returns NULL for other token kinds. const char *getKeywordSpelling(TokenKind Kind) LLVM_READNONE; -/// \brief Return true if this is a raw identifier or an identifier kind. +/// Return true if this is a raw identifier or an identifier kind. inline bool isAnyIdentifier(TokenKind K) { return (K == tok::identifier) || (K == tok::raw_identifier); } -/// \brief Return true if this is a C or C++ string-literal (or +/// Return true if this is a C or C++ string-literal (or /// C++11 user-defined-string-literal) token. inline bool isStringLiteral(TokenKind K) { return K == tok::string_literal || K == tok::wide_string_literal || @@ -82,7 +82,7 @@ inline bool isStringLiteral(TokenKind K) { K == tok::utf32_string_literal; } -/// \brief Return true if this is a "literal" kind, like a numeric +/// Return true if this is a "literal" kind, like a numeric /// constant, string, etc. inline bool isLiteral(TokenKind K) { return K == tok::numeric_constant || K == tok::char_constant || @@ -91,7 +91,7 @@ inline bool isLiteral(TokenKind K) { isStringLiteral(K) || K == tok::angle_string_literal; } -/// \brief Return true if this is any of tok::annot_* kinds. +/// Return true if this is any of tok::annot_* kinds. inline bool isAnnotation(TokenKind K) { #define ANNOTATION(NAME) \ if (K == tok::annot_##NAME) \ diff --git a/include/clang/Basic/TypeTraits.h b/include/clang/Basic/TypeTraits.h index 8ecd63f9c3cbb..bdb426834a8cc 100644 --- a/include/clang/Basic/TypeTraits.h +++ b/include/clang/Basic/TypeTraits.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines enumerations for the type traits support. +/// Defines enumerations for the type traits support. /// //===----------------------------------------------------------------------===// @@ -17,7 +17,7 @@ namespace clang { - /// \brief Names for traits that operate specifically on types. + /// Names for traits that operate specifically on types. enum TypeTrait { UTT_HasNothrowAssign, UTT_HasNothrowMoveAssign, @@ -80,19 +80,20 @@ namespace clang { BTT_IsAssignable, BTT_IsNothrowAssignable, BTT_IsTriviallyAssignable, - BTT_Last = BTT_IsTriviallyAssignable, + BTT_ReferenceBindsToTemporary, + BTT_Last = BTT_ReferenceBindsToTemporary, TT_IsConstructible, TT_IsNothrowConstructible, TT_IsTriviallyConstructible }; - /// \brief Names for the array type traits. + /// Names for the array type traits. enum ArrayTypeTrait { ATT_ArrayRank, ATT_ArrayExtent }; - /// \brief Names for the "expression or type" traits. + /// Names for the "expression or type" traits. enum UnaryExprOrTypeTrait { UETT_SizeOf, UETT_AlignOf, diff --git a/include/clang/Basic/Version.h b/include/clang/Basic/Version.h index 57dcf92c3b280..6d625c6ddb80e 100644 --- a/include/clang/Basic/Version.h +++ b/include/clang/Basic/Version.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines version macros and version-related utility functions +/// Defines version macros and version-related utility functions /// for Clang. /// //===----------------------------------------------------------------------===// @@ -20,40 +20,40 @@ #include "llvm/ADT/StringRef.h" namespace clang { - /// \brief Retrieves the repository path (e.g., Subversion path) that + /// Retrieves the repository path (e.g., Subversion path) that /// identifies the particular Clang branch, tag, or trunk from which this /// Clang was built. std::string getClangRepositoryPath(); - /// \brief Retrieves the repository path from which LLVM was built. + /// Retrieves the repository path from which LLVM was built. /// /// This supports LLVM residing in a separate repository from clang. std::string getLLVMRepositoryPath(); - /// \brief Retrieves the repository revision number (or identifer) from which + /// Retrieves the repository revision number (or identifier) from which /// this Clang was built. std::string getClangRevision(); - /// \brief Retrieves the repository revision number (or identifer) from which + /// Retrieves the repository revision number (or identifier) from which /// LLVM was built. /// /// If Clang and LLVM are in the same repository, this returns the same /// string as getClangRevision. std::string getLLVMRevision(); - /// \brief Retrieves the full repository version that is an amalgamation of + /// Retrieves the full repository version that is an amalgamation of /// the information in getClangRepositoryPath() and getClangRevision(). std::string getClangFullRepositoryVersion(); - /// \brief Retrieves a string representing the complete clang version, + /// Retrieves a string representing the complete clang version, /// which includes the clang version number, the repository version, /// and the vendor tag. std::string getClangFullVersion(); - /// \brief Like getClangFullVersion(), but with a custom tool name. + /// Like getClangFullVersion(), but with a custom tool name. std::string getClangToolFullVersion(llvm::StringRef ToolName); - /// \brief Retrieves a string representing the complete clang version suitable + /// Retrieves a string representing the complete clang version suitable /// for use in the CPP __VERSION__ macro, which includes the clang version /// number, the repository version, and the vendor tag. std::string getClangFullCPPVersion(); diff --git a/include/clang/Basic/VersionTuple.h b/include/clang/Basic/VersionTuple.h deleted file mode 100644 index da3b01903ed93..0000000000000 --- a/include/clang/Basic/VersionTuple.h +++ /dev/null @@ -1,168 +0,0 @@ -//===- VersionTuple.h - Version Number Handling -----------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief Defines the clang::VersionTuple class, which represents a version in -/// the form major[.minor[.subminor]]. -/// -//===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_BASIC_VERSIONTUPLE_H -#define LLVM_CLANG_BASIC_VERSIONTUPLE_H - -#include "clang/Basic/LLVM.h" -#include "llvm/ADT/Optional.h" -#include <string> -#include <tuple> - -namespace clang { - -/// \brief Represents a version number in the form major[.minor[.subminor[.build]]]. -class VersionTuple { - unsigned Major : 31; - - unsigned UsesUnderscores : 1; - - unsigned Minor : 31; - unsigned HasMinor : 1; - - unsigned Subminor : 31; - unsigned HasSubminor : 1; - - unsigned Build : 31; - unsigned HasBuild : 1; - -public: - VersionTuple() - : Major(0), UsesUnderscores(false), Minor(0), HasMinor(false), - Subminor(0), HasSubminor(false), Build(0), HasBuild(false) {} - - explicit VersionTuple(unsigned Major) - : Major(Major), UsesUnderscores(false), Minor(0), HasMinor(false), - Subminor(0), HasSubminor(false), Build(0), HasBuild(false) {} - - explicit VersionTuple(unsigned Major, unsigned Minor, - bool UsesUnderscores = false) - : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor), - HasMinor(true), Subminor(0), HasSubminor(false), Build(0), - HasBuild(false) {} - - explicit VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, - bool UsesUnderscores = false) - : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor), - HasMinor(true), Subminor(Subminor), HasSubminor(true), Build(0), - HasBuild(false) {} - - explicit VersionTuple(unsigned Major, unsigned Minor, unsigned Subminor, - unsigned Build, bool UsesUnderscores = false) - : Major(Major), UsesUnderscores(UsesUnderscores), Minor(Minor), - HasMinor(true), Subminor(Subminor), HasSubminor(true), Build(Build), - HasBuild(true) {} - - /// \brief Determine whether this version information is empty - /// (e.g., all version components are zero). - bool empty() const { - return Major == 0 && Minor == 0 && Subminor == 0 && Build == 0; - } - - /// \brief Retrieve the major version number. - unsigned getMajor() const { return Major; } - - /// \brief Retrieve the minor version number, if provided. - Optional<unsigned> getMinor() const { - if (!HasMinor) - return None; - return Minor; - } - - /// \brief Retrieve the subminor version number, if provided. - Optional<unsigned> getSubminor() const { - if (!HasSubminor) - return None; - return Subminor; - } - - /// \brief Retrieve the build version number, if provided. - Optional<unsigned> getBuild() const { - if (!HasBuild) - return None; - return Build; - } - - bool usesUnderscores() const { - return UsesUnderscores; - } - - void UseDotAsSeparator() { - UsesUnderscores = false; - } - - /// \brief Determine if two version numbers are equivalent. If not - /// provided, minor and subminor version numbers are considered to be zero. - friend bool operator==(const VersionTuple& X, const VersionTuple &Y) { - return X.Major == Y.Major && X.Minor == Y.Minor && - X.Subminor == Y.Subminor && X.Build == Y.Build; - } - - /// \brief Determine if two version numbers are not equivalent. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator!=(const VersionTuple &X, const VersionTuple &Y) { - return !(X == Y); - } - - /// \brief Determine whether one version number precedes another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator<(const VersionTuple &X, const VersionTuple &Y) { - return std::tie(X.Major, X.Minor, X.Subminor, X.Build) < - std::tie(Y.Major, Y.Minor, Y.Subminor, Y.Build); - } - - /// \brief Determine whether one version number follows another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator>(const VersionTuple &X, const VersionTuple &Y) { - return Y < X; - } - - /// \brief Determine whether one version number precedes or is - /// equivalent to another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator<=(const VersionTuple &X, const VersionTuple &Y) { - return !(Y < X); - } - - /// \brief Determine whether one version number follows or is - /// equivalent to another. - /// - /// If not provided, minor and subminor version numbers are considered to be - /// zero. - friend bool operator>=(const VersionTuple &X, const VersionTuple &Y) { - return !(X < Y); - } - - /// \brief Retrieve a string representation of the version number. - std::string getAsString() const; - - /// \brief Try to parse the given string as a version number. - /// \returns \c true if the string does not match the regular expression - /// [0-9]+(\.[0-9]+){0,3} - bool tryParse(StringRef string); -}; - -/// \brief Print a version number. -raw_ostream& operator<<(raw_ostream &Out, const VersionTuple &V); - -} // end namespace clang -#endif // LLVM_CLANG_BASIC_VERSIONTUPLE_H diff --git a/include/clang/Basic/VirtualFileSystem.h b/include/clang/Basic/VirtualFileSystem.h index 245452dd12b57..2480b91123c15 100644 --- a/include/clang/Basic/VirtualFileSystem.h +++ b/include/clang/Basic/VirtualFileSystem.h @@ -6,8 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// /// \file -/// \brief Defines the virtual file system interface vfs::FileSystem. +/// Defines the virtual file system interface vfs::FileSystem. +// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_VIRTUALFILESYSTEM_H @@ -15,6 +17,7 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" +#include "llvm/ADT/None.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" @@ -23,8 +26,6 @@ #include "llvm/Support/ErrorOr.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/SourceMgr.h" -#include "llvm/Support/raw_ostream.h" -#include <algorithm> #include <cassert> #include <cstdint> #include <ctime> @@ -39,12 +40,12 @@ namespace llvm { class MemoryBuffer; -} // end namespace llvm +} // namespace llvm namespace clang { namespace vfs { -/// \brief The result of a \p status operation. +/// The result of a \p status operation. class Status { std::string Name; llvm::sys::fs::UniqueID UID; @@ -52,14 +53,14 @@ class Status { uint32_t User; uint32_t Group; uint64_t Size; - llvm::sys::fs::file_type Type; + llvm::sys::fs::file_type Type = llvm::sys::fs::file_type::status_error; llvm::sys::fs::perms Perms; public: - bool IsVFSMapped; // FIXME: remove when files support multiple names + // FIXME: remove when files support multiple names + bool IsVFSMapped = false; -public: - Status() : Type(llvm::sys::fs::file_type::status_error) {} + Status() = default; Status(const llvm::sys::fs::file_status &Status); Status(StringRef Name, llvm::sys::fs::UniqueID UID, llvm::sys::TimePoint<> MTime, uint32_t User, uint32_t Group, @@ -71,7 +72,7 @@ public: static Status copyWithNewName(const llvm::sys::fs::file_status &In, StringRef NewName); - /// \brief Returns the name that should be used for this file or directory. + /// Returns the name that should be used for this file or directory. StringRef getName() const { return Name; } /// @name Status interface from llvm::sys::fs @@ -97,18 +98,18 @@ public: /// @} }; -/// \brief Represents an open file. +/// Represents an open file. class File { public: - /// \brief Destroy the file after closing it (if open). + /// Destroy the file after closing it (if open). /// Sub-classes should generally call close() inside their destructors. We /// cannot do that from the base class, since close is virtual. virtual ~File(); - /// \brief Get the status of the file. + /// Get the status of the file. virtual llvm::ErrorOr<Status> status() = 0; - /// \brief Get the name of the file + /// Get the name of the file virtual llvm::ErrorOr<std::string> getName() { if (auto Status = status()) return Status->getName().str(); @@ -116,32 +117,32 @@ public: return Status.getError(); } - /// \brief Get the contents of the file as a \p MemoryBuffer. + /// Get the contents of the file as a \p MemoryBuffer. virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> getBuffer(const Twine &Name, int64_t FileSize = -1, bool RequiresNullTerminator = true, bool IsVolatile = false) = 0; - /// \brief Closes the file. + /// Closes the file. virtual std::error_code close() = 0; }; namespace detail { -/// \brief An interface for virtual file systems to provide an iterator over the +/// An interface for virtual file systems to provide an iterator over the /// (non-recursive) contents of a directory. struct DirIterImpl { virtual ~DirIterImpl(); - /// \brief Sets \c CurrentEntry to the next entry in the directory on success, + /// Sets \c CurrentEntry to the next entry in the directory on success, /// or returns a system-defined \c error_code. virtual std::error_code increment() = 0; Status CurrentEntry; }; -} // end namespace detail +} // namespace detail -/// \brief An input iterator over the entries in a virtual path, similar to +/// An input iterator over the entries in a virtual path, similar to /// llvm::sys::fs::directory_iterator. class directory_iterator { std::shared_ptr<detail::DirIterImpl> Impl; // Input iterator semantics on copy @@ -154,10 +155,10 @@ public: Impl.reset(); // Normalize the end iterator to Impl == nullptr. } - /// \brief Construct an 'end' iterator. + /// Construct an 'end' iterator. directory_iterator() = default; - /// \brief Equivalent to operator++, with an error code. + /// Equivalent to operator++, with an error code. directory_iterator &increment(std::error_code &EC) { assert(Impl && "attempting to increment past end"); EC = Impl->increment(); @@ -181,11 +182,11 @@ public: class FileSystem; -/// \brief An input iterator over the recursive contents of a virtual path, +/// An input iterator over the recursive contents of a virtual path, /// similar to llvm::sys::fs::recursive_directory_iterator. class recursive_directory_iterator { - typedef std::stack<directory_iterator, std::vector<directory_iterator>> - IterState; + using IterState = + std::stack<directory_iterator, std::vector<directory_iterator>>; FileSystem *FS; std::shared_ptr<IterState> State; // Input iterator semantics on copy. @@ -193,10 +194,11 @@ class recursive_directory_iterator { public: recursive_directory_iterator(FileSystem &FS, const Twine &Path, std::error_code &EC); - /// \brief Construct an 'end' iterator. + + /// Construct an 'end' iterator. recursive_directory_iterator() = default; - /// \brief Equivalent to operator++, with an error code. + /// Equivalent to operator++, with an error code. recursive_directory_iterator &increment(std::error_code &EC); const Status &operator*() const { return *State->top(); } @@ -209,21 +211,22 @@ public: return !(*this == RHS); } - /// \brief Gets the current level. Starting path is at level 0. + /// Gets the current level. Starting path is at level 0. int level() const { - assert(State->size() && "Cannot get level without any iteration state"); + assert(!State->empty() && "Cannot get level without any iteration state"); return State->size()-1; } }; -/// \brief The virtual file system interface. +/// The virtual file system interface. class FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> { public: virtual ~FileSystem(); - /// \brief Get the status of the entry at \p Path, if one exists. + /// Get the status of the entry at \p Path, if one exists. virtual llvm::ErrorOr<Status> status(const Twine &Path) = 0; - /// \brief Get a \p File object for the file at \p Path, if one exists. + + /// Get a \p File object for the file at \p Path, if one exists. virtual llvm::ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) = 0; @@ -233,7 +236,7 @@ public: getBufferForFile(const Twine &Name, int64_t FileSize = -1, bool RequiresNullTerminator = true, bool IsVolatile = false); - /// \brief Get a directory_iterator for \p Dir. + /// Get a directory_iterator for \p Dir. /// \note The 'end' iterator is directory_iterator(). virtual directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) = 0; @@ -241,9 +244,16 @@ public: /// Set the working directory. This will affect all following operations on /// this file system and may propagate down for nested file systems. virtual std::error_code setCurrentWorkingDirectory(const Twine &Path) = 0; + /// Get the working directory of this file system. virtual llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const = 0; + /// Gets real path of \p Path e.g. collapse all . and .. patterns, resolve + /// symlinks. For real file system, this uses `llvm::sys::fs::real_path`. + /// This returns errc::operation_not_permitted if not implemented by subclass. + virtual std::error_code getRealPath(const Twine &Path, + SmallVectorImpl<char> &Output) const; + /// Check whether a file exists. Provided for convenience. bool exists(const Twine &Path); @@ -261,11 +271,11 @@ public: std::error_code makeAbsolute(SmallVectorImpl<char> &Path) const; }; -/// \brief Gets an \p vfs::FileSystem for the 'real' file system, as seen by +/// Gets an \p vfs::FileSystem for the 'real' file system, as seen by /// the operating system. IntrusiveRefCntPtr<FileSystem> getRealFileSystem(); -/// \brief A file system that allows overlaying one \p AbstractFileSystem on top +/// A file system that allows overlaying one \p AbstractFileSystem on top /// of another. /// /// Consists of a stack of >=1 \p FileSystem objects, which are treated as being @@ -276,14 +286,16 @@ IntrusiveRefCntPtr<FileSystem> getRealFileSystem(); /// that exists in more than one file system, the file in the top-most file /// system overrides the other(s). class OverlayFileSystem : public FileSystem { - typedef SmallVector<IntrusiveRefCntPtr<FileSystem>, 1> FileSystemList; - /// \brief The stack of file systems, implemented as a list in order of + using FileSystemList = SmallVector<IntrusiveRefCntPtr<FileSystem>, 1>; + + /// The stack of file systems, implemented as a list in order of /// their addition. FileSystemList FSList; public: OverlayFileSystem(IntrusiveRefCntPtr<FileSystem> Base); - /// \brief Pushes a file system on top of the stack. + + /// Pushes a file system on top of the stack. void pushOverlay(IntrusiveRefCntPtr<FileSystem> FS); llvm::ErrorOr<Status> status(const Twine &Path) override; @@ -292,22 +304,27 @@ public: directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override; llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const override; std::error_code setCurrentWorkingDirectory(const Twine &Path) override; + std::error_code getRealPath(const Twine &Path, + SmallVectorImpl<char> &Output) const override; + + using iterator = FileSystemList::reverse_iterator; + using const_iterator = FileSystemList::const_reverse_iterator; - typedef FileSystemList::reverse_iterator iterator; - - /// \brief Get an iterator pointing to the most recently added file system. + /// Get an iterator pointing to the most recently added file system. iterator overlays_begin() { return FSList.rbegin(); } + const_iterator overlays_begin() const { return FSList.rbegin(); } - /// \brief Get an iterator pointing one-past the least recently added file + /// Get an iterator pointing one-past the least recently added file /// system. iterator overlays_end() { return FSList.rend(); } + const_iterator overlays_end() const { return FSList.rend(); } }; namespace detail { class InMemoryDirectory; -} // end namespace detail +} // namespace detail /// An in-memory file system. class InMemoryFileSystem : public FileSystem { @@ -330,6 +347,7 @@ public: Optional<uint32_t> User = None, Optional<uint32_t> Group = None, Optional<llvm::sys::fs::file_type> Type = None, Optional<llvm::sys::fs::perms> Perms = None); + /// Add a buffer to the VFS with a path. The VFS does not own the buffer. /// If present, User, Group, Type and Perms apply to the newly-created file /// or directory. @@ -344,6 +362,7 @@ public: Optional<llvm::sys::fs::perms> Perms = None); std::string toString() const; + /// Return true if this file system normalizes . and .. in paths. bool useNormalizedPaths() const { return UseNormalizedPaths; } @@ -351,16 +370,26 @@ public: llvm::ErrorOr<std::unique_ptr<File>> openFileForRead(const Twine &Path) override; directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override; + llvm::ErrorOr<std::string> getCurrentWorkingDirectory() const override { return WorkingDirectory; } + /// Canonicalizes \p Path by combining with the current working + /// directory and normalizing the path (e.g. remove dots). If the current + /// working directory is not set, this returns errc::operation_not_permitted. + /// + /// This doesn't resolve symlinks as they are not supported in in-memory file + /// system. + std::error_code getRealPath(const Twine &Path, + SmallVectorImpl<char> &Output) const override; + std::error_code setCurrentWorkingDirectory(const Twine &Path) override; }; -/// \brief Get a globally unique ID for a virtual file or directory. +/// Get a globally unique ID for a virtual file or directory. llvm::sys::fs::UniqueID getNextVirtualUniqueID(); -/// \brief Gets a \p FileSystem for a virtual file system described in YAML +/// Gets a \p FileSystem for a virtual file system described in YAML /// format. IntrusiveRefCntPtr<FileSystem> getVFSFromYAML(std::unique_ptr<llvm::MemoryBuffer> Buffer, @@ -376,7 +405,7 @@ struct YAMLVFSEntry { std::string RPath; }; -/// \brief Collect all pairs of <virtual path, real path> entries from the +/// Collect all pairs of <virtual path, real path> entries from the /// \p YAMLFilePath. This is used by the module dependency collector to forward /// the entries into the reproducer output VFS YAML file. void collectVFSFromYAML( @@ -419,7 +448,7 @@ public: void write(llvm::raw_ostream &OS); }; -} // end namespace vfs -} // end namespace clang +} // namespace vfs +} // namespace clang #endif // LLVM_CLANG_BASIC_VIRTUALFILESYSTEM_H diff --git a/include/clang/Basic/Visibility.h b/include/clang/Basic/Visibility.h index cc839d789e7fd..c5ab62436fe0e 100644 --- a/include/clang/Basic/Visibility.h +++ b/include/clang/Basic/Visibility.h @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief Defines the clang::Visibility enumeration and various utility +/// Defines the clang::Visibility enumeration and various utility /// functions. /// //===----------------------------------------------------------------------===// @@ -16,10 +16,12 @@ #define LLVM_CLANG_BASIC_VISIBILITY_H #include "clang/Basic/Linkage.h" +#include <cassert> +#include <cstdint> namespace clang { -/// \brief Describes the different kinds of visibility that a declaration +/// Describes the different kinds of visibility that a declaration /// may have. /// /// Visibility determines how a declaration interacts with the dynamic diff --git a/include/clang/Basic/X86Target.def b/include/clang/Basic/X86Target.def index 21550fe2dd55f..d2d2540e50054 100644 --- a/include/clang/Basic/X86Target.def +++ b/include/clang/Basic/X86Target.def @@ -12,6 +12,10 @@ // //===----------------------------------------------------------------------===// +#ifndef PROC_WITH_FEAT +#define PROC_WITH_FEAT(ENUM, STRING, IS64BIT, KEYFEATURE) \ + PROC(ENUM, STRING, IS64BIT) +#endif #ifndef PROC #define PROC(ENUM, STRING, IS64BIT) @@ -21,6 +25,18 @@ #define PROC_ALIAS(ENUM, ALIAS) #endif +#ifndef FEATURE +#define FEATURE(ENUM) +#endif + +#ifndef CPU_SPECIFIC +#define CPU_SPECIFIC(NAME, MANGLING, FEATURES) +#endif + +#ifndef CPU_SPECIFIC_ALIAS +#define CPU_SPECIFIC_ALIAS(NEW_NAME, NAME) +#endif + #define PROC_64_BIT true #define PROC_32_BIT false @@ -77,7 +93,7 @@ PROC(Nocona, "nocona", PROC_64_BIT) /// \name Core /// Core microarchitecture based processors. //@{ -PROC(Core2, "core2", PROC_64_BIT) +PROC_WITH_FEAT(Core2, "core2", PROC_64_BIT, FEATURE_SSSE3) /// This enumerator, like Yonah, is a bit odd. It is another /// codename which GCC no longer accepts as an option to -march, but Clang @@ -89,67 +105,74 @@ PROC(Penryn, "penryn", PROC_64_BIT) /// \name Atom /// Atom processors //@{ -PROC(Bonnell, "bonnell", PROC_64_BIT) +PROC_WITH_FEAT(Bonnell, "bonnell", PROC_64_BIT, FEATURE_SSSE3) PROC_ALIAS(Bonnell, "atom") -PROC(Silvermont, "silvermont", PROC_64_BIT) +PROC_WITH_FEAT(Silvermont, "silvermont", PROC_64_BIT, FEATURE_SSE4_2) PROC_ALIAS(Silvermont, "slm") PROC(Goldmont, "goldmont", PROC_64_BIT) +PROC(GoldmontPlus, "goldmont-plus", PROC_64_BIT) + +PROC(Tremont, "tremont", PROC_64_BIT) //@} /// \name Nehalem /// Nehalem microarchitecture based processors. -PROC(Nehalem, "nehalem", PROC_64_BIT) +PROC_WITH_FEAT(Nehalem, "nehalem", PROC_64_BIT, FEATURE_SSE4_2) PROC_ALIAS(Nehalem, "corei7") /// \name Westmere /// Westmere microarchitecture based processors. -PROC(Westmere, "westmere", PROC_64_BIT) +PROC_WITH_FEAT(Westmere, "westmere", PROC_64_BIT, FEATURE_PCLMUL) /// \name Sandy Bridge /// Sandy Bridge microarchitecture based processors. -PROC(SandyBridge, "sandybridge", PROC_64_BIT) +PROC_WITH_FEAT(SandyBridge, "sandybridge", PROC_64_BIT, FEATURE_AVX) PROC_ALIAS(SandyBridge, "corei7-avx") /// \name Ivy Bridge /// Ivy Bridge microarchitecture based processors. -PROC(IvyBridge, "ivybridge", PROC_64_BIT) +PROC_WITH_FEAT(IvyBridge, "ivybridge", PROC_64_BIT, FEATURE_AVX) PROC_ALIAS(IvyBridge, "core-avx-i") /// \name Haswell /// Haswell microarchitecture based processors. -PROC(Haswell, "haswell", PROC_64_BIT) +PROC_WITH_FEAT(Haswell, "haswell", PROC_64_BIT, FEATURE_AVX2) PROC_ALIAS(Haswell, "core-avx2") /// \name Broadwell /// Broadwell microarchitecture based processors. -PROC(Broadwell, "broadwell", PROC_64_BIT) +PROC_WITH_FEAT(Broadwell, "broadwell", PROC_64_BIT, FEATURE_AVX2) /// \name Skylake Client /// Skylake client microarchitecture based processors. -PROC(SkylakeClient, "skylake", PROC_64_BIT) +PROC_WITH_FEAT(SkylakeClient, "skylake", PROC_64_BIT, FEATURE_AVX2) /// \name Skylake Server /// Skylake server microarchitecture based processors. -PROC(SkylakeServer, "skylake-avx512", PROC_64_BIT) +PROC_WITH_FEAT(SkylakeServer, "skylake-avx512", PROC_64_BIT, FEATURE_AVX512F) PROC_ALIAS(SkylakeServer, "skx") /// \name Cannonlake Client /// Cannonlake client microarchitecture based processors. -PROC(Cannonlake, "cannonlake", PROC_64_BIT) +PROC_WITH_FEAT(Cannonlake, "cannonlake", PROC_64_BIT, FEATURE_AVX512VBMI) /// \name Icelake Client /// Icelake client microarchitecture based processors. -PROC(Icelake, "icelake", PROC_64_BIT) +PROC(IcelakeClient, "icelake-client", PROC_64_BIT) + +/// \name Icelake Server +/// Icelake server microarchitecture based processors. +PROC(IcelakeServer, "icelake-server", PROC_64_BIT) /// \name Knights Landing /// Knights Landing processor. -PROC(KNL, "knl", PROC_64_BIT) +PROC_WITH_FEAT(KNL, "knl", PROC_64_BIT, FEATURE_AVX512F) /// \name Knights Mill /// Knights Mill processor. -PROC(KNM, "knm", PROC_64_BIT) +PROC_WITH_FEAT(KNM, "knm", PROC_64_BIT, FEATURE_AVX5124FMAPS) /// \name Lakemont /// Lakemont microarchitecture based processors. @@ -186,30 +209,30 @@ PROC(K8SSE3, "k8-sse3", PROC_64_BIT) PROC_ALIAS(K8SSE3, "athlon64-sse3") PROC_ALIAS(K8SSE3, "opteron-sse3") -PROC(AMDFAM10, "amdfam10", PROC_64_BIT) +PROC_WITH_FEAT(AMDFAM10, "amdfam10", PROC_64_BIT, FEATURE_SSE4_A) PROC_ALIAS(AMDFAM10, "barcelona") //@} /// \name Bobcat /// Bobcat architecture processors. //@{ -PROC(BTVER1, "btver1", PROC_64_BIT) -PROC(BTVER2, "btver2", PROC_64_BIT) +PROC_WITH_FEAT(BTVER1, "btver1", PROC_64_BIT, FEATURE_SSE4_A) +PROC_WITH_FEAT(BTVER2, "btver2", PROC_64_BIT, FEATURE_BMI) //@} /// \name Bulldozer /// Bulldozer architecture processors. //@{ -PROC(BDVER1, "bdver1", PROC_64_BIT) -PROC(BDVER2, "bdver2", PROC_64_BIT) -PROC(BDVER3, "bdver3", PROC_64_BIT) -PROC(BDVER4, "bdver4", PROC_64_BIT) +PROC_WITH_FEAT(BDVER1, "bdver1", PROC_64_BIT, FEATURE_XOP) +PROC_WITH_FEAT(BDVER2, "bdver2", PROC_64_BIT, FEATURE_FMA) +PROC_WITH_FEAT(BDVER3, "bdver3", PROC_64_BIT, FEATURE_FMA) +PROC_WITH_FEAT(BDVER4, "bdver4", PROC_64_BIT, FEATURE_AVX2) //@} /// \name zen /// Zen architecture processors. //@{ -PROC(ZNVER1, "znver1", PROC_64_BIT) +PROC_WITH_FEAT(ZNVER1, "znver1", PROC_64_BIT, FEATURE_AVX2) //@} /// This specification is deprecated and will be removed in the future. @@ -225,8 +248,84 @@ PROC(x86_64, "x86-64", PROC_64_BIT) PROC(Geode, "geode", PROC_32_BIT) //@} - +// List of CPU Supports features in order. These need to remain in the order +// required by attribute 'target' checking. Note that not all are supported/ +// prioritized by GCC, so synchronization with GCC's implementation may require +// changing some existing values. +FEATURE(FEATURE_CMOV) +FEATURE(FEATURE_MMX) +FEATURE(FEATURE_SSE) +FEATURE(FEATURE_SSE2) +FEATURE(FEATURE_SSE3) +FEATURE(FEATURE_SSSE3) +FEATURE(FEATURE_SSE4_A) +FEATURE(FEATURE_SSE4_1) +FEATURE(FEATURE_SSE4_2) +FEATURE(FEATURE_POPCNT) +FEATURE(FEATURE_AES) +FEATURE(FEATURE_PCLMUL) +FEATURE(FEATURE_AVX) +FEATURE(FEATURE_BMI) +FEATURE(FEATURE_FMA4) +FEATURE(FEATURE_XOP) +FEATURE(FEATURE_FMA) +FEATURE(FEATURE_BMI2) +FEATURE(FEATURE_AVX2) +FEATURE(FEATURE_AVX512F) +FEATURE(FEATURE_AVX512VL) +FEATURE(FEATURE_AVX512BW) +FEATURE(FEATURE_AVX512DQ) +FEATURE(FEATURE_AVX512CD) +FEATURE(FEATURE_AVX512ER) +FEATURE(FEATURE_AVX512PF) +FEATURE(FEATURE_AVX512VBMI) +FEATURE(FEATURE_AVX512IFMA) +FEATURE(FEATURE_AVX5124VNNIW) +FEATURE(FEATURE_AVX5124FMAPS) +FEATURE(FEATURE_AVX512VPOPCNTDQ) + + +// FIXME: When commented out features are supported in LLVM, enable them here. +CPU_SPECIFIC("generic", 'A', "") +CPU_SPECIFIC("pentium", 'B', "") +CPU_SPECIFIC("pentium_pro", 'C', "+cmov") +CPU_SPECIFIC("pentium_mmx", 'D', "+mmx") +CPU_SPECIFIC("pentium_ii", 'E', "+cmov,+mmx") +CPU_SPECIFIC("pentium_iii", 'H', "+cmov,+mmx,+sse") +CPU_SPECIFIC("pentium_iii_no_xmm_regs", 'H',"+cmov,+sse") +CPU_SPECIFIC("pentium_4", 'J', "+cmov,+mmx,+sse,+sse2") +CPU_SPECIFIC("pentium_m", 'K', "+cmov,+mmx,+sse,+sse2") +CPU_SPECIFIC("pentium_4_sse3", 'L', "+cmov,+mmx,+sse,+sse2,+sse3") +CPU_SPECIFIC("core_2_duo_ssse3", 'M', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3") +CPU_SPECIFIC("core_2_duo_sse4_1", 'N', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1") +CPU_SPECIFIC("atom", 'O', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+movbe") +CPU_SPECIFIC("atom_sse4_2", 'c', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") +CPU_SPECIFIC("core_i7_sse4_2", 'P', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") +CPU_SPECIFIC("core_aes_pclmulqdq", 'Q', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") +CPU_SPECIFIC("atom_sse4_2_movbe", 'd', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt") +CPU_SPECIFIC("goldmont", 'i', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt") +CPU_SPECIFIC("sandybridge", 'R', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx") +CPU_SPECIFIC_ALIAS("core_2nd_gen_avx", "sandybridge") +CPU_SPECIFIC("ivybridge", 'S', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+f16c,+avx") +CPU_SPECIFIC_ALIAS("core_3rd_gen_avx", "ivybridge") +CPU_SPECIFIC("haswell", 'V', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2") +CPU_SPECIFIC_ALIAS("core_4th_gen_avx", "haswell") +CPU_SPECIFIC("core_4th_gen_avx_tsx", 'W', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2") +CPU_SPECIFIC("broadwell", 'X', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx") +CPU_SPECIFIC_ALIAS("core_5th_gen_avx", "broadwell") +CPU_SPECIFIC("core_5th_gen_avx_tsx", 'Y', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx") +CPU_SPECIFIC("knl", 'Z', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd") +CPU_SPECIFIC_ALIAS("mic_avx512", "knl") +CPU_SPECIFIC("skylake", 'b', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx,+mpx") +CPU_SPECIFIC( "skylake_avx512", 'a', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512cd,+avx512bw,+avx512vl,+clwb") +CPU_SPECIFIC("cannonlake", 'e', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512ifma,+avx512cd,+avx512bw,+avx512vl,+avx512vbmi") +CPU_SPECIFIC("knm", 'j', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd,+avx5124fmaps,+avx5124vnniw,+avx512vpopcntdq") + +#undef CPU_SPECIFIC_ALIAS +#undef CPU_SPECIFIC #undef PROC_64_BIT #undef PROC_32_BIT +#undef FEATURE #undef PROC #undef PROC_ALIAS +#undef PROC_WITH_FEAT diff --git a/include/clang/Basic/XRayInstr.h b/include/clang/Basic/XRayInstr.h new file mode 100644 index 0000000000000..13c3032a5ccab --- /dev/null +++ b/include/clang/Basic/XRayInstr.h @@ -0,0 +1,70 @@ +//===--- XRayInstr.h --------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +/// \file +/// Defines the clang::XRayInstrKind enum. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_BASIC_XRAYINSTR_H +#define LLVM_CLANG_BASIC_XRAYINSTR_H + +#include "clang/Basic/LLVM.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/MathExtras.h" +#include <cassert> +#include <cstdint> + +namespace clang { + +using XRayInstrMask = uint32_t; + +namespace XRayInstrKind { + +// TODO: Auto-generate these as we add more instrumentation kinds. +enum XRayInstrOrdinal : XRayInstrMask { + XRIO_Function, + XRIO_Custom, + XRIO_Typed, + XRIO_Count +}; + +constexpr XRayInstrMask None = 0; +constexpr XRayInstrMask Function = 1U << XRIO_Function; +constexpr XRayInstrMask Custom = 1U << XRIO_Custom; +constexpr XRayInstrMask Typed = 1U << XRIO_Typed; +constexpr XRayInstrMask All = Function | Custom | Typed; + +} // namespace XRayInstrKind + +struct XRayInstrSet { + bool has(XRayInstrMask K) const { + assert(llvm::isPowerOf2_32(K)); + return Mask & K; + } + + bool hasOneOf(XRayInstrMask K) const { return Mask & K; } + + void set(XRayInstrMask K, bool Value) { + assert(llvm::isPowerOf2_32(K)); + Mask = Value ? (Mask | K) : (Mask & ~K); + } + + void clear(XRayInstrMask K = XRayInstrKind::All) { Mask &= ~K; } + + bool empty() const { return Mask == 0; } + + XRayInstrMask Mask = 0; +}; + +XRayInstrMask parseXRayInstrValue(StringRef Value); + +} // namespace clang + +#endif // LLVM_CLANG_BASIC_XRAYINSTR_H diff --git a/include/clang/Basic/XRayLists.h b/include/clang/Basic/XRayLists.h index 8cfea70e280a9..244b1d533b7ca 100644 --- a/include/clang/Basic/XRayLists.h +++ b/include/clang/Basic/XRayLists.h @@ -26,12 +26,13 @@ namespace clang { class XRayFunctionFilter { std::unique_ptr<llvm::SpecialCaseList> AlwaysInstrument; std::unique_ptr<llvm::SpecialCaseList> NeverInstrument; + std::unique_ptr<llvm::SpecialCaseList> AttrList; SourceManager &SM; public: XRayFunctionFilter(ArrayRef<std::string> AlwaysInstrumentPaths, ArrayRef<std::string> NeverInstrumentPaths, - SourceManager &SM); + ArrayRef<std::string> AttrListPaths, SourceManager &SM); enum class ImbueAttribute { NONE, diff --git a/include/clang/Basic/arm_fp16.td b/include/clang/Basic/arm_fp16.td new file mode 100644 index 0000000000000..bc15a22d84a63 --- /dev/null +++ b/include/clang/Basic/arm_fp16.td @@ -0,0 +1,131 @@ +//===--- arm_fp16.td - ARM FP16 compiler interface ------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the TableGen definitions from which the ARM FP16 header +// file will be generated. +// +//===----------------------------------------------------------------------===// + +include "arm_neon_incl.td" + +// ARMv8.2-A FP16 intrinsics. +let ArchGuard = "defined(__ARM_FEATURE_FP16_SCALAR_ARITHMETIC) && defined(__aarch64__)" in { + + // Negate + def VNEGSH : SInst<"vneg", "ss", "Sh">; + + // Reciprocal/Sqrt + def SCALAR_FRECPSH : IInst<"vrecps", "sss", "Sh">; + def FSQRTSH : SInst<"vsqrt", "ss", "Sh">; + def SCALAR_FRSQRTSH : IInst<"vrsqrts", "sss", "Sh">; + + // Reciprocal Estimate + def SCALAR_FRECPEH : IInst<"vrecpe", "ss", "Sh">; + + // Reciprocal Exponent + def SCALAR_FRECPXH : IInst<"vrecpx", "ss", "Sh">; + + // Reciprocal Square Root Estimate + def SCALAR_FRSQRTEH : IInst<"vrsqrte", "ss", "Sh">; + + // Rounding + def FRINTZ_S64H : SInst<"vrnd", "ss", "Sh">; + def FRINTA_S64H : SInst<"vrnda", "ss", "Sh">; + def FRINTI_S64H : SInst<"vrndi", "ss", "Sh">; + def FRINTM_S64H : SInst<"vrndm", "ss", "Sh">; + def FRINTN_S64H : SInst<"vrndn", "ss", "Sh">; + def FRINTP_S64H : SInst<"vrndp", "ss", "Sh">; + def FRINTX_S64H : SInst<"vrndx", "ss", "Sh">; + + // Conversion + def SCALAR_SCVTFSH : SInst<"vcvth_f16", "Ys", "silUsUiUl">; + def SCALAR_FCVTZSH : SInst<"vcvt_s16", "$s", "Sh">; + def SCALAR_FCVTZSH1 : SInst<"vcvt_s32", "Is", "Sh">; + def SCALAR_FCVTZSH2 : SInst<"vcvt_s64", "Ls", "Sh">; + def SCALAR_FCVTZUH : SInst<"vcvt_u16", "bs", "Sh">; + def SCALAR_FCVTZUH1 : SInst<"vcvt_u32", "Us", "Sh">; + def SCALAR_FCVTZUH2 : SInst<"vcvt_u64", "Os", "Sh">; + def SCALAR_FCVTASH : SInst<"vcvta_s16", "$s", "Sh">; + def SCALAR_FCVTASH1 : SInst<"vcvta_s32", "Is", "Sh">; + def SCALAR_FCVTASH2 : SInst<"vcvta_s64", "Ls", "Sh">; + def SCALAR_FCVTAUH : SInst<"vcvta_u16", "bs", "Sh">; + def SCALAR_FCVTAUH1 : SInst<"vcvta_u32", "Us", "Sh">; + def SCALAR_FCVTAUH2 : SInst<"vcvta_u64", "Os", "Sh">; + def SCALAR_FCVTMSH : SInst<"vcvtm_s16", "$s", "Sh">; + def SCALAR_FCVTMSH1 : SInst<"vcvtm_s32", "Is", "Sh">; + def SCALAR_FCVTMSH2 : SInst<"vcvtm_s64", "Ls", "Sh">; + def SCALAR_FCVTMUH : SInst<"vcvtm_u16", "bs", "Sh">; + def SCALAR_FCVTMUH1 : SInst<"vcvtm_u32", "Us", "Sh">; + def SCALAR_FCVTMUH2 : SInst<"vcvtm_u64", "Os", "Sh">; + def SCALAR_FCVTNSH : SInst<"vcvtn_s16", "$s", "Sh">; + def SCALAR_FCVTNSH1 : SInst<"vcvtn_s32", "Is", "Sh">; + def SCALAR_FCVTNSH2 : SInst<"vcvtn_s64", "Ls", "Sh">; + def SCALAR_FCVTNUH : SInst<"vcvtn_u16", "bs", "Sh">; + def SCALAR_FCVTNUH1 : SInst<"vcvtn_u32", "Us", "Sh">; + def SCALAR_FCVTNUH2 : SInst<"vcvtn_u64", "Os", "Sh">; + def SCALAR_FCVTPSH : SInst<"vcvtp_s16", "$s", "Sh">; + def SCALAR_FCVTPSH1 : SInst<"vcvtp_s32", "Is", "Sh">; + def SCALAR_FCVTPSH2 : SInst<"vcvtp_s64", "Ls", "Sh">; + def SCALAR_FCVTPUH : SInst<"vcvtp_u16", "bs", "Sh">; + def SCALAR_FCVTPUH1 : SInst<"vcvtp_u32", "Us", "Sh">; + def SCALAR_FCVTPUH2 : SInst<"vcvtp_u64", "Os", "Sh">; + let isVCVT_N = 1 in { + def SCALAR_SCVTFSHO : SInst<"vcvth_n_f16", "Ysi", "silUsUiUl">; + def SCALAR_FCVTZSHO : SInst<"vcvt_n_s16", "$si", "Sh">; + def SCALAR_FCVTZSH1O: SInst<"vcvt_n_s32", "Isi", "Sh">; + def SCALAR_FCVTZSH2O: SInst<"vcvt_n_s64", "Lsi", "Sh">; + def SCALAR_FCVTZUHO : SInst<"vcvt_n_u16", "bsi", "Sh">; + def SCALAR_FCVTZUH1O: SInst<"vcvt_n_u32", "Usi", "Sh">; + def SCALAR_FCVTZUH2O: SInst<"vcvt_n_u64", "Osi", "Sh">; + } + // Comparison + def SCALAR_CMEQRH : SInst<"vceq", "bss", "Sh">; + def SCALAR_CMEQZH : SInst<"vceqz", "bs", "Sh">; + def SCALAR_CMGERH : SInst<"vcge", "bss", "Sh">; + def SCALAR_CMGEZH : SInst<"vcgez", "bs", "Sh">; + def SCALAR_CMGTRH : SInst<"vcgt", "bss", "Sh">; + def SCALAR_CMGTZH : SInst<"vcgtz", "bs", "Sh">; + def SCALAR_CMLERH : SInst<"vcle", "bss", "Sh">; + def SCALAR_CMLEZH : SInst<"vclez", "bs", "Sh">; + def SCALAR_CMLTH : SInst<"vclt", "bss", "Sh">; + def SCALAR_CMLTZH : SInst<"vcltz", "bs", "Sh">; + + // Absolute Compare Mask Greater Than Or Equal + def SCALAR_FACGEH : IInst<"vcage", "bss", "Sh">; + def SCALAR_FACLEH : IInst<"vcale", "bss", "Sh">; + + // Absolute Compare Mask Greater Than + def SCALAR_FACGT : IInst<"vcagt", "bss", "Sh">; + def SCALAR_FACLT : IInst<"vcalt", "bss", "Sh">; + + // Scalar Absolute Value + def SCALAR_ABSH : SInst<"vabs", "ss", "Sh">; + + // Scalar Absolute Difference + def SCALAR_ABDH: IInst<"vabd", "sss", "Sh">; + + // Add/Sub + def VADDSH : SInst<"vadd", "sss", "Sh">; + def VSUBHS : SInst<"vsub", "sss", "Sh">; + + // Max/Min + def VMAXHS : SInst<"vmax", "sss", "Sh">; + def VMINHS : SInst<"vmin", "sss", "Sh">; + def FMAXNMHS : SInst<"vmaxnm", "sss", "Sh">; + def FMINNMHS : SInst<"vminnm", "sss", "Sh">; + + // Multiplication/Division + def VMULHS : SInst<"vmul", "sss", "Sh">; + def MULXHS : SInst<"vmulx", "sss", "Sh">; + def FDIVHS : SInst<"vdiv", "sss", "Sh">; + + // Vector fused multiply-add operations + def VFMAHS : SInst<"vfma", "ssss", "Sh">; + def VFMSHS : SInst<"vfms", "ssss", "Sh">; +} diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td index d5c16a91a34f2..d405aac106504 100644 --- a/include/clang/Basic/arm_neon.td +++ b/include/clang/Basic/arm_neon.td @@ -11,309 +11,8 @@ // file will be generated. See ARM document DUI0348B. // //===----------------------------------------------------------------------===// -// -// Each intrinsic is a subclass of the Inst class. An intrinsic can either -// generate a __builtin_* call or it can expand to a set of generic operations. -// -// The operations are subclasses of Operation providing a list of DAGs, the -// last of which is the return value. The available DAG nodes are documented -// below. -// -//===----------------------------------------------------------------------===// - -// The base Operation class. All operations must subclass this. -class Operation<list<dag> ops=[]> { - list<dag> Ops = ops; - bit Unavailable = 0; -} -// An operation that only contains a single DAG. -class Op<dag op> : Operation<[op]>; -// A shorter version of Operation - takes a list of DAGs. The last of these will -// be the return value. -class LOp<list<dag> ops> : Operation<ops>; - -// These defs and classes are used internally to implement the SetTheory -// expansion and should be ignored. -foreach Index = 0-63 in - def sv##Index; -class MaskExpand; - -//===----------------------------------------------------------------------===// -// Available operations -//===----------------------------------------------------------------------===// - -// DAG arguments can either be operations (documented below) or variables. -// Variables are prefixed with '$'. There are variables for each input argument, -// with the name $pN, where N starts at zero. So the zero'th argument will be -// $p0, the first $p1 etc. - -// op - Binary or unary operator, depending on the number of arguments. The -// operator itself is just treated as a raw string and is not checked. -// example: (op "+", $p0, $p1) -> "__p0 + __p1". -// (op "-", $p0) -> "-__p0" -def op; -// call - Invoke another intrinsic. The input types are type checked and -// disambiguated. If there is no intrinsic defined that takes -// the given types (or if there is a type ambiguity) an error is -// generated at tblgen time. The name of the intrinsic is the raw -// name as given to the Inst class (not mangled). -// example: (call "vget_high", $p0) -> "vgetq_high_s16(__p0)" -// (assuming $p0 has type int16x8_t). -def call; -// cast - Perform a cast to a different type. This gets emitted as a static -// C-style cast. For a pure reinterpret cast (T x = *(T*)&y), use -// "bitcast". -// -// The syntax is (cast MOD* VAL). The last argument is the value to -// cast, preceded by a sequence of type modifiers. The target type -// starts off as the type of VAL, and is modified by MOD in sequence. -// The available modifiers are: -// - $X - Take the type of parameter/variable X. For example: -// (cast $p0, $p1) would cast $p1 to the type of $p0. -// - "R" - The type of the return type. -// - A typedef string - A NEON or stdint.h type that is then parsed. -// for example: (cast "uint32x4_t", $p0). -// - "U" - Make the type unsigned. -// - "S" - Make the type signed. -// - "H" - Halve the number of lanes in the type. -// - "D" - Double the number of lanes in the type. -// - "8" - Convert type to an equivalent vector of 8-bit signed -// integers. -// example: (cast "R", "U", $p0) -> "(uint32x4_t)__p0" (assuming the return -// value is of type "int32x4_t". -// (cast $p0, "D", "8", $p1) -> "(int8x16_t)__p1" (assuming __p0 -// has type float64x1_t or any other vector type of 64 bits). -// (cast "int32_t", $p2) -> "(int32_t)__p2" -def cast; -// bitcast - Same as "cast", except a reinterpret-cast is produced: -// (bitcast "T", $p0) -> "*(T*)&__p0". -// The VAL argument is saved to a temporary so it can be used -// as an l-value. -def bitcast; -// dup - Take a scalar argument and create a vector by duplicating it into -// all lanes. The type of the vector is the base type of the intrinsic. -// example: (dup $p1) -> "(uint32x2_t) {__p1, __p1}" (assuming the base type -// is uint32x2_t). -def dup; -// splat - Take a vector and a lane index, and return a vector of the same type -// containing repeated instances of the source vector at the lane index. -// example: (splat $p0, $p1) -> -// "__builtin_shufflevector(__p0, __p0, __p1, __p1, __p1, __p1)" -// (assuming __p0 has four elements). -def splat; -// save_temp - Create a temporary (local) variable. The variable takes a name -// based on the zero'th parameter and can be referenced using -// using that name in subsequent DAGs in the same -// operation. The scope of a temp is the operation. If a variable -// with the given name already exists, an error will be given at -// tblgen time. -// example: [(save_temp $var, (call "foo", $p0)), -// (op "+", $var, $p1)] -> -// "int32x2_t __var = foo(__p0); return __var + __p1;" -def save_temp; -// name_replace - Return the name of the current intrinsic with the first -// argument replaced by the second argument. Raises an error if -// the first argument does not exist in the intrinsic name. -// example: (call (name_replace "_high_", "_"), $p0) (to call the non-high -// version of this intrinsic). -def name_replace; -// literal - Create a literal piece of code. The code is treated as a raw -// string, and must be given a type. The type is a stdint.h or -// NEON intrinsic type as given to (cast). -// example: (literal "int32_t", "0") -def literal; -// shuffle - Create a vector shuffle. The syntax is (shuffle ARG0, ARG1, MASK). -// The MASK argument is a set of elements. The elements are generated -// from the two special defs "mask0" and "mask1". "mask0" expands to -// the lane indices in sequence for ARG0, and "mask1" expands to -// the lane indices in sequence for ARG1. They can be used as-is, e.g. -// -// (shuffle $p0, $p1, mask0) -> $p0 -// (shuffle $p0, $p1, mask1) -> $p1 -// -// or, more usefully, they can be manipulated using the SetTheory -// operators plus some extra operators defined in the NEON emitter. -// The operators are described below. -// example: (shuffle $p0, $p1, (add (highhalf mask0), (highhalf mask1))) -> -// A concatenation of the high halves of the input vectors. -def shuffle; - -// add, interleave, decimate: These set operators are vanilla SetTheory -// operators and take their normal definition. -def add; -def interleave; -def decimate; -// rotl - Rotate set left by a number of elements. -// example: (rotl mask0, 3) -> [3, 4, 5, 6, 0, 1, 2] -def rotl; -// rotl - Rotate set right by a number of elements. -// example: (rotr mask0, 3) -> [4, 5, 6, 0, 1, 2, 3] -def rotr; -// highhalf - Take only the high half of the input. -// example: (highhalf mask0) -> [4, 5, 6, 7] (assuming mask0 had 8 elements) -def highhalf; -// highhalf - Take only the low half of the input. -// example: (lowhalf mask0) -> [0, 1, 2, 3] (assuming mask0 had 8 elements) -def lowhalf; -// rev - Perform a variable-width reversal of the elements. The zero'th argument -// is a width in bits to reverse. The lanes this maps to is determined -// based on the element width of the underlying type. -// example: (rev 32, mask0) -> [3, 2, 1, 0, 7, 6, 5, 4] (if 8-bit elements) -// example: (rev 32, mask0) -> [1, 0, 3, 2] (if 16-bit elements) -def rev; -// mask0 - The initial sequence of lanes for shuffle ARG0 -def mask0 : MaskExpand; -// mask0 - The initial sequence of lanes for shuffle ARG1 -def mask1 : MaskExpand; - -def OP_NONE : Operation; -def OP_UNAVAILABLE : Operation { - let Unavailable = 1; -} - -//===----------------------------------------------------------------------===// -// Instruction definitions -//===----------------------------------------------------------------------===// - -// Every intrinsic subclasses "Inst". An intrinsic has a name, a prototype and -// a sequence of typespecs. -// -// The name is the base name of the intrinsic, for example "vget_lane". This is -// then mangled by the tblgen backend to add type information ("vget_lane_s16"). -// -// A typespec is a sequence of uppercase characters (modifiers) followed by one -// lowercase character. A typespec encodes a particular "base type" of the -// intrinsic. -// -// An example typespec is "Qs" - quad-size short - uint16x8_t. The available -// typespec codes are given below. -// -// The string given to an Inst class is a sequence of typespecs. The intrinsic -// is instantiated for every typespec in the sequence. For example "sdQsQd". -// -// The prototype is a string that defines the return type of the intrinsic -// and the type of each argument. The return type and every argument gets a -// "modifier" that can change in some way the "base type" of the intrinsic. -// -// The modifier 'd' means "default" and does not modify the base type in any -// way. The available modifiers are given below. -// -// Typespecs -// --------- -// c: char -// s: short -// i: int -// l: long -// k: 128-bit long -// f: float -// h: half-float -// d: double -// -// Typespec modifiers -// ------------------ -// S: scalar, only used for function mangling. -// U: unsigned -// Q: 128b -// H: 128b without mangling 'q' -// P: polynomial -// -// Prototype modifiers -// ------------------- -// prototype: return (arg, arg, ...) -// -// v: void -// t: best-fit integer (int/poly args) -// x: signed integer (int/float args) -// u: unsigned integer (int/float args) -// f: float (int args) -// F: double (int args) -// H: half (int args) -// d: default -// g: default, ignore 'Q' size modifier. -// j: default, force 'Q' size modifier. -// w: double width elements, same num elts -// n: double width elements, half num elts -// h: half width elements, double num elts -// q: half width elements, quad num elts -// e: half width elements, double num elts, unsigned -// m: half width elements, same num elts -// i: constant int -// l: constant uint64 -// s: scalar of element type -// z: scalar of half width element type, signed -// r: scalar of double width element type, signed -// a: scalar of element type (splat to vector type) -// b: scalar of unsigned integer/long type (int/float args) -// $: scalar of signed integer/long type (int/float args) -// y: scalar of float -// o: scalar of double -// k: default elt width, double num elts -// 2,3,4: array of default vectors -// B,C,D: array of default elts, force 'Q' size modifier. -// p: pointer type -// c: const pointer type - -// Every intrinsic subclasses Inst. -class Inst <string n, string p, string t, Operation o> { - string Name = n; - string Prototype = p; - string Types = t; - string ArchGuard = ""; - - Operation Operation = o; - bit CartesianProductOfTypes = 0; - bit BigEndianSafe = 0; - bit isShift = 0; - bit isScalarShift = 0; - bit isScalarNarrowShift = 0; - bit isVCVT_N = 0; - // For immediate checks: the immediate will be assumed to specify the lane of - // a Q register. Only used for intrinsics which end up calling polymorphic - // builtins. - bit isLaneQ = 0; - - // Certain intrinsics have different names than their representative - // instructions. This field allows us to handle this correctly when we - // are generating tests. - string InstName = ""; - - // Certain intrinsics even though they are not a WOpInst or LOpInst, - // generate a WOpInst/LOpInst instruction (see below for definition - // of a WOpInst/LOpInst). For testing purposes we need to know - // this. Ex: vset_lane which outputs vmov instructions. - bit isHiddenWInst = 0; - bit isHiddenLInst = 0; -} - -// The following instruction classes are implemented via builtins. -// These declarations are used to generate Builtins.def: -// -// SInst: Instruction with signed/unsigned suffix (e.g., "s8", "u8", "p8") -// IInst: Instruction with generic integer suffix (e.g., "i8") -// WInst: Instruction with only bit size suffix (e.g., "8") -class SInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} -class IInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} -class WInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} - -// The following instruction classes are implemented via operators -// instead of builtins. As such these declarations are only used for -// the purpose of generating tests. -// -// SOpInst: Instruction with signed/unsigned suffix (e.g., "s8", -// "u8", "p8"). -// IOpInst: Instruction with generic integer suffix (e.g., "i8"). -// WOpInst: Instruction with bit size only suffix (e.g., "8"). -// LOpInst: Logical instruction with no bit size suffix. -// NoTestOpInst: Intrinsic that has no corresponding instruction. -class SOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class IOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class WOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class LOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -class NoTestOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} -//===----------------------------------------------------------------------===// -// Operations -//===----------------------------------------------------------------------===// +include "arm_neon_incl.td" def OP_ADD : Op<(op "+", $p0, $p1)>; def OP_ADDL : Op<(op "+", (call "vmovl", $p0), (call "vmovl", $p1))>; @@ -500,6 +199,13 @@ def OP_SCALAR_HALF_SET_LNQ : Op<(bitcast "float16x8_t", (bitcast "int16_t", $p0), (bitcast "int16x8_t", $p1), $p2))>; +def OP_DOT_LN + : Op<(call "vdot", $p0, $p1, + (bitcast $p1, (splat(bitcast "uint32x2_t", $p2), $p3)))>; +def OP_DOT_LNQ + : Op<(call "vdot", $p0, $p1, + (bitcast $p1, (splat(bitcast "uint32x4_t", $p2), $p3)))>; + //===----------------------------------------------------------------------===// // Instructions //===----------------------------------------------------------------------===// @@ -632,12 +338,24 @@ def VSLI_N : WInst<"vsli_n", "dddi", // E.3.14 Loads and stores of a single vector def VLD1 : WInst<"vld1", "dc", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; +def VLD1_X2 : WInst<"vld1_x2", "2c", + "cfhilsUcUiUlUsQcQfQhQiQlQsQUcQUiQUlQUsPcPsQPcQPs">; +def VLD1_X3 : WInst<"vld1_x3", "3c", + "cfhilsUcUiUlUsQcQfQhQiQlQsQUcQUiQUlQUsPcPsQPcQPs">; +def VLD1_X4 : WInst<"vld1_x4", "4c", + "cfhilsUcUiUlUsQcQfQhQiQlQsQUcQUiQUlQUsPcPsQPcQPs">; def VLD1_LANE : WInst<"vld1_lane", "dcdi", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; def VLD1_DUP : WInst<"vld1_dup", "dc", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; def VST1 : WInst<"vst1", "vpd", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; +def VST1_X2 : WInst<"vst1_x2", "vp2", + "cfhilsUcUiUlUsQcQfQhQiQlQsQUcQUiQUlQUsPcPsQPcQPs">; +def VST1_X3 : WInst<"vst1_x3", "vp3", + "cfhilsUcUiUlUsQcQfQhQiQlQsQUcQUiQUlQUsPcPsQPcQPs">; +def VST1_X4 : WInst<"vst1_x4", "vp4", + "cfhilsUcUiUlUsQcQfQhQiQlQsQUcQUiQUlQUsPcPsQPcQPs">; def VST1_LANE : WInst<"vst1_lane", "vpdi", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">; @@ -646,9 +364,12 @@ def VST1_LANE : WInst<"vst1_lane", "vpdi", def VLD2 : WInst<"vld2", "2c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; def VLD3 : WInst<"vld3", "3c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; def VLD4 : WInst<"vld4", "4c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">; -def VLD2_DUP : WInst<"vld2_dup", "2c", "UcUsUiUlcsilhfPcPs">; -def VLD3_DUP : WInst<"vld3_dup", "3c", "UcUsUiUlcsilhfPcPs">; -def VLD4_DUP : WInst<"vld4_dup", "4c", "UcUsUiUlcsilhfPcPs">; +def VLD2_DUP : WInst<"vld2_dup", "2c", + "UcUsUiUlcsilhfPcPsQcQfQhQiQlQsQPcQPsQUcQUiQUlQUs">; +def VLD3_DUP : WInst<"vld3_dup", "3c", + "UcUsUiUlcsilhfPcPsQcQfQhQiQlQsQPcQPsQUcQUiQUlQUs">; +def VLD4_DUP : WInst<"vld4_dup", "4c", + "UcUsUiUlcsilhfPcPsQcQfQhQiQlQsQPcQPsQUcQUiQUlQUs">; def VLD2_LANE : WInst<"vld2_lane", "2c2i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; def VLD3_LANE : WInst<"vld3_lane", "3c3i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; def VLD4_LANE : WInst<"vld4_lane", "4c4i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">; @@ -698,6 +419,10 @@ def VCOMBINE : NoTestOpInst<"vcombine", "kdd", "csilhfUcUsUiUlPcPs", OP_CONC>; //////////////////////////////////////////////////////////////////////////////// // E.3.21 Splitting vectors +// Note that the ARM NEON Reference 2.0 mistakenly document the vget_high_f16() +// and vget_low_f16() intrinsics as AArch64-only. We (and GCC) support all +// versions of these intrinsics in both AArch32 and AArch64 architectures. See +// D45668 for more details. let InstName = "vmov" in { def VGET_HIGH : NoTestOpInst<"vget_high", "dk", "csilhfUcUsUiUlPcPs", OP_HI>; def VGET_LOW : NoTestOpInst<"vget_low", "dk", "csilhfUcUsUiUlPcPs", OP_LO>; @@ -832,6 +557,7 @@ def VREINTERPRET let ArchGuard = "defined(__ARM_FEATURE_FMA)" in { def VFMA : SInst<"vfma", "dddd", "fQf">; def VFMS : SOpInst<"vfms", "dddd", "fQf", OP_FMLS>; + def FMLA_N_F32 : SOpInst<"vfma_n", "ddds", "fQf", OP_FMLA_N>; } //////////////////////////////////////////////////////////////////////////////// @@ -858,18 +584,15 @@ def ST3 : WInst<"vst3", "vp3", "QUlQldQdPlQPl">; def ST4 : WInst<"vst4", "vp4", "QUlQldQdPlQPl">; def LD1_X2 : WInst<"vld1_x2", "2c", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def LD3_x3 : WInst<"vld1_x3", "3c", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def LD4_x4 : WInst<"vld1_x4", "4c", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; - -def ST1_X2 : WInst<"vst1_x2", "vp2", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def ST1_X3 : WInst<"vst1_x3", "vp3", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; -def ST1_X4 : WInst<"vst1_x4", "vp4", - "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPsQUlQldQdPlQPl">; + "dQdPlQPl">; +def LD1_X3 : WInst<"vld1_x3", "3c", + "dQdPlQPl">; +def LD1_X4 : WInst<"vld1_x4", "4c", + "dQdPlQPl">; + +def ST1_X2 : WInst<"vst1_x2", "vp2", "dQdPlQPl">; +def ST1_X3 : WInst<"vst1_x3", "vp3", "dQdPlQPl">; +def ST1_X4 : WInst<"vst1_x4", "vp4", "dQdPlQPl">; def LD1_LANE : WInst<"vld1_lane", "dcdi", "dQdPlQPl">; def LD2_LANE : WInst<"vld2_lane", "2c2i", "lUlQcQUcQPcQlQUldQdPlQPl">; @@ -881,12 +604,9 @@ def ST3_LANE : WInst<"vst3_lane", "vp3i", "lUlQcQUcQPcQlQUldQdPlQPl">; def ST4_LANE : WInst<"vst4_lane", "vp4i", "lUlQcQUcQPcQlQUldQdPlQPl">; def LD1_DUP : WInst<"vld1_dup", "dc", "dQdPlQPl">; -def LD2_DUP : WInst<"vld2_dup", "2c", - "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">; -def LD3_DUP : WInst<"vld3_dup", "3c", - "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">; -def LD4_DUP : WInst<"vld4_dup", "4c", - "QUcQUsQUiQUlQcQsQiQlQhQfQdQPcQPsQPldPl">; +def LD2_DUP : WInst<"vld2_dup", "2c", "dQdPlQPl">; +def LD3_DUP : WInst<"vld3_dup", "3c", "dQdPlQPl">; +def LD4_DUP : WInst<"vld4_dup", "4c", "dQdPlQPl">; def VLDRQ : WInst<"vldrq", "sc", "Pk">; def VSTRQ : WInst<"vstrq", "vps", "Pk">; @@ -922,8 +642,8 @@ def FMLS : SOpInst<"vfms", "dddd", "dQd", OP_FMLS>; // MUL, MLA, MLS, FMA, FMS definitions with scalar argument def VMUL_N_A64 : IOpInst<"vmul_n", "dds", "Qd", OP_MUL_N>; -def FMLA_N : SOpInst<"vfma_n", "ddds", "fQfQd", OP_FMLA_N>; -def FMLS_N : SOpInst<"vfms_n", "ddds", "fQfQd", OP_FMLS_N>; +def FMLA_N : SOpInst<"vfma_n", "ddds", "dQd", OP_FMLA_N>; +def FMLS_N : SOpInst<"vfms_n", "ddds", "fdQfQd", OP_FMLS_N>; def MLA_N : SOpInst<"vmla_n", "ddds", "Qd", OP_MLA_N>; def MLS_N : SOpInst<"vmls_n", "ddds", "Qd", OP_MLS_N>; @@ -1214,7 +934,7 @@ def VEXT_A64 : WInst<"vext", "dddi", "dQdPlQPl">; //////////////////////////////////////////////////////////////////////////////// // Crypto -let ArchGuard = "__ARM_FEATURE_CRYPTO" in { +let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_CRYPTO)" in { def AESE : SInst<"vaese", "ddd", "QUc">; def AESD : SInst<"vaesd", "ddd", "QUc">; def AESMC : SInst<"vaesmc", "dd", "QUc">; @@ -1268,6 +988,7 @@ def FRINTP_S32 : SInst<"vrndp", "dd", "fQf">; def FRINTM_S32 : SInst<"vrndm", "dd", "fQf">; def FRINTX_S32 : SInst<"vrndx", "dd", "fQf">; def FRINTZ_S32 : SInst<"vrnd", "dd", "fQf">; +def FRINTI_S32 : SInst<"vrndi", "dd", "fQf">; } let ArchGuard = "__ARM_ARCH >= 8 && defined(__aarch64__) && defined(__ARM_FEATURE_DIRECTED_ROUNDING)" in { @@ -1277,7 +998,7 @@ def FRINTP_S64 : SInst<"vrndp", "dd", "dQd">; def FRINTM_S64 : SInst<"vrndm", "dd", "dQd">; def FRINTX_S64 : SInst<"vrndx", "dd", "dQd">; def FRINTZ_S64 : SInst<"vrnd", "dd", "dQd">; -def FRINTI_S64 : SInst<"vrndi", "dd", "fdQfQd">; +def FRINTI_S64 : SInst<"vrndi", "dd", "dQd">; } //////////////////////////////////////////////////////////////////////////////// @@ -1417,6 +1138,12 @@ def SCALAR_FCVTZU_N_U64 : SInst<"vcvt_n_u64", "bsi", "Sd">; } //////////////////////////////////////////////////////////////////////////////// +// Scalar Floating-point Round to Integral +let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_DIRECTED_ROUNDING)" in { +def SCALAR_FRINTN_S32 : SInst<"vrndn", "ss", "Sf">; +} + +//////////////////////////////////////////////////////////////////////////////// // Scalar Reduce Pairwise Addition (Scalar and Floating Point) def SCALAR_ADDP : SInst<"vpadd", "sd", "SfSHlSHdSHUl">; @@ -1664,8 +1391,8 @@ def SCALAR_VDUP_LANE : IInst<"vdup_lane", "sdi", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs def SCALAR_VDUP_LANEQ : IInst<"vdup_laneq", "sji", "ScSsSiSlSfSdSUcSUsSUiSUlSPcSPs">; } -// ARMv8.2-A FP16 intrinsics. -let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)" in { +// ARMv8.2-A FP16 vector intrinsics for A32/A64. +let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)" in { // ARMv8.2-A FP16 one-operand vector intrinsics. @@ -1690,20 +1417,20 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc def VCVTP_U16 : SInst<"vcvtp_u16", "ud", "hQh">; // Vector rounding - def FRINTZH : SInst<"vrnd", "dd", "hQh">; - def FRINTNH : SInst<"vrndn", "dd", "hQh">; - def FRINTAH : SInst<"vrnda", "dd", "hQh">; - def FRINTPH : SInst<"vrndp", "dd", "hQh">; - def FRINTMH : SInst<"vrndm", "dd", "hQh">; - def FRINTXH : SInst<"vrndx", "dd", "hQh">; - def FRINTIH : SInst<"vrndi", "dd", "hQh">; + let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_DIRECTED_ROUNDING) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)" in { + def FRINTZH : SInst<"vrnd", "dd", "hQh">; + def FRINTNH : SInst<"vrndn", "dd", "hQh">; + def FRINTAH : SInst<"vrnda", "dd", "hQh">; + def FRINTPH : SInst<"vrndp", "dd", "hQh">; + def FRINTMH : SInst<"vrndm", "dd", "hQh">; + def FRINTXH : SInst<"vrndx", "dd", "hQh">; + } // Misc. def VABSH : SInst<"vabs", "dd", "hQh">; def VNEGH : SOpInst<"vneg", "dd", "hQh", OP_NEG>; def VRECPEH : SInst<"vrecpe", "dd", "hQh">; def FRSQRTEH : SInst<"vrsqrte", "dd", "hQh">; - def FSQRTH : SInst<"vsqrt", "dd", "hQh">; // ARMv8.2-A FP16 two-operands vector intrinsics. @@ -1714,12 +1441,12 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc // Comparison let InstName = "vacge" in { - def VCAGEH : SInst<"vcage", "udd", "hQh">; - def VCALEH : SInst<"vcale", "udd", "hQh">; + def VCAGEH : SInst<"vcage", "udd", "hQh">; + def VCALEH : SInst<"vcale", "udd", "hQh">; } let InstName = "vacgt" in { def VCAGTH : SInst<"vcagt", "udd", "hQh">; - def VCALTH : SInst<"vcalt", "udd", "hQh">; + def VCALTH : SInst<"vcalt", "udd", "hQh">; } def VCEQH : SOpInst<"vceq", "udd", "hQh", OP_EQ>; def VCGEH : SOpInst<"vcge", "udd", "hQh", OP_GE>; @@ -1739,23 +1466,20 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc // Max/Min def VMAXH : SInst<"vmax", "ddd", "hQh">; def VMINH : SInst<"vmin", "ddd", "hQh">; - def FMAXNMH : SInst<"vmaxnm", "ddd", "hQh">; - def FMINNMH : SInst<"vminnm", "ddd", "hQh">; + let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_NUMERIC_MAXMIN) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)" in { + def FMAXNMH : SInst<"vmaxnm", "ddd", "hQh">; + def FMINNMH : SInst<"vminnm", "ddd", "hQh">; + } // Multiplication/Division def VMULH : SOpInst<"vmul", "ddd", "hQh", OP_MUL>; - def MULXH : SInst<"vmulx", "ddd", "hQh">; - def FDIVH : IOpInst<"vdiv", "ddd", "hQh", OP_DIV>; // Pairwise addition - def VPADDH : SInst<"vpadd", "ddd", "hQh">; + def VPADDH : SInst<"vpadd", "ddd", "h">; // Pairwise Max/Min - def VPMAXH : SInst<"vpmax", "ddd", "hQh">; - def VPMINH : SInst<"vpmin", "ddd", "hQh">; - // Pairwise MaxNum/MinNum - def FMAXNMPH : SInst<"vpmaxnm", "ddd", "hQh">; - def FMINNMPH : SInst<"vpminnm", "ddd", "hQh">; + def VPMAXH : SInst<"vpmax", "ddd", "h">; + def VPMINH : SInst<"vpmin", "ddd", "h">; // Reciprocal/Sqrt def VRECPSH : SInst<"vrecps", "ddd", "hQh">; @@ -1769,6 +1493,63 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc // ARMv8.2-A FP16 lane vector intrinsics. + // Mul lane + def VMUL_LANEH : IOpInst<"vmul_lane", "ddgi", "hQh", OP_MUL_LN>; + def VMUL_NH : IOpInst<"vmul_n", "dds", "hQh", OP_MUL_N>; + + // Data processing intrinsics - section 5 + + // Logical operations + let isHiddenLInst = 1 in + def VBSLH : SInst<"vbsl", "dudd", "hQh">; + + // Transposition operations + def VZIPH : WInst<"vzip", "2dd", "hQh">; + def VUZPH : WInst<"vuzp", "2dd", "hQh">; + def VTRNH : WInst<"vtrn", "2dd", "hQh">; + + + let ArchGuard = "!defined(__aarch64__)" in { + // Set all lanes to same value. + // Already implemented prior to ARMv8.2-A. + def VMOV_NH : WOpInst<"vmov_n", "ds", "hQh", OP_DUP>; + def VDUP_NH : WOpInst<"vdup_n", "ds", "hQh", OP_DUP>; + def VDUP_LANE1H : WOpInst<"vdup_lane", "dgi", "hQh", OP_DUP_LN>; + } + + // Vector Extract + def VEXTH : WInst<"vext", "dddi", "hQh">; + + // Reverse vector elements + def VREV64H : WOpInst<"vrev64", "dd", "hQh", OP_REV64>; +} + +// ARMv8.2-A FP16 vector intrinsics for A64 only. +let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarch64__)" in { + + // Vector rounding + def FRINTIH : SInst<"vrndi", "dd", "hQh">; + + // Misc. + def FSQRTH : SInst<"vsqrt", "dd", "hQh">; + + // Multiplication/Division + def MULXH : SInst<"vmulx", "ddd", "hQh">; + def FDIVH : IOpInst<"vdiv", "ddd", "hQh", OP_DIV>; + + // Pairwise addition + def VPADDH1 : SInst<"vpadd", "ddd", "Qh">; + + // Pairwise Max/Min + def VPMAXH1 : SInst<"vpmax", "ddd", "Qh">; + def VPMINH1 : SInst<"vpmin", "ddd", "Qh">; + + // Pairwise MaxNum/MinNum + def FMAXNMPH : SInst<"vpmaxnm", "ddd", "hQh">; + def FMINNMPH : SInst<"vpminnm", "ddd", "hQh">; + + // ARMv8.2-A FP16 lane vector intrinsics. + // FMA lane def VFMA_LANEH : IInst<"vfma_lane", "dddgi", "hQh">; def VFMA_LANEQH : IInst<"vfma_laneq", "dddji", "hQh">; @@ -1789,9 +1570,7 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc def SCALAR_FMLS_LANEQH : IOpInst<"vfms_laneq", "sssji", "Sh", OP_FMS_LNQ>; // Mul lane - def VMUL_LANEH : IOpInst<"vmul_lane", "ddgi", "hQh", OP_MUL_LN>; def VMUL_LANEQH : IOpInst<"vmul_laneq", "ddji", "hQh", OP_MUL_LN>; - def VMUL_NH : IOpInst<"vmul_n", "dds", "hQh", OP_MUL_N>; // Scalar floating point multiply (scalar, by element) def SCALAR_FMUL_LANEH : IOpInst<"vmul_lane", "ssdi", "Sh", OP_SCALAR_MUL_LN>; def SCALAR_FMUL_LANEQH : IOpInst<"vmul_laneq", "ssji", "Sh", OP_SCALAR_MUL_LN>; @@ -1800,11 +1579,9 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc def VMULX_LANEH : IOpInst<"vmulx_lane", "ddgi", "hQh", OP_MULX_LN>; def VMULX_LANEQH : IOpInst<"vmulx_laneq", "ddji", "hQh", OP_MULX_LN>; def VMULX_NH : IOpInst<"vmulx_n", "dds", "hQh", OP_MULX_N>; - // TODO: Scalar floating point multiply extended (scalar, by element) - // Below ones are commented out because they need vmulx_f16(float16_t, float16_t) - // which will be implemented later with fp16 scalar intrinsic (arm_fp16.h) - //def SCALAR_FMULX_LANEH : IOpInst<"vmulx_lane", "ssdi", "Sh", OP_SCALAR_MUL_LN>; - //def SCALAR_FMULX_LANEQH : IOpInst<"vmulx_laneq", "ssji", "Sh", OP_SCALAR_MUL_LN>; + // Scalar floating point mulx (scalar, by element) + def SCALAR_FMULX_LANEH : IInst<"vmulx_lane", "ssdi", "Sh">; + def SCALAR_FMULX_LANEQH : IInst<"vmulx_laneq", "ssji", "Sh">; // ARMv8.2-A FP16 reduction vector intrinsics. def VMAXVH : SInst<"vmaxv", "sd", "hQh">; @@ -1812,29 +1589,6 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc def FMAXNMVH : SInst<"vmaxnmv", "sd", "hQh">; def FMINNMVH : SInst<"vminnmv", "sd", "hQh">; - // Data processing intrinsics - section 5 - - // Logical operations - let isHiddenLInst = 1 in - def VBSLH : SInst<"vbsl", "dudd", "hQh">; - - // Transposition operations - def VZIPH : WInst<"vzip", "2dd", "hQh">; - def VUZPH : WInst<"vuzp", "2dd", "hQh">; - def VTRNH : WInst<"vtrn", "2dd", "hQh">; - - // Set all lanes to same value. - /* Already implemented prior to ARMv8.2-A. - def VMOV_NH : WOpInst<"vmov_n", "ds", "hQh", OP_DUP>; - def VDUP_NH : WOpInst<"vdup_n", "ds", "hQh", OP_DUP>; - def VDUP_LANE1H : WOpInst<"vdup_lane", "dgi", "hQh", OP_DUP_LN>;*/ - - // Vector Extract - def VEXTH : WInst<"vext", "dddi", "hQh">; - - // Reverse vector elements - def VREV64H : WOpInst<"vrev64", "dd", "hQh", OP_REV64>; - // Permutation def VTRN1H : SOpInst<"vtrn1", "ddd", "hQh", OP_TRN1>; def VZIP1H : SOpInst<"vzip1", "ddd", "hQh", OP_ZIP1>; @@ -1846,3 +1600,13 @@ let ArchGuard = "defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(__aarc def SCALAR_VDUP_LANEH : IInst<"vdup_lane", "sdi", "Sh">; def SCALAR_VDUP_LANEQH : IInst<"vdup_laneq", "sji", "Sh">; } + +// v8.2-A dot product instructions. +let ArchGuard = "defined(__ARM_FEATURE_DOTPROD)" in { + def DOT : SInst<"vdot", "dd88", "iQiUiQUi">; + def DOT_LANE : SOpInst<"vdot_lane", "dd87i", "iUiQiQUi", OP_DOT_LN>; +} +let ArchGuard = "defined(__ARM_FEATURE_DOTPROD) && defined(__aarch64__)" in { + // Variants indexing into a 128-bit vector are A64 only. + def UDOT_LANEQ : SOpInst<"vdot_laneq", "dd89i", "iUiQiQUi", OP_DOT_LNQ>; +} diff --git a/include/clang/Basic/arm_neon_incl.td b/include/clang/Basic/arm_neon_incl.td new file mode 100644 index 0000000000000..46708a52aa3a6 --- /dev/null +++ b/include/clang/Basic/arm_neon_incl.td @@ -0,0 +1,316 @@ +//===--- arm_neon_incl.td - ARM NEON compiler interface ------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines data structures shared by arm_neon.td and arm_fp16.td. +// It constains base operation classes, operations, instructions, instruction +// modifiers, etc. +// +//===----------------------------------------------------------------------===// +// +// Each intrinsic is a subclass of the Inst class. An intrinsic can either +// generate a __builtin_* call or it can expand to a set of generic operations. +// +// The operations are subclasses of Operation providing a list of DAGs, the +// last of which is the return value. The available DAG nodes are documented +// below. +// +//===----------------------------------------------------------------------===// + +// The base Operation class. All operations must subclass this. +class Operation<list<dag> ops=[]> { + list<dag> Ops = ops; + bit Unavailable = 0; +} +// An operation that only contains a single DAG. +class Op<dag op> : Operation<[op]>; +// A shorter version of Operation - takes a list of DAGs. The last of these will +// be the return value. +class LOp<list<dag> ops> : Operation<ops>; + +// These defs and classes are used internally to implement the SetTheory +// expansion and should be ignored. +foreach Index = 0-63 in + def sv##Index; +class MaskExpand; + +//===----------------------------------------------------------------------===// +// Available operations +//===----------------------------------------------------------------------===// + +// DAG arguments can either be operations (documented below) or variables. +// Variables are prefixed with '$'. There are variables for each input argument, +// with the name $pN, where N starts at zero. So the zero'th argument will be +// $p0, the first $p1 etc. + +// op - Binary or unary operator, depending on the number of arguments. The +// operator itself is just treated as a raw string and is not checked. +// example: (op "+", $p0, $p1) -> "__p0 + __p1". +// (op "-", $p0) -> "-__p0" +def op; +// call - Invoke another intrinsic. The input types are type checked and +// disambiguated. If there is no intrinsic defined that takes +// the given types (or if there is a type ambiguity) an error is +// generated at tblgen time. The name of the intrinsic is the raw +// name as given to the Inst class (not mangled). +// example: (call "vget_high", $p0) -> "vgetq_high_s16(__p0)" +// (assuming $p0 has type int16x8_t). +def call; +// cast - Perform a cast to a different type. This gets emitted as a static +// C-style cast. For a pure reinterpret cast (T x = *(T*)&y), use +// "bitcast". +// +// The syntax is (cast MOD* VAL). The last argument is the value to +// cast, preceded by a sequence of type modifiers. The target type +// starts off as the type of VAL, and is modified by MOD in sequence. +// The available modifiers are: +// - $X - Take the type of parameter/variable X. For example: +// (cast $p0, $p1) would cast $p1 to the type of $p0. +// - "R" - The type of the return type. +// - A typedef string - A NEON or stdint.h type that is then parsed. +// for example: (cast "uint32x4_t", $p0). +// - "U" - Make the type unsigned. +// - "S" - Make the type signed. +// - "H" - Halve the number of lanes in the type. +// - "D" - Double the number of lanes in the type. +// - "8" - Convert type to an equivalent vector of 8-bit signed +// integers. +// example: (cast "R", "U", $p0) -> "(uint32x4_t)__p0" (assuming the return +// value is of type "int32x4_t". +// (cast $p0, "D", "8", $p1) -> "(int8x16_t)__p1" (assuming __p0 +// has type float64x1_t or any other vector type of 64 bits). +// (cast "int32_t", $p2) -> "(int32_t)__p2" +def cast; +// bitcast - Same as "cast", except a reinterpret-cast is produced: +// (bitcast "T", $p0) -> "*(T*)&__p0". +// The VAL argument is saved to a temporary so it can be used +// as an l-value. +def bitcast; +// dup - Take a scalar argument and create a vector by duplicating it into +// all lanes. The type of the vector is the base type of the intrinsic. +// example: (dup $p1) -> "(uint32x2_t) {__p1, __p1}" (assuming the base type +// is uint32x2_t). +def dup; +// splat - Take a vector and a lane index, and return a vector of the same type +// containing repeated instances of the source vector at the lane index. +// example: (splat $p0, $p1) -> +// "__builtin_shufflevector(__p0, __p0, __p1, __p1, __p1, __p1)" +// (assuming __p0 has four elements). +def splat; +// save_temp - Create a temporary (local) variable. The variable takes a name +// based on the zero'th parameter and can be referenced using +// using that name in subsequent DAGs in the same +// operation. The scope of a temp is the operation. If a variable +// with the given name already exists, an error will be given at +// tblgen time. +// example: [(save_temp $var, (call "foo", $p0)), +// (op "+", $var, $p1)] -> +// "int32x2_t __var = foo(__p0); return __var + __p1;" +def save_temp; +// name_replace - Return the name of the current intrinsic with the first +// argument replaced by the second argument. Raises an error if +// the first argument does not exist in the intrinsic name. +// example: (call (name_replace "_high_", "_"), $p0) (to call the non-high +// version of this intrinsic). +def name_replace; +// literal - Create a literal piece of code. The code is treated as a raw +// string, and must be given a type. The type is a stdint.h or +// NEON intrinsic type as given to (cast). +// example: (literal "int32_t", "0") +def literal; +// shuffle - Create a vector shuffle. The syntax is (shuffle ARG0, ARG1, MASK). +// The MASK argument is a set of elements. The elements are generated +// from the two special defs "mask0" and "mask1". "mask0" expands to +// the lane indices in sequence for ARG0, and "mask1" expands to +// the lane indices in sequence for ARG1. They can be used as-is, e.g. +// +// (shuffle $p0, $p1, mask0) -> $p0 +// (shuffle $p0, $p1, mask1) -> $p1 +// +// or, more usefully, they can be manipulated using the SetTheory +// operators plus some extra operators defined in the NEON emitter. +// The operators are described below. +// example: (shuffle $p0, $p1, (add (highhalf mask0), (highhalf mask1))) -> +// A concatenation of the high halves of the input vectors. +def shuffle; + +// add, interleave, decimate: These set operators are vanilla SetTheory +// operators and take their normal definition. +def add; +def interleave; +def decimate; +// rotl - Rotate set left by a number of elements. +// example: (rotl mask0, 3) -> [3, 4, 5, 6, 0, 1, 2] +def rotl; +// rotl - Rotate set right by a number of elements. +// example: (rotr mask0, 3) -> [4, 5, 6, 0, 1, 2, 3] +def rotr; +// highhalf - Take only the high half of the input. +// example: (highhalf mask0) -> [4, 5, 6, 7] (assuming mask0 had 8 elements) +def highhalf; +// highhalf - Take only the low half of the input. +// example: (lowhalf mask0) -> [0, 1, 2, 3] (assuming mask0 had 8 elements) +def lowhalf; +// rev - Perform a variable-width reversal of the elements. The zero'th argument +// is a width in bits to reverse. The lanes this maps to is determined +// based on the element width of the underlying type. +// example: (rev 32, mask0) -> [3, 2, 1, 0, 7, 6, 5, 4] (if 8-bit elements) +// example: (rev 32, mask0) -> [1, 0, 3, 2] (if 16-bit elements) +def rev; +// mask0 - The initial sequence of lanes for shuffle ARG0 +def mask0 : MaskExpand; +// mask0 - The initial sequence of lanes for shuffle ARG1 +def mask1 : MaskExpand; + +def OP_NONE : Operation; +def OP_UNAVAILABLE : Operation { + let Unavailable = 1; +} + +//===----------------------------------------------------------------------===// +// Instruction definitions +//===----------------------------------------------------------------------===// + +// Every intrinsic subclasses "Inst". An intrinsic has a name, a prototype and +// a sequence of typespecs. +// +// The name is the base name of the intrinsic, for example "vget_lane". This is +// then mangled by the tblgen backend to add type information ("vget_lane_s16"). +// +// A typespec is a sequence of uppercase characters (modifiers) followed by one +// lowercase character. A typespec encodes a particular "base type" of the +// intrinsic. +// +// An example typespec is "Qs" - quad-size short - uint16x8_t. The available +// typespec codes are given below. +// +// The string given to an Inst class is a sequence of typespecs. The intrinsic +// is instantiated for every typespec in the sequence. For example "sdQsQd". +// +// The prototype is a string that defines the return type of the intrinsic +// and the type of each argument. The return type and every argument gets a +// "modifier" that can change in some way the "base type" of the intrinsic. +// +// The modifier 'd' means "default" and does not modify the base type in any +// way. The available modifiers are given below. +// +// Typespecs +// --------- +// c: char +// s: short +// i: int +// l: long +// k: 128-bit long +// f: float +// h: half-float +// d: double +// +// Typespec modifiers +// ------------------ +// S: scalar, only used for function mangling. +// U: unsigned +// Q: 128b +// H: 128b without mangling 'q' +// P: polynomial +// +// Prototype modifiers +// ------------------- +// prototype: return (arg, arg, ...) +// +// v: void +// t: best-fit integer (int/poly args) +// x: signed integer (int/float args) +// u: unsigned integer (int/float args) +// f: float (int args) +// F: double (int args) +// H: half (int args) +// d: default +// g: default, ignore 'Q' size modifier. +// j: default, force 'Q' size modifier. +// w: double width elements, same num elts +// n: double width elements, half num elts +// h: half width elements, double num elts +// q: half width elements, quad num elts +// e: half width elements, double num elts, unsigned +// m: half width elements, same num elts +// i: constant int +// l: constant uint64 +// s: scalar of element type +// z: scalar of half width element type, signed +// r: scalar of double width element type, signed +// a: scalar of element type (splat to vector type) +// b: scalar of unsigned integer/long type (int/float args) +// $: scalar of signed integer/long type (int/float args) +// y: scalar of float +// o: scalar of double +// k: default elt width, double num elts +// 2,3,4: array of default vectors +// B,C,D: array of default elts, force 'Q' size modifier. +// p: pointer type +// c: const pointer type +// 7: vector of 8-bit elements, ignore 'Q' size modifier +// 8: vector of 8-bit elements, same width as default type +// 9: vector of 8-bit elements, force 'Q' size modifier + +// Every intrinsic subclasses Inst. +class Inst <string n, string p, string t, Operation o> { + string Name = n; + string Prototype = p; + string Types = t; + string ArchGuard = ""; + + Operation Operation = o; + bit CartesianProductOfTypes = 0; + bit BigEndianSafe = 0; + bit isShift = 0; + bit isScalarShift = 0; + bit isScalarNarrowShift = 0; + bit isVCVT_N = 0; + // For immediate checks: the immediate will be assumed to specify the lane of + // a Q register. Only used for intrinsics which end up calling polymorphic + // builtins. + bit isLaneQ = 0; + + // Certain intrinsics have different names than their representative + // instructions. This field allows us to handle this correctly when we + // are generating tests. + string InstName = ""; + + // Certain intrinsics even though they are not a WOpInst or LOpInst, + // generate a WOpInst/LOpInst instruction (see below for definition + // of a WOpInst/LOpInst). For testing purposes we need to know + // this. Ex: vset_lane which outputs vmov instructions. + bit isHiddenWInst = 0; + bit isHiddenLInst = 0; +} + +// The following instruction classes are implemented via builtins. +// These declarations are used to generate Builtins.def: +// +// SInst: Instruction with signed/unsigned suffix (e.g., "s8", "u8", "p8") +// IInst: Instruction with generic integer suffix (e.g., "i8") +// WInst: Instruction with only bit size suffix (e.g., "8") +class SInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} +class IInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} +class WInst<string n, string p, string t> : Inst<n, p, t, OP_NONE> {} + +// The following instruction classes are implemented via operators +// instead of builtins. As such these declarations are only used for +// the purpose of generating tests. +// +// SOpInst: Instruction with signed/unsigned suffix (e.g., "s8", +// "u8", "p8"). +// IOpInst: Instruction with generic integer suffix (e.g., "i8"). +// WOpInst: Instruction with bit size only suffix (e.g., "8"). +// LOpInst: Logical instruction with no bit size suffix. +// NoTestOpInst: Intrinsic that has no corresponding instruction. +class SOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} +class IOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} +class WOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} +class LOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} +class NoTestOpInst<string n, string p, string t, Operation o> : Inst<n, p, t, o> {} |