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);
160 case CK_IcelakeServer:
161 setFeatureEnabledImpl(Features,
"pconfig",
true);
162 setFeatureEnabledImpl(Features,
"wbnoinvd",
true);
164 case CK_IcelakeClient:
165 setFeatureEnabledImpl(Features,
"vaes",
true);
166 setFeatureEnabledImpl(Features,
"gfni",
true);
167 setFeatureEnabledImpl(Features,
"vpclmulqdq",
true);
168 setFeatureEnabledImpl(Features,
"avx512bitalg",
true);
169 setFeatureEnabledImpl(Features,
"avx512vbmi2",
true);
170 setFeatureEnabledImpl(Features,
"avx512vnni",
true);
171 setFeatureEnabledImpl(Features,
"avx512vpopcntdq",
true);
172 setFeatureEnabledImpl(Features,
"rdpid",
true);
173 setFeatureEnabledImpl(Features,
"clwb",
true);
176 setFeatureEnabledImpl(Features,
"avx512f",
true);
177 setFeatureEnabledImpl(Features,
"avx512cd",
true);
178 setFeatureEnabledImpl(Features,
"avx512dq",
true);
179 setFeatureEnabledImpl(Features,
"avx512bw",
true);
180 setFeatureEnabledImpl(Features,
"avx512vl",
true);
181 setFeatureEnabledImpl(Features,
"avx512ifma",
true);
182 setFeatureEnabledImpl(Features,
"avx512vbmi",
true);
183 setFeatureEnabledImpl(Features,
"pku",
true);
184 setFeatureEnabledImpl(Features,
"sha",
true);
186 case CK_SkylakeClient:
187 setFeatureEnabledImpl(Features,
"sgx",
true);
190 setFeatureEnabledImpl(Features,
"xsavec",
true);
191 setFeatureEnabledImpl(Features,
"xsaves",
true);
192 setFeatureEnabledImpl(Features,
"mpx",
true);
193 setFeatureEnabledImpl(Features,
"clflushopt",
true);
194 setFeatureEnabledImpl(Features,
"aes",
true);
197 setFeatureEnabledImpl(Features,
"rdseed",
true);
198 setFeatureEnabledImpl(Features,
"adx",
true);
199 setFeatureEnabledImpl(Features,
"prfchw",
true);
202 setFeatureEnabledImpl(Features,
"avx2",
true);
203 setFeatureEnabledImpl(Features,
"lzcnt",
true);
204 setFeatureEnabledImpl(Features,
"bmi",
true);
205 setFeatureEnabledImpl(Features,
"bmi2",
true);
206 setFeatureEnabledImpl(Features,
"fma",
true);
207 setFeatureEnabledImpl(Features,
"invpcid",
true);
208 setFeatureEnabledImpl(Features,
"movbe",
true);
211 setFeatureEnabledImpl(Features,
"rdrnd",
true);
212 setFeatureEnabledImpl(Features,
"f16c",
true);
213 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
216 setFeatureEnabledImpl(Features,
"avx",
true);
217 setFeatureEnabledImpl(Features,
"xsave",
true);
218 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
221 setFeatureEnabledImpl(Features,
"pclmul",
true);
224 setFeatureEnabledImpl(Features,
"sse4.2",
true);
227 setFeatureEnabledImpl(Features,
"sse4.1",
true);
230 setFeatureEnabledImpl(Features,
"ssse3",
true);
231 setFeatureEnabledImpl(Features,
"sahf",
true);
234 setFeatureEnabledImpl(Features,
"cx16",
true);
238 setFeatureEnabledImpl(Features,
"sse3",
true);
243 setFeatureEnabledImpl(Features,
"sse2",
true);
247 setFeatureEnabledImpl(Features,
"sse",
true);
248 setFeatureEnabledImpl(Features,
"fxsr",
true);
252 setFeatureEnabledImpl(Features,
"cldemote",
true);
253 setFeatureEnabledImpl(Features,
"movdiri",
true);
254 setFeatureEnabledImpl(Features,
"movdir64b",
true);
255 setFeatureEnabledImpl(Features,
"gfni",
true);
256 setFeatureEnabledImpl(Features,
"waitpkg",
true);
258 case CK_GoldmontPlus:
259 setFeatureEnabledImpl(Features,
"ptwrite",
true);
260 setFeatureEnabledImpl(Features,
"rdpid",
true);
261 setFeatureEnabledImpl(Features,
"sgx",
true);
264 setFeatureEnabledImpl(Features,
"sha",
true);
265 setFeatureEnabledImpl(Features,
"rdseed",
true);
266 setFeatureEnabledImpl(Features,
"xsave",
true);
267 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
268 setFeatureEnabledImpl(Features,
"xsavec",
true);
269 setFeatureEnabledImpl(Features,
"xsaves",
true);
270 setFeatureEnabledImpl(Features,
"clflushopt",
true);
271 setFeatureEnabledImpl(Features,
"mpx",
true);
272 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
273 setFeatureEnabledImpl(Features,
"aes",
true);
276 setFeatureEnabledImpl(Features,
"rdrnd",
true);
277 setFeatureEnabledImpl(Features,
"pclmul",
true);
278 setFeatureEnabledImpl(Features,
"sse4.2",
true);
279 setFeatureEnabledImpl(Features,
"prfchw",
true);
282 setFeatureEnabledImpl(Features,
"movbe",
true);
283 setFeatureEnabledImpl(Features,
"ssse3",
true);
284 setFeatureEnabledImpl(Features,
"fxsr",
true);
285 setFeatureEnabledImpl(Features,
"cx16",
true);
286 setFeatureEnabledImpl(Features,
"sahf",
true);
291 setFeatureEnabledImpl(Features,
"avx512vpopcntdq",
true);
294 setFeatureEnabledImpl(Features,
"avx512f",
true);
295 setFeatureEnabledImpl(Features,
"avx512cd",
true);
296 setFeatureEnabledImpl(Features,
"avx512er",
true);
297 setFeatureEnabledImpl(Features,
"avx512pf",
true);
298 setFeatureEnabledImpl(Features,
"prfchw",
true);
299 setFeatureEnabledImpl(Features,
"prefetchwt1",
true);
300 setFeatureEnabledImpl(Features,
"fxsr",
true);
301 setFeatureEnabledImpl(Features,
"rdseed",
true);
302 setFeatureEnabledImpl(Features,
"adx",
true);
303 setFeatureEnabledImpl(Features,
"lzcnt",
true);
304 setFeatureEnabledImpl(Features,
"bmi",
true);
305 setFeatureEnabledImpl(Features,
"bmi2",
true);
306 setFeatureEnabledImpl(Features,
"fma",
true);
307 setFeatureEnabledImpl(Features,
"rdrnd",
true);
308 setFeatureEnabledImpl(Features,
"f16c",
true);
309 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
310 setFeatureEnabledImpl(Features,
"aes",
true);
311 setFeatureEnabledImpl(Features,
"pclmul",
true);
312 setFeatureEnabledImpl(Features,
"cx16",
true);
313 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
314 setFeatureEnabledImpl(Features,
"xsave",
true);
315 setFeatureEnabledImpl(Features,
"movbe",
true);
316 setFeatureEnabledImpl(Features,
"sahf",
true);
323 setFeatureEnabledImpl(Features,
"3dnow",
true);
327 setFeatureEnabledImpl(Features,
"sse4a",
true);
328 setFeatureEnabledImpl(Features,
"lzcnt",
true);
329 setFeatureEnabledImpl(Features,
"popcnt",
true);
330 setFeatureEnabledImpl(Features,
"sahf",
true);
333 setFeatureEnabledImpl(Features,
"sse3",
true);
336 setFeatureEnabledImpl(Features,
"sse2",
true);
339 setFeatureEnabledImpl(Features,
"sse",
true);
340 setFeatureEnabledImpl(Features,
"fxsr",
true);
344 setFeatureEnabledImpl(Features,
"3dnowa",
true);
348 setFeatureEnabledImpl(Features,
"avx",
true);
349 setFeatureEnabledImpl(Features,
"aes",
true);
350 setFeatureEnabledImpl(Features,
"pclmul",
true);
351 setFeatureEnabledImpl(Features,
"bmi",
true);
352 setFeatureEnabledImpl(Features,
"f16c",
true);
353 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
354 setFeatureEnabledImpl(Features,
"movbe",
true);
357 setFeatureEnabledImpl(Features,
"ssse3",
true);
358 setFeatureEnabledImpl(Features,
"sse4a",
true);
359 setFeatureEnabledImpl(Features,
"lzcnt",
true);
360 setFeatureEnabledImpl(Features,
"popcnt",
true);
361 setFeatureEnabledImpl(Features,
"prfchw",
true);
362 setFeatureEnabledImpl(Features,
"cx16",
true);
363 setFeatureEnabledImpl(Features,
"fxsr",
true);
364 setFeatureEnabledImpl(Features,
"sahf",
true);
368 setFeatureEnabledImpl(Features,
"clwb",
true);
369 setFeatureEnabledImpl(Features,
"rdpid",
true);
370 setFeatureEnabledImpl(Features,
"wbnoinvd",
true);
373 setFeatureEnabledImpl(Features,
"adx",
true);
374 setFeatureEnabledImpl(Features,
"aes",
true);
375 setFeatureEnabledImpl(Features,
"avx2",
true);
376 setFeatureEnabledImpl(Features,
"bmi",
true);
377 setFeatureEnabledImpl(Features,
"bmi2",
true);
378 setFeatureEnabledImpl(Features,
"clflushopt",
true);
379 setFeatureEnabledImpl(Features,
"clzero",
true);
380 setFeatureEnabledImpl(Features,
"cx16",
true);
381 setFeatureEnabledImpl(Features,
"f16c",
true);
382 setFeatureEnabledImpl(Features,
"fma",
true);
383 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
384 setFeatureEnabledImpl(Features,
"fxsr",
true);
385 setFeatureEnabledImpl(Features,
"lzcnt",
true);
386 setFeatureEnabledImpl(Features,
"mwaitx",
true);
387 setFeatureEnabledImpl(Features,
"movbe",
true);
388 setFeatureEnabledImpl(Features,
"pclmul",
true);
389 setFeatureEnabledImpl(Features,
"popcnt",
true);
390 setFeatureEnabledImpl(Features,
"prfchw",
true);
391 setFeatureEnabledImpl(Features,
"rdrnd",
true);
392 setFeatureEnabledImpl(Features,
"rdseed",
true);
393 setFeatureEnabledImpl(Features,
"sahf",
true);
394 setFeatureEnabledImpl(Features,
"sha",
true);
395 setFeatureEnabledImpl(Features,
"sse4a",
true);
396 setFeatureEnabledImpl(Features,
"xsave",
true);
397 setFeatureEnabledImpl(Features,
"xsavec",
true);
398 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
399 setFeatureEnabledImpl(Features,
"xsaves",
true);
403 setFeatureEnabledImpl(Features,
"avx2",
true);
404 setFeatureEnabledImpl(Features,
"bmi2",
true);
405 setFeatureEnabledImpl(Features,
"mwaitx",
true);
408 setFeatureEnabledImpl(Features,
"fsgsbase",
true);
409 setFeatureEnabledImpl(Features,
"xsaveopt",
true);
412 setFeatureEnabledImpl(Features,
"bmi",
true);
413 setFeatureEnabledImpl(Features,
"fma",
true);
414 setFeatureEnabledImpl(Features,
"f16c",
true);
415 setFeatureEnabledImpl(Features,
"tbm",
true);
419 setFeatureEnabledImpl(Features,
"xop",
true);
420 setFeatureEnabledImpl(Features,
"lwp",
true);
421 setFeatureEnabledImpl(Features,
"lzcnt",
true);
422 setFeatureEnabledImpl(Features,
"aes",
true);
423 setFeatureEnabledImpl(Features,
"pclmul",
true);
424 setFeatureEnabledImpl(Features,
"prfchw",
true);
425 setFeatureEnabledImpl(Features,
"cx16",
true);
426 setFeatureEnabledImpl(Features,
"fxsr",
true);
427 setFeatureEnabledImpl(Features,
"xsave",
true);
428 setFeatureEnabledImpl(Features,
"sahf",
true);
438 auto I = Features.find(
"sse4.2");
439 if (I != Features.end() && I->getValue() &&
440 llvm::find(FeaturesVec,
"-popcnt") == FeaturesVec.end())
441 Features[
"popcnt"] =
true;
444 I = Features.find(
"3dnow");
445 if (I != Features.end() && I->getValue() &&
446 llvm::find(FeaturesVec,
"-prfchw") == FeaturesVec.end())
447 Features[
"prfchw"] =
true;
451 I = Features.find(
"sse");
452 if (I != Features.end() && I->getValue() &&
453 llvm::find(FeaturesVec,
"-mmx") == FeaturesVec.end())
454 Features[
"mmx"] =
true;
460 X86SSEEnum
Level,
bool Enabled) {
464 Features[
"avx512f"] =
true;
465 Features[
"fma"] =
true;
466 Features[
"f16c"] =
true;
469 Features[
"avx2"] =
true;
472 Features[
"avx"] =
true;
473 Features[
"xsave"] =
true;
476 Features[
"sse4.2"] =
true;
479 Features[
"sse4.1"] =
true;
482 Features[
"ssse3"] =
true;
485 Features[
"sse3"] =
true;
488 Features[
"sse2"] =
true;
491 Features[
"sse"] =
true;
502 Features[
"sse"] =
false;
505 Features[
"sse2"] = Features[
"pclmul"] = Features[
"aes"] =
false;
506 Features[
"sha"] = Features[
"gfni"] =
false;
509 Features[
"sse3"] =
false;
510 setXOPLevel(Features, NoXOP,
false);
513 Features[
"ssse3"] =
false;
516 Features[
"sse4.1"] =
false;
519 Features[
"sse4.2"] =
false;
522 Features[
"fma"] = Features[
"avx"] = Features[
"f16c"] =
false;
523 Features[
"xsave"] = Features[
"xsaveopt"] = Features[
"vaes"] =
false;
524 Features[
"vpclmulqdq"] =
false;
525 setXOPLevel(Features, FMA4,
false);
528 Features[
"avx2"] =
false;
531 Features[
"avx512f"] = Features[
"avx512cd"] = Features[
"avx512er"] =
false;
532 Features[
"avx512pf"] = Features[
"avx512dq"] = Features[
"avx512bw"] =
false;
533 Features[
"avx512vl"] = Features[
"avx512vbmi"] =
false;
534 Features[
"avx512ifma"] = Features[
"avx512vpopcntdq"] =
false;
535 Features[
"avx512bitalg"] = Features[
"avx512vnni"] =
false;
536 Features[
"avx512vbmi2"] = Features[
"avx512bf16"] =
false;
537 Features[
"avx512vp2intersect"] =
false;
543 MMX3DNowEnum
Level,
bool Enabled) {
547 Features[
"3dnowa"] =
true;
550 Features[
"3dnow"] =
true;
553 Features[
"mmx"] =
true;
564 Features[
"mmx"] =
false;
567 Features[
"3dnow"] =
false;
570 Features[
"3dnowa"] =
false;
580 Features[
"xop"] =
true;
583 Features[
"fma4"] =
true;
584 setSSELevel(Features, AVX,
true);
587 Features[
"sse4a"] =
true;
588 setSSELevel(Features, SSE3,
true);
599 Features[
"sse4a"] =
false;
602 Features[
"fma4"] =
false;
605 Features[
"xop"] =
false;
611 StringRef Name,
bool Enabled) {
616 Features[Name] = Enabled;
619 setMMXLevel(Features, MMX, Enabled);
620 }
else if (Name ==
"sse") {
621 setSSELevel(Features, SSE1, Enabled);
622 }
else if (Name ==
"sse2") {
623 setSSELevel(Features, SSE2, Enabled);
624 }
else if (Name ==
"sse3") {
625 setSSELevel(Features, SSE3, Enabled);
626 }
else if (Name ==
"ssse3") {
627 setSSELevel(Features, SSSE3, Enabled);
628 }
else if (Name ==
"sse4.2") {
629 setSSELevel(Features, SSE42, Enabled);
630 }
else if (Name ==
"sse4.1") {
631 setSSELevel(Features, SSE41, Enabled);
632 }
else if (Name ==
"3dnow") {
633 setMMXLevel(Features, AMD3DNow, Enabled);
634 }
else if (Name ==
"3dnowa") {
635 setMMXLevel(Features, AMD3DNowAthlon, Enabled);
636 }
else if (Name ==
"aes") {
638 setSSELevel(Features, SSE2, Enabled);
640 Features[
"vaes"] =
false;
641 }
else if (Name ==
"vaes") {
643 setSSELevel(Features, AVX, Enabled);
644 Features[
"aes"] =
true;
646 }
else if (Name ==
"pclmul") {
648 setSSELevel(Features, SSE2, Enabled);
650 Features[
"vpclmulqdq"] =
false;
651 }
else if (Name ==
"vpclmulqdq") {
653 setSSELevel(Features, AVX, Enabled);
654 Features[
"pclmul"] =
true;
656 }
else if (Name ==
"gfni") {
658 setSSELevel(Features, SSE2, Enabled);
659 }
else if (Name ==
"avx") {
660 setSSELevel(Features, AVX, Enabled);
661 }
else if (Name ==
"avx2") {
662 setSSELevel(Features, AVX2, Enabled);
663 }
else if (Name ==
"avx512f") {
664 setSSELevel(Features, AVX512F, Enabled);
665 }
else if (Name.startswith(
"avx512")) {
667 setSSELevel(Features, AVX512F, Enabled);
669 if ((Name ==
"avx512vbmi" || Name ==
"avx512vbmi2" ||
670 Name ==
"avx512bitalg" || Name ==
"avx512bf16") && Enabled)
671 Features[
"avx512bw"] =
true;
673 if (Name ==
"avx512bw" && !Enabled) {
674 Features[
"avx512vbmi"] =
false;
675 Features[
"avx512vbmi2"] =
false;
676 Features[
"avx512bitalg"] =
false;
677 Features[
"avx512bf16"] =
false;
679 }
else if (Name ==
"fma") {
681 setSSELevel(Features, AVX, Enabled);
683 setSSELevel(Features, AVX512F, Enabled);
684 }
else if (Name ==
"fma4") {
685 setXOPLevel(Features, FMA4, Enabled);
686 }
else if (Name ==
"xop") {
687 setXOPLevel(Features, XOP, Enabled);
688 }
else if (Name ==
"sse4a") {
689 setXOPLevel(Features, SSE4A, Enabled);
690 }
else if (Name ==
"f16c") {
692 setSSELevel(Features, AVX, Enabled);
694 setSSELevel(Features, AVX512F, Enabled);
695 }
else if (Name ==
"sha") {
697 setSSELevel(Features, SSE2, Enabled);
698 }
else if (Name ==
"sse4") {
704 setSSELevel(Features, SSE42, Enabled);
706 setSSELevel(Features, SSE41, Enabled);
707 }
else if (Name ==
"xsave") {
709 Features[
"xsaveopt"] =
false;
710 }
else if (Name ==
"xsaveopt" || Name ==
"xsavec" || Name ==
"xsaves") {
712 Features[
"xsave"] =
true;
720 for (
const auto &Feature : Features) {
721 if (Feature[0] !=
'+')
724 if (Feature ==
"+aes") {
726 }
else if (Feature ==
"+vaes") {
728 }
else if (Feature ==
"+pclmul") {
730 }
else if (Feature ==
"+vpclmulqdq") {
731 HasVPCLMULQDQ =
true;
732 }
else if (Feature ==
"+lzcnt") {
734 }
else if (Feature ==
"+rdrnd") {
736 }
else if (Feature ==
"+fsgsbase") {
738 }
else if (Feature ==
"+bmi") {
740 }
else if (Feature ==
"+bmi2") {
742 }
else if (Feature ==
"+popcnt") {
744 }
else if (Feature ==
"+rtm") {
746 }
else if (Feature ==
"+prfchw") {
748 }
else if (Feature ==
"+rdseed") {
750 }
else if (Feature ==
"+adx") {
752 }
else if (Feature ==
"+tbm") {
754 }
else if (Feature ==
"+lwp") {
756 }
else if (Feature ==
"+fma") {
758 }
else if (Feature ==
"+f16c") {
760 }
else if (Feature ==
"+gfni") {
762 }
else if (Feature ==
"+avx512cd") {
764 }
else if (Feature ==
"+avx512vpopcntdq") {
765 HasAVX512VPOPCNTDQ =
true;
766 }
else if (Feature ==
"+avx512vnni") {
767 HasAVX512VNNI =
true;
768 }
else if (Feature ==
"+avx512bf16") {
769 HasAVX512BF16 =
true;
770 }
else if (Feature ==
"+avx512er") {
772 }
else if (Feature ==
"+avx512pf") {
774 }
else if (Feature ==
"+avx512dq") {
776 }
else if (Feature ==
"+avx512bitalg") {
777 HasAVX512BITALG =
true;
778 }
else if (Feature ==
"+avx512bw") {
780 }
else if (Feature ==
"+avx512vl") {
782 }
else if (Feature ==
"+avx512vbmi") {
783 HasAVX512VBMI =
true;
784 }
else if (Feature ==
"+avx512vbmi2") {
785 HasAVX512VBMI2 =
true;
786 }
else if (Feature ==
"+avx512ifma") {
787 HasAVX512IFMA =
true;
788 }
else if (Feature ==
"+avx512vp2intersect") {
789 HasAVX512VP2INTERSECT =
true;
790 }
else if (Feature ==
"+sha") {
792 }
else if (Feature ==
"+mpx") {
794 }
else if (Feature ==
"+shstk") {
796 }
else if (Feature ==
"+movbe") {
798 }
else if (Feature ==
"+sgx") {
800 }
else if (Feature ==
"+cx8") {
802 }
else if (Feature ==
"+cx16") {
804 }
else if (Feature ==
"+fxsr") {
806 }
else if (Feature ==
"+xsave") {
808 }
else if (Feature ==
"+xsaveopt") {
810 }
else if (Feature ==
"+xsavec") {
812 }
else if (Feature ==
"+xsaves") {
814 }
else if (Feature ==
"+mwaitx") {
816 }
else if (Feature ==
"+pku") {
818 }
else if (Feature ==
"+clflushopt") {
819 HasCLFLUSHOPT =
true;
820 }
else if (Feature ==
"+clwb") {
822 }
else if (Feature ==
"+wbnoinvd") {
824 }
else if (Feature ==
"+prefetchwt1") {
825 HasPREFETCHWT1 =
true;
826 }
else if (Feature ==
"+clzero") {
828 }
else if (Feature ==
"+cldemote") {
830 }
else if (Feature ==
"+rdpid") {
832 }
else if (Feature ==
"+retpoline-external-thunk") {
833 HasRetpolineExternalThunk =
true;
834 }
else if (Feature ==
"+sahf") {
836 }
else if (Feature ==
"+waitpkg") {
838 }
else if (Feature ==
"+movdiri") {
840 }
else if (Feature ==
"+movdir64b") {
842 }
else if (Feature ==
"+pconfig") {
844 }
else if (Feature ==
"+ptwrite") {
846 }
else if (Feature ==
"+invpcid") {
848 }
else if (Feature ==
"+enqcmd") {
852 X86SSEEnum
Level = llvm::StringSwitch<X86SSEEnum>(Feature)
853 .Case(
"+avx512f", AVX512F)
856 .Case(
"+sse4.2", SSE42)
857 .Case(
"+sse4.1", SSE41)
858 .Case(
"+ssse3", SSSE3)
863 SSELevel =
std::max(SSELevel, Level);
865 MMX3DNowEnum ThreeDNowLevel = llvm::StringSwitch<MMX3DNowEnum>(Feature)
866 .Case(
"+3dnowa", AMD3DNowAthlon)
867 .Case(
"+3dnow", AMD3DNow)
869 .Default(NoMMX3DNow);
870 MMX3DNowLevel =
std::max(MMX3DNowLevel, ThreeDNowLevel);
872 XOPEnum XLevel = llvm::StringSwitch<XOPEnum>(Feature)
875 .Case(
"+sse4a", SSE4A)
877 XOPLevel =
std::max(XOPLevel, XLevel);
882 if ((FPMath == FP_SSE && SSELevel < SSE1) ||
883 (FPMath == FP_387 && SSELevel >= SSE1)) {
884 Diags.
Report(diag::err_target_unsupported_fpmath)
885 << (FPMath == FP_SSE ?
"sse" :
"387");
901 std::string CodeModel = getTargetOpts().CodeModel;
902 if (CodeModel ==
"default")
904 Builder.
defineMacro(
"__code_model_" + CodeModel +
"_");
907 if (getTriple().getArch() == llvm::Triple::x86_64) {
912 if (getTriple().getArchName() ==
"x86_64h") {
922 Builder.
defineMacro(
"__seg_gs",
"__attribute__((address_space(256)))");
923 Builder.
defineMacro(
"__seg_fs",
"__attribute__((address_space(257)))");
984 case CK_GoldmontPlus:
996 case CK_SkylakeClient:
997 case CK_SkylakeServer:
1001 case CK_IcelakeClient:
1002 case CK_IcelakeServer:
1023 if (CPU != CK_K6_2) {
1037 if (SSELevel != NoSSE) {
1166 if (HasAVX512VPOPCNTDQ)
1178 if (HasAVX512BITALG)
1190 if (HasAVX512VP2INTERSECT)
1277 if (Opts.MicrosoftExt && getTriple().getArch() == llvm::Triple::x86) {
1299 switch (MMX3DNowLevel) {
1300 case AMD3DNowAthlon:
1313 if (CPU >= CK_i486 || CPU == CK_Generic) {
1314 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
1315 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
1316 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
1319 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
1320 if (HasCX16 && getTriple().getArch() == llvm::Triple::x86_64)
1321 Builder.
defineMacro(
"__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
1328 return llvm::StringSwitch<bool>(Name)
1329 .Case(
"3dnow",
true)
1330 .Case(
"3dnowa",
true)
1335 .Case(
"avx512f",
true)
1336 .Case(
"avx512cd",
true)
1337 .Case(
"avx512vpopcntdq",
true)
1338 .Case(
"avx512vnni",
true)
1339 .Case(
"avx512bf16",
true)
1340 .Case(
"avx512er",
true)
1341 .Case(
"avx512pf",
true)
1342 .Case(
"avx512dq",
true)
1343 .Case(
"avx512bitalg",
true)
1344 .Case(
"avx512bw",
true)
1345 .Case(
"avx512vl",
true)
1346 .Case(
"avx512vbmi",
true)
1347 .Case(
"avx512vbmi2",
true)
1348 .Case(
"avx512ifma",
true)
1349 .Case(
"avx512vp2intersect",
true)
1352 .Case(
"cldemote",
true)
1353 .Case(
"clflushopt",
true)
1355 .Case(
"clzero",
true)
1357 .Case(
"enqcmd",
true)
1361 .Case(
"fsgsbase",
true)
1364 .Case(
"invpcid",
true)
1366 .Case(
"lzcnt",
true)
1368 .Case(
"movbe",
true)
1369 .Case(
"movdiri",
true)
1370 .Case(
"movdir64b",
true)
1372 .Case(
"mwaitx",
true)
1373 .Case(
"pclmul",
true)
1374 .Case(
"pconfig",
true)
1376 .Case(
"popcnt",
true)
1377 .Case(
"prefetchwt1",
true)
1378 .Case(
"prfchw",
true)
1379 .Case(
"ptwrite",
true)
1380 .Case(
"rdpid",
true)
1381 .Case(
"rdrnd",
true)
1382 .Case(
"rdseed",
true)
1387 .Case(
"shstk",
true)
1391 .Case(
"ssse3",
true)
1393 .Case(
"sse4.1",
true)
1394 .Case(
"sse4.2",
true)
1395 .Case(
"sse4a",
true)
1398 .Case(
"vpclmulqdq",
true)
1399 .Case(
"wbnoinvd",
true)
1400 .Case(
"waitpkg",
true)
1403 .Case(
"xsave",
true)
1404 .Case(
"xsavec",
true)
1405 .Case(
"xsaves",
true)
1406 .Case(
"xsaveopt",
true)
1411 return llvm::StringSwitch<bool>(Feature)
1412 .Case(
"adx", HasADX)
1413 .Case(
"aes", HasAES)
1414 .Case(
"avx", SSELevel >= AVX)
1415 .Case(
"avx2", SSELevel >= AVX2)
1416 .Case(
"avx512f", SSELevel >= AVX512F)
1417 .Case(
"avx512cd", HasAVX512CD)
1418 .Case(
"avx512vpopcntdq", HasAVX512VPOPCNTDQ)
1419 .Case(
"avx512vnni", HasAVX512VNNI)
1420 .Case(
"avx512bf16", HasAVX512BF16)
1421 .Case(
"avx512er", HasAVX512ER)
1422 .Case(
"avx512pf", HasAVX512PF)
1423 .Case(
"avx512dq", HasAVX512DQ)
1424 .Case(
"avx512bitalg", HasAVX512BITALG)
1425 .Case(
"avx512bw", HasAVX512BW)
1426 .Case(
"avx512vl", HasAVX512VL)
1427 .Case(
"avx512vbmi", HasAVX512VBMI)
1428 .Case(
"avx512vbmi2", HasAVX512VBMI2)
1429 .Case(
"avx512ifma", HasAVX512IFMA)
1430 .Case(
"avx512vp2intersect", HasAVX512VP2INTERSECT)
1431 .Case(
"bmi", HasBMI)
1432 .Case(
"bmi2", HasBMI2)
1433 .Case(
"cldemote", HasCLDEMOTE)
1434 .Case(
"clflushopt", HasCLFLUSHOPT)
1435 .Case(
"clwb", HasCLWB)
1436 .Case(
"clzero", HasCLZERO)
1437 .Case(
"cx8", HasCX8)
1438 .Case(
"cx16", HasCX16)
1439 .Case(
"enqcmd", HasENQCMD)
1440 .Case(
"f16c", HasF16C)
1441 .Case(
"fma", HasFMA)
1442 .Case(
"fma4", XOPLevel >= FMA4)
1443 .Case(
"fsgsbase", HasFSGSBASE)
1444 .Case(
"fxsr", HasFXSR)
1445 .Case(
"gfni", HasGFNI)
1446 .Case(
"invpcid", HasINVPCID)
1447 .Case(
"lwp", HasLWP)
1448 .Case(
"lzcnt", HasLZCNT)
1449 .Case(
"mm3dnow", MMX3DNowLevel >= AMD3DNow)
1450 .Case(
"mm3dnowa", MMX3DNowLevel >= AMD3DNowAthlon)
1451 .Case(
"mmx", MMX3DNowLevel >= MMX)
1452 .Case(
"movbe", HasMOVBE)
1453 .Case(
"movdiri", HasMOVDIRI)
1454 .Case(
"movdir64b", HasMOVDIR64B)
1455 .Case(
"mpx", HasMPX)
1456 .Case(
"mwaitx", HasMWAITX)
1457 .Case(
"pclmul", HasPCLMUL)
1458 .Case(
"pconfig", HasPCONFIG)
1459 .Case(
"pku", HasPKU)
1460 .Case(
"popcnt", HasPOPCNT)
1461 .Case(
"prefetchwt1", HasPREFETCHWT1)
1462 .Case(
"prfchw", HasPRFCHW)
1463 .Case(
"ptwrite", HasPTWRITE)
1464 .Case(
"rdpid", HasRDPID)
1465 .Case(
"rdrnd", HasRDRND)
1466 .Case(
"rdseed", HasRDSEED)
1467 .Case(
"retpoline-external-thunk", HasRetpolineExternalThunk)
1468 .Case(
"rtm", HasRTM)
1469 .Case(
"sahf", HasLAHFSAHF)
1470 .Case(
"sgx", HasSGX)
1471 .Case(
"sha", HasSHA)
1472 .Case(
"shstk", HasSHSTK)
1473 .Case(
"sse", SSELevel >= SSE1)
1474 .Case(
"sse2", SSELevel >= SSE2)
1475 .Case(
"sse3", SSELevel >= SSE3)
1476 .Case(
"ssse3", SSELevel >= SSSE3)
1477 .Case(
"sse4.1", SSELevel >= SSE41)
1478 .Case(
"sse4.2", SSELevel >= SSE42)
1479 .Case(
"sse4a", XOPLevel >= SSE4A)
1480 .Case(
"tbm", HasTBM)
1481 .Case(
"vaes", HasVAES)
1482 .Case(
"vpclmulqdq", HasVPCLMULQDQ)
1483 .Case(
"wbnoinvd", HasWBNOINVD)
1484 .Case(
"waitpkg", HasWAITPKG)
1486 .Case(
"x86_32", getTriple().getArch() == llvm::Triple::x86)
1487 .Case(
"x86_64", getTriple().getArch() == llvm::Triple::x86_64)
1488 .Case(
"xop", XOPLevel >= XOP)
1489 .Case(
"xsave", HasXSAVE)
1490 .Case(
"xsavec", HasXSAVEC)
1491 .Case(
"xsaves", HasXSAVES)
1492 .Case(
"xsaveopt", HasXSAVEOPT)
1502 return llvm::StringSwitch<bool>(FeatureStr)
1504 #include "llvm/Support/X86TargetParser.def" 1509 return llvm::StringSwitch<llvm::X86::ProcessorFeatures>(Name)
1511 #include "llvm/Support/X86TargetParser.def" 1518 enum class FeatPriority {
1519 #define FEATURE(FEAT) FEAT, 1520 #include "clang/Basic/X86Target.def" 1523 #define FEATURE(FEAT) \ 1524 case llvm::X86::FEAT: \ 1525 return static_cast<unsigned>(FeatPriority::FEAT); 1526 #include "clang/Basic/X86Target.def" 1528 llvm_unreachable(
"No Feature Priority for non-CPUSupports Features");
1536 if (Kind != CK_Generic) {
1540 "CPU Type without a key feature used in 'target' attribute");
1541 #define PROC_WITH_FEAT(ENUM, STR, IS64, KEY_FEAT) \ 1543 return (getFeaturePriority(llvm::X86::KEY_FEAT) << 1) + 1; 1544 #include "clang/Basic/X86Target.def" 1554 return llvm::StringSwitch<bool>(Name)
1555 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME,
true)
1556 #define CPU_SPECIFIC_ALIAS(NEW_NAME, NAME) .Case(NEW_NAME, true) 1557 #include "clang/Basic/X86Target.def" 1562 return llvm::StringSwitch<StringRef>(Name)
1564 #include "clang/Basic/X86Target.def" 1570 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME, MANGLING)
1571 #include "clang/Basic/X86Target.def" 1577 StringRef WholeList =
1579 #define
CPU_SPECIFIC(NAME, MANGLING, FEATURES) .Case(NAME, FEATURES)
1580 #include "clang/Basic/X86Target.def" 1582 WholeList.split(Features,
',', -1,
false);
1590 return llvm::StringSwitch<bool>(FeatureStr)
1591 #define
X86_VENDOR(ENUM, STRING) .Case(STRING,
true)
1592 #define X86_CPU_TYPE_COMPAT_WITH_ALIAS(ARCHNAME, ENUM, STR, ALIAS) \ 1593 .Cases(STR, ALIAS, true) 1594 #define X86_CPU_TYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true) 1595 #define X86_CPU_SUBTYPE_COMPAT(ARCHNAME, ENUM, STR) .Case(STR, true) 1596 #include "llvm/Support/X86TargetParser.def" 1601 auto RV = llvm::StringSwitch<unsigned>(Name)
1728 unsigned Size)
const {
1730 while (Constraint[0] ==
'=' || Constraint[0] ==
'+' || Constraint[0] ==
'&')
1731 Constraint = Constraint.substr(1);
1733 return validateOperandSize(Constraint, Size);
1737 unsigned Size)
const {
1738 return validateOperandSize(Constraint, Size);
1742 unsigned Size)
const {
1743 switch (Constraint[0]) {
1756 switch (Constraint[1]) {
1766 if (SSELevel >= SSE1)
1767 return Size <= 128U;
1773 if (SSELevel < SSE2)
1780 if (SSELevel >= AVX512F)
1782 return Size <= 512U;
1783 else if (SSELevel >= AVX)
1785 return Size <= 256U;
1786 return Size <= 128U;
1794 switch (*Constraint) {
1797 std::string Converted =
"{" + std::string(Constraint, Len) +
"}";
1798 Constraint += Len - 1;
1801 return std::string(1, *Constraint);
1803 return std::string(
"{ax}");
1805 return std::string(
"{bx}");
1807 return std::string(
"{cx}");
1809 return std::string(
"{dx}");
1811 return std::string(
"{si}");
1813 return std::string(
"{di}");
1815 return std::string(
"im");
1817 return std::string(
"{st}");
1819 return std::string(
"{st(1)}");
1821 switch (Constraint[1]) {
1837 return std::string(
"^") + std::string(Constraint++, 2);
1841 return std::string(1, *Constraint);
1852 #define PROC(ENUM, STRING, IS64BIT) \ 1854 return IS64BIT || getTriple().getArch() == llvm::Triple::x86; 1855 #include "clang/Basic/X86Target.def" 1857 llvm_unreachable(
"Unhandled CPU kind");
1861 #define PROC(ENUM, STRING, IS64BIT) \ 1862 if (IS64BIT || getTriple().getArch() == llvm::Triple::x86) \ 1863 Values.emplace_back(STRING); 1865 #define PROC_ALIAS(ENUM, ALIAS) \ 1866 if (checkCPUKind(CK_##ENUM)) \ 1867 Values.emplace_back(ALIAS); 1868 #include "clang/Basic/X86Target.def" 1872 return llvm::StringSwitch<CPUKind>(CPU)
1873 #define
PROC(ENUM, STRING, IS64BIT) .Case(STRING, CK_##ENUM)
1874 #define PROC_ALIAS(ENUM, ALIAS) .Case(ALIAS, CK_##ENUM) 1875 #include "clang/Basic/X86Target.def" 1876 .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 ...