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