LLVM 23.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"
15#include "llvm/ADT/Enum.h"
17#include <numeric>
18
19using namespace llvm;
20using namespace llvm::X86;
21
22namespace {
23
25
26struct ProcInfo {
27 X86::CPUKind Kind;
28 unsigned KeyFeature;
29 FeatureBitset Features;
30 char Mangling;
31 bool OnlyForCPUDispatchSpecific;
32};
33
34} // end anonymous namespace
35
36#define X86_FEATURE(ENUM, STRING) \
37 constexpr FeatureBitset Feature##ENUM = {X86::FEATURE_##ENUM};
38#include "llvm/TargetParser/X86TargetParser.def"
39
40// Pentium with MMX.
42 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX;
43
44// Pentium 2 and 3.
46 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeatureFXSR | FeatureCMOV;
48
49// Pentium 4 CPUs
53 FeaturesPrescott | Feature64BIT | FeatureCMPXCHG16B;
54
55// Basic 64-bit capable CPU.
58 FeaturePOPCNT | FeatureCRC32 |
59 FeatureSSE4_2 | FeatureCMPXCHG16B;
61 FeaturesX86_64_V2 | FeatureAVX2 | FeatureBMI | FeatureBMI2 | FeatureF16C |
62 FeatureFMA | FeatureLZCNT | FeatureMOVBE | FeatureXSAVE;
64 FeatureAVX512BW | FeatureAVX512CD |
65 FeatureAVX512DQ | FeatureAVX512VL;
66
67// Intel Core CPUs
69 FeaturesNocona | FeatureSAHF | FeatureSSSE3;
70constexpr FeatureBitset FeaturesPenryn = FeaturesCore2 | FeatureSSE4_1;
72 FeaturesPenryn | FeaturePOPCNT | FeatureCRC32 | FeatureSSE4_2;
75 FeaturesWestmere | FeatureAVX | FeatureXSAVE | FeatureXSAVEOPT;
77 FeaturesSandyBridge | FeatureF16C | FeatureFSGSBASE | FeatureRDRND;
79 FeaturesIvyBridge | FeatureAVX2 | FeatureBMI | FeatureBMI2 | FeatureFMA |
80 FeatureINVPCID | FeatureLZCNT | FeatureMOVBE;
82 FeaturesHaswell | FeatureADX | FeaturePRFCHW | FeatureRDSEED;
83
84// Intel Knights Landing and Knights Mill
85// Knights Landing has feature parity with Broadwell.
87 FeaturesBroadwell | FeatureAES | FeatureAVX512F | FeatureAVX512CD;
88constexpr FeatureBitset FeaturesKNM = FeaturesKNL | FeatureAVX512VPOPCNTDQ;
89
90// Intel Skylake processors.
92 FeaturesBroadwell | FeatureAES | FeatureCLFLUSHOPT | FeatureXSAVEC |
93 FeatureXSAVES | FeatureSGX;
94// SkylakeServer inherits all SkylakeClient features except SGX.
95// FIXME: That doesn't match gcc.
97 (FeaturesSkylakeClient & ~FeatureSGX) | FeatureAVX512F | FeatureAVX512CD |
98 FeatureAVX512DQ | FeatureAVX512BW | FeatureAVX512VL | FeatureCLWB |
99 FeaturePKU;
101 FeaturesSkylakeServer | FeatureAVX512VNNI;
103 FeaturesCascadeLake | FeatureAVX512BF16;
104
105// Intel 10nm processors.
107 FeaturesSkylakeClient | FeatureAVX512F | FeatureAVX512CD | FeatureAVX512DQ |
108 FeatureAVX512BW | FeatureAVX512VL | FeatureAVX512IFMA | FeatureAVX512VBMI |
109 FeaturePKU | FeatureSHA;
111 FeaturesCannonlake | FeatureAVX512BITALG | FeatureAVX512VBMI2 |
112 FeatureAVX512VNNI | FeatureAVX512VPOPCNTDQ | FeatureGFNI | FeatureRDPID |
113 FeatureVAES | FeatureVPCLMULQDQ;
116 FeaturesICLClient | FeatureCLWB | FeaturePCONFIG | FeatureWBNOINVD;
118 FeaturesICLClient | FeatureAVX512VP2INTERSECT | FeatureMOVDIR64B |
119 FeatureCLWB | FeatureMOVDIRI | FeatureSHSTK | FeatureKL | FeatureWIDEKL;
121 FeaturesICLServer | FeatureAMX_BF16 | FeatureAMX_INT8 | FeatureAMX_TILE |
122 FeatureAVX512BF16 | FeatureAVX512FP16 | FeatureAVXVNNI | FeatureCLDEMOTE |
123 FeatureENQCMD | FeatureMOVDIR64B | FeatureMOVDIRI | FeaturePTWRITE |
124 FeatureSERIALIZE | FeatureSHSTK | FeatureTSXLDTRK | FeatureUINTR |
125 FeatureWAITPKG | FeatureAVX512DQ | FeatureAVX512VL;
127 FeaturesSapphireRapids | FeatureAMX_FP16 | FeaturePREFETCHI;
129 FeaturesGraniteRapids | FeatureAMX_COMPLEX | FeatureAVX10_2 |
130 FeatureCMPCCXADD | FeatureAVXIFMA | FeatureAVXNECONVERT |
131 FeatureAVXVNNIINT8 | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
132 FeatureSM4 | FeatureEGPR | FeatureZU | FeatureCCMP | FeaturePush2Pop2 |
133 FeaturePPX | FeatureNDD | FeatureNF | FeatureJMPABS | FeatureMOVRS |
134 FeatureAMX_MOVRS | FeatureAMX_AVX512 | FeatureAMX_FP8 | FeatureAMX_TF32;
135
136// Intel Atom processors.
137// Bonnell has feature parity with Core2 and adds MOVBE.
138constexpr FeatureBitset FeaturesBonnell = FeaturesCore2 | FeatureMOVBE;
139// Silvermont has parity with Westmere and Bonnell plus PRFCHW and RDRND.
141 FeaturesBonnell | FeaturesWestmere | FeaturePRFCHW | FeatureRDRND;
143 FeaturesSilvermont | FeatureAES | FeatureCLFLUSHOPT | FeatureFSGSBASE |
144 FeatureRDSEED | FeatureSHA | FeatureXSAVE | FeatureXSAVEC |
145 FeatureXSAVEOPT | FeatureXSAVES;
147 FeaturesGoldmont | FeaturePTWRITE | FeatureRDPID | FeatureSGX;
149 FeaturesGoldmontPlus | FeatureCLWB | FeatureGFNI;
151 FeaturesTremont | FeatureADX | FeatureBMI | FeatureBMI2 | FeatureF16C |
152 FeatureFMA | FeatureINVPCID | FeatureLZCNT | FeaturePCONFIG | FeaturePKU |
153 FeatureSERIALIZE | FeatureSHSTK | FeatureVAES | FeatureVPCLMULQDQ |
154 FeatureMOVDIR64B | FeatureMOVDIRI | FeatureWAITPKG | FeatureAVXVNNI |
155 FeatureHRESET | FeatureWIDEKL;
157 FeaturesAlderlake | FeatureCMPCCXADD | FeatureAVXIFMA | FeatureUINTR |
158 FeatureENQCMD | FeatureAVXNECONVERT | FeatureAVXVNNIINT8;
160 FeaturesArrowlake | FeatureCLDEMOTE;
162 FeaturesArrowlake | FeatureAVXVNNIINT16 | FeatureSHA512 | FeatureSM3 |
163 FeatureSM4;
165 (FeaturesArrowlakeS ^ FeatureWIDEKL);
167 FeaturesPantherlake | FeaturePREFETCHI | FeatureAVX10_2 | FeatureMOVRS |
168 FeatureEGPR | FeatureZU | FeatureCCMP | FeaturePush2Pop2 | FeaturePPX |
169 FeatureNDD | FeatureNF | FeatureJMPABS;
171 (FeaturesSierraforest ^ FeatureWIDEKL) | FeatureAVXVNNIINT16 |
172 FeatureSHA512 | FeatureSM3 | FeatureSM4 | FeaturePREFETCHI | FeatureUSERMSR;
173
174// Geode Processor.
176 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeaturePRFCHW;
177
178// K6 processor.
179constexpr FeatureBitset FeaturesK6 = FeatureX87 | FeatureCMPXCHG8B | FeatureMMX;
180
181// K7 and K8 architecture processors.
183 FeatureX87 | FeatureCMPXCHG8B | FeatureMMX | FeaturePRFCHW;
185 FeaturesAthlon | FeatureFXSR | FeatureSSE;
187 FeaturesAthlonXP | FeatureSSE2 | Feature64BIT;
188constexpr FeatureBitset FeaturesK8SSE3 = FeaturesK8 | FeatureSSE3;
190 FeaturesK8SSE3 | FeatureCMPXCHG16B | FeatureLZCNT | FeaturePOPCNT |
191 FeaturePRFCHW | FeatureSAHF | FeatureSSE4_A;
192
193// Bobcat architecture processors.
195 FeatureX87 | FeatureCMPXCHG8B | FeatureCMPXCHG16B | Feature64BIT |
196 FeatureFXSR | FeatureLZCNT | FeatureMMX | FeaturePOPCNT | FeaturePRFCHW |
197 FeatureSSE | FeatureSSE2 | FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_A |
198 FeatureSAHF;
200 FeaturesBTVER1 | FeatureAES | FeatureAVX | FeatureBMI | FeatureCRC32 |
201 FeatureF16C | FeatureMOVBE | FeaturePCLMUL | FeatureXSAVE | FeatureXSAVEOPT;
202
203// AMD Bulldozer architecture processors.
205 FeatureX87 | FeatureAES | FeatureAVX | FeatureCMPXCHG8B |
206 FeatureCMPXCHG16B | FeatureCRC32 | Feature64BIT | FeatureFMA4 |
207 FeatureFXSR | FeatureLWP | FeatureLZCNT | FeatureMMX | FeaturePCLMUL |
208 FeaturePOPCNT | FeaturePRFCHW | FeatureSAHF | FeatureSSE | FeatureSSE2 |
209 FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_1 | FeatureSSE4_2 | FeatureSSE4_A |
210 FeatureXOP | FeatureXSAVE;
212 FeaturesBDVER1 | FeatureBMI | FeatureFMA | FeatureF16C | FeatureTBM;
214 FeaturesBDVER2 | FeatureFSGSBASE | FeatureXSAVEOPT;
215constexpr FeatureBitset FeaturesBDVER4 = FeaturesBDVER3 | FeatureAVX2 |
216 FeatureBMI2 | FeatureMOVBE |
217 FeatureMWAITX | FeatureRDRND;
218
219// AMD Zen architecture processors.
221 FeatureX87 | FeatureADX | FeatureAES | FeatureAVX | FeatureAVX2 |
222 FeatureBMI | FeatureBMI2 | FeatureCLFLUSHOPT | FeatureCLZERO |
223 FeatureCMPXCHG8B | FeatureCMPXCHG16B | FeatureCRC32 | Feature64BIT |
224 FeatureF16C | FeatureFMA | FeatureFSGSBASE | FeatureFXSR | FeatureLZCNT |
225 FeatureMMX | FeatureMOVBE | FeatureMWAITX | FeaturePCLMUL | FeaturePOPCNT |
226 FeaturePRFCHW | FeatureRDRND | FeatureRDSEED | FeatureSAHF | FeatureSHA |
227 FeatureSSE | FeatureSSE2 | FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_1 |
228 FeatureSSE4_2 | FeatureSSE4_A | FeatureXSAVE | FeatureXSAVEC |
229 FeatureXSAVEOPT | FeatureXSAVES;
230constexpr FeatureBitset FeaturesZNVER2 = FeaturesZNVER1 | FeatureCLWB |
231 FeatureRDPID | FeatureRDPRU |
232 FeatureWBNOINVD;
234 FeatureINVPCID | FeaturePKU |
235 FeatureVAES | FeatureVPCLMULQDQ;
237 FeaturesZNVER3 | FeatureAVX512F | FeatureAVX512CD | FeatureAVX512DQ |
238 FeatureAVX512BW | FeatureAVX512VL | FeatureAVX512IFMA | FeatureAVX512VBMI |
239 FeatureAVX512VBMI2 | FeatureAVX512VNNI | FeatureAVX512BITALG |
240 FeatureAVX512VPOPCNTDQ | FeatureAVX512BF16 | FeatureGFNI | FeatureSHSTK;
241
243 FeaturesZNVER4 | FeatureAVXVNNI | FeatureMOVDIRI | FeatureMOVDIR64B |
244 FeatureAVX512VP2INTERSECT | FeaturePREFETCHI | FeatureAVXVNNI;
245
247 FeaturesZNVER5 | FeatureAVXVNNIINT8 | FeatureAVX512FP16 | FeatureAVXIFMA |
248 FeatureAVXNECONVERT | FeatureAVX512BMM;
249
250// Hygon architecture processors.
252 FeatureX87 | FeatureADX | FeatureAES | FeatureAVX | FeatureAVX2 |
253 FeatureBMI | FeatureBMI2 | FeatureCLFLUSHOPT | FeatureCLZERO |
254 FeatureCMPXCHG8B | FeatureCMPXCHG16B | FeatureCRC32 | Feature64BIT |
255 FeatureF16C | FeatureFMA | FeatureFSGSBASE | FeatureFXSR | FeatureLZCNT |
256 FeatureMMX | FeatureMOVBE | FeatureMWAITX | FeaturePCLMUL | FeaturePOPCNT |
257 FeaturePRFCHW | FeatureRDRND | FeatureRDSEED | FeatureSAHF | FeatureSHA |
258 FeatureSSE | FeatureSSE2 | FeatureSSE3 | FeatureSSSE3 | FeatureSSE4_1 |
259 FeatureSSE4_2 | FeatureSSE4_A | FeatureXSAVE | FeatureXSAVEC |
260 FeatureXSAVEOPT | FeatureXSAVES;
261
263
265 FeaturesC86_4G_M4 | FeatureAVX512BF16 | FeatureAVX512BITALG |
266 FeatureAVX512BW | FeatureAVX512CD | FeatureAVX512DQ | FeatureAVX512F |
267 FeatureAVX512IFMA | FeatureAVX512VBMI | FeatureAVX512VBMI2 |
268 FeatureAVX512VL | FeatureAVX512VNNI | FeatureAVX512VPOPCNTDQ | FeatureCLWB |
269 FeatureCMOV | FeatureGFNI | FeatureVAES | FeatureVPCLMULQDQ |
270 FeatureWBNOINVD;
271
273 FeaturesC86_4G_M7 | FeatureSHSTK;
274
275// D151696 tranplanted Mangling and OnlyForCPUDispatchSpecific from
276// X86TargetParser.def to here. They are assigned by following ways:
277// 1. Copy the mangling from the original CPU_SPEICIFC MACROs. If no, assign
278// to '\0' by default, which means not support cpu_specific/dispatch feature.
279// 2. set OnlyForCPUDispatchSpecific as true if this cpu name was not
280// listed here before, which means it doesn't support -march, -mtune and so on.
281// FIXME: Remove OnlyForCPUDispatchSpecific after all CPUs here support both
282// cpu_dispatch/specific() feature and -march, -mtune, and so on.
283// clang-format off
285 // Empty processor. Include X87 and CMPXCHG8 for backwards compatibility.
286 { {""}, {CK_None, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false} },
287 { {"generic"}, {CK_None, ~0U, FeatureX87 | FeatureCMPXCHG8B | Feature64BIT, 'A', true} },
288 // i386-generation processors.
289 { {"i386"}, {CK_i386, ~0U, FeatureX87, '\0', false} },
290 // i486-generation processors.
291 { {"i486"}, {CK_i486, ~0U, FeatureX87, '\0', false} },
292 { {"winchip-c6"}, {CK_WinChipC6, ~0U, FeaturesPentiumMMX, '\0', false} },
293 { {"winchip2"}, {CK_WinChip2, ~0U, FeaturesPentiumMMX | FeaturePRFCHW, '\0', false} },
294 { {"c3"}, {CK_C3, ~0U, FeaturesPentiumMMX | FeaturePRFCHW, '\0', false} },
295 // i586-generation processors, P5 microarchitecture based.
296 { {"i586"}, {CK_i586, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false} },
297 { {"pentium"}, {CK_Pentium, ~0U, FeatureX87 | FeatureCMPXCHG8B, 'B', false} },
298 { {"pentium-mmx"}, {CK_PentiumMMX, ~0U, FeaturesPentiumMMX, '\0', false} },
299 { {"pentium_mmx"}, {CK_PentiumMMX, ~0U, FeaturesPentiumMMX, 'D', true} },
300 // i686-generation processors, P6 / Pentium M microarchitecture based.
301 { {"pentiumpro"}, {CK_PentiumPro, ~0U, FeatureCMOV | FeatureX87 | FeatureCMPXCHG8B, 'C', false} },
302 { {"pentium_pro"}, {CK_PentiumPro, ~0U, FeatureCMOV | FeatureX87 | FeatureCMPXCHG8B, 'C', true} },
303 { {"i686"}, {CK_i686, ~0U, FeatureCMOV | FeatureX87 | FeatureCMPXCHG8B, '\0', false} },
304 { {"pentium2"}, {CK_Pentium2, ~0U, FeaturesPentium2, 'E', false} },
305 { {"pentium_ii"}, {CK_Pentium2, ~0U, FeaturesPentium2, 'E', true} },
306 { {"pentium3"}, {CK_Pentium3, ~0U, FeaturesPentium3, 'H', false} },
307 { {"pentium3m"}, {CK_Pentium3, ~0U, FeaturesPentium3, 'H', false} },
308 { {"pentium_iii"}, {CK_Pentium3, ~0U, FeaturesPentium3, 'H', true} },
309 { {"pentium_iii_no_xmm_regs"}, {CK_Pentium3, ~0U, FeaturesPentium3, 'H', true} },
310 { {"pentium-m"}, {CK_PentiumM, ~0U, FeaturesPentium4, '\0', false} },
311 { {"pentium_m"}, {CK_PentiumM, ~0U, FeaturesPentium4, 'K', true} },
312 { {"c3-2"}, {CK_C3_2, ~0U, FeaturesPentium3, '\0', false} },
313 { {"yonah"}, {CK_Yonah, ~0U, FeaturesPrescott, 'L', false} },
314 // Netburst microarchitecture based processors.
315 { {"pentium4"}, {CK_Pentium4, ~0U, FeaturesPentium4, 'J', false} },
316 { {"pentium4m"}, {CK_Pentium4, ~0U, FeaturesPentium4, 'J', false} },
317 { {"pentium_4"}, {CK_Pentium4, ~0U, FeaturesPentium4, 'J', true} },
318 { {"pentium_4_sse3"}, {CK_Prescott, ~0U, FeaturesPrescott, 'L', true} },
319 { {"prescott"}, {CK_Prescott, ~0U, FeaturesPrescott, 'L', false} },
320 { {"nocona"}, {CK_Nocona, ~0U, FeaturesNocona, 'L', false} },
321 // Core microarchitecture based processors.
322 { {"core2"}, {CK_Core2, FEATURE_SSSE3, FeaturesCore2, 'M', false} },
323 { {"core_2_duo_ssse3"}, {CK_Core2, ~0U, FeaturesCore2, 'M', true} },
324 { {"penryn"}, {CK_Penryn, ~0U, FeaturesPenryn, 'N', false} },
325 { {"core_2_duo_sse4_1"}, {CK_Penryn, ~0U, FeaturesPenryn, 'N', true} },
326 // Atom processors
327 { {"bonnell"}, {CK_Bonnell, FEATURE_SSSE3, FeaturesBonnell, 'O', false} },
328 { {"atom"}, {CK_Bonnell, FEATURE_SSSE3, FeaturesBonnell, 'O', false} },
329 { {"silvermont"}, {CK_Silvermont, FEATURE_SSE4_2, FeaturesSilvermont, 'c', false} },
330 { {"slm"}, {CK_Silvermont, FEATURE_SSE4_2, FeaturesSilvermont, 'c', false} },
331 { {"atom_sse4_2"}, {CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'c', true} },
332 { {"atom_sse4_2_movbe"}, {CK_Goldmont, FEATURE_SSE4_2, FeaturesGoldmont, 'd', true} },
333 { {"goldmont"}, {CK_Goldmont, FEATURE_SSE4_2, FeaturesGoldmont, 'i', false} },
334 { {"goldmont-plus"}, {CK_GoldmontPlus, FEATURE_SSE4_2, FeaturesGoldmontPlus, '\0', false} },
335 { {"goldmont_plus"}, {CK_GoldmontPlus, FEATURE_SSE4_2, FeaturesGoldmontPlus, 'd', true} },
336 { {"tremont"}, {CK_Tremont, FEATURE_SSE4_2, FeaturesTremont, 'd', false} },
337 // Nehalem microarchitecture based processors.
338 { {"nehalem"}, {CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'P', false} },
339 { {"core_i7_sse4_2"}, {CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'P', true} },
340 { {"corei7"}, {CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'P', false} },
341 // Westmere microarchitecture based processors.
342 { {"westmere"}, {CK_Westmere, FEATURE_PCLMUL, FeaturesWestmere, 'Q', false} },
343 { {"core_aes_pclmulqdq"}, {CK_Nehalem, FEATURE_SSE4_2, FeaturesNehalem, 'Q', true} },
344 // Sandy Bridge microarchitecture based processors.
345 { {"sandybridge"}, {CK_SandyBridge, FEATURE_AVX, FeaturesSandyBridge, 'R', false} },
346 { {"core_2nd_gen_avx"}, {CK_SandyBridge, FEATURE_AVX, FeaturesSandyBridge, 'R', true} },
347 { {"corei7-avx"}, {CK_SandyBridge, FEATURE_AVX, FeaturesSandyBridge, '\0', false} },
348 // Ivy Bridge microarchitecture based processors.
349 { {"ivybridge"}, {CK_IvyBridge, FEATURE_AVX, FeaturesIvyBridge, 'S', false} },
350 { {"core_3rd_gen_avx"}, {CK_IvyBridge, FEATURE_AVX, FeaturesIvyBridge, 'S', true} },
351 { {"core-avx-i"}, {CK_IvyBridge, FEATURE_AVX, FeaturesIvyBridge, '\0', false} },
352 // Haswell microarchitecture based processors.
353 { {"haswell"}, {CK_Haswell, FEATURE_AVX2, FeaturesHaswell, 'V', false} },
354 { {"core-avx2"}, {CK_Haswell, FEATURE_AVX2, FeaturesHaswell, '\0', false} },
355 { {"core_4th_gen_avx"}, {CK_Haswell, FEATURE_AVX2, FeaturesHaswell, 'V', true} },
356 { {"core_4th_gen_avx_tsx"}, {CK_Haswell, FEATURE_AVX2, FeaturesHaswell, 'W', true} },
357 // Broadwell microarchitecture based processors.
358 { {"broadwell"}, {CK_Broadwell, FEATURE_AVX2, FeaturesBroadwell, 'X', false} },
359 { {"core_5th_gen_avx"}, {CK_Broadwell, FEATURE_AVX2, FeaturesBroadwell, 'X', true} },
360 { {"core_5th_gen_avx_tsx"}, {CK_Broadwell, FEATURE_AVX2, FeaturesBroadwell, 'Y', true} },
361 // Skylake client microarchitecture based processors.
362 { {"skylake"}, {CK_SkylakeClient, FEATURE_AVX2, FeaturesSkylakeClient, 'b', false} },
363 // Skylake server microarchitecture based processors.
364 { {"skylake-avx512"}, {CK_SkylakeServer, FEATURE_AVX512F, FeaturesSkylakeServer, '\0', false} },
365 { {"skx"}, {CK_SkylakeServer, FEATURE_AVX512F, FeaturesSkylakeServer, 'a', false} },
366 { {"skylake_avx512"}, {CK_SkylakeServer, FEATURE_AVX512F, FeaturesSkylakeServer, 'a', true} },
367 // Cascadelake Server microarchitecture based processors.
368 { {"cascadelake"}, {CK_Cascadelake, FEATURE_AVX512VNNI, FeaturesCascadeLake, 'o', false} },
369 // Cooperlake Server microarchitecture based processors.
370 { {"cooperlake"}, {CK_Cooperlake, FEATURE_AVX512BF16, FeaturesCooperLake, 'f', false} },
371 // Cannonlake client microarchitecture based processors.
372 { {"cannonlake"}, {CK_Cannonlake, FEATURE_AVX512VBMI, FeaturesCannonlake, 'e', false} },
373 // Icelake client microarchitecture based processors.
374 { {"icelake-client"}, {CK_IcelakeClient, FEATURE_AVX512VBMI2, FeaturesICLClient, '\0', false} },
375 { {"icelake_client"}, {CK_IcelakeClient, FEATURE_AVX512VBMI2, FeaturesICLClient, 'k', true} },
376 // Rocketlake microarchitecture based processors.
377 { {"rocketlake"}, {CK_Rocketlake, FEATURE_AVX512VBMI2, FeaturesRocketlake, 'k', false} },
378 // Icelake server microarchitecture based processors.
379 { {"icelake-server"}, {CK_IcelakeServer, FEATURE_AVX512VBMI2, FeaturesICLServer, '\0', false} },
380 { {"icelake_server"}, {CK_IcelakeServer, FEATURE_AVX512VBMI2, FeaturesICLServer, 'k', true} },
381 // Tigerlake microarchitecture based processors.
382 { {"tigerlake"}, {CK_Tigerlake, FEATURE_AVX512VP2INTERSECT, FeaturesTigerlake, 'l', false} },
383 // Sapphire Rapids microarchitecture based processors.
384 { {"sapphirerapids"}, {CK_SapphireRapids, FEATURE_AVX512FP16, FeaturesSapphireRapids, 'n', false} },
385 // Alderlake microarchitecture based processors.
386 { {"alderlake"}, {CK_Alderlake, FEATURE_AVX2, FeaturesAlderlake, 'p', false} },
387 // Raptorlake microarchitecture based processors.
388 { {"raptorlake"}, {CK_Raptorlake, FEATURE_AVX2, FeaturesAlderlake, 'p', false} },
389 // Meteorlake microarchitecture based processors.
390 { {"meteorlake"}, {CK_Meteorlake, FEATURE_AVX2, FeaturesAlderlake, 'p', false} },
391 // Arrowlake microarchitecture based processors.
392 { {"arrowlake"}, {CK_Arrowlake, FEATURE_AVX2, FeaturesArrowlake, 'p', false} },
393 { {"arrowlake-s"}, {CK_ArrowlakeS, FEATURE_AVX2, FeaturesArrowlakeS, '\0', false} },
394 { {"arrowlake_s"}, {CK_ArrowlakeS, FEATURE_AVX2, FeaturesArrowlakeS, 'p', true} },
395 // Lunarlake microarchitecture based processors.
396 { {"lunarlake"}, {CK_Lunarlake, FEATURE_AVX2, FeaturesArrowlakeS, 'p', false} },
397 // Gracemont microarchitecture based processors.
398 { {"gracemont"}, {CK_Gracemont, FEATURE_AVX2, FeaturesAlderlake, 'p', false} },
399 // Pantherlake microarchitecture based processors.
400 { {"pantherlake"}, {CK_Lunarlake, FEATURE_AVX2, FeaturesPantherlake, 'p', false} },
401 { {"wildcatlake"}, {CK_Lunarlake, FEATURE_AVX2, FeaturesPantherlake, 'p', false} },
402 // Novalake microarchitecture based processors.
403 { {"novalake"}, {CK_Novalake, FEATURE_AVX2, FeaturesNovalake, 'r', false} },
404 // Sierraforest microarchitecture based processors.
405 { {"sierraforest"}, {CK_Sierraforest, FEATURE_AVX2, FeaturesSierraforest, 'p', false} },
406 // Grandridge microarchitecture based processors.
407 { {"grandridge"}, {CK_Grandridge, FEATURE_AVX2, FeaturesSierraforest, 'p', false} },
408 // Granite Rapids microarchitecture based processors.
409 { {"graniterapids"}, {CK_Graniterapids, FEATURE_AVX512FP16, FeaturesGraniteRapids, 'n', false} },
410 // Granite Rapids D microarchitecture based processors.
411 { {"graniterapids-d"}, {CK_GraniterapidsD, FEATURE_AVX512FP16, FeaturesGraniteRapids | FeatureAMX_COMPLEX, '\0', false} },
412 { {"graniterapids_d"}, {CK_GraniterapidsD, FEATURE_AVX512FP16, FeaturesGraniteRapids | FeatureAMX_COMPLEX, 'n', true} },
413 // Emerald Rapids microarchitecture based processors.
414 { {"emeraldrapids"}, {CK_Emeraldrapids, FEATURE_AVX512FP16, FeaturesSapphireRapids, 'n', false} },
415 // Clearwaterforest microarchitecture based processors.
416 { {"clearwaterforest"}, {CK_Lunarlake, FEATURE_AVX2, FeaturesClearwaterforest, 'p', false} },
417 // Diamond Rapids microarchitecture based processors.
418 { {"diamondrapids"}, {CK_Diamondrapids, FEATURE_AVX10_2, FeaturesDiamondRapids, 'z', false} },
419 // Knights Landing processor.
420 { {"knl"}, {CK_KNL, FEATURE_AVX512F, FeaturesKNL, 'Z', false} },
421 { {"mic_avx512"}, {CK_KNL, FEATURE_AVX512F, FeaturesKNL, 'Z', true} },
422 // Knights Mill processor.
423 { {"knm"}, {CK_KNM, FEATURE_AVX5124FMAPS, FeaturesKNM, 'j', false} },
424 // Lakemont microarchitecture based processors.
425 { {"lakemont"}, {CK_Lakemont, ~0U, FeatureCMPXCHG8B, '\0', false} },
426 // K6 architecture processors.
427 { {"k6"}, {CK_K6, ~0U, FeaturesK6, '\0', false} },
428 { {"k6-2"}, {CK_K6_2, ~0U, FeaturesK6 | FeaturePRFCHW, '\0', false} },
429 { {"k6-3"}, {CK_K6_3, ~0U, FeaturesK6 | FeaturePRFCHW, '\0', false} },
430 // K7 architecture processors.
431 { {"athlon"}, {CK_Athlon, ~0U, FeaturesAthlon, '\0', false} },
432 { {"athlon-tbird"}, {CK_Athlon, ~0U, FeaturesAthlon, '\0', false} },
433 { {"athlon-xp"}, {CK_AthlonXP, ~0U, FeaturesAthlonXP, '\0', false} },
434 { {"athlon-mp"}, {CK_AthlonXP, ~0U, FeaturesAthlonXP, '\0', false} },
435 { {"athlon-4"}, {CK_AthlonXP, ~0U, FeaturesAthlonXP, '\0', false} },
436 // K8 architecture processors.
437 { {"k8"}, {CK_K8, ~0U, FeaturesK8, '\0', false} },
438 { {"athlon64"}, {CK_K8, ~0U, FeaturesK8, '\0', false} },
439 { {"athlon-fx"}, {CK_K8, ~0U, FeaturesK8, '\0', false} },
440 { {"opteron"}, {CK_K8, ~0U, FeaturesK8, '\0', false} },
441 { {"k8-sse3"}, {CK_K8SSE3, ~0U, FeaturesK8SSE3, '\0', false} },
442 { {"athlon64-sse3"}, {CK_K8SSE3, ~0U, FeaturesK8SSE3, '\0', false} },
443 { {"opteron-sse3"}, {CK_K8SSE3, ~0U, FeaturesK8SSE3, '\0', false} },
444 { {"amdfam10"}, {CK_AMDFAM10, FEATURE_SSE4_A, FeaturesAMDFAM10, '\0', false} },
445 { {"barcelona"}, {CK_AMDFAM10, FEATURE_SSE4_A, FeaturesAMDFAM10, '\0', false} },
446 // Bobcat architecture processors.
447 { {"btver1"}, {CK_BTVER1, FEATURE_SSE4_A, FeaturesBTVER1, '\0', false} },
448 { {"btver2"}, {CK_BTVER2, FEATURE_BMI, FeaturesBTVER2, '\0', false} },
449 // Bulldozer architecture processors.
450 { {"bdver1"}, {CK_BDVER1, FEATURE_XOP, FeaturesBDVER1, '\0', false} },
451 { {"bdver2"}, {CK_BDVER2, FEATURE_FMA, FeaturesBDVER2, '\0', false} },
452 { {"bdver3"}, {CK_BDVER3, FEATURE_FMA, FeaturesBDVER3, '\0', false} },
453 { {"bdver4"}, {CK_BDVER4, FEATURE_AVX2, FeaturesBDVER4, '\0', false} },
454 // Zen architecture processors.
455 { {"znver1"}, {CK_ZNVER1, FEATURE_AVX2, FeaturesZNVER1, '\0', false} },
456 { {"znver2"}, {CK_ZNVER2, FEATURE_AVX2, FeaturesZNVER2, '\0', false} },
457 { {"znver3"}, {CK_ZNVER3, FEATURE_AVX2, FeaturesZNVER3, '\0', false} },
458 { {"znver4"}, {CK_ZNVER4, FEATURE_AVX512VBMI2, FeaturesZNVER4, '\0', false} },
459 { {"znver5"}, {CK_ZNVER5, FEATURE_AVX512VP2INTERSECT, FeaturesZNVER5, '\0', false} },
460 { {"znver6"}, {CK_ZNVER6, FEATURE_AVX512FP16, FeaturesZNVER6, '\0', false} },
461 // Hygon processors.
462 { {"c86-4g-m4"}, {CK_C86_4G_M4, FEATURE_AVX2, FeaturesC86_4G_M4 , '\0', false} },
463 { {"c86-4g-m6"}, {CK_C86_4G_M6, FEATURE_AVX2, FeaturesC86_4G_M6 , '\0', false} },
464 { {"c86-4g-m7"}, {CK_C86_4G_M7, FEATURE_AVX512VBMI2, FeaturesC86_4G_M7 , '\0', false} },
465 { {"c86-4g-m8"}, {CK_C86_4G_M8, FEATURE_AVX512VBMI2, FeaturesC86_4G_M8 , '\0', false} },
466 // Generic 64-bit processor.
467 { {"x86-64"}, {CK_x86_64, FEATURE_SSE2 , FeaturesX86_64, '\0', false} },
468 { {"x86-64-v2"}, {CK_x86_64_v2, FEATURE_SSE4_2 , FeaturesX86_64_V2, '\0', false} },
469 { {"x86-64-v3"}, {CK_x86_64_v3, FEATURE_AVX2, FeaturesX86_64_V3, '\0', false} },
470 { {"x86-64-v4"}, {CK_x86_64_v4, FEATURE_AVX512VL, FeaturesX86_64_V4, '\0', false} },
471 // Geode processors.
472 { {"geode"}, {CK_Geode, ~0U, FeaturesGeode, '\0', false} },
473};
474// clang-format on
476
477constexpr const char *NoTuneList[] = {"x86-64-v2", "x86-64-v3", "x86-64-v4"};
478
480 for (const auto &P : Processors)
481 if (!P.value().OnlyForCPUDispatchSpecific && P.name() == CPU &&
482 (P.value().Features[FEATURE_64BIT] || !Only64Bit))
483 return P.value().Kind;
484
485 return CK_None;
486}
487
490 return CK_None;
491 return parseArchX86(CPU, Only64Bit);
492}
493
495 bool Only64Bit) {
496 for (const auto &P : Processors)
497 if (!P.value().OnlyForCPUDispatchSpecific && !P.name().empty() &&
498 (P.value().Features[FEATURE_64BIT] || !Only64Bit))
499 Values.emplace_back(P.name());
500}
501
503 bool Only64Bit) {
504 for (const auto &P : Processors)
505 if (!P.value().OnlyForCPUDispatchSpecific && !P.name().empty() &&
506 (P.value().Features[FEATURE_64BIT] || !Only64Bit) &&
508 Values.emplace_back(P.name());
509}
510
512 // FIXME: Can we avoid a linear search here? The table might be sorted by
513 // CPUKind so we could binary search?
514 for (const auto &P : Processors) {
515 if (P.value().Kind == Kind) {
516 assert(P.value().KeyFeature != ~0U &&
517 "Processor does not have a key feature.");
518 return static_cast<ProcessorFeatures>(P.value().KeyFeature);
519 }
520 }
521
522 llvm_unreachable("Unable to find CPU kind!");
523}
524
525// Features with no dependencies.
572
573// Not really CPU features, but need to be in the table because clang uses
574// target features to communicate them to the backend.
580
581// XSAVE features are dependent on basic XSAVE.
582constexpr FeatureBitset ImpliedFeaturesXSAVEC = FeatureXSAVE;
583constexpr FeatureBitset ImpliedFeaturesXSAVEOPT = FeatureXSAVE;
584constexpr FeatureBitset ImpliedFeaturesXSAVES = FeatureXSAVE;
585
586// SSE/AVX/AVX512F chain.
588constexpr FeatureBitset ImpliedFeaturesSSE2 = FeatureSSE;
589constexpr FeatureBitset ImpliedFeaturesSSE3 = FeatureSSE2;
590constexpr FeatureBitset ImpliedFeaturesSSSE3 = FeatureSSE3;
591constexpr FeatureBitset ImpliedFeaturesSSE4_1 = FeatureSSSE3;
592constexpr FeatureBitset ImpliedFeaturesSSE4_2 = FeatureSSE4_1;
593constexpr FeatureBitset ImpliedFeaturesAVX = FeatureSSE4_2;
594constexpr FeatureBitset ImpliedFeaturesAVX2 = FeatureAVX;
597 FeatureAVX2 | FeatureF16C | FeatureFMA;
598
599// Vector extensions that build on SSE or AVX.
600constexpr FeatureBitset ImpliedFeaturesAES = FeatureSSE2;
601constexpr FeatureBitset ImpliedFeaturesF16C = FeatureAVX;
602constexpr FeatureBitset ImpliedFeaturesFMA = FeatureAVX;
603constexpr FeatureBitset ImpliedFeaturesGFNI = FeatureSSE2;
604constexpr FeatureBitset ImpliedFeaturesPCLMUL = FeatureSSE2;
605constexpr FeatureBitset ImpliedFeaturesSHA = FeatureSSE2;
606constexpr FeatureBitset ImpliedFeaturesVAES = FeatureAES | FeatureAVX2;
607constexpr FeatureBitset ImpliedFeaturesVPCLMULQDQ = FeatureAVX | FeaturePCLMUL;
608constexpr FeatureBitset ImpliedFeaturesSM3 = FeatureAVX;
609constexpr FeatureBitset ImpliedFeaturesSM4 = FeatureAVX2;
610
611// AVX512 features.
612constexpr FeatureBitset ImpliedFeaturesAVX512CD = FeatureAVX512F;
613constexpr FeatureBitset ImpliedFeaturesAVX512BW = FeatureAVX512F;
614constexpr FeatureBitset ImpliedFeaturesAVX512DQ = FeatureAVX512F;
615constexpr FeatureBitset ImpliedFeaturesAVX512VL = FeatureAVX512F;
616
617constexpr FeatureBitset ImpliedFeaturesAVX512BF16 = FeatureAVX512BW;
618constexpr FeatureBitset ImpliedFeaturesAVX512BITALG = FeatureAVX512BW;
619constexpr FeatureBitset ImpliedFeaturesAVX512BMM = FeatureAVX512BW;
620constexpr FeatureBitset ImpliedFeaturesAVX512IFMA = FeatureAVX512F;
621constexpr FeatureBitset ImpliedFeaturesAVX512VNNI = FeatureAVX512F;
623constexpr FeatureBitset ImpliedFeaturesAVX512VBMI = FeatureAVX512BW;
624constexpr FeatureBitset ImpliedFeaturesAVX512VBMI2 = FeatureAVX512BW;
626
627// FIXME: These two aren't really implemented and just exist in the feature
628// list for __builtin_cpu_supports. So omit their dependencies.
631
632// SSE4_A->FMA4->XOP chain.
633constexpr FeatureBitset ImpliedFeaturesSSE4_A = FeatureSSE3;
634constexpr FeatureBitset ImpliedFeaturesFMA4 = FeatureAVX | FeatureSSE4_A;
635constexpr FeatureBitset ImpliedFeaturesXOP = FeatureFMA4;
636
637// AMX Features
639constexpr FeatureBitset ImpliedFeaturesAMX_BF16 = FeatureAMX_TILE;
640constexpr FeatureBitset ImpliedFeaturesAMX_FP16 = FeatureAMX_TILE;
641constexpr FeatureBitset ImpliedFeaturesAMX_INT8 = FeatureAMX_TILE;
642constexpr FeatureBitset ImpliedFeaturesAMX_COMPLEX = FeatureAMX_TILE;
643constexpr FeatureBitset ImpliedFeaturesAMX_FP8 = FeatureAMX_TILE;
644constexpr FeatureBitset ImpliedFeaturesAMX_MOVRS = FeatureAMX_TILE;
646 FeatureAMX_TILE | FeatureAVX10_2;
647constexpr FeatureBitset ImpliedFeaturesAMX_TF32 = FeatureAMX_TILE;
649
655constexpr FeatureBitset ImpliedFeaturesAVXIFMA = FeatureAVX2;
657constexpr FeatureBitset ImpliedFeaturesSHA512 = FeatureAVX2;
658constexpr FeatureBitset ImpliedFeaturesAVX512FP16 = FeatureAVX512BW;
659// Key Locker Features
660constexpr FeatureBitset ImpliedFeaturesKL = FeatureSSE2;
662
663// AVXVNNI Features
664constexpr FeatureBitset ImpliedFeaturesAVXVNNI = FeatureAVX2;
665
666// AVX10 Features
668 FeatureAVX512CD | FeatureAVX512VBMI | FeatureAVX512IFMA |
669 FeatureAVX512VNNI | FeatureAVX512BF16 | FeatureAVX512VPOPCNTDQ |
670 FeatureAVX512VBMI2 | FeatureAVX512BITALG | FeatureAVX512FP16 |
671 FeatureAVX512DQ | FeatureAVX512VL;
672constexpr FeatureBitset ImpliedFeaturesAVX10_2 = FeatureAVX10_1;
673
674// APX Features
684
689
691
693#define X86_FEATURE(ENUM, STR) {{"+" STR}, ImpliedFeatures##ENUM},
694#include "llvm/TargetParser/X86TargetParser.def"
695};
697
699 SmallVectorImpl<StringRef> &EnabledFeatures,
700 bool NeedPlus) {
701 auto I =
702 llvm::find_if(Processors, [&](const auto &P) { return P.name() == CPU; });
703 assert(I != std::end(Processors) && "Processor not found!");
704
705 FeatureBitset Bits = I->value().Features;
706
707 // Remove the 64-bit feature which we only use to validate if a CPU can
708 // be used with 64-bit mode.
709 Bits &= ~Feature64BIT;
710
711 // Add the string version of all set bits.
712 for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i) {
713 StringRef Name = FeatureInfos[i].name().drop_front(!NeedPlus);
714 if (Bits[i] && !Name.empty())
715 EnabledFeatures.push_back(Name);
716 }
717}
718
719// For each feature that is (transitively) implied by this feature, set it.
721 const FeatureBitset &Implies) {
722 // Fast path: Implies is often empty.
723 if (!Implies.any())
724 return;
725 FeatureBitset Prev;
726 Bits |= Implies;
727 do {
728 Prev = Bits;
729 for (unsigned i = CPU_FEATURE_MAX; i;)
730 if (Bits[--i])
731 Bits |= FeatureInfos[i].value();
732 } while (Prev != Bits);
733}
734
735/// Create bit vector of features that are implied disabled if the feature
736/// passed in Value is disabled.
737static void getImpliedDisabledFeatures(FeatureBitset &Bits, unsigned Value) {
738 // Check all features looking for any dependent on this feature. If we find
739 // one, mark it and recursively find any feature that depend on it.
740 FeatureBitset Prev;
741 Bits.set(Value);
742 do {
743 Prev = Bits;
744 for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i)
745 if ((FeatureInfos[i].value() & Bits).any())
746 Bits.set(i);
747 } while (Prev != Bits);
748}
749
751 StringRef Feature, bool Enabled,
752 StringMap<bool> &Features) {
753 auto I = llvm::find_if(FeatureInfos, [&](const auto &FI) {
754 return FI.name().drop_front() == Feature;
755 });
756 if (I == std::end(FeatureInfos)) {
757 // FIXME: This shouldn't happen, but may not have all features in the table
758 // yet.
759 return;
760 }
761
762 FeatureBitset ImpliedBits;
763 if (Enabled)
764 getImpliedEnabledFeatures(ImpliedBits, I->value());
765 else
766 getImpliedDisabledFeatures(ImpliedBits,
767 std::distance(std::begin(FeatureInfos), I));
768
769 // Update the map entry for all implied features.
770 for (unsigned i = 0; i != CPU_FEATURE_MAX; ++i) {
771 StringRef Name = FeatureInfos[i].name().drop_front();
772 if (ImpliedBits[i] && !Name.empty())
773 Features[Name] = Enabled;
774 }
775}
776
778 auto I =
779 llvm::find_if(Processors, [&](const auto &P) { return P.name() == CPU; });
780 assert(I != std::end(Processors) && "Processor not found!");
781 assert(I->value().Mangling != '\0' &&
782 "Processor dooesn't support function multiversion!");
783 return I->value().Mangling;
784}
785
788 [&](const auto &P) { return P.name() == Name; });
789 return I != std::end(Processors);
790}
791
792std::array<uint32_t, 4>
794 // Processor features and mapping to processor feature value.
795 std::array<uint32_t, 4> FeatureMask{};
796 for (StringRef FeatureStr : FeatureStrs) {
797 unsigned Feature = StringSwitch<unsigned>(FeatureStr)
798#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY, ABI_VALUE) .Case(STR, ABI_VALUE)
799#define X86_MICROARCH_LEVEL(ENUM, STR, PRIORITY, ABI_VALUE) \
800 .Case(STR, ABI_VALUE)
801#include "llvm/TargetParser/X86TargetParser.def"
802 ;
803 assert(Feature / 32 < FeatureMask.size());
804 FeatureMask[Feature / 32] |= 1U << (Feature % 32);
805 }
806 return FeatureMask;
807}
808
810#ifndef NDEBUG
811 // Check that priorities are set properly in the .def file. We expect that
812 // "compat" features are assigned non-duplicate consecutive priorities
813 // starting from one (1, ..., MAX_PRIORITY) and multiple zeros.
814#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY, ABI_VALUE) PRIORITY,
815 unsigned Priorities[] = {
816#include "llvm/TargetParser/X86TargetParser.def"
817 };
818 std::array<unsigned, std::size(Priorities)> HelperList;
819 std::iota(HelperList.begin(), HelperList.begin() + MAX_PRIORITY + 1, 0);
820 for (size_t i = MAX_PRIORITY + 1; i != std::size(Priorities); ++i)
821 HelperList[i] = 0;
822 assert(std::is_permutation(HelperList.begin(), HelperList.end(),
823 std::begin(Priorities), std::end(Priorities)) &&
824 "Priorities don't form consecutive range!");
825#endif
826
827 switch (Feat) {
828#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY, ABI_VALUE) \
829 case X86::FEATURE_##ENUM: \
830 return PRIORITY;
831#include "llvm/TargetParser/X86TargetParser.def"
832 default:
833 llvm_unreachable("No Feature Priority for non-CPUSupports Features");
834 }
835}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define BUILD_ENUM_STRINGS(Tab)
Definition Enum.h:120
#define I(x, y, z)
Definition MD5.cpp:57
#define P(N)
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 EnumStringDef< ProcInfo > ProcessorDefs[]
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 FeaturesC86_4G_M4
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 EnumStringDef< FeatureBitset > FeatureInfoDefs[]
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 ImpliedFeaturesJMPABS
constexpr FeatureBitset ImpliedFeaturesAVX512BF16
constexpr FeatureBitset ImpliedFeaturesRDPRU
constexpr FeatureBitset FeaturesAMDFAM10
constexpr FeatureBitset ImpliedFeaturesAMX_TILE
constexpr FeatureBitset FeaturesSkylakeServer
constexpr FeatureBitset FeaturesPentiumMMX
static constexpr FeatureBitset FeaturesC86_4G_M8
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
constexpr auto FeatureInfos
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
static constexpr FeatureBitset FeaturesZNVER6
constexpr FeatureBitset ImpliedFeaturesRETPOLINE_EXTERNAL_THUNK
constexpr FeatureBitset ImpliedFeaturesAMX_BF16
constexpr auto Processors
constexpr FeatureBitset FeaturesBroadwell
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
static constexpr FeatureBitset FeaturesC86_4G_M6
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 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
static constexpr FeatureBitset FeaturesC86_4G_M7
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 ImpliedFeaturesAVX512BMM
constexpr FeatureBitset ImpliedFeaturesUSERMSR
constexpr FeatureBitset FeaturesTigerlake
constexpr FeatureBitset ImpliedFeaturesAVX10_1
constexpr FeatureBitset ImpliedFeaturesRDRND
constexpr FeatureBitset ImpliedFeaturesZU
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...
void push_back(const T &Elt)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:128
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
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.
RelativeUniformCounterPtr Values
Definition InstrProf.h:91
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:1772
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1947
@ Enabled
Convert any .debug_str_offsets tables to DWARF64 if needed.
Definition DWP.h:31
Compile-time data representation of enum entries.
Definition Enum.h:47