17 #include "llvm/ADT/StringExtras.h" 18 #include "llvm/ADT/StringRef.h" 19 #include "llvm/ADT/StringSwitch.h" 20 #include "llvm/Support/TargetParser.h" 26 #define BUILTIN(ID, TYPE, ATTRS) \ 27 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr}, 28 #define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \ 29 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, FEATURE}, 30 #define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \ 31 {#ID, TYPE, ATTRS, HEADER, LANGS, FEATURE}, 32 #include "clang/Basic/BuiltinsX86.def" 34 #define BUILTIN(ID, TYPE, ATTRS) \ 35 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr}, 36 #define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) \ 37 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, FEATURE}, 38 #define TARGET_HEADER_BUILTIN(ID, TYPE, ATTRS, HEADER, LANGS, FEATURE) \ 39 {#ID, TYPE, ATTRS, HEADER, LANGS, FEATURE}, 40 #include "clang/Basic/BuiltinsX86_64.def" 44 "ax",
"dx",
"cx",
"bx",
"si",
"di",
"bp",
"sp",
45 "st",
"st(1)",
"st(2)",
"st(3)",
"st(4)",
"st(5)",
"st(6)",
"st(7)",
46 "argp",
"flags",
"fpcr",
"fpsr",
"dirflag",
"frame",
"xmm0",
"xmm1",
47 "xmm2",
"xmm3",
"xmm4",
"xmm5",
"xmm6",
"xmm7",
"mm0",
"mm1",
48 "mm2",
"mm3",
"mm4",
"mm5",
"mm6",
"mm7",
"r8",
"r9",
49 "r10",
"r11",
"r12",
"r13",
"r14",
"r15",
"xmm8",
"xmm9",
50 "xmm10",
"xmm11",
"xmm12",
"xmm13",
"xmm14",
"xmm15",
"ymm0",
"ymm1",
51 "ymm2",
"ymm3",
"ymm4",
"ymm5",
"ymm6",
"ymm7",
"ymm8",
"ymm9",
52 "ymm10",
"ymm11",
"ymm12",
"ymm13",
"ymm14",
"ymm15",
"xmm16",
"xmm17",
53 "xmm18",
"xmm19",
"xmm20",
"xmm21",
"xmm22",
"xmm23",
"xmm24",
"xmm25",
54 "xmm26",
"xmm27",
"xmm28",
"xmm29",
"xmm30",
"xmm31",
"ymm16",
"ymm17",
55 "ymm18",
"ymm19",
"ymm20",
"ymm21",
"ymm22",
"ymm23",
"ymm24",
"ymm25",
56 "ymm26",
"ymm27",
"ymm28",
"ymm29",
"ymm30",
"ymm31",
"zmm0",
"zmm1",
57 "zmm2",
"zmm3",
"zmm4",
"zmm5",
"zmm6",
"zmm7",
"zmm8",
"zmm9",
58 "zmm10",
"zmm11",
"zmm12",
"zmm13",
"zmm14",
"zmm15",
"zmm16",
"zmm17",
59 "zmm18",
"zmm19",
"zmm20",
"zmm21",
"zmm22",
"zmm23",
"zmm24",
"zmm25",
60 "zmm26",
"zmm27",
"zmm28",
"zmm29",
"zmm30",
"zmm31",
"k0",
"k1",
61 "k2",
"k3",
"k4",
"k5",
"k6",
"k7",
62 "cr0",
"cr2",
"cr3",
"cr4",
"cr8",
63 "dr0",
"dr1",
"dr2",
"dr3",
"dr6",
"dr7",
64 "bnd0",
"bnd1",
"bnd2",
"bnd3",
68 {{
"al",
"ah",
"eax",
"rax"}, 0},
69 {{
"bl",
"bh",
"ebx",
"rbx"}, 3},
70 {{
"cl",
"ch",
"ecx",
"rcx"}, 2},
71 {{
"dl",
"dh",
"edx",
"rdx"}, 1},
76 {{
"r8d",
"r8w",
"r8b"}, 38},
77 {{
"r9d",
"r9w",
"r9b"}, 39},
78 {{
"r10d",
"r10w",
"r10b"}, 40},
79 {{
"r11d",
"r11w",
"r11b"}, 41},
80 {{
"r12d",
"r12w",
"r12b"}, 42},
81 {{
"r13d",
"r13w",
"r13b"}, 43},
82 {{
"r14d",
"r14w",
"r14b"}, 44},
83 {{
"r15d",
"r15w",
"r15b"}, 45},
89 using namespace clang;
106 const std::vector<std::string> &FeaturesVec)
const {
109 if (getTriple().getArch() == llvm::Triple::x86_64)
110 setFeatureEnabledImpl(Features,
"sse2",
true);
115 if (Kind != CK_Lakemont)
116 setFeatureEnabledImpl(Features,
"x87",
true);
120 if (Kind >= CK_i586 || Kind == CK_Generic)
121 setFeatureEnabledImpl(Features,
"cx8",
true);
136 setFeatureEnabledImpl(Features,
"avx512bf16",
true);
140 setFeatureEnabledImpl(Features,
"avx512vnni",
true);
142 case CK_SkylakeServer:
143 setFeatureEnabledImpl(Features,
"avx512f",
true);
144 setFeatureEnabledImpl(Features,
"avx512cd",
true);
145 setFeatureEnabledImpl(Features,
"avx512dq",
true);
146 setFeatureEnabledImpl(Features,
"avx512bw",
true);
147 setFeatureEnabledImpl(Features,
"avx512vl",
true);
148 setFeatureEnabledImpl(Features,
"clwb",
true);
149 setFeatureEnabledImpl(Features,
"pku",
true);
154 setFeatureEnabledImpl(Features,
"avx512vp2intersect",
true);
155 setFeatureEnabledImpl(Features,
"movdiri",
true);
156 setFeatureEnabledImpl(Features,
"movdir64b",
true);
157 setFeatureEnabledImpl(Features,
"shstk",
true);
161 case CK_IcelakeServer:
162 setFeatureEnabledImpl(Features,
"pconfig",
true);
163 setFeatureEnabledImpl(Features,
"wbnoinvd",
true);
165 case CK_IcelakeClient:
167 setFeatureEnabledImpl(Features,
"vaes",
true);
168 setFeatureEnabledImpl(Features,
"gfni",
true);
169 setFeatureEnabledImpl(Features,
"vpclmulqdq",
true);
170 setFeatureEnabledImpl(Features,
"avx512bitalg",
true);
171 setFeatureEnabledImpl(Features,
"avx512vbmi2",
true);
172 setFeatureEnabledImpl(Features,
"avx512vnni",
true);
173 setFeatureEnabledImpl(Features,
"avx512vpopcntdq",
true);
174 setFeatureEnabledImpl(Features,
"rdpid",
true);
175 setFeatureEnabledImpl(Features,
"clwb",
true);
178 setFeatureEnabledImpl(Features,
"avx512f",
true);
179 setFeatureEnabledImpl(Features,
"avx512cd",
true);
180 setFeatureEnabledImpl(Features,
"avx512dq",
true);
181 setFeatureEnabledImpl(Features,
"avx512bw",
true);
182 setFeatureEnabledImpl(Features,
"avx512vl",
true);
183 setFeatureEnabledImpl(Features,
"avx512ifma",
true);
184 setFeatureEnabledImpl(Features,
"avx512vbmi",
true);
185 setFeatureEnabledImpl(Features,
"pku",
true);
186 setFeatureEnabledImpl(Features,
"sha",
true);
188 case CK_SkylakeClient:
189 setFeatureEnabledImpl(Features,
"sgx",
true);
192 setFeatureEnabledImpl(Features,
"xsavec",
true);
193 setFeatureEnabledImpl(Features,
"xsaves",
true);
194 setFeatureEnabledImpl(Features,
"clflushopt",
true);
195 setFeatureEnabledImpl(Features,
"aes",
true);
198 setFeatureEnabledImpl(Features,
"rdseed",
true);
199 setFeatureEnabledImpl(Features,
"adx",
true);
200 setFeatureEnabledImpl(Features,
"prfchw",
true);
203 setFeatureEnabledImpl(Features,
"avx2",
true);
204 setFeatureEnabledImpl(Features,
"lzcnt",
true);
205 setFeatureEnabledImpl(Features,
"bmi",
true);
206 setFeatureEnabledImpl(Features,
"bmi2",
true);
207 setFeatureEnabledImpl(Features,
"fma",
true);
208 setFeatureEnabledImpl(Features,
"invpcid",
true);
209 setFeatureEnabledImpl(Features,
"movbe",
true);
212 setFeatureEnabledImpl(Features,
"rdrnd",
true);
213 setFeatureEnabledImpl(Features,
"f16c",
true);
214 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
217 setFeatureEnabledImpl(Features,
"avx",
true);
218 setFeatureEnabledImpl(Features,
"xsave",
true);
219 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
222 setFeatureEnabledImpl(Features,
"pclmul",
true);
225 setFeatureEnabledImpl(Features,
"sse4.2",
true);
228 setFeatureEnabledImpl(Features,
"sse4.1",
true);
231 setFeatureEnabledImpl(Features,
"ssse3",
true);
232 setFeatureEnabledImpl(Features,
"sahf",
true);
235 setFeatureEnabledImpl(Features,
"cx16",
true);
239 setFeatureEnabledImpl(Features,
"sse3",
true);
244 setFeatureEnabledImpl(Features,
"sse2",
true);
248 setFeatureEnabledImpl(Features,
"sse",
true);
251 setFeatureEnabledImpl(Features,
"fxsr",
true);
256 setFeatureEnabledImpl(Features,
"mmx",
true);
260 setFeatureEnabledImpl(Features,
"cldemote",
true);
261 setFeatureEnabledImpl(Features,
"movdiri",
true);
262 setFeatureEnabledImpl(Features,
"movdir64b",
true);
263 setFeatureEnabledImpl(Features,
"gfni",
true);
264 setFeatureEnabledImpl(Features,
"waitpkg",
true);
266 case CK_GoldmontPlus:
267 setFeatureEnabledImpl(Features,
"ptwrite",
true);
268 setFeatureEnabledImpl(Features,
"rdpid",
true);
269 setFeatureEnabledImpl(Features,
"sgx",
true);
272 setFeatureEnabledImpl(Features,
"sha",
true);
273 setFeatureEnabledImpl(Features,
"rdseed",
true);
274 setFeatureEnabledImpl(Features,
"xsave",
true);
275 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
276 setFeatureEnabledImpl(Features,
"xsavec",
true);
277 setFeatureEnabledImpl(Features,
"xsaves",
true);
278 setFeatureEnabledImpl(Features,
"clflushopt",
true);
279 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
280 setFeatureEnabledImpl(Features,
"aes",
true);
283 setFeatureEnabledImpl(Features,
"rdrnd",
true);
284 setFeatureEnabledImpl(Features,
"pclmul",
true);
285 setFeatureEnabledImpl(Features,
"sse4.2",
true);
286 setFeatureEnabledImpl(Features,
"prfchw",
true);
289 setFeatureEnabledImpl(Features,
"movbe",
true);
290 setFeatureEnabledImpl(Features,
"ssse3",
true);
291 setFeatureEnabledImpl(Features,
"fxsr",
true);
292 setFeatureEnabledImpl(Features,
"cx16",
true);
293 setFeatureEnabledImpl(Features,
"sahf",
true);
294 setFeatureEnabledImpl(Features,
"mmx",
true);
299 setFeatureEnabledImpl(Features,
"avx512vpopcntdq",
true);
302 setFeatureEnabledImpl(Features,
"avx512f",
true);
303 setFeatureEnabledImpl(Features,
"avx512cd",
true);
304 setFeatureEnabledImpl(Features,
"avx512er",
true);
305 setFeatureEnabledImpl(Features,
"avx512pf",
true);
306 setFeatureEnabledImpl(Features,
"prfchw",
true);
307 setFeatureEnabledImpl(Features,
"prefetchwt1",
true);
308 setFeatureEnabledImpl(Features,
"fxsr",
true);
309 setFeatureEnabledImpl(Features,
"rdseed",
true);
310 setFeatureEnabledImpl(Features,
"adx",
true);
311 setFeatureEnabledImpl(Features,
"lzcnt",
true);
312 setFeatureEnabledImpl(Features,
"bmi",
true);
313 setFeatureEnabledImpl(Features,
"bmi2",
true);
314 setFeatureEnabledImpl(Features,
"fma",
true);
315 setFeatureEnabledImpl(Features,
"rdrnd",
true);
316 setFeatureEnabledImpl(Features,
"f16c",
true);
317 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
318 setFeatureEnabledImpl(Features,
"aes",
true);
319 setFeatureEnabledImpl(Features,
"pclmul",
true);
320 setFeatureEnabledImpl(Features,
"cx16",
true);
321 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
322 setFeatureEnabledImpl(Features,
"xsave",
true);
323 setFeatureEnabledImpl(Features,
"movbe",
true);
324 setFeatureEnabledImpl(Features,
"sahf",
true);
325 setFeatureEnabledImpl(Features,
"mmx",
true);
332 setFeatureEnabledImpl(Features,
"3dnow",
true);
336 setFeatureEnabledImpl(Features,
"sse4a",
true);
337 setFeatureEnabledImpl(Features,
"lzcnt",
true);
338 setFeatureEnabledImpl(Features,
"popcnt",
true);
339 setFeatureEnabledImpl(Features,
"sahf",
true);
342 setFeatureEnabledImpl(Features,
"sse3",
true);
345 setFeatureEnabledImpl(Features,
"sse2",
true);
348 setFeatureEnabledImpl(Features,
"sse",
true);
349 setFeatureEnabledImpl(Features,
"fxsr",
true);
353 setFeatureEnabledImpl(Features,
"3dnowa",
true);
357 setFeatureEnabledImpl(Features,
"avx",
true);
358 setFeatureEnabledImpl(Features,
"aes",
true);
359 setFeatureEnabledImpl(Features,
"pclmul",
true);
360 setFeatureEnabledImpl(Features,
"bmi",
true);
361 setFeatureEnabledImpl(Features,
"f16c",
true);
362 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
363 setFeatureEnabledImpl(Features,
"movbe",
true);
366 setFeatureEnabledImpl(Features,
"ssse3",
true);
367 setFeatureEnabledImpl(Features,
"sse4a",
true);
368 setFeatureEnabledImpl(Features,
"lzcnt",
true);
369 setFeatureEnabledImpl(Features,
"popcnt",
true);
370 setFeatureEnabledImpl(Features,
"prfchw",
true);
371 setFeatureEnabledImpl(Features,
"cx16",
true);
372 setFeatureEnabledImpl(Features,
"fxsr",
true);
373 setFeatureEnabledImpl(Features,
"sahf",
true);
374 setFeatureEnabledImpl(Features,
"mmx",
true);
378 setFeatureEnabledImpl(Features,
"clwb",
true);
379 setFeatureEnabledImpl(Features,
"rdpid",
true);
380 setFeatureEnabledImpl(Features,
"wbnoinvd",
true);
383 setFeatureEnabledImpl(Features,
"adx",
true);
384 setFeatureEnabledImpl(Features,
"aes",
true);
385 setFeatureEnabledImpl(Features,
"avx2",
true);
386 setFeatureEnabledImpl(Features,
"bmi",
true);
387 setFeatureEnabledImpl(Features,
"bmi2",
true);
388 setFeatureEnabledImpl(Features,
"clflushopt",
true);
389 setFeatureEnabledImpl(Features,
"clzero",
true);
390 setFeatureEnabledImpl(Features,
"cx16",
true);
391 setFeatureEnabledImpl(Features,
"f16c",
true);
392 setFeatureEnabledImpl(Features,
"fma",
true);
393 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
394 setFeatureEnabledImpl(Features,
"fxsr",
true);
395 setFeatureEnabledImpl(Features,
"lzcnt",
true);
396 setFeatureEnabledImpl(Features,
"mmx",
true);
397 setFeatureEnabledImpl(Features,
"mwaitx",
true);
398 setFeatureEnabledImpl(Features,
"movbe",
true);
399 setFeatureEnabledImpl(Features,
"pclmul",
true);
400 setFeatureEnabledImpl(Features,
"popcnt",
true);
401 setFeatureEnabledImpl(Features,
"prfchw",
true);
402 setFeatureEnabledImpl(Features,
"rdrnd",
true);
403 setFeatureEnabledImpl(Features,
"rdseed",
true);
404 setFeatureEnabledImpl(Features,
"sahf",
true);
405 setFeatureEnabledImpl(Features,
"sha",
true);
406 setFeatureEnabledImpl(Features,
"sse4a",
true);
407 setFeatureEnabledImpl(Features,
"xsave",
true);
408 setFeatureEnabledImpl(Features,
"xsavec",
true);
409 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
410 setFeatureEnabledImpl(Features,
"xsaves",
true);
414 setFeatureEnabledImpl(Features,
"avx2",
true);
415 setFeatureEnabledImpl(Features,
"bmi2",
true);
416 setFeatureEnabledImpl(Features,
"mwaitx",
true);
419 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
420 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
423 setFeatureEnabledImpl(Features,
"bmi",
true);
424 setFeatureEnabledImpl(Features,
"fma",
true);
425 setFeatureEnabledImpl(Features,
"f16c",
true);
426 setFeatureEnabledImpl(Features,
"tbm",
true);
430 setFeatureEnabledImpl(Features,
"xop",
true);
431 setFeatureEnabledImpl(Features,
"lwp",
true);
432 setFeatureEnabledImpl(Features,
"lzcnt",
true);
433 setFeatureEnabledImpl(Features,
"aes",
true);
434 setFeatureEnabledImpl(Features,
"pclmul",
true);
435 setFeatureEnabledImpl(Features,
"prfchw",
true);
436 setFeatureEnabledImpl(Features,
"cx16",
true);
437 setFeatureEnabledImpl(Features,
"fxsr",
true);
438 setFeatureEnabledImpl(Features,
"xsave",
true);
439 setFeatureEnabledImpl(Features,
"sahf",
true);
440 setFeatureEnabledImpl(Features,
"mmx",
true);
450 auto I = Features.find(
"sse4.2");
451 if (I != Features.end() && I->getValue() &&
452 llvm::find(FeaturesVec,
"-popcnt") == FeaturesVec.end())
453 Features[
"popcnt"] =
true;
456 I = Features.find(
"3dnow");
457 if (I != Features.end() && I->getValue() &&
458 llvm::find(FeaturesVec,
"-prfchw") == FeaturesVec.end())
459 Features[
"prfchw"] =
true;
463 I = Features.find(
"sse");
464 if (I != Features.end() && I->getValue() &&
465 llvm::find(FeaturesVec,
"-mmx") == FeaturesVec.end())
466 Features[
"mmx"] =
true;
472 X86SSEEnum
Level,
bool Enabled) {
476 Features[
"avx512f"] =
true;
477 Features[
"fma"] =
true;
478 Features[
"f16c"] =
true;
481 Features[
"avx2"] =
true;
484 Features[
"avx"] =
true;
485 Features[
"xsave"] =
true;
488 Features[
"sse4.2"] =
true;
491 Features[
"sse4.1"] =
true;
494 Features[
"ssse3"] =
true;
497 Features[
"sse3"] =
true;
500 Features[
"sse2"] =
true;
503 Features[
"sse"] =
true;
514 Features[
"sse"] =
false;
517 Features[
"sse2"] = Features[
"pclmul"] = Features[
"aes"] =
false;
518 Features[
"sha"] = Features[
"gfni"] =
false;
521 Features[
"sse3"] =
false;
522 setXOPLevel(Features, NoXOP,
false);
525 Features[
"ssse3"] =
false;
528 Features[
"sse4.1"] =
false;
531 Features[
"sse4.2"] =
false;
534 Features[
"fma"] = Features[
"avx"] = Features[
"f16c"] =
false;
535 Features[
"xsave"] = Features[
"xsaveopt"] = Features[
"vaes"] =
false;
536 Features[
"vpclmulqdq"] =
false;
537 setXOPLevel(Features, FMA4,
false);
540 Features[
"avx2"] =
false;
543 Features[
"avx512f"] = Features[
"avx512cd"] = Features[
"avx512er"] =
false;
544 Features[
"avx512pf"] = Features[
"avx512dq"] = Features[
"avx512bw"] =
false;
545 Features[
"avx512vl"] = Features[
"avx512vbmi"] =
false;
546 Features[
"avx512ifma"] = Features[
"avx512vpopcntdq"] =
false;
547 Features[
"avx512bitalg"] = Features[
"avx512vnni"] =
false;
548 Features[
"avx512vbmi2"] = Features[
"avx512bf16"] =
false;
549 Features[
"avx512vp2intersect"] =
false;
555 MMX3DNowEnum
Level,
bool Enabled) {
559 Features[
"3dnowa"] =
true;
562 Features[
"3dnow"] =
true;
565 Features[
"mmx"] =
true;
576 Features[
"mmx"] =
false;
579 Features[
"3dnow"] =
false;
582 Features[
"3dnowa"] =
false;
592 Features[
"xop"] =
true;
595 Features[
"fma4"] =
true;
596 setSSELevel(Features, AVX,
true);
599 Features[
"sse4a"] =
true;
600 setSSELevel(Features, SSE3,
true);
611 Features[
"sse4a"] =
false;
614 Features[
"fma4"] =
false;
617 Features[
"xop"] =
false;
623 StringRef Name,
bool Enabled) {
628 Features[Name] = Enabled;
631 setMMXLevel(Features, MMX, Enabled);
632 }
else if (Name ==
"sse") {
633 setSSELevel(Features, SSE1, Enabled);
634 }
else if (Name ==
"sse2") {
635 setSSELevel(Features, SSE2, Enabled);
636 }
else if (Name ==
"sse3") {
637 setSSELevel(Features, SSE3, Enabled);
638 }
else if (Name ==
"ssse3") {
639 setSSELevel(Features, SSSE3, Enabled);
640 }
else if (Name ==
"sse4.2") {
641 setSSELevel(Features, SSE42, Enabled);
642 }
else if (Name ==
"sse4.1") {
643 setSSELevel(Features, SSE41, Enabled);
644 }
else if (Name ==
"3dnow") {
645 setMMXLevel(Features, AMD3DNow, Enabled);
646 }
else if (Name ==
"3dnowa") {
647 setMMXLevel(Features, AMD3DNowAthlon, Enabled);
648 }
else if (Name ==
"aes") {
650 setSSELevel(Features, SSE2, Enabled);
652 Features[
"vaes"] =
false;
653 }
else if (Name ==
"vaes") {
655 setSSELevel(Features, AVX, Enabled);
656 Features[
"aes"] =
true;
658 }
else if (Name ==
"pclmul") {
660 setSSELevel(Features, SSE2, Enabled);
662 Features[
"vpclmulqdq"] =
false;
663 }
else if (Name ==
"vpclmulqdq") {
665 setSSELevel(Features, AVX, Enabled);
666 Features[
"pclmul"] =
true;
668 }
else if (Name ==
"gfni") {
670 setSSELevel(Features, SSE2, Enabled);
671 }
else if (Name ==
"avx") {
672 setSSELevel(Features, AVX, Enabled);
673 }
else if (Name ==
"avx2") {
674 setSSELevel(Features, AVX2, Enabled);
675 }
else if (Name ==
"avx512f") {
676 setSSELevel(Features, AVX512F, Enabled);
677 }
else if (Name.startswith(
"avx512")) {
679 setSSELevel(Features, AVX512F, Enabled);
681 if ((Name ==
"avx512vbmi" || Name ==
"avx512vbmi2" ||
682 Name ==
"avx512bitalg" || Name ==
"avx512bf16") && Enabled)
683 Features[
"avx512bw"] =
true;
685 if (Name ==
"avx512bw" && !Enabled) {
686 Features[
"avx512vbmi"] =
false;
687 Features[
"avx512vbmi2"] =
false;
688 Features[
"avx512bitalg"] =
false;
689 Features[
"avx512bf16"] =
false;
691 }
else if (Name ==
"fma") {
693 setSSELevel(Features, AVX, Enabled);
695 setSSELevel(Features, AVX512F, Enabled);
696 }
else if (Name ==
"fma4") {
697 setXOPLevel(Features, FMA4, Enabled);
698 }
else if (Name ==
"xop") {
699 setXOPLevel(Features, XOP, Enabled);
700 }
else if (Name ==
"sse4a") {
701 setXOPLevel(Features, SSE4A, Enabled);
702 }
else if (Name ==
"f16c") {
704 setSSELevel(Features, AVX, Enabled);
706 setSSELevel(Features, AVX512F, Enabled);
707 }
else if (Name ==
"sha") {
709 setSSELevel(Features, SSE2, Enabled);
710 }
else if (Name ==
"sse4") {
716 setSSELevel(Features, SSE42, Enabled);
718 setSSELevel(Features, SSE41, Enabled);
719 }
else if (Name ==
"xsave") {
721 Features[
"xsaveopt"] =
false;
722 }
else if (Name ==
"xsaveopt" || Name ==
"xsavec" || Name ==
"xsaves") {
724 Features[
"xsave"] =
true;
732 for (
const auto &Feature : Features) {
733 if (Feature[0] !=
'+')
736 if (Feature ==
"+aes") {
738 }
else if (Feature ==
"+vaes") {
740 }
else if (Feature ==
"+pclmul") {
742 }
else if (Feature ==
"+vpclmulqdq") {
743 HasVPCLMULQDQ =
true;
744 }
else if (Feature ==
"+lzcnt") {
746 }
else if (Feature ==
"+rdrnd") {
748 }
else if (Feature ==
"+fsgsbase") {
750 }
else if (Feature ==
"+bmi") {
752 }
else if (Feature ==
"+bmi2") {
754 }
else if (Feature ==
"+popcnt") {
756 }
else if (Feature ==
"+rtm") {
758 }
else if (Feature ==
"+prfchw") {
760 }
else if (Feature ==
"+rdseed") {
762 }
else if (Feature ==
"+adx") {
764 }
else if (Feature ==
"+tbm") {
766 }
else if (Feature ==
"+lwp") {
768 }
else if (Feature ==
"+fma") {
770 }
else if (Feature ==
"+f16c") {
772 }
else if (Feature ==
"+gfni") {
774 }
else if (Feature ==
"+avx512cd") {
776 }
else if (Feature ==
"+avx512vpopcntdq") {
777 HasAVX512VPOPCNTDQ =
true;
778 }
else if (Feature ==
"+avx512vnni") {
779 HasAVX512VNNI =
true;
780 }
else if (Feature ==
"+avx512bf16") {
781 HasAVX512BF16 =
true;
782 }
else if (Feature ==
"+avx512er") {
784 }
else if (Feature ==
"+avx512pf") {
786 }
else if (Feature ==
"+avx512dq") {
788 }
else if (Feature ==
"+avx512bitalg") {
789 HasAVX512BITALG =
true;
790 }
else if (Feature ==
"+avx512bw") {
792 }
else if (Feature ==
"+avx512vl") {
794 }
else if (Feature ==
"+avx512vbmi") {
795 HasAVX512VBMI =
true;
796 }
else if (Feature ==
"+avx512vbmi2") {
797 HasAVX512VBMI2 =
true;
798 }
else if (Feature ==
"+avx512ifma") {
799 HasAVX512IFMA =
true;
800 }
else if (Feature ==
"+avx512vp2intersect") {
801 HasAVX512VP2INTERSECT =
true;
802 }
else if (Feature ==
"+sha") {
804 }
else if (Feature ==
"+shstk") {
806 }
else if (Feature ==
"+movbe") {
808 }
else if (Feature ==
"+sgx") {
810 }
else if (Feature ==
"+cx8") {
812 }
else if (Feature ==
"+cx16") {
814 }
else if (Feature ==
"+fxsr") {
816 }
else if (Feature ==
"+xsave") {
818 }
else if (Feature ==
"+xsaveopt") {
820 }
else if (Feature ==
"+xsavec") {
822 }
else if (Feature ==
"+xsaves") {
824 }
else if (Feature ==
"+mwaitx") {
826 }
else if (Feature ==
"+pku") {
828 }
else if (Feature ==
"+clflushopt") {
829 HasCLFLUSHOPT =
true;
830 }
else if (Feature ==
"+clwb") {
832 }
else if (Feature ==
"+wbnoinvd") {
834 }
else if (Feature ==
"+prefetchwt1") {
835 HasPREFETCHWT1 =
true;
836 }
else if (Feature ==
"+clzero") {
838 }
else if (Feature ==
"+cldemote") {
840 }
else if (Feature ==
"+rdpid") {
842 }
else if (Feature ==
"+retpoline-external-thunk") {
843 HasRetpolineExternalThunk =
true;
844 }
else if (Feature ==
"+sahf") {
846 }
else if (Feature ==
"+waitpkg") {
848 }
else if (Feature ==
"+movdiri") {
850 }
else if (Feature ==
"+movdir64b") {
852 }
else if (Feature ==
"+pconfig") {
854 }
else if (Feature ==
"+ptwrite") {
856 }
else if (Feature ==
"+invpcid") {
858 }
else if (Feature ==
"+enqcmd") {
862 X86SSEEnum
Level = llvm::StringSwitch<X86SSEEnum>(Feature)
863 .Case(
"+avx512f", AVX512F)
866 .Case(
"+sse4.2", SSE42)
867 .Case(
"+sse4.1", SSE41)
868 .Case(
"+ssse3", SSSE3)
873 SSELevel =
std::max(SSELevel, Level);
875 MMX3DNowEnum ThreeDNowLevel = llvm::StringSwitch<MMX3DNowEnum>(Feature)
876 .Case(
"+3dnowa", AMD3DNowAthlon)
877 .Case(
"+3dnow", AMD3DNow)
879 .Default(NoMMX3DNow);
880 MMX3DNowLevel =
std::max(MMX3DNowLevel, ThreeDNowLevel);
882 XOPEnum XLevel = llvm::StringSwitch<XOPEnum>(Feature)
885 .Case(
"+sse4a", SSE4A)
887 XOPLevel =
std::max(XOPLevel, XLevel);
892 if ((FPMath == FP_SSE && SSELevel < SSE1) ||
893 (FPMath == FP_387 && SSELevel >= SSE1)) {
894 Diags.
Report(diag::err_target_unsupported_fpmath)
895 << (FPMath == FP_SSE ?
"sse" :
"387");
911 std::string CodeModel = getTargetOpts().CodeModel;
912 if (CodeModel ==
"default")
914 Builder.
defineMacro(
"__code_model_" + CodeModel +
"_");
917 if (getTriple().getArch() == llvm::Triple::x86_64) {
922 if (getTriple().getArchName() ==
"x86_64h") {
932 Builder.
defineMacro(
"__seg_gs",
"__attribute__((address_space(256)))");
933 Builder.
defineMacro(
"__seg_fs",
"__attribute__((address_space(257)))");
994 case CK_GoldmontPlus:
1002 case CK_SandyBridge:
1006 case CK_SkylakeClient:
1007 case CK_SkylakeServer:
1008 case CK_Cascadelake:
1011 case CK_IcelakeClient:
1012 case CK_IcelakeServer:
1034 if (CPU != CK_K6_2) {
1048 if (SSELevel != NoSSE) {
1177 if (HasAVX512VPOPCNTDQ)
1189 if (HasAVX512BITALG)
1201 if (HasAVX512VP2INTERSECT)
1286 if (Opts.MicrosoftExt && getTriple().getArch() == llvm::Triple::x86) {
1308 switch (MMX3DNowLevel) {
1309 case AMD3DNowAthlon:
1322 if (CPU >= CK_i486 || CPU == CK_Generic) {
1323 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
1324 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
1325 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
1328 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
1329 if (HasCX16 && getTriple().getArch() == llvm::Triple::x86_64)
1330 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
1337 return llvm::StringSwitch<bool>(Name)
1338 .Case(
"3dnow",
true)
1339 .Case(
"3dnowa",
true)
1344 .Case(
"avx512f",
true)
1345 .Case(
"avx512cd",
true)
1346 .Case(
"avx512vpopcntdq",
true)
1347 .Case(
"avx512vnni",
true)
1348 .Case(
"avx512bf16",
true)
1349 .Case(
"avx512er",
true)
1350 .Case(
"avx512pf",
true)
1351 .Case(
"avx512dq",
true)
1352 .Case(
"avx512bitalg",
true)
1353 .Case(
"avx512bw",
true)
1354 .Case(
"avx512vl",
true)
1355 .Case(
"avx512vbmi",
true)
1356 .Case(
"avx512vbmi2",
true)
1357 .Case(
"avx512ifma",
true)
1358 .Case(
"avx512vp2intersect",
true)
1361 .Case(
"cldemote",
true)
1362 .Case(
"clflushopt",
true)
1364 .Case(
"clzero",
true)
1366 .Case(
"enqcmd",
true)
1370 .Case(
"fsgsbase",
true)
1373 .Case(
"invpcid",
true)
1375 .Case(
"lzcnt",
true)
1377 .Case(
"movbe",
true)
1378 .Case(
"movdiri",
true)
1379 .Case(
"movdir64b",
true)
1380 .Case(
"mwaitx",
true)
1381 .Case(
"pclmul",
true)
1382 .Case(
"pconfig",
true)
1384 .Case(
"popcnt",
true)
1385 .Case(
"prefetchwt1",
true)
1386 .Case(
"prfchw",
true)
1387 .Case(
"ptwrite",
true)
1388 .Case(
"rdpid",
true)
1389 .Case(
"rdrnd",
true)
1390 .Case(
"rdseed",
true)
1395 .Case(
"shstk",
true)
1399 .Case(
"ssse3",
true)
1401 .Case(
"sse4.1",
true)
1402 .Case(
"sse4.2",
true)
1403 .Case(
"sse4a",
true)
1406 .Case(
"vpclmulqdq",
true)
1407 .Case(
"wbnoinvd",
true)
1408 .Case(
"waitpkg",
true)
1411 .Case(
"xsave",
true)
1412 .Case(
"xsavec",
true)
1413 .Case(
"xsaves",
true)
1414 .Case(
"xsaveopt",
true)
1419 return llvm::StringSwitch<bool>(Feature)
1420 .Case(
"adx", HasADX)
1421 .Case(
"aes", HasAES)
1422 .Case(
"avx", SSELevel >= AVX)
1423 .Case(
"avx2", SSELevel >= AVX2)
1424 .Case(
"avx512f", SSELevel >= AVX512F)
1425 .Case(
"avx512cd", HasAVX512CD)
1426 .Case(
"avx512vpopcntdq", HasAVX512VPOPCNTDQ)
1427 .Case(
"avx512vnni", HasAVX512VNNI)
1428 .Case(
"avx512bf16", HasAVX512BF16)
1429 .Case(
"avx512er", HasAVX512ER)
1430 .Case(
"avx512pf", HasAVX512PF)
1431 .Case(
"avx512dq", HasAVX512DQ)
1432 .Case(
"avx512bitalg", HasAVX512BITALG)
1433 .Case(
"avx512bw", HasAVX512BW)
1434 .Case(
"avx512vl", HasAVX512VL)
1435 .Case(
"avx512vbmi", HasAVX512VBMI)
1436 .Case(
"avx512vbmi2", HasAVX512VBMI2)
1437 .Case(
"avx512ifma", HasAVX512IFMA)
1438 .Case(
"avx512vp2intersect", HasAVX512VP2INTERSECT)
1439 .Case(
"bmi", HasBMI)
1440 .Case(
"bmi2", HasBMI2)
1441 .Case(
"cldemote", HasCLDEMOTE)
1442 .Case(
"clflushopt", HasCLFLUSHOPT)
1443 .Case(
"clwb", HasCLWB)
1444 .Case(
"clzero", HasCLZERO)
1445 .Case(
"cx8", HasCX8)
1446 .Case(
"cx16", HasCX16)
1447 .Case(
"enqcmd", HasENQCMD)
1448 .Case(
"f16c", HasF16C)
1449 .Case(
"fma", HasFMA)
1450 .Case(
"fma4", XOPLevel >= FMA4)
1451 .Case(
"fsgsbase", HasFSGSBASE)
1452 .Case(
"fxsr", HasFXSR)
1453 .Case(
"gfni", HasGFNI)
1454 .Case(
"invpcid", HasINVPCID)
1455 .Case(
"lwp", HasLWP)
1456 .Case(
"lzcnt", HasLZCNT)
1457 .Case(
"mm3dnow", MMX3DNowLevel >= AMD3DNow)
1458 .Case(
"mm3dnowa", MMX3DNowLevel >= AMD3DNowAthlon)
1459 .Case(
"mmx", MMX3DNowLevel >= MMX)
1460 .Case(
"movbe", HasMOVBE)
1461 .Case(
"movdiri", HasMOVDIRI)
1462 .Case(
"movdir64b", HasMOVDIR64B)
1463 .Case(
"mwaitx", HasMWAITX)
1464 .Case(
"pclmul", HasPCLMUL)
1465 .Case(
"pconfig", HasPCONFIG)
1466 .Case(
"pku", HasPKU)
1467 .Case(
"popcnt", HasPOPCNT)
1468 .Case(
"prefetchwt1", HasPREFETCHWT1)
1469 .Case(
"prfchw", HasPRFCHW)
1470 .Case(
"ptwrite", HasPTWRITE)
1471 .Case(
"rdpid", HasRDPID)
1472 .Case(
"rdrnd", HasRDRND)
1473 .Case(
"rdseed", HasRDSEED)
1474 .Case(
"retpoline-external-thunk", HasRetpolineExternalThunk)
1475 .Case(
"rtm", HasRTM)
1476 .Case(
"sahf", HasLAHFSAHF)
1477 .Case(
"sgx", HasSGX)
1478 .Case(
"sha", HasSHA)
1479 .Case(
"shstk", HasSHSTK)
1480 .Case(
"sse", SSELevel >= SSE1)
1481 .Case(
"sse2", SSELevel >= SSE2)
1482 .Case(
"sse3", SSELevel >= SSE3)
1483 .Case(
"ssse3", SSELevel >= SSSE3)
1484 .Case(
"sse4.1", SSELevel >= SSE41)
1485 .Case(
"sse4.2", SSELevel >= SSE42)
1486 .Case(
"sse4a", XOPLevel >= SSE4A)
1487 .Case(
"tbm", HasTBM)
1488 .Case(
"vaes", HasVAES)
1489 .Case(
"vpclmulqdq", HasVPCLMULQDQ)
1490 .Case(
"wbnoinvd", HasWBNOINVD)
1491 .Case(
"waitpkg", HasWAITPKG)
1493 .Case(
"x86_32", getTriple().getArch() == llvm::Triple::x86)
1494 .Case(
"x86_64", getTriple().getArch() == llvm::Triple::x86_64)
1495 .Case(
"xop", XOPLevel >= XOP)
1496 .Case(
"xsave", HasXSAVE)
1497 .Case(
"xsavec", HasXSAVEC)
1498 .Case(
"xsaves", HasXSAVES)
1499 .Case(
"xsaveopt", HasXSAVEOPT)
1509 return llvm::StringSwitch<bool>(FeatureStr)
1511 #include "llvm/Support/X86TargetParser.def" 1516 return llvm::StringSwitch<llvm::X86::ProcessorFeatures>(Name)
1518 #include "llvm/Support/X86TargetParser.def" 1525 enum class FeatPriority {
1526 #define FEATURE(FEAT) FEAT, 1527 #include "clang/Basic/X86Target.def" 1530 #define FEATURE(FEAT) \ 1531 case llvm::X86::FEAT: \ 1532 return static_cast<unsigned>(FeatPriority::FEAT); 1533 #include "clang/Basic/X86Target.def" 1535 llvm_unreachable(
"No Feature Priority for non-CPUSupports Features");
1543 if (Kind != CK_Generic) {
1547 "CPU Type without a key feature used in 'target' attribute");
1548 #define PROC_WITH_FEAT(ENUM, STR, IS64, KEY_FEAT) \ 1550 return (getFeaturePriority(llvm::X86::KEY_FEAT) << 1) + 1; 1551 #include "clang/Basic/X86Target.def" 1561 return llvm::StringSwitch<bool>(Name)
1562 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME,
true)
1563 #define CPU_SPECIFIC_ALIAS(NEW_NAME, NAME) .Case(NEW_NAME, true) 1564 #include "clang/Basic/X86Target.def" 1569 return llvm::StringSwitch<StringRef>(Name)
1571 #include "clang/Basic/X86Target.def" 1577 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME, MANGLING)
1578 #include "clang/Basic/X86Target.def" 1584 StringRef WholeList =
1586 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME, FEATURES)
1587 #include "clang/Basic/X86Target.def" 1589 WholeList.split(Features,
',', -1,
false);
1597 return llvm::StringSwitch<bool>(FeatureStr)
1598 #define
X86_VENDOR(ENUM, STRING) .Case(STRING,
true)
1599 #define X86_CPU_TYPE_COMPAT_WITH_ALIAS(ARCHNAME, ENUM, STR, ALIAS) \ 1600 .Cases(STR, ALIAS, true) 1601 #define X86_CPU_TYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true) 1602 #define X86_CPU_SUBTYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true) 1603 #include "llvm/Support/X86TargetParser.def" 1608 auto RV = llvm::StringSwitch<unsigned>(Name)
1735 StringRef Constraint,
1736 unsigned Size)
const {
1738 while (Constraint[0] ==
'=' || Constraint[0] ==
'+' || Constraint[0] ==
'&')
1739 Constraint = Constraint.substr(1);
1741 return validateOperandSize(FeatureMap, Constraint, Size);
1745 StringRef Constraint,
1746 unsigned Size)
const {
1747 return validateOperandSize(FeatureMap, Constraint, Size);
1751 StringRef Constraint,
1752 unsigned Size)
const {
1753 switch (Constraint[0]) {
1766 switch (Constraint[1]) {
1776 if (FeatureMap.lookup(
"sse"))
1777 return Size <= 128U;
1783 if (SSELevel < SSE2)
1790 if (FeatureMap.lookup(
"avx512f"))
1792 return Size <= 512U;
1793 else if (FeatureMap.lookup(
"avx"))
1795 return Size <= 256U;
1796 return Size <= 128U;
1804 switch (*Constraint) {
1807 std::string Converted =
"{" + std::string(Constraint, Len) +
"}";
1808 Constraint += Len - 1;
1811 return std::string(1, *Constraint);
1813 return std::string(
"{ax}");
1815 return std::string(
"{bx}");
1817 return std::string(
"{cx}");
1819 return std::string(
"{dx}");
1821 return std::string(
"{si}");
1823 return std::string(
"{di}");
1825 return std::string(
"im");
1827 return std::string(
"{st}");
1829 return std::string(
"{st(1)}");
1831 switch (Constraint[1]) {
1847 return std::string(
"^") + std::string(Constraint++, 2);
1851 return std::string(1, *Constraint);
1862 #define PROC(ENUM, STRING, IS64BIT) \ 1864 return IS64BIT || getTriple().getArch() == llvm::Triple::x86; 1865 #include "clang/Basic/X86Target.def" 1867 llvm_unreachable(
"Unhandled CPU kind");
1871 #define PROC(ENUM, STRING, IS64BIT) \ 1872 if (IS64BIT || getTriple().getArch() == llvm::Triple::x86) \ 1873 Values.emplace_back(STRING); 1875 #define PROC_ALIAS(ENUM, ALIAS) \ 1876 if (checkCPUKind(CK_##ENUM)) \ 1877 Values.emplace_back(ALIAS); 1878 #include "clang/Basic/X86Target.def" 1882 return llvm::StringSwitch<CPUKind>(CPU)
1883 #define
PROC(ENUM, STRING, IS64BIT) .Case(STRING, CK_##ENUM)
1884 #define PROC_ALIAS(ENUM, ALIAS) .Case(ALIAS, CK_##ENUM) 1885 #include "clang/Basic/X86Target.def" 1886 .Default(CK_Generic);
void DefineStd(MacroBuilder &Builder, StringRef MacroName, const LangOptions &Opts)
DefineStd - Define a macro name and standard variants.
bool validateOutputSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const override
bool setFPMath(StringRef Name) override
Use the specified unit for FP math.
const Builtin::Info BuiltinInfoX86[]
static void setMMXLevel(llvm::StringMap< bool > &Features, MMX3DNowEnum Level, bool Enabled)
virtual bool validateOperandSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
ArrayRef< TargetInfo::AddlRegName > getGCCAddlRegNames() const override
void setRequiresImmediate(int Min, int Max)
void fillValidCPUList(SmallVectorImpl< StringRef > &Values) const override
Fill a SmallVectorImpl with the valid values to setCPU.
static void setXOPLevel(llvm::StringMap< bool > &Features, XOPEnum Level, bool Enabled)
static unsigned matchAsmCCConstraint(const char *&Name)
const TargetInfo::AddlRegName AddlRegNames[]
__DEVICE__ int max(int __a, int __b)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool validateCpuSupports(StringRef Name) const override
void getCPUSpecificCPUDispatchFeatures(StringRef Name, llvm::SmallVectorImpl< StringRef > &Features) const override
#define X86_FEATURE_COMPAT(VAL, ENUM, STR)
Concrete class used by the front-end to report problems and issues.
Defines the Diagnostic-related interfaces.
static llvm::X86::ProcessorFeatures getFeature(StringRef Name)
#define CPU_SPECIFIC_ALIAS(NEW_NAME, NAME)
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &info) const override
static const char *const GCCRegNames[]
bool validateCPUSpecificCPUDispatch(StringRef Name) const override
bool isValidFeatureName(StringRef Name) const override
Determine whether this TargetInfo supports the given feature.
#define X86_VENDOR(ENUM, STRING)
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 ...
static StringRef CPUSpecificCPUDispatchNameDealias(StringRef Name)
std::string ConstraintStr
CPUKind getCPUKind(StringRef CPU) const
bool validateInputSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const override
bool hasFeature(StringRef Feature) const override
Determine whether the given target has the given feature.
static void setSSELevel(llvm::StringMap< bool > &Features, X86SSEEnum Level, bool Enabled)
Enumerates target-specific builtins in their own namespaces within namespace clang.
CPUKind
Enumeration of all of the X86 CPUs supported by Clang.
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
static unsigned getFeaturePriority(llvm::X86::ProcessorFeatures Feat)
std::string convertConstraint(const char *&Constraint) const override
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
char CPUSpecificManglingCharacter(StringRef Name) const override
Dataflow Directional Tag Classes.
unsigned multiVersionSortPriority(StringRef Name) const override
#define CPU_SPECIFIC(NAME, MANGLING, FEATURES)
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
handleTargetFeatures - Perform initialization based on the user configured set of features...
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
#define PROC(ENUM, STRING, IS64BIT)
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature...
bool checkCPUKind(CPUKind Kind) const
void defineCPUMacros(MacroBuilder &Builder, StringRef CPUName, bool Tuning)
void defineMacro(const Twine &Name, const Twine &Value="1")
Append a #define line for macro of the form "\#define Name Value\n".
static void setFeatureEnabledImpl(llvm::StringMap< bool > &Features, StringRef Name, bool Enabled)
bool validateCpuIs(StringRef Name) const override
ArrayRef< const char * > getGCCRegNames() const override
Defines enum values for all the target-independent builtin functions.
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 ...