17#include "llvm/ADT/StringExtras.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/ADT/StringSwitch.h"
20#include "llvm/TargetParser/X86TargetParser.h"
27#define BUILTIN(ID, TYPE, ATTRS) \
28 {#ID, TYPE, ATTRS, nullptr, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
29#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \
30 {#ID, TYPE, ATTRS, FEATURE, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
31#define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \
32 {#ID, TYPE, ATTRS, FEATURE, HeaderDesc::HEADER, LANGS},
33#include "clang/Basic/BuiltinsX86.def"
35#define BUILTIN(ID, TYPE, ATTRS) \
36 {#ID, TYPE, ATTRS, nullptr, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
37#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \
38 {#ID, TYPE, ATTRS, FEATURE, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
39#define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \
40 {#ID, TYPE, ATTRS, FEATURE, HeaderDesc::HEADER, LANGS},
41#include "clang/Basic/BuiltinsX86.inc"
43#define BUILTIN(ID, TYPE, ATTRS) \
44 {#ID, TYPE, ATTRS, nullptr, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
45#define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \
46 {#ID, TYPE, ATTRS, FEATURE, HeaderDesc::NO_HEADER, ALL_LANGUAGES},
47#define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \
48 {#ID, TYPE, ATTRS, FEATURE, HeaderDesc::HEADER, LANGS},
49#include "clang/Basic/BuiltinsX86_64.def"
53 "ax",
"dx",
"cx",
"bx",
"si",
"di",
"bp",
"sp",
54 "st",
"st(1)",
"st(2)",
"st(3)",
"st(4)",
"st(5)",
"st(6)",
"st(7)",
55 "argp",
"flags",
"fpcr",
"fpsr",
"dirflag",
"frame",
"xmm0",
"xmm1",
56 "xmm2",
"xmm3",
"xmm4",
"xmm5",
"xmm6",
"xmm7",
"mm0",
"mm1",
57 "mm2",
"mm3",
"mm4",
"mm5",
"mm6",
"mm7",
"r8",
"r9",
58 "r10",
"r11",
"r12",
"r13",
"r14",
"r15",
"xmm8",
"xmm9",
59 "xmm10",
"xmm11",
"xmm12",
"xmm13",
"xmm14",
"xmm15",
"ymm0",
"ymm1",
60 "ymm2",
"ymm3",
"ymm4",
"ymm5",
"ymm6",
"ymm7",
"ymm8",
"ymm9",
61 "ymm10",
"ymm11",
"ymm12",
"ymm13",
"ymm14",
"ymm15",
"xmm16",
"xmm17",
62 "xmm18",
"xmm19",
"xmm20",
"xmm21",
"xmm22",
"xmm23",
"xmm24",
"xmm25",
63 "xmm26",
"xmm27",
"xmm28",
"xmm29",
"xmm30",
"xmm31",
"ymm16",
"ymm17",
64 "ymm18",
"ymm19",
"ymm20",
"ymm21",
"ymm22",
"ymm23",
"ymm24",
"ymm25",
65 "ymm26",
"ymm27",
"ymm28",
"ymm29",
"ymm30",
"ymm31",
"zmm0",
"zmm1",
66 "zmm2",
"zmm3",
"zmm4",
"zmm5",
"zmm6",
"zmm7",
"zmm8",
"zmm9",
67 "zmm10",
"zmm11",
"zmm12",
"zmm13",
"zmm14",
"zmm15",
"zmm16",
"zmm17",
68 "zmm18",
"zmm19",
"zmm20",
"zmm21",
"zmm22",
"zmm23",
"zmm24",
"zmm25",
69 "zmm26",
"zmm27",
"zmm28",
"zmm29",
"zmm30",
"zmm31",
"k0",
"k1",
70 "k2",
"k3",
"k4",
"k5",
"k6",
"k7",
71 "cr0",
"cr2",
"cr3",
"cr4",
"cr8",
72 "dr0",
"dr1",
"dr2",
"dr3",
"dr6",
"dr7",
73 "bnd0",
"bnd1",
"bnd2",
"bnd3",
74 "tmm0",
"tmm1",
"tmm2",
"tmm3",
"tmm4",
"tmm5",
"tmm6",
"tmm7",
75 "r16",
"r17",
"r18",
"r19",
"r20",
"r21",
"r22",
"r23",
76 "r24",
"r25",
"r26",
"r27",
"r28",
"r29",
"r30",
"r31",
80 {{
"al",
"ah",
"eax",
"rax"}, 0},
81 {{
"bl",
"bh",
"ebx",
"rbx"}, 3},
82 {{
"cl",
"ch",
"ecx",
"rcx"}, 2},
83 {{
"dl",
"dh",
"edx",
"rdx"}, 1},
88 {{
"r8d",
"r8w",
"r8b"}, 38},
89 {{
"r9d",
"r9w",
"r9b"}, 39},
90 {{
"r10d",
"r10w",
"r10b"}, 40},
91 {{
"r11d",
"r11w",
"r11b"}, 41},
92 {{
"r12d",
"r12w",
"r12b"}, 42},
93 {{
"r13d",
"r13w",
"r13b"}, 43},
94 {{
"r14d",
"r14w",
"r14b"}, 44},
95 {{
"r15d",
"r15w",
"r15b"}, 45},
96 {{
"r16d",
"r16w",
"r16b"}, 165},
97 {{
"r17d",
"r17w",
"r17b"}, 166},
98 {{
"r18d",
"r18w",
"r18b"}, 167},
99 {{
"r19d",
"r19w",
"r19b"}, 168},
100 {{
"r20d",
"r20w",
"r20b"}, 169},
101 {{
"r21d",
"r21w",
"r21b"}, 170},
102 {{
"r22d",
"r22w",
"r22b"}, 171},
103 {{
"r23d",
"r23w",
"r23b"}, 172},
104 {{
"r24d",
"r24w",
"r24b"}, 173},
105 {{
"r25d",
"r25w",
"r25b"}, 174},
106 {{
"r26d",
"r26w",
"r26b"}, 175},
107 {{
"r27d",
"r27w",
"r27b"}, 176},
108 {{
"r28d",
"r28w",
"r28b"}, 177},
109 {{
"r29d",
"r29w",
"r29b"}, 178},
110 {{
"r30d",
"r30w",
"r30b"}, 179},
111 {{
"r31d",
"r31w",
"r31b"}, 180},
116using namespace clang;
133 const std::vector<std::string> &FeaturesVec)
const {
136 if (
getTriple().getArch() == llvm::Triple::x86_64)
139 using namespace llvm::X86;
142 getFeaturesForCPU(
CPU, CPUFeatures);
143 for (
auto &F : CPUFeatures)
146 std::vector<std::string> UpdatedFeaturesVec;
147 std::vector<std::string> UpdatedAVX10FeaturesVec;
148 enum { FE_NOSET = -1, FE_FALSE, FE_TRUE };
149 int HasEVEX512 = FE_NOSET;
150 bool HasAVX512F = Features.lookup(
"avx512f");
151 bool HasAVX10 = Features.lookup(
"avx10.1-256");
152 bool HasAVX10_512 = Features.lookup(
"avx10.1-512");
153 std::string LastAVX10;
154 std::string LastAVX512;
155 for (
const auto &Feature : FeaturesVec) {
157 if (Feature ==
"+general-regs-only") {
158 UpdatedFeaturesVec.push_back(
"-x87");
159 UpdatedFeaturesVec.push_back(
"-mmx");
160 UpdatedFeaturesVec.push_back(
"-sse");
164 if (Feature.substr(1, 6) ==
"avx10.") {
165 if (Feature[0] ==
'+') {
167 if (StringRef(Feature).ends_with(
"512"))
170 }
else if (HasAVX10 && Feature ==
"-avx10.1-256") {
172 HasAVX10_512 =
false;
173 }
else if (HasAVX10_512 && Feature ==
"-avx10.1-512") {
174 HasAVX10_512 =
false;
177 UpdatedAVX10FeaturesVec.push_back(Feature);
179 }
else if (!HasAVX512F && StringRef(Feature).starts_with(
"+avx512")) {
181 LastAVX512 = Feature;
182 }
else if (HasAVX512F && Feature ==
"-avx512f") {
184 }
else if (HasEVEX512 != FE_TRUE && Feature ==
"+evex512") {
185 HasEVEX512 = FE_TRUE;
187 }
else if (HasEVEX512 != FE_FALSE && Feature ==
"-evex512") {
188 HasEVEX512 = FE_FALSE;
192 UpdatedFeaturesVec.push_back(Feature);
194 llvm::append_range(UpdatedFeaturesVec, UpdatedAVX10FeaturesVec);
197 if (!HasAVX10_512 && HasAVX512F) {
198 UpdatedFeaturesVec.push_back(HasEVEX512 == FE_FALSE ?
"-evex512"
200 if (HasAVX10 && HasEVEX512 != FE_FALSE)
201 Diags.
Report(diag::warn_invalid_feature_combination)
202 << LastAVX512 +
" " + LastAVX10 +
"; will be promoted to avx10.1-512";
203 }
else if (HasAVX10) {
204 if (!HasAVX512F && HasEVEX512 != FE_NOSET)
205 Diags.
Report(diag::warn_invalid_feature_combination)
206 << LastAVX10 + (HasEVEX512 == FE_TRUE ?
" +evex512" :
" -evex512");
207 UpdatedFeaturesVec.push_back(HasAVX10_512 ?
"+evex512" :
"-evex512");
217 auto I = Features.find(
"sse4.2");
218 if (I != Features.end() && I->getValue() &&
219 !llvm::is_contained(UpdatedFeaturesVec,
"-popcnt"))
220 Features[
"popcnt"] =
true;
224 I = Features.find(
"sse");
225 if (I != Features.end() && I->getValue() &&
226 !llvm::is_contained(UpdatedFeaturesVec,
"-mmx"))
227 Features[
"mmx"] =
true;
230 I = Features.find(
"avx");
231 if (I != Features.end() && I->getValue() &&
232 !llvm::is_contained(UpdatedFeaturesVec,
"-xsave"))
233 Features[
"xsave"] =
true;
236 I = Features.find(
"sse4.2");
237 if (I != Features.end() && I->getValue() &&
238 !llvm::is_contained(UpdatedFeaturesVec,
"-crc32"))
239 Features[
"crc32"] =
true;
245 StringRef Name,
bool Enabled)
const {
246 if (Name ==
"sse4") {
257 Features[Name] = Enabled;
258 llvm::X86::updateImpliedFeatures(Name, Enabled, Features);
265 for (
const auto &Feature : Features) {
266 if (Feature[0] !=
'+')
269 if (Feature ==
"+mmx") {
271 }
else if (Feature ==
"+aes") {
273 }
else if (Feature ==
"+vaes") {
275 }
else if (Feature ==
"+pclmul") {
277 }
else if (Feature ==
"+vpclmulqdq") {
278 HasVPCLMULQDQ =
true;
279 }
else if (Feature ==
"+lzcnt") {
281 }
else if (Feature ==
"+rdrnd") {
283 }
else if (Feature ==
"+fsgsbase") {
285 }
else if (Feature ==
"+bmi") {
287 }
else if (Feature ==
"+bmi2") {
289 }
else if (Feature ==
"+popcnt") {
291 }
else if (Feature ==
"+rtm") {
293 }
else if (Feature ==
"+prfchw") {
295 }
else if (Feature ==
"+rdseed") {
297 }
else if (Feature ==
"+adx") {
299 }
else if (Feature ==
"+tbm") {
301 }
else if (Feature ==
"+lwp") {
303 }
else if (Feature ==
"+fma") {
305 }
else if (Feature ==
"+f16c") {
307 }
else if (Feature ==
"+gfni") {
309 }
else if (Feature ==
"+evex512") {
311 }
else if (Feature ==
"+avx10.1-256") {
313 }
else if (Feature ==
"+avx10.1-512") {
314 HasAVX10_1_512 =
true;
315 }
else if (Feature ==
"+avx10.2-256") {
318 }
else if (Feature ==
"+avx10.2-512") {
319 HasAVX10_2_512 =
true;
320 }
else if (Feature ==
"+avx512cd") {
322 }
else if (Feature ==
"+avx512vpopcntdq") {
323 HasAVX512VPOPCNTDQ =
true;
324 }
else if (Feature ==
"+avx512vnni") {
325 HasAVX512VNNI =
true;
326 }
else if (Feature ==
"+avx512bf16") {
327 HasAVX512BF16 =
true;
328 }
else if (Feature ==
"+avx512fp16") {
329 HasAVX512FP16 =
true;
331 }
else if (Feature ==
"+avx512dq") {
333 }
else if (Feature ==
"+avx512bitalg") {
334 HasAVX512BITALG =
true;
335 }
else if (Feature ==
"+avx512bw") {
337 }
else if (Feature ==
"+avx512vl") {
339 }
else if (Feature ==
"+avx512vbmi") {
340 HasAVX512VBMI =
true;
341 }
else if (Feature ==
"+avx512vbmi2") {
342 HasAVX512VBMI2 =
true;
343 }
else if (Feature ==
"+avx512ifma") {
344 HasAVX512IFMA =
true;
345 }
else if (Feature ==
"+avx512vp2intersect") {
346 HasAVX512VP2INTERSECT =
true;
347 }
else if (Feature ==
"+sha") {
349 }
else if (Feature ==
"+sha512") {
351 }
else if (Feature ==
"+shstk") {
353 }
else if (Feature ==
"+sm3") {
355 }
else if (Feature ==
"+sm4") {
357 }
else if (Feature ==
"+movbe") {
359 }
else if (Feature ==
"+movrs") {
361 }
else if (Feature ==
"+sgx") {
363 }
else if (Feature ==
"+cx8") {
365 }
else if (Feature ==
"+cx16") {
367 }
else if (Feature ==
"+fxsr") {
369 }
else if (Feature ==
"+xsave") {
371 }
else if (Feature ==
"+xsaveopt") {
373 }
else if (Feature ==
"+xsavec") {
375 }
else if (Feature ==
"+xsaves") {
377 }
else if (Feature ==
"+mwaitx") {
379 }
else if (Feature ==
"+pku") {
381 }
else if (Feature ==
"+clflushopt") {
382 HasCLFLUSHOPT =
true;
383 }
else if (Feature ==
"+clwb") {
385 }
else if (Feature ==
"+wbnoinvd") {
387 }
else if (Feature ==
"+prefetchi") {
389 }
else if (Feature ==
"+clzero") {
391 }
else if (Feature ==
"+cldemote") {
393 }
else if (Feature ==
"+rdpid") {
395 }
else if (Feature ==
"+rdpru") {
397 }
else if (Feature ==
"+kl") {
399 }
else if (Feature ==
"+widekl") {
401 }
else if (Feature ==
"+retpoline-external-thunk") {
402 HasRetpolineExternalThunk =
true;
403 }
else if (Feature ==
"+sahf") {
405 }
else if (Feature ==
"+waitpkg") {
407 }
else if (Feature ==
"+movdiri") {
409 }
else if (Feature ==
"+movdir64b") {
411 }
else if (Feature ==
"+pconfig") {
413 }
else if (Feature ==
"+ptwrite") {
415 }
else if (Feature ==
"+invpcid") {
417 }
else if (Feature ==
"+enqcmd") {
419 }
else if (Feature ==
"+hreset") {
421 }
else if (Feature ==
"+amx-bf16") {
423 }
else if (Feature ==
"+amx-fp16") {
425 }
else if (Feature ==
"+amx-int8") {
427 }
else if (Feature ==
"+amx-tile") {
429 }
else if (Feature ==
"+amx-complex") {
430 HasAMXCOMPLEX =
true;
431 }
else if (Feature ==
"+amx-fp8") {
433 }
else if (Feature ==
"+amx-movrs") {
435 }
else if (Feature ==
"+amx-transpose") {
436 HasAMXTRANSPOSE =
true;
437 }
else if (Feature ==
"+amx-avx512") {
439 }
else if (Feature ==
"+amx-tf32") {
441 }
else if (Feature ==
"+cmpccxadd") {
443 }
else if (Feature ==
"+raoint") {
445 }
else if (Feature ==
"+avxifma") {
447 }
else if (Feature ==
"+avxneconvert") {
448 HasAVXNECONVERT=
true;
449 }
else if (Feature ==
"+avxvnni") {
451 }
else if (Feature ==
"+avxvnniint16") {
452 HasAVXVNNIINT16 =
true;
453 }
else if (Feature ==
"+avxvnniint8") {
454 HasAVXVNNIINT8 =
true;
455 }
else if (Feature ==
"+serialize") {
457 }
else if (Feature ==
"+tsxldtrk") {
459 }
else if (Feature ==
"+uintr") {
461 }
else if (Feature ==
"+usermsr") {
463 }
else if (Feature ==
"+crc32") {
465 }
else if (Feature ==
"+x87") {
467 }
else if (Feature ==
"+fullbf16") {
469 }
else if (Feature ==
"+egpr") {
471 }
else if (Feature ==
"+inline-asm-use-gpr32") {
472 HasInlineAsmUseGPR32 =
true;
473 }
else if (Feature ==
"+push2pop2") {
475 }
else if (Feature ==
"+ppx") {
477 }
else if (Feature ==
"+ndd") {
479 }
else if (Feature ==
"+ccmp") {
481 }
else if (Feature ==
"+nf") {
483 }
else if (Feature ==
"+cf") {
485 }
else if (Feature ==
"+zu") {
487 }
else if (Feature ==
"+branch-hint") {
488 HasBranchHint =
true;
491 X86SSEEnum Level = llvm::StringSwitch<X86SSEEnum>(Feature)
492 .Case(
"+avx512f", AVX512F)
495 .Case(
"+sse4.2", SSE42)
496 .Case(
"+sse4.1", SSE41)
497 .Case(
"+ssse3", SSSE3)
502 SSELevel = std::max(SSELevel, Level);
517 XOPEnum XLevel = llvm::StringSwitch<XOPEnum>(Feature)
520 .Case(
"+sse4a", SSE4A)
522 XOPLevel = std::max(XOPLevel, XLevel);
529 Diags.
Report(diag::err_target_unsupported_fpmath)
547 Builder.defineMacro(
"__GCC_ASM_FLAG_OUTPUTS__");
550 if (CodeModel ==
"default")
552 Builder.defineMacro(
"__code_model_" + CodeModel +
"__");
555 if (
getTriple().getArch() == llvm::Triple::x86_64) {
556 Builder.defineMacro(
"__amd64__");
557 Builder.defineMacro(
"__amd64");
558 Builder.defineMacro(
"__x86_64");
559 Builder.defineMacro(
"__x86_64__");
560 if (
getTriple().getArchName() ==
"x86_64h") {
561 Builder.defineMacro(
"__x86_64h");
562 Builder.defineMacro(
"__x86_64h__");
568 Builder.defineMacro(
"__SEG_GS");
569 Builder.defineMacro(
"__SEG_FS");
570 Builder.defineMacro(
"__seg_gs",
"__attribute__((address_space(256)))");
571 Builder.defineMacro(
"__seg_fs",
"__attribute__((address_space(257)))");
576 using namespace llvm::X86;
582 Builder.defineMacro(
"__tune_i386__");
591 Builder.defineMacro(
"__pentium_mmx__");
592 Builder.defineMacro(
"__tune_pentium_mmx__");
601 Builder.defineMacro(
"__tune_pentium3__");
605 Builder.defineMacro(
"__tune_pentium2__");
633 case CK_GoldmontPlus:
647 case CK_SkylakeClient:
648 case CK_SkylakeServer:
652 case CK_IcelakeClient:
654 case CK_IcelakeServer:
656 case CK_SapphireRapids:
664 case CK_Sierraforest:
666 case CK_Graniterapids:
667 case CK_GraniterapidsD:
668 case CK_Emeraldrapids:
669 case CK_Clearwaterforest:
670 case CK_Diamondrapids:
684 Builder.defineMacro(
"__tune_lakemont__");
687 Builder.defineMacro(
"__k6_2__");
688 Builder.defineMacro(
"__tune_k6_2__");
691 if (
CPU != CK_K6_2) {
695 Builder.defineMacro(
"__k6_3__");
696 Builder.defineMacro(
"__tune_k6_3__");
705 if (SSELevel != NoSSE) {
706 Builder.defineMacro(
"__athlon_sse__");
707 Builder.defineMacro(
"__tune_athlon_sse__");
761 Builder.defineMacro(
"__REGISTER_PREFIX__",
"");
766 Builder.defineMacro(
"__NO_MATH_INLINES");
769 Builder.defineMacro(
"__AES__");
772 Builder.defineMacro(
"__VAES__");
775 Builder.defineMacro(
"__PCLMUL__");
778 Builder.defineMacro(
"__VPCLMULQDQ__");
782 if (HasLAHFSAHF ||
getTriple().getArch() == llvm::Triple::x86)
783 Builder.defineMacro(
"__LAHF_SAHF__");
786 Builder.defineMacro(
"__LZCNT__");
789 Builder.defineMacro(
"__RDRND__");
792 Builder.defineMacro(
"__FSGSBASE__");
795 Builder.defineMacro(
"__BMI__");
798 Builder.defineMacro(
"__BMI2__");
801 Builder.defineMacro(
"__POPCNT__");
804 Builder.defineMacro(
"__RTM__");
807 Builder.defineMacro(
"__PRFCHW__");
810 Builder.defineMacro(
"__RDSEED__");
813 Builder.defineMacro(
"__ADX__");
816 Builder.defineMacro(
"__TBM__");
819 Builder.defineMacro(
"__LWP__");
822 Builder.defineMacro(
"__MWAITX__");
825 Builder.defineMacro(
"__MOVBE__");
829 Builder.defineMacro(
"__XOP__");
832 Builder.defineMacro(
"__FMA4__");
835 Builder.defineMacro(
"__SSE4A__");
842 Builder.defineMacro(
"__FMA__");
845 Builder.defineMacro(
"__F16C__");
848 Builder.defineMacro(
"__GFNI__");
851 Builder.defineMacro(
"__EVEX512__");
853 Builder.defineMacro(
"__AVX10_1__");
855 Builder.defineMacro(
"__AVX10_1_512__");
857 Builder.defineMacro(
"__AVX10_2__");
859 Builder.defineMacro(
"__AVX10_2_512__");
861 Builder.defineMacro(
"__AVX512CD__");
862 if (HasAVX512VPOPCNTDQ)
863 Builder.defineMacro(
"__AVX512VPOPCNTDQ__");
865 Builder.defineMacro(
"__AVX512VNNI__");
867 Builder.defineMacro(
"__AVX512BF16__");
869 Builder.defineMacro(
"__AVX512FP16__");
871 Builder.defineMacro(
"__AVX512DQ__");
873 Builder.defineMacro(
"__AVX512BITALG__");
875 Builder.defineMacro(
"__AVX512BW__");
877 Builder.defineMacro(
"__AVX512VL__");
878 Builder.defineMacro(
"__EVEX256__");
881 Builder.defineMacro(
"__AVX512VBMI__");
883 Builder.defineMacro(
"__AVX512VBMI2__");
885 Builder.defineMacro(
"__AVX512IFMA__");
886 if (HasAVX512VP2INTERSECT)
887 Builder.defineMacro(
"__AVX512VP2INTERSECT__");
889 Builder.defineMacro(
"__SHA__");
891 Builder.defineMacro(
"__SHA512__");
894 Builder.defineMacro(
"__FXSR__");
896 Builder.defineMacro(
"__XSAVE__");
898 Builder.defineMacro(
"__XSAVEOPT__");
900 Builder.defineMacro(
"__XSAVEC__");
902 Builder.defineMacro(
"__XSAVES__");
904 Builder.defineMacro(
"__PKU__");
906 Builder.defineMacro(
"__CLFLUSHOPT__");
908 Builder.defineMacro(
"__CLWB__");
910 Builder.defineMacro(
"__WBNOINVD__");
912 Builder.defineMacro(
"__SHSTK__");
914 Builder.defineMacro(
"__SGX__");
916 Builder.defineMacro(
"__SM3__");
918 Builder.defineMacro(
"__SM4__");
920 Builder.defineMacro(
"__PREFETCHI__");
922 Builder.defineMacro(
"__CLZERO__");
924 Builder.defineMacro(
"__KL__");
926 Builder.defineMacro(
"__WIDEKL__");
928 Builder.defineMacro(
"__RDPID__");
930 Builder.defineMacro(
"__RDPRU__");
932 Builder.defineMacro(
"__CLDEMOTE__");
934 Builder.defineMacro(
"__WAITPKG__");
936 Builder.defineMacro(
"__MOVDIRI__");
938 Builder.defineMacro(
"__MOVDIR64B__");
940 Builder.defineMacro(
"__MOVRS__");
942 Builder.defineMacro(
"__PCONFIG__");
944 Builder.defineMacro(
"__PTWRITE__");
946 Builder.defineMacro(
"__INVPCID__");
948 Builder.defineMacro(
"__ENQCMD__");
950 Builder.defineMacro(
"__HRESET__");
952 Builder.defineMacro(
"__AMX_TILE__");
954 Builder.defineMacro(
"__AMX_INT8__");
956 Builder.defineMacro(
"__AMX_BF16__");
958 Builder.defineMacro(
"__AMX_FP16__");
960 Builder.defineMacro(
"__AMX_COMPLEX__");
962 Builder.defineMacro(
"__AMX_FP8__");
964 Builder.defineMacro(
"__AMX_MOVRS__");
966 Builder.defineMacro(
"__AMX_TRANSPOSE__");
968 Builder.defineMacro(
"__AMX_AVX512__");
970 Builder.defineMacro(
"__AMX_TF32__");
972 Builder.defineMacro(
"__CMPCCXADD__");
974 Builder.defineMacro(
"__RAOINT__");
976 Builder.defineMacro(
"__AVXIFMA__");
978 Builder.defineMacro(
"__AVXNECONVERT__");
980 Builder.defineMacro(
"__AVXVNNI__");
982 Builder.defineMacro(
"__AVXVNNIINT16__");
984 Builder.defineMacro(
"__AVXVNNIINT8__");
986 Builder.defineMacro(
"__SERIALIZE__");
988 Builder.defineMacro(
"__TSXLDTRK__");
990 Builder.defineMacro(
"__UINTR__");
992 Builder.defineMacro(
"__USERMSR__");
994 Builder.defineMacro(
"__CRC32__");
996 Builder.defineMacro(
"__EGPR__");
998 Builder.defineMacro(
"__PUSH2POP2__");
1000 Builder.defineMacro(
"__PPX__");
1002 Builder.defineMacro(
"__NDD__");
1004 Builder.defineMacro(
"__CCMP__");
1006 Builder.defineMacro(
"__NF__");
1008 Builder.defineMacro(
"__CF__");
1010 Builder.defineMacro(
"__ZU__");
1011 if (HasEGPR && HasPush2Pop2 && HasPPX && HasNDD && HasCCMP && HasNF &&
1013 Builder.defineMacro(
"__APX_F__");
1014 if (HasEGPR && HasInlineAsmUseGPR32)
1015 Builder.defineMacro(
"__APX_INLINE_ASM_USE_GPR32__");
1020 Builder.defineMacro(
"__AVX512F__");
1023 Builder.defineMacro(
"__AVX2__");
1026 Builder.defineMacro(
"__AVX__");
1029 Builder.defineMacro(
"__SSE4_2__");
1032 Builder.defineMacro(
"__SSE4_1__");
1035 Builder.defineMacro(
"__SSSE3__");
1038 Builder.defineMacro(
"__SSE3__");
1041 Builder.defineMacro(
"__SSE2__");
1042 Builder.defineMacro(
"__SSE2_MATH__");
1045 Builder.defineMacro(
"__SSE__");
1046 Builder.defineMacro(
"__SSE_MATH__");
1052 if (Opts.MicrosoftExt &&
getTriple().getArch() == llvm::Triple::x86) {
1062 Builder.defineMacro(
"_M_IX86_FP", Twine(2));
1065 Builder.defineMacro(
"_M_IX86_FP", Twine(1));
1068 Builder.defineMacro(
"_M_IX86_FP", Twine(0));
1075 Builder.defineMacro(
"__MMX__");
1078 if (
CPU >= CK_i486 ||
CPU == CK_None) {
1079 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
1080 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
1081 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
1084 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
1085 if (HasCX16 &&
getTriple().getArch() == llvm::Triple::x86_64)
1086 Builder.defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
1089 Builder.defineMacro(
"__SIZEOF_FLOAT128__",
"16");
1093 return llvm::StringSwitch<bool>(Name)
1096 .Case(
"amx-avx512",
true)
1097 .Case(
"amx-bf16",
true)
1098 .Case(
"amx-complex",
true)
1099 .Case(
"amx-fp16",
true)
1100 .Case(
"amx-fp8",
true)
1101 .Case(
"amx-int8",
true)
1102 .Case(
"amx-movrs",
true)
1103 .Case(
"amx-tf32",
true)
1104 .Case(
"amx-tile",
true)
1105 .Case(
"amx-transpose",
true)
1107 .Case(
"avx10.1-256",
true)
1108 .Case(
"avx10.1-512",
true)
1109 .Case(
"avx10.2-256",
true)
1110 .Case(
"avx10.2-512",
true)
1112 .Case(
"avx512f",
true)
1113 .Case(
"avx512cd",
true)
1114 .Case(
"avx512vpopcntdq",
true)
1115 .Case(
"avx512vnni",
true)
1116 .Case(
"avx512bf16",
true)
1117 .Case(
"avx512fp16",
true)
1118 .Case(
"avx512dq",
true)
1119 .Case(
"avx512bitalg",
true)
1120 .Case(
"avx512bw",
true)
1121 .Case(
"avx512vl",
true)
1122 .Case(
"avx512vbmi",
true)
1123 .Case(
"avx512vbmi2",
true)
1124 .Case(
"avx512ifma",
true)
1125 .Case(
"avx512vp2intersect",
true)
1126 .Case(
"avxifma",
true)
1127 .Case(
"avxneconvert",
true)
1128 .Case(
"avxvnni",
true)
1129 .Case(
"avxvnniint16",
true)
1130 .Case(
"avxvnniint8",
true)
1133 .Case(
"cldemote",
true)
1134 .Case(
"clflushopt",
true)
1136 .Case(
"clzero",
true)
1137 .Case(
"cmpccxadd",
true)
1138 .Case(
"crc32",
true)
1140 .Case(
"enqcmd",
true)
1141 .Case(
"evex512",
true)
1145 .Case(
"fsgsbase",
true)
1147 .Case(
"general-regs-only",
true)
1149 .Case(
"hreset",
true)
1150 .Case(
"invpcid",
true)
1152 .Case(
"widekl",
true)
1154 .Case(
"lzcnt",
true)
1156 .Case(
"movbe",
true)
1157 .Case(
"movrs",
true)
1158 .Case(
"movdiri",
true)
1159 .Case(
"movdir64b",
true)
1160 .Case(
"mwaitx",
true)
1161 .Case(
"pclmul",
true)
1162 .Case(
"pconfig",
true)
1164 .Case(
"popcnt",
true)
1165 .Case(
"prefer-256-bit",
true)
1166 .Case(
"prefetchi",
true)
1167 .Case(
"prfchw",
true)
1168 .Case(
"ptwrite",
true)
1169 .Case(
"raoint",
true)
1170 .Case(
"rdpid",
true)
1171 .Case(
"rdpru",
true)
1172 .Case(
"rdrnd",
true)
1173 .Case(
"rdseed",
true)
1176 .Case(
"serialize",
true)
1179 .Case(
"sha512",
true)
1180 .Case(
"shstk",
true)
1186 .Case(
"ssse3",
true)
1188 .Case(
"sse4.1",
true)
1189 .Case(
"sse4.2",
true)
1190 .Case(
"sse4a",
true)
1192 .Case(
"tsxldtrk",
true)
1193 .Case(
"uintr",
true)
1194 .Case(
"usermsr",
true)
1196 .Case(
"vpclmulqdq",
true)
1197 .Case(
"wbnoinvd",
true)
1198 .Case(
"waitpkg",
true)
1201 .Case(
"xsave",
true)
1202 .Case(
"xsavec",
true)
1203 .Case(
"xsaves",
true)
1204 .Case(
"xsaveopt",
true)
1206 .Case(
"push2pop2",
true)
1217 return llvm::StringSwitch<bool>(Feature)
1218 .Case(
"adx", HasADX)
1219 .Case(
"aes", HasAES)
1220 .Case(
"amx-avx512", HasAMXAVX512)
1221 .Case(
"amx-bf16", HasAMXBF16)
1222 .Case(
"amx-complex", HasAMXCOMPLEX)
1223 .Case(
"amx-fp16", HasAMXFP16)
1224 .Case(
"amx-fp8", HasAMXFP8)
1225 .Case(
"amx-int8", HasAMXINT8)
1226 .Case(
"amx-movrs", HasAMXMOVRS)
1227 .Case(
"amx-tf32", HasAMXTF32)
1228 .Case(
"amx-tile", HasAMXTILE)
1229 .Case(
"amx-transpose", HasAMXTRANSPOSE)
1230 .Case(
"avx", SSELevel >= AVX)
1231 .Case(
"avx10.1-256", HasAVX10_1)
1232 .Case(
"avx10.1-512", HasAVX10_1_512)
1233 .Case(
"avx10.2-256", HasAVX10_2)
1234 .Case(
"avx10.2-512", HasAVX10_2_512)
1235 .Case(
"avx2", SSELevel >= AVX2)
1236 .Case(
"avx512f", SSELevel >= AVX512F)
1237 .Case(
"avx512cd", HasAVX512CD)
1238 .Case(
"avx512vpopcntdq", HasAVX512VPOPCNTDQ)
1239 .Case(
"avx512vnni", HasAVX512VNNI)
1240 .Case(
"avx512bf16", HasAVX512BF16)
1241 .Case(
"avx512fp16", HasAVX512FP16)
1242 .Case(
"avx512dq", HasAVX512DQ)
1243 .Case(
"avx512bitalg", HasAVX512BITALG)
1244 .Case(
"avx512bw", HasAVX512BW)
1245 .Case(
"avx512vl", HasAVX512VL)
1246 .Case(
"avx512vbmi", HasAVX512VBMI)
1247 .Case(
"avx512vbmi2", HasAVX512VBMI2)
1248 .Case(
"avx512ifma", HasAVX512IFMA)
1249 .Case(
"avx512vp2intersect", HasAVX512VP2INTERSECT)
1250 .Case(
"avxifma", HasAVXIFMA)
1251 .Case(
"avxneconvert", HasAVXNECONVERT)
1252 .Case(
"avxvnni", HasAVXVNNI)
1253 .Case(
"avxvnniint16", HasAVXVNNIINT16)
1254 .Case(
"avxvnniint8", HasAVXVNNIINT8)
1255 .Case(
"bmi", HasBMI)
1256 .Case(
"bmi2", HasBMI2)
1257 .Case(
"cldemote", HasCLDEMOTE)
1258 .Case(
"clflushopt", HasCLFLUSHOPT)
1259 .Case(
"clwb", HasCLWB)
1260 .Case(
"clzero", HasCLZERO)
1261 .Case(
"cmpccxadd", HasCMPCCXADD)
1262 .Case(
"crc32", HasCRC32)
1263 .Case(
"cx8", HasCX8)
1264 .Case(
"cx16", HasCX16)
1265 .Case(
"enqcmd", HasENQCMD)
1266 .Case(
"evex512", HasEVEX512)
1267 .Case(
"f16c", HasF16C)
1268 .Case(
"fma", HasFMA)
1269 .Case(
"fma4", XOPLevel >= FMA4)
1270 .Case(
"fsgsbase", HasFSGSBASE)
1271 .Case(
"fxsr", HasFXSR)
1272 .Case(
"gfni", HasGFNI)
1273 .Case(
"hreset", HasHRESET)
1274 .Case(
"invpcid", HasINVPCID)
1276 .Case(
"widekl", HasWIDEKL)
1277 .Case(
"lwp", HasLWP)
1278 .Case(
"lzcnt", HasLZCNT)
1279 .Case(
"mmx", HasMMX)
1280 .Case(
"movbe", HasMOVBE)
1281 .Case(
"movrs", HasMOVRS)
1282 .Case(
"movdiri", HasMOVDIRI)
1283 .Case(
"movdir64b", HasMOVDIR64B)
1284 .Case(
"mwaitx", HasMWAITX)
1285 .Case(
"pclmul", HasPCLMUL)
1286 .Case(
"pconfig", HasPCONFIG)
1287 .Case(
"pku", HasPKU)
1288 .Case(
"popcnt", HasPOPCNT)
1289 .Case(
"prefetchi", HasPREFETCHI)
1290 .Case(
"prfchw", HasPRFCHW)
1291 .Case(
"ptwrite", HasPTWRITE)
1292 .Case(
"raoint", HasRAOINT)
1293 .Case(
"rdpid", HasRDPID)
1294 .Case(
"rdpru", HasRDPRU)
1295 .Case(
"rdrnd", HasRDRND)
1296 .Case(
"rdseed", HasRDSEED)
1297 .Case(
"retpoline-external-thunk", HasRetpolineExternalThunk)
1298 .Case(
"rtm", HasRTM)
1299 .Case(
"sahf", HasLAHFSAHF)
1300 .Case(
"serialize", HasSERIALIZE)
1301 .Case(
"sgx", HasSGX)
1302 .Case(
"sha", HasSHA)
1303 .Case(
"sha512", HasSHA512)
1304 .Case(
"shstk", HasSHSTK)
1305 .Case(
"sm3", HasSM3)
1306 .Case(
"sm4", HasSM4)
1307 .Case(
"sse", SSELevel >= SSE1)
1308 .Case(
"sse2", SSELevel >= SSE2)
1309 .Case(
"sse3", SSELevel >= SSE3)
1310 .Case(
"ssse3", SSELevel >= SSSE3)
1311 .Case(
"sse4.1", SSELevel >= SSE41)
1312 .Case(
"sse4.2", SSELevel >= SSE42)
1313 .Case(
"sse4a", XOPLevel >= SSE4A)
1314 .Case(
"tbm", HasTBM)
1315 .Case(
"tsxldtrk", HasTSXLDTRK)
1316 .Case(
"uintr", HasUINTR)
1317 .Case(
"usermsr", HasUSERMSR)
1318 .Case(
"vaes", HasVAES)
1319 .Case(
"vpclmulqdq", HasVPCLMULQDQ)
1320 .Case(
"wbnoinvd", HasWBNOINVD)
1321 .Case(
"waitpkg", HasWAITPKG)
1323 .Case(
"x86_32",
getTriple().getArch() == llvm::Triple::x86)
1324 .Case(
"x86_64",
getTriple().getArch() == llvm::Triple::x86_64)
1325 .Case(
"x87", HasX87)
1326 .Case(
"xop", XOPLevel >= XOP)
1327 .Case(
"xsave", HasXSAVE)
1328 .Case(
"xsavec", HasXSAVEC)
1329 .Case(
"xsaves", HasXSAVES)
1330 .Case(
"xsaveopt", HasXSAVEOPT)
1332 .Case(
"egpr", HasEGPR)
1333 .Case(
"push2pop2", HasPush2Pop2)
1334 .Case(
"ppx", HasPPX)
1335 .Case(
"ndd", HasNDD)
1336 .Case(
"ccmp", HasCCMP)
1340 .Case(
"branch-hint", HasBranchHint)
1350 return llvm::StringSwitch<bool>(FeatureStr)
1351#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY) .Case(STR, true)
1352#define X86_MICROARCH_LEVEL(ENUM, STR, PRIORITY) .Case(STR, true)
1353#include "llvm/TargetParser/X86TargetParser.def"
1358 return llvm::StringSwitch<llvm::X86::ProcessorFeatures>(Name)
1359#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY) \
1360 .Case(STR, llvm::X86::FEATURE_##ENUM)
1362#include "llvm/TargetParser/X86TargetParser.def"
1369 auto getPriority = [](StringRef Feature) ->
unsigned {
1372 using namespace llvm::X86;
1373 CPUKind Kind = parseArchX86(Feature);
1374 if (Kind != CK_None) {
1375 ProcessorFeatures KeyFeature = getKeyFeature(Kind);
1376 return (getFeaturePriority(KeyFeature) << 1) + 1;
1380 return getFeaturePriority(
getFeature(Feature)) << 1;
1384 for (StringRef Feature : Features)
1385 if (!Feature.empty())
1391 return llvm::X86::validateCPUSpecificCPUDispatch(Name);
1395 return llvm::X86::getCPUDispatchMangling(Name);
1401 llvm::X86::getFeaturesForCPU(Name, TargetCPUFeatures,
true);
1402 for (
auto &F : TargetCPUFeatures)
1403 Features.push_back(F);
1411 return llvm::StringSwitch<bool>(FeatureStr)
1412#define X86_VENDOR(ENUM, STRING) .Case(STRING, true)
1413#define X86_CPU_TYPE_ALIAS(ENUM, ALIAS) .Case(ALIAS, true)
1414#define X86_CPU_TYPE(ENUM, STR) .Case(STR, true)
1415#define X86_CPU_SUBTYPE_ALIAS(ENUM, ALIAS) .Case(ALIAS, true)
1416#define X86_CPU_SUBTYPE(ENUM, STR) .Case(STR, true)
1417#include "llvm/TargetParser/X86TargetParser.def"
1422 auto RV = llvm::StringSwitch<unsigned>(Name)
1590 using namespace llvm::X86;
1630 case CK_GoldmontPlus:
1635 case CK_SandyBridge:
1639 case CK_SkylakeClient:
1640 case CK_SkylakeServer:
1641 case CK_Cascadelake:
1646 case CK_SapphireRapids:
1647 case CK_IcelakeClient:
1649 case CK_IcelakeServer:
1656 case CK_Pantherlake:
1657 case CK_Sierraforest:
1659 case CK_Graniterapids:
1660 case CK_GraniterapidsD:
1661 case CK_Emeraldrapids:
1662 case CK_Clearwaterforest:
1663 case CK_Diamondrapids:
1700 return std::nullopt;
1702 llvm_unreachable(
"Unknown CPU kind");
1706 StringRef Constraint,
1707 unsigned Size)
const {
1709 Constraint = Constraint.ltrim(
"=+&");
1715 StringRef Constraint,
1716 unsigned Size)
const {
1721 StringRef Constraint,
1722 unsigned Size)
const {
1723 switch (Constraint[0]) {
1736 switch (Constraint[1]) {
1748 return Size <= 512U;
1751 return Size <= 256U;
1753 return Size <= 128U;
1759 if (SSELevel < SSE2)
1770 return Size <= 512U;
1773 return Size <= 256U;
1774 return Size <= 128U;
1782 switch (*Constraint) {
1785 std::string Converted =
"{" + std::string(Constraint, Len) +
"}";
1786 Constraint += Len - 1;
1789 return std::string(1, *Constraint);
1791 return std::string(
"{ax}");
1793 return std::string(
"{bx}");
1795 return std::string(
"{cx}");
1797 return std::string(
"{dx}");
1799 return std::string(
"{si}");
1801 return std::string(
"{di}");
1803 return std::string(
"p");
1805 return std::string(
"{st}");
1807 return std::string(
"{st(1)}");
1809 assert(Constraint[1] ==
's');
1810 return '^' + std::string(Constraint++, 2);
1812 switch (Constraint[1]) {
1827 return std::string(
"^") + std::string(Constraint++, 2);
1831 switch (Constraint[1]) {
1842 return std::string(
"^") + std::string(Constraint++, 2);
1846 return std::string(1, *Constraint);
1851 bool Only64Bit =
getTriple().getArch() != llvm::Triple::x86;
1852 llvm::X86::fillValidCPUArchList(Values, Only64Bit);
1856 llvm::X86::fillValidTuneCPUList(Values);
Defines the Diagnostic-related interfaces.
static unsigned matchAsmCCConstraint(const char *Name)
static llvm::X86::ProcessorFeatures getFeature(StringRef Name)
Defines enum values for all the target-independent builtin functions.
Enumerates target-specific builtins in their own namespaces within namespace clang.
Concrete class used by the front-end to report problems and issues.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TargetOptions & getTargetOpts() const
Retrieve the target options.
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
virtual bool hasFeatureEnabled(const llvm::StringMap< bool > &Features, StringRef Name) const
Check if target has a given feature enabled.
virtual bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeatureVec) const
Initialize the map with the default set of target features for the CPU this should include all legal ...
enum clang::targets::X86TargetInfo::FPMathKind FPMath
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
handleTargetFeatures - Perform initialization based on the user configured set of features.
std::optional< unsigned > getCPUCacheLineSize() const override
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
bool setFPMath(StringRef Name) override
Use the specified unit for FP math.
ArrayRef< const char * > getGCCRegNames() const override
char CPUSpecificManglingCharacter(StringRef Name) const override
std::string convertConstraint(const char *&Constraint) const override
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
bool initFeatureMap(llvm::StringMap< bool > &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector< std::string > &FeaturesVec) const override
Initialize the map with the default set of target features for the CPU this should include all legal ...
void getCPUSpecificCPUDispatchFeatures(StringRef Name, llvm::SmallVectorImpl< StringRef > &Features) const override
bool validateCpuIs(StringRef FeatureStr) const override
bool validateOutputSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const override
virtual bool validateOperandSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const
void fillValidTuneCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values for tuning CPU.
bool validateCPUSpecificCPUDispatch(StringRef Name) const override
bool validateCpuSupports(StringRef FeatureStr) const override
bool isValidFeatureName(StringRef Name) const override
Determine whether this TargetInfo supports the given feature.
bool hasFeature(StringRef Feature) const final
Determine whether the given target has the given feature.
void setFeatureEnabled(llvm::StringMap< bool > &Features, StringRef Name, bool Enabled) const final
Enable or disable a specific target feature; the feature name must be valid.
void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
ArrayRef< TargetInfo::AddlRegName > getGCCAddlRegNames() const override
bool validateInputSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const override
unsigned getFMVPriority(ArrayRef< StringRef > Features) const override
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
LLVM_LIBRARY_VISIBILITY void defineCPUMacros(clang::MacroBuilder &Builder, llvm::StringRef CPUName, bool Tuning=true)
static constexpr Builtin::Info BuiltinInfoX86[]
const TargetInfo::AddlRegName AddlRegNames[]
static const char *const GCCRegNames[]
LLVM_LIBRARY_VISIBILITY void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName, const clang::LangOptions &Opts)
Define a macro name and standard variants.
The JSON file list parser is used to communicate input to InstallAPI.
std::string ConstraintStr
void setRequiresImmediate(int Min, int Max)
const llvm::fltSemantics * LongDoubleFormat