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);
138 setFeatureEnabledImpl(Features,
"mmx",
true);
143 setFeatureEnabledImpl(Features,
"avx512bf16",
true);
147 setFeatureEnabledImpl(Features,
"avx512vnni",
true);
149 case CK_SkylakeServer:
150 setFeatureEnabledImpl(Features,
"avx512f",
true);
151 setFeatureEnabledImpl(Features,
"avx512cd",
true);
152 setFeatureEnabledImpl(Features,
"avx512dq",
true);
153 setFeatureEnabledImpl(Features,
"avx512bw",
true);
154 setFeatureEnabledImpl(Features,
"avx512vl",
true);
155 setFeatureEnabledImpl(Features,
"clwb",
true);
156 setFeatureEnabledImpl(Features,
"pku",
true);
161 setFeatureEnabledImpl(Features,
"avx512vp2intersect",
true);
162 setFeatureEnabledImpl(Features,
"movdiri",
true);
163 setFeatureEnabledImpl(Features,
"movdir64b",
true);
164 setFeatureEnabledImpl(Features,
"shstk",
true);
168 case CK_IcelakeServer:
169 setFeatureEnabledImpl(Features,
"pconfig",
true);
170 setFeatureEnabledImpl(Features,
"wbnoinvd",
true);
172 case CK_IcelakeClient:
174 setFeatureEnabledImpl(Features,
"vaes",
true);
175 setFeatureEnabledImpl(Features,
"gfni",
true);
176 setFeatureEnabledImpl(Features,
"vpclmulqdq",
true);
177 setFeatureEnabledImpl(Features,
"avx512bitalg",
true);
178 setFeatureEnabledImpl(Features,
"avx512vbmi2",
true);
179 setFeatureEnabledImpl(Features,
"avx512vnni",
true);
180 setFeatureEnabledImpl(Features,
"avx512vpopcntdq",
true);
181 setFeatureEnabledImpl(Features,
"rdpid",
true);
182 setFeatureEnabledImpl(Features,
"clwb",
true);
185 setFeatureEnabledImpl(Features,
"avx512f",
true);
186 setFeatureEnabledImpl(Features,
"avx512cd",
true);
187 setFeatureEnabledImpl(Features,
"avx512dq",
true);
188 setFeatureEnabledImpl(Features,
"avx512bw",
true);
189 setFeatureEnabledImpl(Features,
"avx512vl",
true);
190 setFeatureEnabledImpl(Features,
"avx512ifma",
true);
191 setFeatureEnabledImpl(Features,
"avx512vbmi",
true);
192 setFeatureEnabledImpl(Features,
"pku",
true);
193 setFeatureEnabledImpl(Features,
"sha",
true);
195 case CK_SkylakeClient:
196 setFeatureEnabledImpl(Features,
"sgx",
true);
199 setFeatureEnabledImpl(Features,
"xsavec",
true);
200 setFeatureEnabledImpl(Features,
"xsaves",
true);
201 setFeatureEnabledImpl(Features,
"clflushopt",
true);
202 setFeatureEnabledImpl(Features,
"aes",
true);
205 setFeatureEnabledImpl(Features,
"rdseed",
true);
206 setFeatureEnabledImpl(Features,
"adx",
true);
207 setFeatureEnabledImpl(Features,
"prfchw",
true);
210 setFeatureEnabledImpl(Features,
"avx2",
true);
211 setFeatureEnabledImpl(Features,
"lzcnt",
true);
212 setFeatureEnabledImpl(Features,
"bmi",
true);
213 setFeatureEnabledImpl(Features,
"bmi2",
true);
214 setFeatureEnabledImpl(Features,
"fma",
true);
215 setFeatureEnabledImpl(Features,
"invpcid",
true);
216 setFeatureEnabledImpl(Features,
"movbe",
true);
219 setFeatureEnabledImpl(Features,
"rdrnd",
true);
220 setFeatureEnabledImpl(Features,
"f16c",
true);
221 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
224 setFeatureEnabledImpl(Features,
"avx",
true);
225 setFeatureEnabledImpl(Features,
"xsave",
true);
226 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
229 setFeatureEnabledImpl(Features,
"pclmul",
true);
232 setFeatureEnabledImpl(Features,
"sse4.2",
true);
235 setFeatureEnabledImpl(Features,
"sse4.1",
true);
238 setFeatureEnabledImpl(Features,
"ssse3",
true);
239 setFeatureEnabledImpl(Features,
"sahf",
true);
242 setFeatureEnabledImpl(Features,
"cx16",
true);
246 setFeatureEnabledImpl(Features,
"sse3",
true);
251 setFeatureEnabledImpl(Features,
"sse2",
true);
255 setFeatureEnabledImpl(Features,
"sse",
true);
256 setFeatureEnabledImpl(Features,
"fxsr",
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);
298 setFeatureEnabledImpl(Features,
"avx512vpopcntdq",
true);
301 setFeatureEnabledImpl(Features,
"avx512f",
true);
302 setFeatureEnabledImpl(Features,
"avx512cd",
true);
303 setFeatureEnabledImpl(Features,
"avx512er",
true);
304 setFeatureEnabledImpl(Features,
"avx512pf",
true);
305 setFeatureEnabledImpl(Features,
"prfchw",
true);
306 setFeatureEnabledImpl(Features,
"prefetchwt1",
true);
307 setFeatureEnabledImpl(Features,
"fxsr",
true);
308 setFeatureEnabledImpl(Features,
"rdseed",
true);
309 setFeatureEnabledImpl(Features,
"adx",
true);
310 setFeatureEnabledImpl(Features,
"lzcnt",
true);
311 setFeatureEnabledImpl(Features,
"bmi",
true);
312 setFeatureEnabledImpl(Features,
"bmi2",
true);
313 setFeatureEnabledImpl(Features,
"fma",
true);
314 setFeatureEnabledImpl(Features,
"rdrnd",
true);
315 setFeatureEnabledImpl(Features,
"f16c",
true);
316 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
317 setFeatureEnabledImpl(Features,
"aes",
true);
318 setFeatureEnabledImpl(Features,
"pclmul",
true);
319 setFeatureEnabledImpl(Features,
"cx16",
true);
320 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
321 setFeatureEnabledImpl(Features,
"xsave",
true);
322 setFeatureEnabledImpl(Features,
"movbe",
true);
323 setFeatureEnabledImpl(Features,
"sahf",
true);
330 setFeatureEnabledImpl(Features,
"3dnow",
true);
334 setFeatureEnabledImpl(Features,
"sse4a",
true);
335 setFeatureEnabledImpl(Features,
"lzcnt",
true);
336 setFeatureEnabledImpl(Features,
"popcnt",
true);
337 setFeatureEnabledImpl(Features,
"sahf",
true);
340 setFeatureEnabledImpl(Features,
"sse3",
true);
343 setFeatureEnabledImpl(Features,
"sse2",
true);
346 setFeatureEnabledImpl(Features,
"sse",
true);
347 setFeatureEnabledImpl(Features,
"fxsr",
true);
351 setFeatureEnabledImpl(Features,
"3dnowa",
true);
355 setFeatureEnabledImpl(Features,
"avx",
true);
356 setFeatureEnabledImpl(Features,
"aes",
true);
357 setFeatureEnabledImpl(Features,
"pclmul",
true);
358 setFeatureEnabledImpl(Features,
"bmi",
true);
359 setFeatureEnabledImpl(Features,
"f16c",
true);
360 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
361 setFeatureEnabledImpl(Features,
"movbe",
true);
364 setFeatureEnabledImpl(Features,
"ssse3",
true);
365 setFeatureEnabledImpl(Features,
"sse4a",
true);
366 setFeatureEnabledImpl(Features,
"lzcnt",
true);
367 setFeatureEnabledImpl(Features,
"popcnt",
true);
368 setFeatureEnabledImpl(Features,
"prfchw",
true);
369 setFeatureEnabledImpl(Features,
"cx16",
true);
370 setFeatureEnabledImpl(Features,
"fxsr",
true);
371 setFeatureEnabledImpl(Features,
"sahf",
true);
375 setFeatureEnabledImpl(Features,
"clwb",
true);
376 setFeatureEnabledImpl(Features,
"rdpid",
true);
377 setFeatureEnabledImpl(Features,
"wbnoinvd",
true);
380 setFeatureEnabledImpl(Features,
"adx",
true);
381 setFeatureEnabledImpl(Features,
"aes",
true);
382 setFeatureEnabledImpl(Features,
"avx2",
true);
383 setFeatureEnabledImpl(Features,
"bmi",
true);
384 setFeatureEnabledImpl(Features,
"bmi2",
true);
385 setFeatureEnabledImpl(Features,
"clflushopt",
true);
386 setFeatureEnabledImpl(Features,
"clzero",
true);
387 setFeatureEnabledImpl(Features,
"cx16",
true);
388 setFeatureEnabledImpl(Features,
"f16c",
true);
389 setFeatureEnabledImpl(Features,
"fma",
true);
390 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
391 setFeatureEnabledImpl(Features,
"fxsr",
true);
392 setFeatureEnabledImpl(Features,
"lzcnt",
true);
393 setFeatureEnabledImpl(Features,
"mwaitx",
true);
394 setFeatureEnabledImpl(Features,
"movbe",
true);
395 setFeatureEnabledImpl(Features,
"pclmul",
true);
396 setFeatureEnabledImpl(Features,
"popcnt",
true);
397 setFeatureEnabledImpl(Features,
"prfchw",
true);
398 setFeatureEnabledImpl(Features,
"rdrnd",
true);
399 setFeatureEnabledImpl(Features,
"rdseed",
true);
400 setFeatureEnabledImpl(Features,
"sahf",
true);
401 setFeatureEnabledImpl(Features,
"sha",
true);
402 setFeatureEnabledImpl(Features,
"sse4a",
true);
403 setFeatureEnabledImpl(Features,
"xsave",
true);
404 setFeatureEnabledImpl(Features,
"xsavec",
true);
405 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
406 setFeatureEnabledImpl(Features,
"xsaves",
true);
410 setFeatureEnabledImpl(Features,
"avx2",
true);
411 setFeatureEnabledImpl(Features,
"bmi2",
true);
412 setFeatureEnabledImpl(Features,
"mwaitx",
true);
415 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
416 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
419 setFeatureEnabledImpl(Features,
"bmi",
true);
420 setFeatureEnabledImpl(Features,
"fma",
true);
421 setFeatureEnabledImpl(Features,
"f16c",
true);
422 setFeatureEnabledImpl(Features,
"tbm",
true);
426 setFeatureEnabledImpl(Features,
"xop",
true);
427 setFeatureEnabledImpl(Features,
"lwp",
true);
428 setFeatureEnabledImpl(Features,
"lzcnt",
true);
429 setFeatureEnabledImpl(Features,
"aes",
true);
430 setFeatureEnabledImpl(Features,
"pclmul",
true);
431 setFeatureEnabledImpl(Features,
"prfchw",
true);
432 setFeatureEnabledImpl(Features,
"cx16",
true);
433 setFeatureEnabledImpl(Features,
"fxsr",
true);
434 setFeatureEnabledImpl(Features,
"xsave",
true);
435 setFeatureEnabledImpl(Features,
"sahf",
true);
445 auto I = Features.find(
"sse4.2");
446 if (I != Features.end() && I->getValue() &&
447 llvm::find(FeaturesVec,
"-popcnt") == FeaturesVec.end())
448 Features[
"popcnt"] =
true;
451 I = Features.find(
"3dnow");
452 if (I != Features.end() && I->getValue() &&
453 llvm::find(FeaturesVec,
"-prfchw") == FeaturesVec.end())
454 Features[
"prfchw"] =
true;
458 I = Features.find(
"sse");
459 if (I != Features.end() && I->getValue() &&
460 llvm::find(FeaturesVec,
"-mmx") == FeaturesVec.end())
461 Features[
"mmx"] =
true;
467 X86SSEEnum
Level,
bool Enabled) {
471 Features[
"avx512f"] =
true;
472 Features[
"fma"] =
true;
473 Features[
"f16c"] =
true;
476 Features[
"avx2"] =
true;
479 Features[
"avx"] =
true;
480 Features[
"xsave"] =
true;
483 Features[
"sse4.2"] =
true;
486 Features[
"sse4.1"] =
true;
489 Features[
"ssse3"] =
true;
492 Features[
"sse3"] =
true;
495 Features[
"sse2"] =
true;
498 Features[
"sse"] =
true;
509 Features[
"sse"] =
false;
512 Features[
"sse2"] = Features[
"pclmul"] = Features[
"aes"] =
false;
513 Features[
"sha"] = Features[
"gfni"] =
false;
516 Features[
"sse3"] =
false;
517 setXOPLevel(Features, NoXOP,
false);
520 Features[
"ssse3"] =
false;
523 Features[
"sse4.1"] =
false;
526 Features[
"sse4.2"] =
false;
529 Features[
"fma"] = Features[
"avx"] = Features[
"f16c"] =
false;
530 Features[
"xsave"] = Features[
"xsaveopt"] = Features[
"vaes"] =
false;
531 Features[
"vpclmulqdq"] =
false;
532 setXOPLevel(Features, FMA4,
false);
535 Features[
"avx2"] =
false;
538 Features[
"avx512f"] = Features[
"avx512cd"] = Features[
"avx512er"] =
false;
539 Features[
"avx512pf"] = Features[
"avx512dq"] = Features[
"avx512bw"] =
false;
540 Features[
"avx512vl"] = Features[
"avx512vbmi"] =
false;
541 Features[
"avx512ifma"] = Features[
"avx512vpopcntdq"] =
false;
542 Features[
"avx512bitalg"] = Features[
"avx512vnni"] =
false;
543 Features[
"avx512vbmi2"] = Features[
"avx512bf16"] =
false;
544 Features[
"avx512vp2intersect"] =
false;
550 MMX3DNowEnum
Level,
bool Enabled) {
554 Features[
"3dnowa"] =
true;
557 Features[
"3dnow"] =
true;
560 Features[
"mmx"] =
true;
571 Features[
"mmx"] =
false;
574 Features[
"3dnow"] =
false;
577 Features[
"3dnowa"] =
false;
587 Features[
"xop"] =
true;
590 Features[
"fma4"] =
true;
591 setSSELevel(Features, AVX,
true);
594 Features[
"sse4a"] =
true;
595 setSSELevel(Features, SSE3,
true);
606 Features[
"sse4a"] =
false;
609 Features[
"fma4"] =
false;
612 Features[
"xop"] =
false;
618 StringRef Name,
bool Enabled) {
623 Features[Name] = Enabled;
626 setMMXLevel(Features, MMX, Enabled);
627 }
else if (Name ==
"sse") {
628 setSSELevel(Features, SSE1, Enabled);
629 }
else if (Name ==
"sse2") {
630 setSSELevel(Features, SSE2, Enabled);
631 }
else if (Name ==
"sse3") {
632 setSSELevel(Features, SSE3, Enabled);
633 }
else if (Name ==
"ssse3") {
634 setSSELevel(Features, SSSE3, Enabled);
635 }
else if (Name ==
"sse4.2") {
636 setSSELevel(Features, SSE42, Enabled);
637 }
else if (Name ==
"sse4.1") {
638 setSSELevel(Features, SSE41, Enabled);
639 }
else if (Name ==
"3dnow") {
640 setMMXLevel(Features, AMD3DNow, Enabled);
641 }
else if (Name ==
"3dnowa") {
642 setMMXLevel(Features, AMD3DNowAthlon, Enabled);
643 }
else if (Name ==
"aes") {
645 setSSELevel(Features, SSE2, Enabled);
647 Features[
"vaes"] =
false;
648 }
else if (Name ==
"vaes") {
650 setSSELevel(Features, AVX, Enabled);
651 Features[
"aes"] =
true;
653 }
else if (Name ==
"pclmul") {
655 setSSELevel(Features, SSE2, Enabled);
657 Features[
"vpclmulqdq"] =
false;
658 }
else if (Name ==
"vpclmulqdq") {
660 setSSELevel(Features, AVX, Enabled);
661 Features[
"pclmul"] =
true;
663 }
else if (Name ==
"gfni") {
665 setSSELevel(Features, SSE2, Enabled);
666 }
else if (Name ==
"avx") {
667 setSSELevel(Features, AVX, Enabled);
668 }
else if (Name ==
"avx2") {
669 setSSELevel(Features, AVX2, Enabled);
670 }
else if (Name ==
"avx512f") {
671 setSSELevel(Features, AVX512F, Enabled);
672 }
else if (Name.startswith(
"avx512")) {
674 setSSELevel(Features, AVX512F, Enabled);
676 if ((Name ==
"avx512vbmi" || Name ==
"avx512vbmi2" ||
677 Name ==
"avx512bitalg" || Name ==
"avx512bf16") && Enabled)
678 Features[
"avx512bw"] =
true;
680 if (Name ==
"avx512bw" && !Enabled) {
681 Features[
"avx512vbmi"] =
false;
682 Features[
"avx512vbmi2"] =
false;
683 Features[
"avx512bitalg"] =
false;
684 Features[
"avx512bf16"] =
false;
686 }
else if (Name ==
"fma") {
688 setSSELevel(Features, AVX, Enabled);
690 setSSELevel(Features, AVX512F, Enabled);
691 }
else if (Name ==
"fma4") {
692 setXOPLevel(Features, FMA4, Enabled);
693 }
else if (Name ==
"xop") {
694 setXOPLevel(Features, XOP, Enabled);
695 }
else if (Name ==
"sse4a") {
696 setXOPLevel(Features, SSE4A, Enabled);
697 }
else if (Name ==
"f16c") {
699 setSSELevel(Features, AVX, Enabled);
701 setSSELevel(Features, AVX512F, Enabled);
702 }
else if (Name ==
"sha") {
704 setSSELevel(Features, SSE2, Enabled);
705 }
else if (Name ==
"sse4") {
711 setSSELevel(Features, SSE42, Enabled);
713 setSSELevel(Features, SSE41, Enabled);
714 }
else if (Name ==
"xsave") {
716 Features[
"xsaveopt"] =
false;
717 }
else if (Name ==
"xsaveopt" || Name ==
"xsavec" || Name ==
"xsaves") {
719 Features[
"xsave"] =
true;
727 for (
const auto &Feature : Features) {
728 if (Feature[0] !=
'+')
731 if (Feature ==
"+aes") {
733 }
else if (Feature ==
"+vaes") {
735 }
else if (Feature ==
"+pclmul") {
737 }
else if (Feature ==
"+vpclmulqdq") {
738 HasVPCLMULQDQ =
true;
739 }
else if (Feature ==
"+lzcnt") {
741 }
else if (Feature ==
"+rdrnd") {
743 }
else if (Feature ==
"+fsgsbase") {
745 }
else if (Feature ==
"+bmi") {
747 }
else if (Feature ==
"+bmi2") {
749 }
else if (Feature ==
"+popcnt") {
751 }
else if (Feature ==
"+rtm") {
753 }
else if (Feature ==
"+prfchw") {
755 }
else if (Feature ==
"+rdseed") {
757 }
else if (Feature ==
"+adx") {
759 }
else if (Feature ==
"+tbm") {
761 }
else if (Feature ==
"+lwp") {
763 }
else if (Feature ==
"+fma") {
765 }
else if (Feature ==
"+f16c") {
767 }
else if (Feature ==
"+gfni") {
769 }
else if (Feature ==
"+avx512cd") {
771 }
else if (Feature ==
"+avx512vpopcntdq") {
772 HasAVX512VPOPCNTDQ =
true;
773 }
else if (Feature ==
"+avx512vnni") {
774 HasAVX512VNNI =
true;
775 }
else if (Feature ==
"+avx512bf16") {
776 HasAVX512BF16 =
true;
777 }
else if (Feature ==
"+avx512er") {
779 }
else if (Feature ==
"+avx512pf") {
781 }
else if (Feature ==
"+avx512dq") {
783 }
else if (Feature ==
"+avx512bitalg") {
784 HasAVX512BITALG =
true;
785 }
else if (Feature ==
"+avx512bw") {
787 }
else if (Feature ==
"+avx512vl") {
789 }
else if (Feature ==
"+avx512vbmi") {
790 HasAVX512VBMI =
true;
791 }
else if (Feature ==
"+avx512vbmi2") {
792 HasAVX512VBMI2 =
true;
793 }
else if (Feature ==
"+avx512ifma") {
794 HasAVX512IFMA =
true;
795 }
else if (Feature ==
"+avx512vp2intersect") {
796 HasAVX512VP2INTERSECT =
true;
797 }
else if (Feature ==
"+sha") {
799 }
else if (Feature ==
"+shstk") {
801 }
else if (Feature ==
"+movbe") {
803 }
else if (Feature ==
"+sgx") {
805 }
else if (Feature ==
"+cx8") {
807 }
else if (Feature ==
"+cx16") {
809 }
else if (Feature ==
"+fxsr") {
811 }
else if (Feature ==
"+xsave") {
813 }
else if (Feature ==
"+xsaveopt") {
815 }
else if (Feature ==
"+xsavec") {
817 }
else if (Feature ==
"+xsaves") {
819 }
else if (Feature ==
"+mwaitx") {
821 }
else if (Feature ==
"+pku") {
823 }
else if (Feature ==
"+clflushopt") {
824 HasCLFLUSHOPT =
true;
825 }
else if (Feature ==
"+clwb") {
827 }
else if (Feature ==
"+wbnoinvd") {
829 }
else if (Feature ==
"+prefetchwt1") {
830 HasPREFETCHWT1 =
true;
831 }
else if (Feature ==
"+clzero") {
833 }
else if (Feature ==
"+cldemote") {
835 }
else if (Feature ==
"+rdpid") {
837 }
else if (Feature ==
"+retpoline-external-thunk") {
838 HasRetpolineExternalThunk =
true;
839 }
else if (Feature ==
"+sahf") {
841 }
else if (Feature ==
"+waitpkg") {
843 }
else if (Feature ==
"+movdiri") {
845 }
else if (Feature ==
"+movdir64b") {
847 }
else if (Feature ==
"+pconfig") {
849 }
else if (Feature ==
"+ptwrite") {
851 }
else if (Feature ==
"+invpcid") {
853 }
else if (Feature ==
"+enqcmd") {
857 X86SSEEnum
Level = llvm::StringSwitch<X86SSEEnum>(Feature)
858 .Case(
"+avx512f", AVX512F)
861 .Case(
"+sse4.2", SSE42)
862 .Case(
"+sse4.1", SSE41)
863 .Case(
"+ssse3", SSSE3)
868 SSELevel =
std::max(SSELevel, Level);
870 MMX3DNowEnum ThreeDNowLevel = llvm::StringSwitch<MMX3DNowEnum>(Feature)
871 .Case(
"+3dnowa", AMD3DNowAthlon)
872 .Case(
"+3dnow", AMD3DNow)
874 .Default(NoMMX3DNow);
875 MMX3DNowLevel =
std::max(MMX3DNowLevel, ThreeDNowLevel);
877 XOPEnum XLevel = llvm::StringSwitch<XOPEnum>(Feature)
880 .Case(
"+sse4a", SSE4A)
882 XOPLevel =
std::max(XOPLevel, XLevel);
887 if ((FPMath == FP_SSE && SSELevel < SSE1) ||
888 (FPMath == FP_387 && SSELevel >= SSE1)) {
889 Diags.
Report(diag::err_target_unsupported_fpmath)
890 << (FPMath == FP_SSE ?
"sse" :
"387");
906 std::string CodeModel = getTargetOpts().CodeModel;
907 if (CodeModel ==
"default")
909 Builder.
defineMacro(
"__code_model_" + CodeModel +
"_");
912 if (getTriple().getArch() == llvm::Triple::x86_64) {
917 if (getTriple().getArchName() ==
"x86_64h") {
927 Builder.
defineMacro(
"__seg_gs",
"__attribute__((address_space(256)))");
928 Builder.
defineMacro(
"__seg_fs",
"__attribute__((address_space(257)))");
989 case CK_GoldmontPlus:
1001 case CK_SkylakeClient:
1002 case CK_SkylakeServer:
1003 case CK_Cascadelake:
1006 case CK_IcelakeClient:
1007 case CK_IcelakeServer:
1029 if (CPU != CK_K6_2) {
1043 if (SSELevel != NoSSE) {
1172 if (HasAVX512VPOPCNTDQ)
1184 if (HasAVX512BITALG)
1196 if (HasAVX512VP2INTERSECT)
1281 if (Opts.MicrosoftExt && getTriple().getArch() == llvm::Triple::x86) {
1303 switch (MMX3DNowLevel) {
1304 case AMD3DNowAthlon:
1317 if (CPU >= CK_i486 || CPU == CK_Generic) {
1318 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
1319 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
1320 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
1323 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
1324 if (HasCX16 && getTriple().getArch() == llvm::Triple::x86_64)
1325 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
1332 return llvm::StringSwitch<bool>(Name)
1333 .Case(
"3dnow",
true)
1334 .Case(
"3dnowa",
true)
1339 .Case(
"avx512f",
true)
1340 .Case(
"avx512cd",
true)
1341 .Case(
"avx512vpopcntdq",
true)
1342 .Case(
"avx512vnni",
true)
1343 .Case(
"avx512bf16",
true)
1344 .Case(
"avx512er",
true)
1345 .Case(
"avx512pf",
true)
1346 .Case(
"avx512dq",
true)
1347 .Case(
"avx512bitalg",
true)
1348 .Case(
"avx512bw",
true)
1349 .Case(
"avx512vl",
true)
1350 .Case(
"avx512vbmi",
true)
1351 .Case(
"avx512vbmi2",
true)
1352 .Case(
"avx512ifma",
true)
1353 .Case(
"avx512vp2intersect",
true)
1356 .Case(
"cldemote",
true)
1357 .Case(
"clflushopt",
true)
1359 .Case(
"clzero",
true)
1361 .Case(
"enqcmd",
true)
1365 .Case(
"fsgsbase",
true)
1368 .Case(
"invpcid",
true)
1370 .Case(
"lzcnt",
true)
1372 .Case(
"movbe",
true)
1373 .Case(
"movdiri",
true)
1374 .Case(
"movdir64b",
true)
1375 .Case(
"mwaitx",
true)
1376 .Case(
"pclmul",
true)
1377 .Case(
"pconfig",
true)
1379 .Case(
"popcnt",
true)
1380 .Case(
"prefetchwt1",
true)
1381 .Case(
"prfchw",
true)
1382 .Case(
"ptwrite",
true)
1383 .Case(
"rdpid",
true)
1384 .Case(
"rdrnd",
true)
1385 .Case(
"rdseed",
true)
1390 .Case(
"shstk",
true)
1394 .Case(
"ssse3",
true)
1396 .Case(
"sse4.1",
true)
1397 .Case(
"sse4.2",
true)
1398 .Case(
"sse4a",
true)
1401 .Case(
"vpclmulqdq",
true)
1402 .Case(
"wbnoinvd",
true)
1403 .Case(
"waitpkg",
true)
1406 .Case(
"xsave",
true)
1407 .Case(
"xsavec",
true)
1408 .Case(
"xsaves",
true)
1409 .Case(
"xsaveopt",
true)
1414 return llvm::StringSwitch<bool>(Feature)
1415 .Case(
"adx", HasADX)
1416 .Case(
"aes", HasAES)
1417 .Case(
"avx", SSELevel >= AVX)
1418 .Case(
"avx2", SSELevel >= AVX2)
1419 .Case(
"avx512f", SSELevel >= AVX512F)
1420 .Case(
"avx512cd", HasAVX512CD)
1421 .Case(
"avx512vpopcntdq", HasAVX512VPOPCNTDQ)
1422 .Case(
"avx512vnni", HasAVX512VNNI)
1423 .Case(
"avx512bf16", HasAVX512BF16)
1424 .Case(
"avx512er", HasAVX512ER)
1425 .Case(
"avx512pf", HasAVX512PF)
1426 .Case(
"avx512dq", HasAVX512DQ)
1427 .Case(
"avx512bitalg", HasAVX512BITALG)
1428 .Case(
"avx512bw", HasAVX512BW)
1429 .Case(
"avx512vl", HasAVX512VL)
1430 .Case(
"avx512vbmi", HasAVX512VBMI)
1431 .Case(
"avx512vbmi2", HasAVX512VBMI2)
1432 .Case(
"avx512ifma", HasAVX512IFMA)
1433 .Case(
"avx512vp2intersect", HasAVX512VP2INTERSECT)
1434 .Case(
"bmi", HasBMI)
1435 .Case(
"bmi2", HasBMI2)
1436 .Case(
"cldemote", HasCLDEMOTE)
1437 .Case(
"clflushopt", HasCLFLUSHOPT)
1438 .Case(
"clwb", HasCLWB)
1439 .Case(
"clzero", HasCLZERO)
1440 .Case(
"cx8", HasCX8)
1441 .Case(
"cx16", HasCX16)
1442 .Case(
"enqcmd", HasENQCMD)
1443 .Case(
"f16c", HasF16C)
1444 .Case(
"fma", HasFMA)
1445 .Case(
"fma4", XOPLevel >= FMA4)
1446 .Case(
"fsgsbase", HasFSGSBASE)
1447 .Case(
"fxsr", HasFXSR)
1448 .Case(
"gfni", HasGFNI)
1449 .Case(
"invpcid", HasINVPCID)
1450 .Case(
"lwp", HasLWP)
1451 .Case(
"lzcnt", HasLZCNT)
1452 .Case(
"mm3dnow", MMX3DNowLevel >= AMD3DNow)
1453 .Case(
"mm3dnowa", MMX3DNowLevel >= AMD3DNowAthlon)
1454 .Case(
"mmx", MMX3DNowLevel >= MMX)
1455 .Case(
"movbe", HasMOVBE)
1456 .Case(
"movdiri", HasMOVDIRI)
1457 .Case(
"movdir64b", HasMOVDIR64B)
1458 .Case(
"mwaitx", HasMWAITX)
1459 .Case(
"pclmul", HasPCLMUL)
1460 .Case(
"pconfig", HasPCONFIG)
1461 .Case(
"pku", HasPKU)
1462 .Case(
"popcnt", HasPOPCNT)
1463 .Case(
"prefetchwt1", HasPREFETCHWT1)
1464 .Case(
"prfchw", HasPRFCHW)
1465 .Case(
"ptwrite", HasPTWRITE)
1466 .Case(
"rdpid", HasRDPID)
1467 .Case(
"rdrnd", HasRDRND)
1468 .Case(
"rdseed", HasRDSEED)
1469 .Case(
"retpoline-external-thunk", HasRetpolineExternalThunk)
1470 .Case(
"rtm", HasRTM)
1471 .Case(
"sahf", HasLAHFSAHF)
1472 .Case(
"sgx", HasSGX)
1473 .Case(
"sha", HasSHA)
1474 .Case(
"shstk", HasSHSTK)
1475 .Case(
"sse", SSELevel >= SSE1)
1476 .Case(
"sse2", SSELevel >= SSE2)
1477 .Case(
"sse3", SSELevel >= SSE3)
1478 .Case(
"ssse3", SSELevel >= SSSE3)
1479 .Case(
"sse4.1", SSELevel >= SSE41)
1480 .Case(
"sse4.2", SSELevel >= SSE42)
1481 .Case(
"sse4a", XOPLevel >= SSE4A)
1482 .Case(
"tbm", HasTBM)
1483 .Case(
"vaes", HasVAES)
1484 .Case(
"vpclmulqdq", HasVPCLMULQDQ)
1485 .Case(
"wbnoinvd", HasWBNOINVD)
1486 .Case(
"waitpkg", HasWAITPKG)
1488 .Case(
"x86_32", getTriple().getArch() == llvm::Triple::x86)
1489 .Case(
"x86_64", getTriple().getArch() == llvm::Triple::x86_64)
1490 .Case(
"xop", XOPLevel >= XOP)
1491 .Case(
"xsave", HasXSAVE)
1492 .Case(
"xsavec", HasXSAVEC)
1493 .Case(
"xsaves", HasXSAVES)
1494 .Case(
"xsaveopt", HasXSAVEOPT)
1504 return llvm::StringSwitch<bool>(FeatureStr)
1506 #include "llvm/Support/X86TargetParser.def" 1511 return llvm::StringSwitch<llvm::X86::ProcessorFeatures>(Name)
1513 #include "llvm/Support/X86TargetParser.def" 1520 enum class FeatPriority {
1521 #define FEATURE(FEAT) FEAT, 1522 #include "clang/Basic/X86Target.def" 1525 #define FEATURE(FEAT) \ 1526 case llvm::X86::FEAT: \ 1527 return static_cast<unsigned>(FeatPriority::FEAT); 1528 #include "clang/Basic/X86Target.def" 1530 llvm_unreachable(
"No Feature Priority for non-CPUSupports Features");
1538 if (Kind != CK_Generic) {
1542 "CPU Type without a key feature used in 'target' attribute");
1543 #define PROC_WITH_FEAT(ENUM, STR, IS64, KEY_FEAT) \ 1545 return (getFeaturePriority(llvm::X86::KEY_FEAT) << 1) + 1; 1546 #include "clang/Basic/X86Target.def" 1556 return llvm::StringSwitch<bool>(Name)
1557 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME,
true)
1558 #define CPU_SPECIFIC_ALIAS(NEW_NAME, NAME) .Case(NEW_NAME, true) 1559 #include "clang/Basic/X86Target.def" 1564 return llvm::StringSwitch<StringRef>(Name)
1566 #include "clang/Basic/X86Target.def" 1572 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME, MANGLING)
1573 #include "clang/Basic/X86Target.def" 1579 StringRef WholeList =
1581 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME, FEATURES)
1582 #include "clang/Basic/X86Target.def" 1584 WholeList.split(Features,
',', -1,
false);
1592 return llvm::StringSwitch<bool>(FeatureStr)
1593 #define
X86_VENDOR(ENUM, STRING) .Case(STRING,
true)
1594 #define X86_CPU_TYPE_COMPAT_WITH_ALIAS(ARCHNAME, ENUM, STR, ALIAS) \ 1595 .Cases(STR, ALIAS, true) 1596 #define X86_CPU_TYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true) 1597 #define X86_CPU_SUBTYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true) 1598 #include "llvm/Support/X86TargetParser.def" 1603 auto RV = llvm::StringSwitch<unsigned>(Name)
1730 unsigned Size)
const {
1732 while (Constraint[0] ==
'=' || Constraint[0] ==
'+' || Constraint[0] ==
'&')
1733 Constraint = Constraint.substr(1);
1735 return validateOperandSize(Constraint, Size);
1739 unsigned Size)
const {
1740 return validateOperandSize(Constraint, Size);
1744 unsigned Size)
const {
1745 switch (Constraint[0]) {
1758 switch (Constraint[1]) {
1768 if (SSELevel >= SSE1)
1769 return Size <= 128U;
1775 if (SSELevel < SSE2)
1782 if (SSELevel >= AVX512F)
1784 return Size <= 512U;
1785 else if (SSELevel >= AVX)
1787 return Size <= 256U;
1788 return Size <= 128U;
1796 switch (*Constraint) {
1799 std::string Converted =
"{" + std::string(Constraint, Len) +
"}";
1800 Constraint += Len - 1;
1803 return std::string(1, *Constraint);
1805 return std::string(
"{ax}");
1807 return std::string(
"{bx}");
1809 return std::string(
"{cx}");
1811 return std::string(
"{dx}");
1813 return std::string(
"{si}");
1815 return std::string(
"{di}");
1817 return std::string(
"im");
1819 return std::string(
"{st}");
1821 return std::string(
"{st(1)}");
1823 switch (Constraint[1]) {
1839 return std::string(
"^") + std::string(Constraint++, 2);
1843 return std::string(1, *Constraint);
1854 #define PROC(ENUM, STRING, IS64BIT) \ 1856 return IS64BIT || getTriple().getArch() == llvm::Triple::x86; 1857 #include "clang/Basic/X86Target.def" 1859 llvm_unreachable(
"Unhandled CPU kind");
1863 #define PROC(ENUM, STRING, IS64BIT) \ 1864 if (IS64BIT || getTriple().getArch() == llvm::Triple::x86) \ 1865 Values.emplace_back(STRING); 1867 #define PROC_ALIAS(ENUM, ALIAS) \ 1868 if (checkCPUKind(CK_##ENUM)) \ 1869 Values.emplace_back(ALIAS); 1870 #include "clang/Basic/X86Target.def" 1874 return llvm::StringSwitch<CPUKind>(CPU)
1875 #define
PROC(ENUM, STRING, IS64BIT) .Case(STRING, CK_##ENUM)
1876 #define PROC_ALIAS(ENUM, ALIAS) .Case(ALIAS, CK_##ENUM) 1877 #include "clang/Basic/X86Target.def" 1878 .Default(CK_Generic);
void DefineStd(MacroBuilder &Builder, StringRef MacroName, const LangOptions &Opts)
DefineStd - Define a macro name and standard variants.
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 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)
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
bool validateOutputSize(StringRef Constraint, unsigned Size) const override
ArrayRef< TargetInfo::AddlRegName > getGCCAddlRegNames() const override
void setRequiresImmediate(int Min, int Max)
virtual bool validateOperandSize(StringRef Constraint, unsigned Size) const
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 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...
bool validateInputSize(StringRef Constraint, unsigned Size) 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...
#define PROC(ENUM, STRING, IS64BIT)
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 ...