Recommit [NFC] Better encapsulation of llvm::Optional Storage
[llvm-complete.git] / include / llvm / Support / X86TargetParser.def
blobfb82228c4dff4c337ceec1f8c0cf85e17bf8fb02
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.
11 //===----------------------------------------------------------------------===//
13 // NOTE: NO INCLUDE GUARD DESIRED!
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
22 // This macro is used to implement CPU types that have an alias. As of now
23 // there is only ever one alias.
24 #ifndef X86_CPU_TYPE_COMPAT_WITH_ALIAS
25 #define X86_CPU_TYPE_COMPAT_WITH_ALIAS(ARCHNAME, ENUM, STR, ALIAS) X86_CPU_TYPE_COMPAT(ARCHNAME, ENUM, STR)
26 #endif
28 // This macro is used for cpu types present in compiler-rt/libgcc.
29 #ifndef X86_CPU_TYPE_COMPAT
30 #define X86_CPU_TYPE_COMPAT(ARCHNAME, ENUM, STR) X86_CPU_TYPE(ARCHNAME, ENUM)
31 #endif
33 #ifndef X86_CPU_TYPE
34 #define X86_CPU_TYPE(ARCHNAME, ENUM)
35 #endif
36 X86_CPU_TYPE_COMPAT_WITH_ALIAS("bonnell", INTEL_BONNELL, "bonnell", "atom")
37 X86_CPU_TYPE_COMPAT ("core2", INTEL_CORE2, "core2")
38 X86_CPU_TYPE_COMPAT ("nehalem", INTEL_COREI7, "corei7")
39 X86_CPU_TYPE_COMPAT_WITH_ALIAS("amdfam10", AMDFAM10H, "amdfam10h", "amdfam10")
40 X86_CPU_TYPE_COMPAT_WITH_ALIAS("bdver1", AMDFAM15H, "amdfam15h", "amdfam15")
41 X86_CPU_TYPE_COMPAT_WITH_ALIAS("silvermont", INTEL_SILVERMONT, "silvermont", "slm")
42 X86_CPU_TYPE_COMPAT ("knl", INTEL_KNL, "knl")
43 X86_CPU_TYPE_COMPAT ("btver1", AMD_BTVER1, "btver1")
44 X86_CPU_TYPE_COMPAT ("btver2", AMD_BTVER2, "btver2")
45 X86_CPU_TYPE_COMPAT ("znver1", AMDFAM17H, "amdfam17h")
46 X86_CPU_TYPE_COMPAT ("knm", INTEL_KNM, "knm")
47 X86_CPU_TYPE_COMPAT ("goldmont", INTEL_GOLDMONT, "goldmont")
48 X86_CPU_TYPE_COMPAT ("goldmont-plus", INTEL_GOLDMONT_PLUS, "goldmont-plus")
49 X86_CPU_TYPE_COMPAT ("tremont", INTEL_TREMONT, "tremont")
50 // Entries below this are not in libgcc/compiler-rt.
51 X86_CPU_TYPE ("i386", INTEL_i386)
52 X86_CPU_TYPE ("i486", INTEL_i486)
53 X86_CPU_TYPE ("pentium", INTEL_PENTIUM)
54 X86_CPU_TYPE ("pentium-mmx", INTEL_PENTIUM_MMX)
55 X86_CPU_TYPE ("pentiumpro", INTEL_PENTIUM_PRO)
56 X86_CPU_TYPE ("pentium2", INTEL_PENTIUM_II)
57 X86_CPU_TYPE ("pentium3", INTEL_PENTIUM_III)
58 X86_CPU_TYPE ("pentium4", INTEL_PENTIUM_IV)
59 X86_CPU_TYPE ("pentium-m", INTEL_PENTIUM_M)
60 X86_CPU_TYPE ("yonah", INTEL_CORE_DUO)
61 X86_CPU_TYPE ("nocona", INTEL_NOCONA)
62 X86_CPU_TYPE ("prescott", INTEL_PRESCOTT)
63 X86_CPU_TYPE ("i486", AMD_i486)
64 X86_CPU_TYPE ("pentium", AMDPENTIUM)
65 X86_CPU_TYPE ("athlon", AMD_ATHLON)
66 X86_CPU_TYPE ("athlon-xp", AMD_ATHLON_XP)
67 X86_CPU_TYPE ("k8", AMD_K8)
68 X86_CPU_TYPE ("k8-sse3", AMD_K8SSE3)
69 #undef X86_CPU_TYPE_COMPAT_WITH_ALIAS
70 #undef X86_CPU_TYPE_COMPAT
71 #undef X86_CPU_TYPE
73 // This macro is used for cpu subtypes present in compiler-rt/libgcc.
74 #ifndef X86_CPU_SUBTYPE_COMPAT
75 #define X86_CPU_SUBTYPE_COMPAT(ARCHNAME, ENUM, STR) X86_CPU_SUBTYPE(ARCHNAME, ENUM)
76 #endif
78 #ifndef X86_CPU_SUBTYPE
79 #define X86_CPU_SUBTYPE(ARCHNAME, ENUM)
80 #endif
82 X86_CPU_SUBTYPE_COMPAT("nehalem", INTEL_COREI7_NEHALEM, "nehalem")
83 X86_CPU_SUBTYPE_COMPAT("westmere", INTEL_COREI7_WESTMERE, "westmere")
84 X86_CPU_SUBTYPE_COMPAT("sandybridge", INTEL_COREI7_SANDYBRIDGE, "sandybridge")
85 X86_CPU_SUBTYPE_COMPAT("amdfam10", AMDFAM10H_BARCELONA, "barcelona")
86 X86_CPU_SUBTYPE_COMPAT("amdfam10", AMDFAM10H_SHANGHAI, "shanghai")
87 X86_CPU_SUBTYPE_COMPAT("amdfam10", AMDFAM10H_ISTANBUL, "istanbul")
88 X86_CPU_SUBTYPE_COMPAT("bdver1", AMDFAM15H_BDVER1, "bdver1")
89 X86_CPU_SUBTYPE_COMPAT("bdver2", AMDFAM15H_BDVER2, "bdver2")
90 X86_CPU_SUBTYPE_COMPAT("bdver3", AMDFAM15H_BDVER3, "bdver3")
91 X86_CPU_SUBTYPE_COMPAT("bdver4", AMDFAM15H_BDVER4, "bdver4")
92 X86_CPU_SUBTYPE_COMPAT("znver1", AMDFAM17H_ZNVER1, "znver1")
93 X86_CPU_SUBTYPE_COMPAT("ivybridge", INTEL_COREI7_IVYBRIDGE, "ivybridge")
94 X86_CPU_SUBTYPE_COMPAT("haswell", INTEL_COREI7_HASWELL, "haswell")
95 X86_CPU_SUBTYPE_COMPAT("broadwell", INTEL_COREI7_BROADWELL, "broadwell")
96 X86_CPU_SUBTYPE_COMPAT("skylake", INTEL_COREI7_SKYLAKE, "skylake")
97 X86_CPU_SUBTYPE_COMPAT("skylake-avx512", INTEL_COREI7_SKYLAKE_AVX512, "skylake-avx512")
98 X86_CPU_SUBTYPE_COMPAT("cannonlake", INTEL_COREI7_CANNONLAKE, "cannonlake")
99 X86_CPU_SUBTYPE_COMPAT("icelake-client", INTEL_COREI7_ICELAKE_CLIENT, "icelake-client")
100 X86_CPU_SUBTYPE_COMPAT("icelake-server", INTEL_COREI7_ICELAKE_SERVER, "icelake-server")
101 // Entries below this are not in libgcc/compiler-rt.
102 X86_CPU_SUBTYPE ("core2", INTEL_CORE2_65)
103 X86_CPU_SUBTYPE ("penryn", INTEL_CORE2_45)
104 X86_CPU_SUBTYPE ("cascadelake", INTEL_COREI7_CASCADELAKE)
105 X86_CPU_SUBTYPE ("k6", AMDPENTIUM_K6)
106 X86_CPU_SUBTYPE ("k6-2", AMDPENTIUM_K62)
107 X86_CPU_SUBTYPE ("k6-3", AMDPENTIUM_K63)
108 X86_CPU_SUBTYPE ("geode", AMDPENTIUM_GEODE)
109 #undef X86_CPU_SUBTYPE_COMPAT
110 #undef X86_CPU_SUBTYPE
113 // This macro is used for cpu types present in compiler-rt/libgcc.
114 #ifndef X86_FEATURE_COMPAT
115 #define X86_FEATURE_COMPAT(VAL, ENUM, STR) X86_FEATURE(VAL, ENUM)
116 #endif
118 #ifndef X86_FEATURE
119 #define X86_FEATURE(VAL, ENUM)
120 #endif
121 X86_FEATURE_COMPAT( 0, FEATURE_CMOV, "cmov")
122 X86_FEATURE_COMPAT( 1, FEATURE_MMX, "mmx")
123 X86_FEATURE_COMPAT( 2, FEATURE_POPCNT, "popcnt")
124 X86_FEATURE_COMPAT( 3, FEATURE_SSE, "sse")
125 X86_FEATURE_COMPAT( 4, FEATURE_SSE2, "sse2")
126 X86_FEATURE_COMPAT( 5, FEATURE_SSE3, "sse3")
127 X86_FEATURE_COMPAT( 6, FEATURE_SSSE3, "ssse3")
128 X86_FEATURE_COMPAT( 7, FEATURE_SSE4_1, "sse4.1")
129 X86_FEATURE_COMPAT( 8, FEATURE_SSE4_2, "sse4.2")
130 X86_FEATURE_COMPAT( 9, FEATURE_AVX, "avx")
131 X86_FEATURE_COMPAT(10, FEATURE_AVX2, "avx2")
132 X86_FEATURE_COMPAT(11, FEATURE_SSE4_A, "sse4a")
133 X86_FEATURE_COMPAT(12, FEATURE_FMA4, "fma4")
134 X86_FEATURE_COMPAT(13, FEATURE_XOP, "xop")
135 X86_FEATURE_COMPAT(14, FEATURE_FMA, "fma")
136 X86_FEATURE_COMPAT(15, FEATURE_AVX512F, "avx512f")
137 X86_FEATURE_COMPAT(16, FEATURE_BMI, "bmi")
138 X86_FEATURE_COMPAT(17, FEATURE_BMI2, "bmi2")
139 X86_FEATURE_COMPAT(18, FEATURE_AES, "aes")
140 X86_FEATURE_COMPAT(19, FEATURE_PCLMUL, "pclmul")
141 X86_FEATURE_COMPAT(20, FEATURE_AVX512VL, "avx512vl")
142 X86_FEATURE_COMPAT(21, FEATURE_AVX512BW, "avx512bw")
143 X86_FEATURE_COMPAT(22, FEATURE_AVX512DQ, "avx512dq")
144 X86_FEATURE_COMPAT(23, FEATURE_AVX512CD, "avx512cd")
145 X86_FEATURE_COMPAT(24, FEATURE_AVX512ER, "avx512er")
146 X86_FEATURE_COMPAT(25, FEATURE_AVX512PF, "avx512pf")
147 X86_FEATURE_COMPAT(26, FEATURE_AVX512VBMI, "avx512vbmi")
148 X86_FEATURE_COMPAT(27, FEATURE_AVX512IFMA, "avx512ifma")
149 X86_FEATURE_COMPAT(28, FEATURE_AVX5124VNNIW, "avx5124vnniw")
150 X86_FEATURE_COMPAT(29, FEATURE_AVX5124FMAPS, "avx5124fmaps")
151 X86_FEATURE_COMPAT(30, FEATURE_AVX512VPOPCNTDQ, "avx512vpopcntdq")
152 X86_FEATURE_COMPAT(31, FEATURE_AVX512VBMI2, "avx512vbmi2")
153 X86_FEATURE_COMPAT(32, FEATURE_GFNI, "gfni")
154 X86_FEATURE_COMPAT(33, FEATURE_VPCLMULQDQ, "vpclmulqdq")
155 X86_FEATURE_COMPAT(34, FEATURE_AVX512VNNI, "avx512vnni")
156 X86_FEATURE_COMPAT(35, FEATURE_AVX512BITALG, "avx512bitalg")
157 // Features below here are not in libgcc/compiler-rt.
158 X86_FEATURE (64, FEATURE_MOVBE)
159 X86_FEATURE (65, FEATURE_ADX)
160 X86_FEATURE (66, FEATURE_EM64T)
161 X86_FEATURE (67, FEATURE_CLFLUSHOPT)
162 X86_FEATURE (68, FEATURE_SHA)
163 #undef X86_FEATURE_COMPAT
164 #undef X86_FEATURE