Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
//===- X86TargetParser.def - X86 target parsing defines ---------*- 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 provides defines to build up the X86 target parser's logic.
10
//
11
//===----------------------------------------------------------------------===//
12
 
13
// NOTE: NO INCLUDE GUARD DESIRED!
14
 
15
#ifndef X86_VENDOR
16
#define X86_VENDOR(ENUM, STR)
17
#endif
18
X86_VENDOR(VENDOR_INTEL, "intel")
19
X86_VENDOR(VENDOR_AMD,   "amd")
20
#undef X86_VENDOR
21
 
22
// This macro is used for cpu types present in compiler-rt/libgcc.
23
#ifndef X86_CPU_TYPE
24
#define X86_CPU_TYPE(ENUM, STR)
25
#endif
26
 
27
#ifndef X86_CPU_TYPE_ALIAS
28
#define X86_CPU_TYPE_ALIAS(ENUM, STR)
29
#endif
30
 
31
// This list must match what is implemented in libgcc and compilert-rt. Clang
32
// uses this to know how to implement __builtin_cpu_is.
33
X86_CPU_TYPE(INTEL_BONNELL,       "bonnell")
34
X86_CPU_TYPE(INTEL_CORE2,         "core2")
35
X86_CPU_TYPE(INTEL_COREI7,        "corei7")
36
X86_CPU_TYPE(AMDFAM10H,           "amdfam10h")
37
X86_CPU_TYPE(AMDFAM15H,           "amdfam15h")
38
X86_CPU_TYPE(INTEL_SILVERMONT,    "silvermont")
39
X86_CPU_TYPE(INTEL_KNL,           "knl")
40
X86_CPU_TYPE(AMD_BTVER1,          "btver1")
41
X86_CPU_TYPE(AMD_BTVER2,          "btver2")
42
X86_CPU_TYPE(AMDFAM17H,           "amdfam17h")
43
X86_CPU_TYPE(INTEL_KNM,           "knm")
44
X86_CPU_TYPE(INTEL_GOLDMONT,      "goldmont")
45
X86_CPU_TYPE(INTEL_GOLDMONT_PLUS, "goldmont-plus")
46
X86_CPU_TYPE(INTEL_TREMONT,       "tremont")
47
X86_CPU_TYPE(AMDFAM19H,           "amdfam19h")
48
X86_CPU_TYPE(ZHAOXIN_FAM7H,       "zhaoxin_fam7h")
49
X86_CPU_TYPE(INTEL_SIERRAFOREST,  "sierraforest")
50
X86_CPU_TYPE(INTEL_GRANDRIDGE,    "grandridge")
51
 
52
// Alternate names supported by __builtin_cpu_is and target multiversioning.
53
X86_CPU_TYPE_ALIAS(INTEL_BONNELL,    "atom")
54
X86_CPU_TYPE_ALIAS(AMDFAM10H,        "amdfam10")
55
X86_CPU_TYPE_ALIAS(AMDFAM15H,        "amdfam15")
56
X86_CPU_TYPE_ALIAS(INTEL_SILVERMONT, "slm")
57
 
58
#undef X86_CPU_TYPE_ALIAS
59
#undef X86_CPU_TYPE
60
 
61
// This macro is used for cpu subtypes present in compiler-rt/libgcc.
62
#ifndef X86_CPU_SUBTYPE
63
#define X86_CPU_SUBTYPE(ENUM, STR)
64
#endif
65
 
66
#ifndef X86_CPU_SUBTYPE_ALIAS
67
#define X86_CPU_SUBTYPE_ALIAS(ENUM, STR)
68
#endif
69
 
70
// This list must match what is implemented in libgcc and compilert-rt. Clang
71
// uses this to know how to implement __builtin_cpu_is.
72
X86_CPU_SUBTYPE(INTEL_COREI7_NEHALEM,        "nehalem")
73
X86_CPU_SUBTYPE(INTEL_COREI7_WESTMERE,       "westmere")
74
X86_CPU_SUBTYPE(INTEL_COREI7_SANDYBRIDGE,    "sandybridge")
75
X86_CPU_SUBTYPE(AMDFAM10H_BARCELONA,         "barcelona")
76
X86_CPU_SUBTYPE(AMDFAM10H_SHANGHAI,          "shanghai")
77
X86_CPU_SUBTYPE(AMDFAM10H_ISTANBUL,          "istanbul")
78
X86_CPU_SUBTYPE(AMDFAM15H_BDVER1,            "bdver1")
79
X86_CPU_SUBTYPE(AMDFAM15H_BDVER2,            "bdver2")
80
X86_CPU_SUBTYPE(AMDFAM15H_BDVER3,            "bdver3")
81
X86_CPU_SUBTYPE(AMDFAM15H_BDVER4,            "bdver4")
82
X86_CPU_SUBTYPE(AMDFAM17H_ZNVER1,            "znver1")
83
X86_CPU_SUBTYPE(INTEL_COREI7_IVYBRIDGE,      "ivybridge")
84
X86_CPU_SUBTYPE(INTEL_COREI7_HASWELL,        "haswell")
85
X86_CPU_SUBTYPE(INTEL_COREI7_BROADWELL,      "broadwell")
86
X86_CPU_SUBTYPE(INTEL_COREI7_SKYLAKE,        "skylake")
87
X86_CPU_SUBTYPE(INTEL_COREI7_SKYLAKE_AVX512, "skylake-avx512")
88
X86_CPU_SUBTYPE(INTEL_COREI7_CANNONLAKE,     "cannonlake")
89
X86_CPU_SUBTYPE(INTEL_COREI7_ICELAKE_CLIENT, "icelake-client")
90
X86_CPU_SUBTYPE(INTEL_COREI7_ICELAKE_SERVER, "icelake-server")
91
X86_CPU_SUBTYPE(AMDFAM17H_ZNVER2,            "znver2")
92
X86_CPU_SUBTYPE(INTEL_COREI7_CASCADELAKE,    "cascadelake")
93
X86_CPU_SUBTYPE(INTEL_COREI7_TIGERLAKE,      "tigerlake")
94
X86_CPU_SUBTYPE(INTEL_COREI7_COOPERLAKE,     "cooperlake")
95
X86_CPU_SUBTYPE(INTEL_COREI7_SAPPHIRERAPIDS, "sapphirerapids")
96
X86_CPU_SUBTYPE(INTEL_COREI7_ALDERLAKE,      "alderlake")
97
X86_CPU_SUBTYPE(AMDFAM19H_ZNVER3,            "znver3")
98
X86_CPU_SUBTYPE(INTEL_COREI7_ROCKETLAKE,     "rocketlake")
99
X86_CPU_SUBTYPE(ZHAOXIN_FAM7H_LUJIAZUI,      "zhaoxin_fam7h_lujiazui")
100
X86_CPU_SUBTYPE(AMDFAM19H_ZNVER4,            "znver4")
101
X86_CPU_SUBTYPE(INTEL_COREI7_GRANITERAPIDS,  "graniterapids")
102
 
103
// Alternate names supported by __builtin_cpu_is and target multiversioning.
104
X86_CPU_SUBTYPE_ALIAS(INTEL_COREI7_ALDERLAKE, "raptorlake")
105
X86_CPU_SUBTYPE_ALIAS(INTEL_COREI7_ALDERLAKE, "meteorlake")
106
X86_CPU_SUBTYPE_ALIAS(INTEL_COREI7_SAPPHIRERAPIDS, "emeraldrapids")
107
 
108
#undef X86_CPU_SUBTYPE_ALIAS
109
#undef X86_CPU_SUBTYPE
110
 
111
// This macro is used for cpu types present in compiler-rt/libgcc. The third
112
// parameter PRIORITY is as required by the attribute 'target' checking. Note
113
// that not all are supported/prioritized by GCC, so synchronization with GCC's
114
// implementation may require changing some existing values.
115
//
116
// We cannot just re-sort the list though because its order is dictated by the
117
// order of bits in CodeGenFunction::GetX86CpuSupportsMask.
118
#ifndef X86_FEATURE_COMPAT
119
#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY) X86_FEATURE(ENUM, STR)
120
#endif
121
 
122
#ifndef X86_FEATURE
123
#define X86_FEATURE(ENUM, STR)
124
#endif
125
 
126
X86_FEATURE_COMPAT(CMOV,            "cmov",                  0)
127
X86_FEATURE_COMPAT(MMX,             "mmx",                   1)
128
X86_FEATURE_COMPAT(POPCNT,          "popcnt",                9)
129
X86_FEATURE_COMPAT(SSE,             "sse",                   2)
130
X86_FEATURE_COMPAT(SSE2,            "sse2",                  3)
131
X86_FEATURE_COMPAT(SSE3,            "sse3",                  4)
132
X86_FEATURE_COMPAT(SSSE3,           "ssse3",                 5)
133
X86_FEATURE_COMPAT(SSE4_1,          "sse4.1",                7)
134
X86_FEATURE_COMPAT(SSE4_2,          "sse4.2",                8)
135
X86_FEATURE_COMPAT(AVX,             "avx",                   12)
136
X86_FEATURE_COMPAT(AVX2,            "avx2",                  18)
137
X86_FEATURE_COMPAT(SSE4_A,          "sse4a",                 6)
138
X86_FEATURE_COMPAT(FMA4,            "fma4",                  14)
139
X86_FEATURE_COMPAT(XOP,             "xop",                   15)
140
X86_FEATURE_COMPAT(FMA,             "fma",                   16)
141
X86_FEATURE_COMPAT(AVX512F,         "avx512f",               19)
142
X86_FEATURE_COMPAT(BMI,             "bmi",                   13)
143
X86_FEATURE_COMPAT(BMI2,            "bmi2",                  17)
144
X86_FEATURE_COMPAT(AES,             "aes",                   10)
145
X86_FEATURE_COMPAT(PCLMUL,          "pclmul",                11)
146
X86_FEATURE_COMPAT(AVX512VL,        "avx512vl",              20)
147
X86_FEATURE_COMPAT(AVX512BW,        "avx512bw",              21)
148
X86_FEATURE_COMPAT(AVX512DQ,        "avx512dq",              22)
149
X86_FEATURE_COMPAT(AVX512CD,        "avx512cd",              23)
150
X86_FEATURE_COMPAT(AVX512ER,        "avx512er",              24)
151
X86_FEATURE_COMPAT(AVX512PF,        "avx512pf",              25)
152
X86_FEATURE_COMPAT(AVX512VBMI,      "avx512vbmi",            26)
153
X86_FEATURE_COMPAT(AVX512IFMA,      "avx512ifma",            27)
154
X86_FEATURE_COMPAT(AVX5124VNNIW,    "avx5124vnniw",          28)
155
X86_FEATURE_COMPAT(AVX5124FMAPS,    "avx5124fmaps",          29)
156
X86_FEATURE_COMPAT(AVX512VPOPCNTDQ, "avx512vpopcntdq",       30)
157
X86_FEATURE_COMPAT(AVX512VBMI2,     "avx512vbmi2",           31)
158
X86_FEATURE_COMPAT(GFNI,            "gfni",                  32)
159
X86_FEATURE_COMPAT(VPCLMULQDQ,      "vpclmulqdq",            33)
160
X86_FEATURE_COMPAT(AVX512VNNI,      "avx512vnni",            34)
161
X86_FEATURE_COMPAT(AVX512BITALG,    "avx512bitalg",          35)
162
X86_FEATURE_COMPAT(AVX512BF16,      "avx512bf16",            36)
163
X86_FEATURE_COMPAT(AVX512VP2INTERSECT, "avx512vp2intersect", 37)
164
// Features below here are not in libgcc/compiler-rt.
165
X86_FEATURE       (3DNOW,           "3dnow")
166
X86_FEATURE       (3DNOWA,          "3dnowa")
167
X86_FEATURE       (64BIT,           "64bit")
168
X86_FEATURE       (ADX,             "adx")
169
X86_FEATURE       (AMX_BF16,        "amx-bf16")
170
X86_FEATURE       (AMX_INT8,        "amx-int8")
171
X86_FEATURE       (AMX_TILE,        "amx-tile")
172
X86_FEATURE       (CLDEMOTE,        "cldemote")
173
X86_FEATURE       (CLFLUSHOPT,      "clflushopt")
174
X86_FEATURE       (CLWB,            "clwb")
175
X86_FEATURE       (CLZERO,          "clzero")
176
X86_FEATURE       (CMPXCHG16B,      "cx16")
177
X86_FEATURE       (CMPXCHG8B,       "cx8")
178
X86_FEATURE       (CRC32,           "crc32")
179
X86_FEATURE       (ENQCMD,          "enqcmd")
180
X86_FEATURE       (F16C,            "f16c")
181
X86_FEATURE       (FSGSBASE,        "fsgsbase")
182
X86_FEATURE       (FXSR,            "fxsr")
183
X86_FEATURE       (INVPCID,         "invpcid")
184
X86_FEATURE       (KL,              "kl")
185
X86_FEATURE       (WIDEKL,          "widekl")
186
X86_FEATURE       (LWP,             "lwp")
187
X86_FEATURE       (LZCNT,           "lzcnt")
188
X86_FEATURE       (MOVBE,           "movbe")
189
X86_FEATURE       (MOVDIR64B,       "movdir64b")
190
X86_FEATURE       (MOVDIRI,         "movdiri")
191
X86_FEATURE       (MWAITX,          "mwaitx")
192
X86_FEATURE       (PCONFIG,         "pconfig")
193
X86_FEATURE       (PKU,             "pku")
194
X86_FEATURE       (PREFETCHI,       "prefetchi")
195
X86_FEATURE       (PREFETCHWT1,     "prefetchwt1")
196
X86_FEATURE       (PRFCHW,          "prfchw")
197
X86_FEATURE       (PTWRITE,         "ptwrite")
198
X86_FEATURE       (RDPID,           "rdpid")
199
X86_FEATURE       (RDPRU,           "rdpru")
200
X86_FEATURE       (RDRND,           "rdrnd")
201
X86_FEATURE       (RDSEED,          "rdseed")
202
X86_FEATURE       (RTM,             "rtm")
203
X86_FEATURE       (SAHF,            "sahf")
204
X86_FEATURE       (SERIALIZE,       "serialize")
205
X86_FEATURE       (SGX,             "sgx")
206
X86_FEATURE       (SHA,             "sha")
207
X86_FEATURE       (SHSTK,           "shstk")
208
X86_FEATURE       (TBM,             "tbm")
209
X86_FEATURE       (TSXLDTRK,        "tsxldtrk")
210
X86_FEATURE       (UINTR,           "uintr")
211
X86_FEATURE       (VAES,            "vaes")
212
X86_FEATURE       (VZEROUPPER,      "vzeroupper")
213
X86_FEATURE       (WAITPKG,         "waitpkg")
214
X86_FEATURE       (WBNOINVD,        "wbnoinvd")
215
X86_FEATURE       (X87,             "x87")
216
X86_FEATURE       (XSAVE,           "xsave")
217
X86_FEATURE       (XSAVEC,          "xsavec")
218
X86_FEATURE       (XSAVEOPT,        "xsaveopt")
219
X86_FEATURE       (XSAVES,          "xsaves")
220
X86_FEATURE       (HRESET,          "hreset")
221
X86_FEATURE       (RAOINT,          "raoint")
222
X86_FEATURE       (AVX512FP16,      "avx512fp16")
223
X86_FEATURE       (AMX_FP16,        "amx-fp16")
224
X86_FEATURE       (CMPCCXADD,       "cmpccxadd")
225
X86_FEATURE       (AVXNECONVERT,    "avxneconvert")
226
X86_FEATURE       (AVXVNNI,         "avxvnni")
227
X86_FEATURE       (AVXIFMA,         "avxifma")
228
X86_FEATURE       (AVXVNNIINT8,     "avxvnniint8")
229
// These features aren't really CPU features, but the frontend can set them.
230
X86_FEATURE       (RETPOLINE_EXTERNAL_THUNK,    "retpoline-external-thunk")
231
X86_FEATURE       (RETPOLINE_INDIRECT_BRANCHES, "retpoline-indirect-branches")
232
X86_FEATURE       (RETPOLINE_INDIRECT_CALLS,    "retpoline-indirect-calls")
233
X86_FEATURE       (LVI_CFI,                     "lvi-cfi")
234
X86_FEATURE       (LVI_LOAD_HARDENING,          "lvi-load-hardening")
235
#undef X86_FEATURE_COMPAT
236
#undef X86_FEATURE
237
 
238
#ifndef CPU_SPECIFIC
239
#define CPU_SPECIFIC(NAME, TUNE_NAME, MANGLING, FEATURES)
240
#endif
241
 
242
#ifndef CPU_SPECIFIC_ALIAS
243
#define CPU_SPECIFIC_ALIAS(NEW_NAME, TUNE_NAME, NAME)
244
#endif
245
 
246
CPU_SPECIFIC("generic", "generic", 'A', "")
247
CPU_SPECIFIC("pentium", "pentium", 'B', "")
248
CPU_SPECIFIC("pentium_pro", "pentiumpro", 'C', "+cmov")
249
CPU_SPECIFIC("pentium_mmx", "pentium-mmx", 'D', "+mmx")
250
CPU_SPECIFIC("pentium_ii", "pentium2", 'E', "+cmov,+mmx")
251
CPU_SPECIFIC("pentium_iii", "pentium3", 'H', "+cmov,+mmx,+sse")
252
CPU_SPECIFIC_ALIAS("pentium_iii_no_xmm_regs", "pentium3", "pentium_iii")
253
CPU_SPECIFIC("pentium_4", "pentium4", 'J', "+cmov,+mmx,+sse,+sse2")
254
CPU_SPECIFIC("pentium_m", "pentium-m", 'K', "+cmov,+mmx,+sse,+sse2")
255
CPU_SPECIFIC("pentium_4_sse3", "prescott", 'L', "+cmov,+mmx,+sse,+sse2,+sse3")
256
CPU_SPECIFIC("core_2_duo_ssse3", "core2", 'M', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3")
257
CPU_SPECIFIC("core_2_duo_sse4_1", "penryn", 'N', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1")
258
CPU_SPECIFIC("atom", "atom", 'O', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+movbe")
259
CPU_SPECIFIC("atom_sse4_2", "silvermont", 'c', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt")
260
CPU_SPECIFIC("core_i7_sse4_2", "nehalem", 'P', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt")
261
CPU_SPECIFIC("core_aes_pclmulqdq", "westmere", 'Q', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt")
262
CPU_SPECIFIC("atom_sse4_2_movbe", "silvermont", 'd', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt")
263
CPU_SPECIFIC("goldmont", "goldmont", 'i', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt")
264
CPU_SPECIFIC("sandybridge", "sandybridge", 'R', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx")
265
CPU_SPECIFIC_ALIAS("core_2nd_gen_avx", "sandybridge", "sandybridge")
266
CPU_SPECIFIC("ivybridge", "ivybridge", 'S', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+f16c,+avx")
267
CPU_SPECIFIC_ALIAS("core_3rd_gen_avx", "ivybridge", "ivybridge")
268
CPU_SPECIFIC("haswell", "haswell", 'V', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2")
269
CPU_SPECIFIC_ALIAS("core_4th_gen_avx", "haswell", "haswell")
270
CPU_SPECIFIC("core_4th_gen_avx_tsx", "haswell", 'W', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2")
271
CPU_SPECIFIC("broadwell", "broadwell", 'X', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx")
272
CPU_SPECIFIC_ALIAS("core_5th_gen_avx", "broadwell", "broadwell")
273
CPU_SPECIFIC("core_5th_gen_avx_tsx", "broadwell", 'Y', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx")
274
CPU_SPECIFIC("knl", "knl", 'Z', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd")
275
CPU_SPECIFIC_ALIAS("mic_avx512", "knl", "knl")
276
CPU_SPECIFIC("skylake", "skylake", 'b', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx,+mpx")
277
CPU_SPECIFIC( "skylake_avx512", "skylake-avx512", 'a', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512cd,+avx512bw,+avx512vl,+clwb")
278
CPU_SPECIFIC("cannonlake", "cannonlake", 'e', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512ifma,+avx512cd,+avx512bw,+avx512vl,+avx512vbmi")
279
CPU_SPECIFIC("knm", "knm", 'j', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd,+avx5124fmaps,+avx5124vnniw,+avx512vpopcntdq")
280
 
281
#undef CPU_SPECIFIC_ALIAS
282
#undef CPU_SPECIFIC