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