LLVM 22.0.0git
X86TargetParser.cpp
Go to the documentation of this file.
1//===-- X86TargetParser - Parser for X86 features ---------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements a target parser to recognise X86 hardware features.
10//
11//===----------------------------------------------------------------------===//
12
14#include "llvm/ADT/Bitset.h"
16#include <numeric>
17
18using namespace llvm;
19using namespace llvm::X86;
20
21namespace {
22
24
25struct ProcInfo {
26 StringLiteral Name;
27 X86::CPUKind Kind;
28 unsigned KeyFeature;
29 FeatureBitset Features;
30 char Mangling;
31 bool OnlyForCPUDispatchSpecific;
32};
33
34struct FeatureInfo {
35 StringLiteral NameWithPlus;
36 FeatureBitset ImpliedFeatures;
37
38 StringRef getName(bool WithPlus = false) const {
39 assert(NameWithPlus[0] == '+' && "Expected string to start with '+'");
40 if (WithPlus)
41 return NameWithPlus;
42 return NameWithPlus.drop_front();
43 }
44};
45
46} // end anonymous namespace
47
48#define X86_FEATURE(ENUM, STRING) \
49 constexpr FeatureBitset Feature##ENUM = {X86::FEATURE_##ENUM};
50#include "llvm/TargetParser/X86TargetParser.def"
51
52// Pentium with MMX.
54 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX;
55
56// Pentium 2 and 3.
58 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeatureFXSR | FeatureCMOV;
60
61// Pentium 4 CPUs
65 FeaturesPrescott | Feature64BIT | FeatureCMPXCHG16B;
66
67// Basic 64-bit capable CPU.
70 FeaturePOPCNT | FeatureCRC32 |
71 FeatureSSE4_2 | FeatureCMPXCHG16B;
73 FeaturesX86_64_V2 | FeatureAVX2 | FeatureBMI | FeatureBMI2 | FeatureF16C |
74 FeatureFMA | FeatureLZCNT | FeatureMOVBE | FeatureXSAVE;
76 FeatureAVX512BW | FeatureAVX512CD |
77 FeatureAVX512DQ | FeatureAVX512VL;
78
79// Intel Core CPUs
81 FeaturesNocona | FeatureSAHF | FeatureSSSE3;
82constexpr FeatureBitset FeaturesPenryn = FeaturesCore2 | FeatureSSE4_1;
84 FeaturesPenryn | FeaturePOPCNT | FeatureCRC32 | FeatureSSE4_2;
87 FeaturesWestmere | FeatureAVX | FeatureXSAVE | FeatureXSAVEOPT;
89 FeaturesSandyBridge | FeatureF16C | FeatureFSGSBASE | FeatureRDRND;
91 FeaturesIvyBridge | FeatureAVX2 | FeatureBMI | FeatureBMI2 | FeatureFMA |
92 FeatureINVPCID | FeatureLZCNT | FeatureMOVBE;
94 FeaturesHaswell | FeatureADX | FeaturePRFCHW | FeatureRDSEED;
95
96// Intel Knights Landing and Knights Mill
97// Knights Landing has feature parity with Broadwell.
99 FeaturesBroadwell | FeatureAES | FeatureAVX512F | FeatureAVX512CD;
100constexpr FeatureBitset FeaturesKNM = FeaturesKNL | FeatureAVX512VPOPCNTDQ;
101
102// Intel Skylake processors.
104 FeaturesBroadwell | FeatureAES | FeatureCLFLUSHOPT | FeatureXSAVEC |
105 FeatureXSAVES | FeatureSGX;
106// SkylakeServer inherits all SkylakeClient features except SGX.
107// FIXME: That doesn't match gcc.
109 (FeaturesSkylakeClient & ~FeatureSGX) | FeatureAVX512F | FeatureAVX512CD |
110 FeatureAVX512DQ | FeatureAVX512BW | FeatureAVX512VL | FeatureCLWB |
111 FeaturePKU;
113 FeaturesSkylakeServer | FeatureAVX512VNNI;
115 FeaturesCascadeLake | FeatureAVX512BF16;
116
117// Intel 10nm processors.
119 FeaturesSkylakeClient | FeatureAVX512F | FeatureAVX512CD | FeatureAVX512DQ |
120 FeatureAVX512BW | FeatureAVX512VL | FeatureAVX512IFMA | FeatureAVX512VBMI |
121 FeaturePKU | FeatureSHA;
123 FeaturesCannonlake | FeatureAVX512BITALG | FeatureAVX512VBMI2 |
124 FeatureAVX512VNNI | FeatureAVX512VPOPCNTDQ | FeatureGFNI | FeatureRDPID |
125 FeatureVAES | FeatureVPCLMULQDQ;
128 FeaturesICLClient | FeatureCLWB | FeaturePCONFIG | FeatureWBNOINVD;
130 FeaturesICLClient | FeatureAVX512VP2INTERSECT | FeatureMOVDIR64B |
131 FeatureCLWB | FeatureMOVDIRI | FeatureSHSTK | FeatureKL | FeatureWIDEKL;
133 FeaturesICLServer | FeatureAMX_BF16 | FeatureAMX_INT8 | FeatureAMX_TILE |
134 FeatureAVX512BF16 | FeatureAVX512FP16 | FeatureAVXVNNI | FeatureCLDEMOTE |
135 FeatureENQCMD | FeatureMOVDIR64B | FeatureMOVDIRI | FeaturePTWRITE |
136 FeatureSERIALIZE | FeatureSHSTK | FeatureTSXLDTRK | FeatureUINTR |
137 FeatureWAITPKG | FeatureAVX512DQ | FeatureAVX512VL;
139 FeaturesSapphireRapids | FeatureAMX_FP16 | FeaturePREFETCHI;
141 FeaturesGraniteRapids | FeatureAMX_COMPLEX | FeatureAVX10_2 |
142 FeatureCMPCCXADD | FeatureAVXIFMA | FeatureAVXNECONVERT |
143 FeatureAVXVNNIINT8 | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
144 FeatureSM4 | FeatureEGPR | FeatureZU | FeatureCCMP | FeaturePush2Pop2 |
145 FeaturePPX | FeatureNDD | FeatureNF | FeatureMOVRS | FeatureAMX_MOVRS |
146 FeatureAMX_AVX512 | FeatureAMX_FP8 | FeatureAMX_TF32;
147
148// Intel Atom processors.
149// Bonnell has feature parity with Core2 and adds MOVBE.
150constexpr FeatureBitset FeaturesBonnell = FeaturesCore2 | FeatureMOVBE;
151// Silvermont has parity with Westmere and Bonnell plus PRFCHW and RDRND.
153 FeaturesBonnell | FeaturesWestmere | FeaturePRFCHW | FeatureRDRND;
155 FeaturesSilvermont | FeatureAES | FeatureCLFLUSHOPT | FeatureFSGSBASE |
156 FeatureRDSEED | FeatureSHA | FeatureXSAVE | FeatureXSAVEC |
157 FeatureXSAVEOPT | FeatureXSAVES;
159 FeaturesGoldmont | FeaturePTWRITE | FeatureRDPID | FeatureSGX;
161 FeaturesGoldmontPlus | FeatureCLWB | FeatureGFNI;
163 FeaturesTremont | FeatureADX | FeatureBMI | FeatureBMI2 | FeatureF16C |
164 FeatureFMA | FeatureINVPCID | FeatureLZCNT | FeaturePCONFIG | FeaturePKU |
165 FeatureSERIALIZE | FeatureSHSTK | FeatureVAES | FeatureVPCLMULQDQ |
166 FeatureMOVDIR64B | FeatureMOVDIRI | FeatureWAITPKG | FeatureAVXVNNI |
167 FeatureHRESET | FeatureWIDEKL;
169 FeaturesAlderlake | FeatureCMPCCXADD | FeatureAVXIFMA | FeatureUINTR |
170 FeatureENQCMD | FeatureAVXNECONVERT | FeatureAVXVNNIINT8;
172 FeaturesArrowlake | FeatureCLDEMOTE;
174 FeaturesArrowlake | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
175 FeatureSM4;
177 (FeaturesArrowlakeS ^ FeatureWIDEKL);
179 FeaturesPantherlake | FeaturePREFETCHI | FeatureAVX10_2 | FeatureMOVRS |
180 FeatureEGPR | FeatureZU | FeatureCCMP | FeaturePush2Pop2 | FeaturePPX |
181 FeatureNDD | FeatureNF;
183 (FeaturesSierraforest ^ FeatureWIDEKL) | FeatureAVXVNNIINT16 |
184 FeatureSHA512 | FeatureSM3 | FeatureSM4 | FeaturePREFETCHI | FeatureUSERMSR;
185
186// Geode Processor.
188 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeaturePRFCHW;
189
190// K6 processor.
191constexpr FeatureBitset FeaturesK6 = FeatureX87 | FeatureCMPXCHG8B | FeatureMMX;
192
193// K7 and K8 architecture processors.
195 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeaturePRFCHW;
197 FeaturesAthlon | FeatureFXSR | FeatureSSE;
199 FeaturesAthlonXP | FeatureSSE2 | Feature64BIT;
200constexpr FeatureBitset FeaturesK8SSE3 = FeaturesK8 | FeatureSSE3;
202 FeaturesK8SSE3 | FeatureCMPXCHG16B | FeatureLZCNT | FeaturePOPCNT |
203 FeaturePRFCHW | FeatureSAHF | FeatureSSE4_A;
204
205// Bobcat architecture processors.
207 FeatureX87 | FeatureCMPXCHG8B | FeatureCMPXCHG16B | Feature64BIT |
208 FeatureFXSR | FeatureLZCNT | FeatureMMX | FeaturePOPCNT | FeaturePRFCHW |
209 FeatureSSE | FeatureSSE2 | FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_A |
210 FeatureSAHF;
212 FeaturesBTVER1 | FeatureAES | FeatureAVX | FeatureBMI | FeatureCRC32 |
213 FeatureF16C | FeatureMOVBE | FeaturePCLMUL | FeatureXSAVE | FeatureXSAVEOPT;
214
215// AMD Bulldozer architecture processors.
217 FeatureX87 | FeatureAES | FeatureAVX | FeatureCMPXCHG8B |
218 FeatureCMPXCHG16B | FeatureCRC32 | Feature64BIT | FeatureFMA4 |
219 FeatureFXSR | FeatureLWP | FeatureLZCNT | FeatureMMX | FeaturePCLMUL |
220 FeaturePOPCNT | FeaturePRFCHW | FeatureSAHF | FeatureSSE | FeatureSSE2 |
221 FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_1 | FeatureSSE4_2 | FeatureSSE4_A |
222 FeatureXOP | FeatureXSAVE;
224 FeaturesBDVER1 | FeatureBMI | FeatureFMA | FeatureF16C | FeatureTBM;
226 FeaturesBDVER2 | FeatureFSGSBASE | FeatureXSAVEOPT;
227constexpr FeatureBitset FeaturesBDVER4 = FeaturesBDVER3 | FeatureAVX2 |
228 FeatureBMI2 | FeatureMOVBE |
229 FeatureMWAITX | FeatureRDRND;
230
231// AMD Zen architecture processors.
233 FeatureX87 | FeatureADX | FeatureAES | FeatureAVX | FeatureAVX2 |
234 FeatureBMI | FeatureBMI2 | FeatureCLFLUSHOPT | FeatureCLZERO |
235 FeatureCMPXCHG8B | FeatureCMPXCHG16B | FeatureCRC32 | Feature64BIT |
236 FeatureF16C | FeatureFMA | FeatureFSGSBASE | FeatureFXSR | FeatureLZCNT |
237 FeatureMMX | FeatureMOVBE | FeatureMWAITX | FeaturePCLMUL | FeaturePOPCNT |
238 FeaturePRFCHW | FeatureRDRND | FeatureRDSEED | FeatureSAHF | FeatureSHA |
239 FeatureSSE | FeatureSSE2 | FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_1 |
240 FeatureSSE4_2 | FeatureSSE4_A | FeatureXSAVE | FeatureXSAVEC |
241 FeatureXSAVEOPT | FeatureXSAVES;
242constexpr FeatureBitset FeaturesZNVER2 = FeaturesZNVER1 | FeatureCLWB |
243 FeatureRDPID | FeatureRDPRU |
244 FeatureWBNOINVD;
246 FeatureINVPCID | FeaturePKU |
247 FeatureVAES | FeatureVPCLMULQDQ;
249 FeaturesZNVER3 | FeatureAVX512F | FeatureAVX512CD | FeatureAVX512DQ |
250 FeatureAVX512BW | FeatureAVX512VL | FeatureAVX512IFMA | FeatureAVX512VBMI |
251 FeatureAVX512VBMI2 | FeatureAVX512VNNI | FeatureAVX512BITALG |
252 FeatureAVX512VPOPCNTDQ | FeatureAVX512BF16 | FeatureGFNI | FeatureSHSTK;
253
255 FeaturesZNVER4 | FeatureAVXVNNI | FeatureMOVDIRI | FeatureMOVDIR64B |
256 FeatureAVX512VP2INTERSECT | FeaturePREFETCHI | FeatureAVXVNNI;
257
258// D151696 tranplanted Mangling and OnlyForCPUDispatchSpecific from
259// X86TargetParser.def to here. They are assigned by following ways:
260// 1. Copy the mangling from the original CPU_SPEICIFC MACROs. If no, assign
261// to '\0' by default, which means not support cpu_specific/dispatch feature.
262// 2. set OnlyForCPUDispatchSpecific as true if this cpu name was not
263// listed here before, which means it doesn't support -march, -mtune and so on.
264// FIXME: Remove OnlyForCPUDispatchSpecific after all CPUs here support both
265// cpu_dispatch/specific() feature and -march, -mtune, and so on.
266// clang-format off
267constexpr ProcInfo Processors[] = {
268 // Empty processor. Include X87 and CMPXCHG8 for backwards compatibility.
269 { {""}, CK_None, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false },
270 { {"generic"}, CK_None, ~0U, FeatureX87 | FeatureCMPXCHG8B | Feature64BIT, 'A', true },
271 // i386-generation processors.
272 { {"i386"}, CK_i386, ~0U, FeatureX87, '\0', false },
273 // i486-generation processors.
274 { {"i486"}, CK_i486, ~0U, FeatureX87, '\0', false },
275 { {"winchip-c6"}, CK_WinChipC6, ~0U, FeaturesPentiumMMX, '\0', false },
276 { {"winchip2"}, CK_WinChip2, ~0U, FeaturesPentiumMMX | FeaturePRFCHW, '\0', false },
277 { {"c3"}, CK_C3, ~0U, FeaturesPentiumMMX | FeaturePRFCHW, '\0', false },
278 // i586-generation processors, P5 microarchitecture based.
279 { {"i586"}, CK_i586, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false },
280 { {"pentium"}, CK_Pentium, ~0U, FeatureX87 | FeatureCMPXCHG8B, 'B', false },
281 { {"pentium-mmx"}, CK_PentiumMMX, ~0U, FeaturesPentiumMMX, '\0', false },
282 { {"pentium_mmx"}, CK_PentiumMMX, ~0U, FeaturesPentiumMMX, 'D', true },
283 // i686-generation processors, P6 / Pentium M microarchitecture based.
284 { {"pentiumpro"}, CK_PentiumPro, ~0U, FeatureCMOV | FeatureX87 | FeatureCMPXCHG8B, 'C', false },
285 { {"pentium_pro"}, CK_PentiumPro, ~0U, FeatureCMOV | FeatureX87 | FeatureCMPXCHG8B, 'C', true },
286 { {"i686"}, CK_i686, ~0U, FeatureCMOV | FeatureX87 | FeatureCMPXCHG8B, '\0', false },
287 { {"pentium2"}, CK_Pentium2, ~0U, FeaturesPentium2, 'E', false },
288 { {"pentium_ii"}, CK_Pentium2, ~0U, FeaturesPentium2, 'E', true },
289 { {"pentium3"}, CK_Pentium3, ~0U, FeaturesPentium3, 'H', false },
290 { {"pentium3m"}, CK_Pentium3, ~0U, FeaturesPentium3, 'H', false },
291 { {"pentium_iii"}, CK_Pentium3, ~0U, FeaturesPentium3, 'H', true },
292 { {"pentium_iii_no_xmm_regs"}, CK_Pentium3, ~0U, FeaturesPentium3, 'H', true },
293 { {"pentium-m"}, CK_PentiumM, ~0U, FeaturesPentium4, '\0', false },
294 { {"pentium_m"}, CK_PentiumM, ~0U, FeaturesPentium4, 'K', true },
295 { {"c3-2"}, CK_C3_2, ~0U, FeaturesPentium3, '\0', false },
296 { {"yonah"}, CK_Yonah, ~0U, FeaturesPrescott, 'L', false },
297 // Netburst microarchitecture based processors.
298 { {"pentium4"}, CK_Pentium4, ~0U, FeaturesPentium4, 'J', false },
299 { {"pentium4m"}, CK_Pentium4, ~0U, FeaturesPentium4, 'J', false },
300 { {"pentium_4"}, CK_Pentium4, ~0U, FeaturesPentium4, 'J', true },
301 { {"pentium_4_sse3"}, CK_Prescott, ~0U, FeaturesPrescott, 'L', true },
302 { {"prescott"}, CK_Prescott, ~0U, FeaturesPrescott, 'L', false },
303 { {"nocona"}, CK_Nocona, ~0U, FeaturesNocona, 'L', false },
304 // Core microarchitecture based processors.
305 { {"core2"}, CK_Core2, FEATURE_SSSE3, FeaturesCore2, 'M', false },
306 { {"core_2_duo_ssse3"}, CK_Core2, ~0U, FeaturesCore2, 'M', true },
307 { {"penryn"}, CK_Penryn, ~0U, FeaturesPenryn, 'N', false },
308 { {"core_2_duo_sse4_1"}, CK_Penryn, ~0U, FeaturesPenryn, 'N', true },
309 // Atom processors
310 { {"bonnell"}, CK_Bonnell, FEATURE_SSSE3, FeaturesBonnell, 'O', false },
311 { {"atom"}, CK_Bonnell, FEATURE_SSSE3, FeaturesBonnell, 'O', false },
312 { {"silvermont"}, CK_Silvermont, FEATURE_SSE4_2, FeaturesSilvermont, 'c', false },
313 { {"slm"}, CK_Silvermont, FEATURE_SSE4_2, FeaturesSilvermont, 'c', false },
314 { {"atom_sse4_2"}, CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'c', true },
315 { {"atom_sse4_2_movbe"}, CK_Goldmont, FEATURE_SSE4_2, FeaturesGoldmont, 'd', true },
316 { {"goldmont"}, CK_Goldmont, FEATURE_SSE4_2, FeaturesGoldmont, 'i', false },
317 { {"goldmont-plus"}, CK_GoldmontPlus, FEATURE_SSE4_2, FeaturesGoldmontPlus, '\0', false },
318 { {"goldmont_plus"}, CK_GoldmontPlus, FEATURE_SSE4_2, FeaturesGoldmontPlus, 'd', true },
319 { {"tremont"}, CK_Tremont, FEATURE_SSE4_2, FeaturesTremont, 'd', false },
320 // Nehalem microarchitecture based processors.
321 { {"nehalem"}, CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'P', false },
322 { {"core_i7_sse4_2"}, CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'P', true },
323 { {"corei7"}, CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'P', false },
324 // Westmere microarchitecture based processors.
325 { {"westmere"}, CK_Westmere, FEATURE_PCLMUL, FeaturesWestmere, 'Q', false },
326 { {"core_aes_pclmulqdq"}, CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'Q', true },
327 // Sandy Bridge microarchitecture based processors.
328 { {"sandybridge"}, CK_SandyBridge, FEATURE_AVX, FeaturesSandyBridge, 'R', false },
329 { {"core_2nd_gen_avx"}, CK_SandyBridge, FEATURE_AVX, FeaturesSandyBridge, 'R', true },
330 { {"corei7-avx"}, CK_SandyBridge, FEATURE_AVX, FeaturesSandyBridge, '\0', false },
331 // Ivy Bridge microarchitecture based processors.
332 { {"ivybridge"}, CK_IvyBridge, FEATURE_AVX, FeaturesIvyBridge, 'S', false },
333 { {"core_3rd_gen_avx"}, CK_IvyBridge, FEATURE_AVX, FeaturesIvyBridge, 'S', true },
334 { {"core-avx-i"}, CK_IvyBridge, FEATURE_AVX, FeaturesIvyBridge, '\0', false },
335 // Haswell microarchitecture based processors.
336 { {"haswell"}, CK_Haswell, FEATURE_AVX2, FeaturesHaswell, 'V', false },
337 { {"core-avx2"}, CK_Haswell, FEATURE_AVX2, FeaturesHaswell, '\0', false },
338 { {"core_4th_gen_avx"}, CK_Haswell, FEATURE_AVX2, FeaturesHaswell, 'V', true },
339 { {"core_4th_gen_avx_tsx"}, CK_Haswell, FEATURE_AVX2, FeaturesHaswell, 'W', true },
340 // Broadwell microarchitecture based processors.
341 { {"broadwell"}, CK_Broadwell, FEATURE_AVX2, FeaturesBroadwell, 'X', false },
342 { {"core_5th_gen_avx"}, CK_Broadwell, FEATURE_AVX2, FeaturesBroadwell, 'X', true },
343 { {"core_5th_gen_avx_tsx"}, CK_Broadwell, FEATURE_AVX2, FeaturesBroadwell, 'Y', true },
344 // Skylake client microarchitecture based processors.
345 { {"skylake"}, CK_SkylakeClient, FEATURE_AVX2, FeaturesSkylakeClient, 'b', false },
346 // Skylake server microarchitecture based processors.
347 { {"skylake-avx512"}, CK_SkylakeServer, FEATURE_AVX512F, FeaturesSkylakeServer, '\0', false },
348 { {"skx"}, CK_SkylakeServer, FEATURE_AVX512F, FeaturesSkylakeServer, 'a', false },
349 { {"skylake_avx512"}, CK_SkylakeServer, FEATURE_AVX512F, FeaturesSkylakeServer, 'a', true },
350 // Cascadelake Server microarchitecture based processors.
351 { {"cascadelake"}, CK_Cascadelake, FEATURE_AVX512VNNI, FeaturesCascadeLake, 'o', false },
352 // Cooperlake Server microarchitecture based processors.
353 { {"cooperlake"}, CK_Cooperlake, FEATURE_AVX512BF16, FeaturesCooperLake, 'f', false },
354 // Cannonlake client microarchitecture based processors.
355 { {"cannonlake"}, CK_Cannonlake, FEATURE_AVX512VBMI, FeaturesCannonlake, 'e', false },
356 // Icelake client microarchitecture based processors.
357 { {"icelake-client"}, CK_IcelakeClient, FEATURE_AVX512VBMI2, FeaturesICLClient, '\0', false },
358 { {"icelake_client"}, CK_IcelakeClient, FEATURE_AVX512VBMI2, FeaturesICLClient, 'k', true },
359 // Rocketlake microarchitecture based processors.
360 { {"rocketlake"}, CK_Rocketlake, FEATURE_AVX512VBMI2, FeaturesRocketlake, 'k', false },
361 // Icelake server microarchitecture based processors.
362 { {"icelake-server"}, CK_IcelakeServer, FEATURE_AVX512VBMI2, FeaturesICLServer, '\0', false },
363 { {"icelake_server"}, CK_IcelakeServer, FEATURE_AVX512VBMI2, FeaturesICLServer, 'k', true },
364 // Tigerlake microarchitecture based processors.
365 { {"tigerlake"}, CK_Tigerlake, FEATURE_AVX512VP2INTERSECT, FeaturesTigerlake, 'l', false },
366 // Sapphire Rapids microarchitecture based processors.
367 { {"sapphirerapids"}, CK_SapphireRapids, FEATURE_AVX512FP16, FeaturesSapphireRapids, 'n', false },
368 // Alderlake microarchitecture based processors.
369 { {"alderlake"}, CK_Alderlake, FEATURE_AVX2, FeaturesAlderlake, 'p', false },
370 // Raptorlake microarchitecture based processors.
371 { {"raptorlake"}, CK_Raptorlake, FEATURE_AVX2, FeaturesAlderlake, 'p', false },
372 // Meteorlake microarchitecture based processors.
373 { {"meteorlake"}, CK_Meteorlake, FEATURE_AVX2, FeaturesAlderlake, 'p', false },
374 // Arrowlake microarchitecture based processors.
375 { {"arrowlake"}, CK_Arrowlake, FEATURE_AVX2, FeaturesArrowlake, 'p', false },
376 { {"arrowlake-s"}, CK_ArrowlakeS, FEATURE_AVX2, FeaturesArrowlakeS, '\0', false },
377 { {"arrowlake_s"}, CK_ArrowlakeS, FEATURE_AVX2, FeaturesArrowlakeS, 'p', true },
378 // Lunarlake microarchitecture based processors.
379 { {"lunarlake"}, CK_Lunarlake, FEATURE_AVX2, FeaturesArrowlakeS, 'p', false },
380 // Gracemont microarchitecture based processors.
381 { {"gracemont"}, CK_Gracemont, FEATURE_AVX2, FeaturesAlderlake, 'p', false },
382 // Pantherlake microarchitecture based processors.
383 { {"pantherlake"}, CK_Lunarlake, FEATURE_AVX2, FeaturesPantherlake, 'p', false },
384 { {"wildcatlake"}, CK_Lunarlake, FEATURE_AVX2, FeaturesPantherlake, 'p', false },
385 // Novalake microarchitecture based processors.
386 { {"novalake"}, CK_Novalake, FEATURE_AVX2, FeaturesNovalake, 'r', false },
387 // Sierraforest microarchitecture based processors.
388 { {"sierraforest"}, CK_Sierraforest, FEATURE_AVX2, FeaturesSierraforest, 'p', false },
389 // Grandridge microarchitecture based processors.
390 { {"grandridge"}, CK_Grandridge, FEATURE_AVX2, FeaturesSierraforest, 'p', false },
391 // Granite Rapids microarchitecture based processors.
392 { {"graniterapids"}, CK_Graniterapids, FEATURE_AVX512FP16, FeaturesGraniteRapids, 'n', false },
393 // Granite Rapids D microarchitecture based processors.
394 { {"graniterapids-d"}, CK_GraniterapidsD, FEATURE_AVX512FP16, FeaturesGraniteRapids | FeatureAMX_COMPLEX, '\0', false },
395 { {"graniterapids_d"}, CK_GraniterapidsD, FEATURE_AVX512FP16, FeaturesGraniteRapids | FeatureAMX_COMPLEX, 'n', true },
396 // Emerald Rapids microarchitecture based processors.
397 { {"emeraldrapids"}, CK_Emeraldrapids, FEATURE_AVX512FP16, FeaturesSapphireRapids, 'n', false },
398 // Clearwaterforest microarchitecture based processors.
399 { {"clearwaterforest"}, CK_Lunarlake, FEATURE_AVX2, FeaturesClearwaterforest, 'p', false },
400 // Diamond Rapids microarchitecture based processors.
401 { {"diamondrapids"}, CK_Diamondrapids, FEATURE_AVX10_2, FeaturesDiamondRapids, 'z', false },
402 // Knights Landing processor.
403 { {"knl"}, CK_KNL, FEATURE_AVX512F, FeaturesKNL, 'Z', false },
404 { {"mic_avx512"}, CK_KNL, FEATURE_AVX512F, FeaturesKNL, 'Z', true },
405 // Knights Mill processor.
406 { {"knm"}, CK_KNM, FEATURE_AVX5124FMAPS, FeaturesKNM, 'j', false },
407 // Lakemont microarchitecture based processors.
408 { {"lakemont"}, CK_Lakemont, ~0U, FeatureCMPXCHG8B, '\0', false },
409 // K6 architecture processors.
410 { {"k6"}, CK_K6, ~0U, FeaturesK6, '\0', false },
411 { {"k6-2"}, CK_K6_2, ~0U, FeaturesK6 | FeaturePRFCHW, '\0', false },
412 { {"k6-3"}, CK_K6_3, ~0U, FeaturesK6 | FeaturePRFCHW, '\0', false },
413 // K7 architecture processors.
414 { {"athlon"}, CK_Athlon, ~0U, FeaturesAthlon, '\0', false },
415 { {"athlon-tbird"}, CK_Athlon, ~0U, FeaturesAthlon, '\0', false },
416 { {"athlon-xp"}, CK_AthlonXP, ~0U, FeaturesAthlonXP, '\0', false },
417 { {"athlon-mp"}, CK_AthlonXP, ~0U, FeaturesAthlonXP, '\0', false },
418 { {"athlon-4"}, CK_AthlonXP, ~0U, FeaturesAthlonXP, '\0', false },
419 // K8 architecture processors.
420 { {"k8"}, CK_K8, ~0U, FeaturesK8, '\0', false },
421 { {"athlon64"}, CK_K8, ~0U, FeaturesK8, '\0', false },
422 { {"athlon-fx"}, CK_K8, ~0U, FeaturesK8, '\0', false },
423 { {"opteron"}, CK_K8, ~0U, FeaturesK8, '\0', false },
424 { {"k8-sse3"}, CK_K8SSE3, ~0U, FeaturesK8SSE3, '\0', false },
425 { {"athlon64-sse3"}, CK_K8SSE3, ~0U, FeaturesK8SSE3, '\0', false },
426 { {"opteron-sse3"}, CK_K8SSE3, ~0U, FeaturesK8SSE3, '\0', false },
427 { {"amdfam10"}, CK_AMDFAM10, FEATURE_SSE4_A, FeaturesAMDFAM10, '\0', false },
428 { {"barcelona"}, CK_AMDFAM10, FEATURE_SSE4_A, FeaturesAMDFAM10, '\0', false },
429 // Bobcat architecture processors.
430 { {"btver1"}, CK_BTVER1, FEATURE_SSE4_A, FeaturesBTVER1, '\0', false },
431 { {"btver2"}, CK_BTVER2, FEATURE_BMI, FeaturesBTVER2, '\0', false },
432 // Bulldozer architecture processors.
433 { {"bdver1"}, CK_BDVER1, FEATURE_XOP, FeaturesBDVER1, '\0', false },
434 { {"bdver2"}, CK_BDVER2, FEATURE_FMA, FeaturesBDVER2, '\0', false },
435 { {"bdver3"}, CK_BDVER3, FEATURE_FMA, FeaturesBDVER3, '\0', false },
436 { {"bdver4"}, CK_BDVER4, FEATURE_AVX2, FeaturesBDVER4, '\0', false },
437 // Zen architecture processors.
438 { {"znver1"}, CK_ZNVER1, FEATURE_AVX2, FeaturesZNVER1, '\0', false },
439 { {"znver2"}, CK_ZNVER2, FEATURE_AVX2, FeaturesZNVER2, '\0', false },
440 { {"znver3"}, CK_ZNVER3, FEATURE_AVX2, FeaturesZNVER3, '\0', false },
441 { {"znver4"}, CK_ZNVER4, FEATURE_AVX512VBMI2, FeaturesZNVER4, '\0', false },
442 { {"znver5"}, CK_ZNVER5, FEATURE_AVX512VP2INTERSECT, FeaturesZNVER5, '\0', false },
443 // Generic 64-bit processor.
444 { {"x86-64"}, CK_x86_64, FEATURE_SSE2 , FeaturesX86_64, '\0', false },
445 { {"x86-64-v2"}, CK_x86_64_v2, FEATURE_SSE4_2 , FeaturesX86_64_V2, '\0', false },
446 { {"x86-64-v3"}, CK_x86_64_v3, FEATURE_AVX2, FeaturesX86_64_V3, '\0', false },
447 { {"x86-64-v4"}, CK_x86_64_v4, FEATURE_AVX512VL, FeaturesX86_64_V4, '\0', false },
448 // Geode processors.
449 { {"geode"}, CK_Geode, ~0U, FeaturesGeode, '\0', false },
450};
451// clang-format on
452
453constexpr const char *NoTuneList[] = {"x86-64-v2", "x86-64-v3", "x86-64-v4"};
454
456 for (const auto &P : Processors)
457 if (!P.OnlyForCPUDispatchSpecific && P.Name == CPU &&
458 (P.Features[FEATURE_64BIT] || !Only64Bit))
459 return P.Kind;
460
461 return CK_None;
462}
463
466 return CK_None;
467 return parseArchX86(CPU, Only64Bit);
468}
469
471 bool Only64Bit) {
472 for (const auto &P : Processors)
473 if (!P.OnlyForCPUDispatchSpecific && !P.Name.empty() &&
474 (P.Features[FEATURE_64BIT] || !Only64Bit))
475 Values.emplace_back(P.Name);
476}
477
479 bool Only64Bit) {
480 for (const ProcInfo &P : Processors)
481 if (!P.OnlyForCPUDispatchSpecific && !P.Name.empty() &&
482 (P.Features[FEATURE_64BIT] || !Only64Bit) &&
484 Values.emplace_back(P.Name);
485}
486
488 // FIXME: Can we avoid a linear search here? The table might be sorted by
489 // CPUKind so we could binary search?
490 for (const auto &P : Processors) {
491 if (P.Kind == Kind) {
492 assert(P.KeyFeature != ~0U && "Processor does not have a key feature.");
493 return static_cast<ProcessorFeatures>(P.KeyFeature);
494 }
495 }
496
497 llvm_unreachable("Unable to find CPU kind!");
498}
499
500// Features with no dependencies.
547
548// Not really CPU features, but need to be in the table because clang uses
549// target features to communicate them to the backend.
555
556// XSAVE features are dependent on basic XSAVE.
557constexpr FeatureBitset ImpliedFeaturesXSAVEC = FeatureXSAVE;
558constexpr FeatureBitset ImpliedFeaturesXSAVEOPT = FeatureXSAVE;
559constexpr FeatureBitset ImpliedFeaturesXSAVES = FeatureXSAVE;
560
561// SSE/AVX/AVX512F chain.
563constexpr FeatureBitset ImpliedFeaturesSSE2 = FeatureSSE;
564constexpr FeatureBitset ImpliedFeaturesSSE3 = FeatureSSE2;
565constexpr FeatureBitset ImpliedFeaturesSSSE3 = FeatureSSE3;
566constexpr FeatureBitset ImpliedFeaturesSSE4_1 = FeatureSSSE3;
567constexpr FeatureBitset ImpliedFeaturesSSE4_2 = FeatureSSE4_1;
568constexpr FeatureBitset ImpliedFeaturesAVX = FeatureSSE4_2;
569constexpr FeatureBitset ImpliedFeaturesAVX2 = FeatureAVX;
572 FeatureAVX2 | FeatureF16C | FeatureFMA;
573
574// Vector extensions that build on SSE or AVX.
575constexpr FeatureBitset ImpliedFeaturesAES = FeatureSSE2;
576constexpr FeatureBitset ImpliedFeaturesF16C = FeatureAVX;
577constexpr FeatureBitset ImpliedFeaturesFMA = FeatureAVX;
578constexpr FeatureBitset ImpliedFeaturesGFNI = FeatureSSE2;
579constexpr FeatureBitset ImpliedFeaturesPCLMUL = FeatureSSE2;
580constexpr FeatureBitset ImpliedFeaturesSHA = FeatureSSE2;
581constexpr FeatureBitset ImpliedFeaturesVAES = FeatureAES | FeatureAVX2;
582constexpr FeatureBitset ImpliedFeaturesVPCLMULQDQ = FeatureAVX | FeaturePCLMUL;
583constexpr FeatureBitset ImpliedFeaturesSM3 = FeatureAVX;
584constexpr FeatureBitset ImpliedFeaturesSM4 = FeatureAVX2;
585
586// AVX512 features.
587constexpr FeatureBitset ImpliedFeaturesAVX512CD = FeatureAVX512F;
588constexpr FeatureBitset ImpliedFeaturesAVX512BW = FeatureAVX512F;
589constexpr FeatureBitset ImpliedFeaturesAVX512DQ = FeatureAVX512F;
590constexpr FeatureBitset ImpliedFeaturesAVX512VL = FeatureAVX512F;
591
592constexpr FeatureBitset ImpliedFeaturesAVX512BF16 = FeatureAVX512BW;
593constexpr FeatureBitset ImpliedFeaturesAVX512BITALG = FeatureAVX512BW;
594constexpr FeatureBitset ImpliedFeaturesAVX512IFMA = FeatureAVX512F;
595constexpr FeatureBitset ImpliedFeaturesAVX512VNNI = FeatureAVX512F;
597constexpr FeatureBitset ImpliedFeaturesAVX512VBMI = FeatureAVX512BW;
598constexpr FeatureBitset ImpliedFeaturesAVX512VBMI2 = FeatureAVX512BW;
600
601// FIXME: These two aren't really implemented and just exist in the feature
602// list for __builtin_cpu_supports. So omit their dependencies.
605
606// SSE4_A->FMA4->XOP chain.
607constexpr FeatureBitset ImpliedFeaturesSSE4_A = FeatureSSE3;
608constexpr FeatureBitset ImpliedFeaturesFMA4 = FeatureAVX | FeatureSSE4_A;
609constexpr FeatureBitset ImpliedFeaturesXOP = FeatureFMA4;
610
611// AMX Features
613constexpr FeatureBitset ImpliedFeaturesAMX_BF16 = FeatureAMX_TILE;
614constexpr FeatureBitset ImpliedFeaturesAMX_FP16 = FeatureAMX_TILE;
615constexpr FeatureBitset ImpliedFeaturesAMX_INT8 = FeatureAMX_TILE;
616constexpr FeatureBitset ImpliedFeaturesAMX_COMPLEX = FeatureAMX_TILE;
617constexpr FeatureBitset ImpliedFeaturesAMX_FP8 = FeatureAMX_TILE;
618constexpr FeatureBitset ImpliedFeaturesAMX_MOVRS = FeatureAMX_TILE;
620 FeatureAMX_TILE | FeatureAVX10_2;
621constexpr FeatureBitset ImpliedFeaturesAMX_TF32 = FeatureAMX_TILE;
623
629constexpr FeatureBitset ImpliedFeaturesAVXIFMA = FeatureAVX2;
631constexpr FeatureBitset ImpliedFeaturesSHA512 = FeatureAVX2;
632constexpr FeatureBitset ImpliedFeaturesAVX512FP16 = FeatureAVX512BW;
633// Key Locker Features
634constexpr FeatureBitset ImpliedFeaturesKL = FeatureSSE2;
636
637// AVXVNNI Features
638constexpr FeatureBitset ImpliedFeaturesAVXVNNI = FeatureAVX2;
639
640// AVX10 Features
642 FeatureAVX512CD | FeatureAVX512VBMI | FeatureAVX512IFMA |
643 FeatureAVX512VNNI | FeatureAVX512BF16 | FeatureAVX512VPOPCNTDQ |
644 FeatureAVX512VBMI2 | FeatureAVX512BITALG | FeatureAVX512FP16 |
645 FeatureAVX512DQ | FeatureAVX512VL;
646constexpr FeatureBitset ImpliedFeaturesAVX10_2 = FeatureAVX10_1;
647
648// APX Features
657
662
664
665constexpr FeatureInfo FeatureInfos[] = {
666#define X86_FEATURE(ENUM, STR) {{"+" STR}, ImpliedFeatures##ENUM},
667#include "llvm/TargetParser/X86TargetParser.def"
668};
669
671 SmallVectorImpl<StringRef> &EnabledFeatures,
672 bool NeedPlus) {
674 [&](const ProcInfo &P) { return P.Name == CPU; });
675 assert(I != std::end(Processors) && "Processor not found!");
676
677 FeatureBitset Bits = I->Features;
678
679 // Remove the 64-bit feature which we only use to validate if a CPU can
680 // be used with 64-bit mode.
681 Bits &= ~Feature64BIT;
682
683 // Add the string version of all set bits.
684 for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i)
685 if (Bits[i] && !FeatureInfos[i].getName(NeedPlus).empty())
686 EnabledFeatures.push_back(FeatureInfos[i].getName(NeedPlus));
687}
688
689// For each feature that is (transitively) implied by this feature, set it.
691 const FeatureBitset &Implies) {
692 // Fast path: Implies is often empty.
693 if (!Implies.any())
694 return;
695 FeatureBitset Prev;
696 Bits |= Implies;
697 do {
698 Prev = Bits;
699 for (unsigned i = CPU_FEATURE_MAX; i;)
700 if (Bits[--i])
701 Bits |= FeatureInfos[i].ImpliedFeatures;
702 } while (Prev != Bits);
703}
704
705/// Create bit vector of features that are implied disabled if the feature
706/// passed in Value is disabled.
707static void getImpliedDisabledFeatures(FeatureBitset &Bits, unsigned Value) {
708 // Check all features looking for any dependent on this feature. If we find
709 // one, mark it and recursively find any feature that depend on it.
710 FeatureBitset Prev;
711 Bits.set(Value);
712 do {
713 Prev = Bits;
714 for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i)
715 if ((FeatureInfos[i].ImpliedFeatures & Bits).any())
716 Bits.set(i);
717 } while (Prev != Bits);
718}
719
721 StringRef Feature, bool Enabled,
722 StringMap<bool> &Features) {
723 auto I = llvm::find_if(FeatureInfos, [&](const FeatureInfo &FI) {
724 return FI.getName() == Feature;
725 });
726 if (I == std::end(FeatureInfos)) {
727 // FIXME: This shouldn't happen, but may not have all features in the table
728 // yet.
729 return;
730 }
731
732 FeatureBitset ImpliedBits;
733 if (Enabled)
734 getImpliedEnabledFeatures(ImpliedBits, I->ImpliedFeatures);
735 else
736 getImpliedDisabledFeatures(ImpliedBits,
737 std::distance(std::begin(FeatureInfos), I));
738
739 // Update the map entry for all implied features.
740 for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i)
741 if (ImpliedBits[i] && !FeatureInfos[i].getName().empty())
742 Features[FeatureInfos[i].getName()] = Enabled;
743}
744
747 [&](const ProcInfo &P) { return P.Name == CPU; });
748 assert(I != std::end(Processors) && "Processor not found!");
749 assert(I->Mangling != '\0' && "Processor dooesn't support function multiversion!");
750 return I->Mangling;
751}
752
755 [&](const ProcInfo &P) { return P.Name == Name; });
756 return I != std::end(Processors);
757}
758
759std::array<uint32_t, 4>
761 // Processor features and mapping to processor feature value.
762 std::array<uint32_t, 4> FeatureMask{};
763 for (StringRef FeatureStr : FeatureStrs) {
764 unsigned Feature = StringSwitch<unsigned>(FeatureStr)
765#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY, ABI_VALUE) .Case(STR, ABI_VALUE)
766#define X86_MICROARCH_LEVEL(ENUM, STR, PRIORITY, ABI_VALUE) \
767 .Case(STR, ABI_VALUE)
768#include "llvm/TargetParser/X86TargetParser.def"
769 ;
770 assert(Feature / 32 < FeatureMask.size());
771 FeatureMask[Feature / 32] |= 1U << (Feature % 32);
772 }
773 return FeatureMask;
774}
775
777#ifndef NDEBUG
778 // Check that priorities are set properly in the .def file. We expect that
779 // "compat" features are assigned non-duplicate consecutive priorities
780 // starting from one (1, ..., MAX_PRIORITY) and multiple zeros.
781#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY, ABI_VALUE) PRIORITY,
782 unsigned Priorities[] = {
783#include "llvm/TargetParser/X86TargetParser.def"
784 };
785 std::array<unsigned, std::size(Priorities)> HelperList;
786 std::iota(HelperList.begin(), HelperList.begin() + MAX_PRIORITY + 1, 0);
787 for (size_t i = MAX_PRIORITY + 1; i != std::size(Priorities); ++i)
788 HelperList[i] = 0;
789 assert(std::is_permutation(HelperList.begin(), HelperList.end(),
790 std::begin(Priorities), std::end(Priorities)) &&
791 "Priorities don't form consecutive range!");
792#endif
793
794 switch (Feat) {
795#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY, ABI_VALUE) \
796 case X86::FEATURE_##ENUM: \
797 return PRIORITY;
798#include "llvm/TargetParser/X86TargetParser.def"
799 default:
800 llvm_unreachable("No Feature Priority for non-CPUSupports Features");
801 }
802}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define I(x, y, z)
Definition MD5.cpp:57
#define P(N)
static StringRef getName(Value *V)
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
constexpr FeatureBitset FeaturesClearwaterforest
constexpr FeatureBitset FeaturesX86_64
constexpr FeatureBitset ImpliedFeaturesLVI_LOAD_HARDENING
constexpr FeatureBitset FeaturesWestmere
constexpr FeatureBitset ImpliedFeaturesNDD
constexpr FeatureBitset ImpliedFeaturesXSAVEOPT
constexpr FeatureBitset FeaturesAthlon
constexpr FeatureBitset ImpliedFeaturesAMX_COMPLEX
constexpr FeatureBitset ImpliedFeaturesAVX5124VNNIW
constexpr FeatureBitset ImpliedFeaturesPOPCNT
constexpr FeatureBitset ImpliedFeaturesAVX512CD
constexpr FeatureBitset ImpliedFeaturesSSE4_1
constexpr FeatureBitset FeaturesZNVER2
constexpr FeatureBitset ImpliedFeaturesAPXF
constexpr FeatureBitset FeaturesBDVER3
constexpr FeatureBitset ImpliedFeaturesBMI2
constexpr FeatureBitset FeaturesGeode
constexpr FeatureBitset ImpliedFeaturesLWP
constexpr FeatureBitset ImpliedFeaturesPREFETCHI
constexpr FeatureBitset ImpliedFeaturesAVX512FP16
constexpr FeatureBitset FeaturesCascadeLake
constexpr FeatureBitset ImpliedFeaturesCLDEMOTE
constexpr FeatureBitset FeaturesK8SSE3
constexpr FeatureBitset FeaturesZNVER1
constexpr FeatureBitset FeaturesNocona
constexpr FeatureBitset ImpliedFeaturesEVEX512
constexpr FeatureBitset ImpliedFeaturesSSE4_A
constexpr FeatureBitset FeaturesPrescott
constexpr FeatureBitset FeaturesCooperLake
constexpr FeatureBitset ImpliedFeaturesEGPR
constexpr FeatureBitset ImpliedFeaturesFXSR
constexpr FeatureBitset FeaturesSapphireRapids
constexpr FeatureBitset ImpliedFeaturesAVX512DQ
constexpr FeatureBitset ImpliedFeaturesSERIALIZE
constexpr FeatureBitset ImpliedFeaturesVPCLMULQDQ
constexpr FeatureBitset ImpliedFeaturesWBNOINVD
constexpr FeatureBitset ImpliedFeaturesAES
constexpr FeatureBitset FeaturesTremont
constexpr FeatureBitset ImpliedFeaturesPush2Pop2
constexpr FeatureBitset FeaturesBDVER1
constexpr FeatureBitset ImpliedFeaturesWAITPKG
constexpr FeatureBitset ImpliedFeaturesCRC32
static constexpr FeatureBitset FeaturesZNVER3
constexpr FeatureBitset FeaturesGoldmontPlus
constexpr FeatureBitset ImpliedFeaturesRDPID
constexpr FeatureBitset ImpliedFeaturesPRFCHW
constexpr FeatureBitset FeaturesCannonlake
constexpr FeatureBitset ImpliedFeaturesX87
constexpr FeatureBitset ImpliedFeaturesAVX512VPOPCNTDQ
constexpr FeatureBitset ImpliedFeaturesVAES
constexpr FeatureBitset FeaturesSandyBridge
constexpr FeatureBitset ImpliedFeaturesAMX_INT8
constexpr FeatureBitset ImpliedFeaturesAVX512BF16
constexpr FeatureBitset ImpliedFeaturesRDPRU
constexpr FeatureBitset FeaturesAMDFAM10
constexpr FeatureBitset ImpliedFeaturesAMX_TILE
constexpr FeatureBitset FeaturesSkylakeServer
constexpr FeatureBitset FeaturesPentiumMMX
constexpr FeatureBitset ImpliedFeaturesCLWB
constexpr FeatureBitset ImpliedFeaturesAVX512IFMA
constexpr FeatureBitset FeaturesKNL
constexpr FeatureBitset FeaturesNehalem
constexpr FeatureBitset FeaturesBTVER1
constexpr FeatureBitset FeaturesPentium3
constexpr FeatureBitset ImpliedFeaturesTBM
constexpr FeatureBitset ImpliedFeaturesAVXNECONVERT
constexpr FeatureBitset FeaturesAthlonXP
constexpr FeatureBitset FeaturesGraniteRapids
constexpr FeatureBitset ImpliedFeaturesFSGSBASE
constexpr FeatureBitset FeaturesPantherlake
constexpr FeatureBitset ImpliedFeaturesPCONFIG
constexpr FeatureBitset ImpliedFeaturesAVX
constexpr FeatureBitset FeaturesX86_64_V3
constexpr FeatureBitset ImpliedFeaturesRETPOLINE_INDIRECT_BRANCHES
constexpr FeatureBitset ImpliedFeaturesAVX512VBMI2
constexpr FeatureBitset ImpliedFeaturesCMPCCXADD
constexpr FeatureBitset ImpliedFeaturesCLFLUSHOPT
constexpr FeatureBitset ImpliedFeaturesAVX5124FMAPS
constexpr FeatureBitset FeaturesDiamondRapids
constexpr FeatureBitset ImpliedFeaturesF16C
constexpr FeatureBitset ImpliedFeaturesAVX10_2
constexpr FeatureBitset ImpliedFeaturesXSAVE
constexpr FeatureBitset FeaturesX86_64_V2
constexpr FeatureBitset FeaturesArrowlakeS
constexpr FeatureBitset ImpliedFeaturesMOVBE
constexpr FeatureBitset FeaturesIvyBridge
constexpr FeatureBitset FeaturesHaswell
static constexpr FeatureBitset FeaturesZNVER5
constexpr FeatureBitset ImpliedFeaturesRETPOLINE_INDIRECT_CALLS
constexpr FeatureBitset ImpliedFeaturesSSSE3
constexpr FeatureBitset ImpliedFeaturesAVXVNNIINT8
constexpr FeatureBitset ImpliedFeaturesCCMP
constexpr FeatureBitset FeaturesICLClient
constexpr FeatureBitset ImpliedFeaturesCF
static void getImpliedDisabledFeatures(FeatureBitset &Bits, unsigned Value)
Create bit vector of features that are implied disabled if the feature passed in Value is disabled.
constexpr FeatureBitset ImpliedFeaturesHRESET
constexpr const char * NoTuneList[]
constexpr FeatureBitset ImpliedFeaturesUINTR
constexpr FeatureBitset ImpliedFeaturesCMOV
constexpr FeatureBitset ImpliedFeaturesAVX512BITALG
constexpr FeatureBitset ImpliedFeaturesRTM
constexpr FeatureBitset FeaturesRocketlake
constexpr FeatureBitset ImpliedFeaturesMOVDIRI
constexpr FeatureBitset ImpliedFeaturesMWAITX
constexpr FeatureBitset ImpliedFeaturesSSE3
constexpr FeatureBitset ImpliedFeaturesVZEROUPPER
constexpr FeatureBitset FeaturesBTVER2
constexpr FeatureBitset FeaturesSkylakeClient
constexpr FeatureBitset ImpliedFeaturesPPX
static void getImpliedEnabledFeatures(FeatureBitset &Bits, const FeatureBitset &Implies)
constexpr FeatureBitset FeaturesPentium2
constexpr FeatureBitset ImpliedFeaturesSHSTK
constexpr FeatureBitset ImpliedFeaturesAMX_FP16
constexpr FeatureBitset ImpliedFeaturesMMX
constexpr FeatureBitset FeaturesICLServer
constexpr FeatureBitset ImpliedFeaturesRETPOLINE_EXTERNAL_THUNK
constexpr FeatureBitset ImpliedFeaturesAMX_BF16
constexpr FeatureBitset FeaturesBroadwell
constexpr ProcInfo Processors[]
constexpr FeatureBitset ImpliedFeaturesAMX_AVX512
constexpr FeatureBitset ImpliedFeaturesCLZERO
constexpr FeatureBitset ImpliedFeaturesAVXVNNIINT16
constexpr FeatureBitset ImpliedFeaturesMOVRS
constexpr FeatureBitset ImpliedFeaturesFMA4
constexpr FeatureBitset ImpliedFeaturesFMA
constexpr FeatureBitset FeaturesSierraforest
constexpr FeatureBitset FeaturesK6
constexpr FeatureBitset ImpliedFeaturesRAOINT
constexpr FeatureBitset FeaturesX86_64_V4
constexpr FeatureBitset FeaturesNovalake
constexpr FeatureBitset ImpliedFeaturesLVI_CFI
constexpr FeatureBitset ImpliedFeaturesCMPXCHG16B
constexpr FeatureBitset ImpliedFeaturesSSE2
constexpr FeatureBitset FeaturesBonnell
constexpr FeatureBitset FeaturesPenryn
constexpr FeatureBitset ImpliedFeaturesKL
constexpr FeatureBitset ImpliedFeaturesBMI
constexpr FeatureBitset ImpliedFeaturesGFNI
constexpr FeatureBitset ImpliedFeatures64BIT
constexpr FeatureBitset FeaturesK8
constexpr FeatureBitset ImpliedFeaturesAVX512VP2INTERSECT
constexpr FeatureBitset ImpliedFeaturesSM4
constexpr FeatureBitset ImpliedFeaturesENQCMD
constexpr FeatureBitset ImpliedFeaturesAVXVNNI
constexpr FeatureBitset ImpliedFeaturesPKU
constexpr FeatureBitset ImpliedFeaturesTSXLDTRK
constexpr FeatureBitset ImpliedFeaturesPTWRITE
constexpr FeatureBitset FeaturesPentium4
constexpr FeatureBitset ImpliedFeaturesXSAVES
constexpr FeatureBitset ImpliedFeaturesAVX512VNNI
constexpr FeatureBitset ImpliedFeaturesAVX512BW
constexpr FeatureBitset ImpliedFeaturesSGX
constexpr FeatureBitset ImpliedFeaturesSSE4_2
constexpr FeatureBitset ImpliedFeaturesAVX512VBMI
constexpr FeatureBitset FeaturesAlderlake
constexpr FeatureBitset ImpliedFeaturesSHA512
constexpr FeatureBitset ImpliedFeaturesAMX_MOVRS
constexpr FeatureBitset ImpliedFeaturesAVXIFMA
constexpr FeatureBitset ImpliedFeaturesAMX_TF32
constexpr FeatureBitset ImpliedFeaturesPCLMUL
constexpr FeatureBitset ImpliedFeaturesXSAVEC
constexpr FeatureBitset FeaturesBDVER2
constexpr FeatureBitset ImpliedFeaturesSSE
constexpr FeatureBitset ImpliedFeaturesNF
constexpr FeatureBitset FeaturesKNM
constexpr FeatureBitset ImpliedFeaturesSAHF
constexpr FeatureBitset ImpliedFeaturesLZCNT
constexpr FeatureBitset ImpliedFeaturesMOVDIR64B
constexpr FeatureBitset ImpliedFeaturesCMPXCHG8B
constexpr FeatureInfo FeatureInfos[]
constexpr FeatureBitset FeaturesGoldmont
constexpr FeatureBitset ImpliedFeaturesAVX2
constexpr FeatureBitset FeaturesBDVER4
constexpr FeatureBitset ImpliedFeaturesAVX512VL
constexpr FeatureBitset FeaturesSilvermont
constexpr FeatureBitset ImpliedFeaturesAMX_FP8
constexpr FeatureBitset FeaturesCore2
constexpr FeatureBitset ImpliedFeaturesXOP
constexpr FeatureBitset ImpliedFeaturesINVPCID
constexpr FeatureBitset ImpliedFeaturesRDSEED
constexpr FeatureBitset ImpliedFeaturesAVX512F
constexpr FeatureBitset ImpliedFeaturesSM3
constexpr FeatureBitset ImpliedFeaturesWIDEKL
constexpr FeatureBitset ImpliedFeaturesADX
constexpr FeatureBitset FeaturesArrowlake
static constexpr FeatureBitset FeaturesZNVER4
constexpr FeatureBitset ImpliedFeaturesSHA
constexpr FeatureBitset ImpliedFeaturesUSERMSR
constexpr FeatureBitset FeaturesTigerlake
constexpr FeatureBitset ImpliedFeaturesAVX10_1
constexpr FeatureBitset ImpliedFeaturesRDRND
constexpr FeatureBitset ImpliedFeaturesZU
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
This is a constexpr reimplementation of a subset of std::bitset.
Definition Bitset.h:30
Container class for subtarget features.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
void push_back(const T &Elt)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:133
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
A switch()-like statement whose cases are string literals.
LLVM Value Representation.
Definition Value.h:75
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Define some predicates that are used for node matching.
LLVM_ABI std::array< uint32_t, 4 > getCpuSupportsMask(ArrayRef< StringRef > FeatureStrs)
LLVM_ABI char getCPUDispatchMangling(StringRef Name)
LLVM_ABI CPUKind parseTuneCPU(StringRef CPU, bool Only64Bit=false)
LLVM_ABI void updateImpliedFeatures(StringRef Feature, bool Enabled, StringMap< bool > &Features)
Set or clear entries in Features that are implied to be enabled/disabled by the provided Feature.
LLVM_ABI CPUKind parseArchX86(StringRef CPU, bool Only64Bit=false)
Parse CPU string into a CPUKind.
LLVM_ABI void fillValidTuneCPUList(SmallVectorImpl< StringRef > &Values, bool Only64Bit=false)
Provide a list of valid -mtune names.
LLVM_ABI void getFeaturesForCPU(StringRef CPU, SmallVectorImpl< StringRef > &Features, bool NeedPlus=false)
Fill in the features that CPU supports into Features.
LLVM_ABI unsigned getFeaturePriority(ProcessorFeatures Feat)
LLVM_ABI void fillValidCPUArchList(SmallVectorImpl< StringRef > &Values, bool Only64Bit=false)
Provide a list of valid CPU names.
LLVM_ABI bool validateCPUSpecificCPUDispatch(StringRef Name)
LLVM_ABI ProcessorFeatures getKeyFeature(CPUKind Kind)
Get the key feature prioritizing target multiversioning.
This is an optimization pass for GlobalISel generic memory operations.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1758
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1897
@ Enabled
Convert any .debug_str_offsets tables to DWARF64 if needed.
Definition DWP.h:27