2017-11-10 18:10:57 +01:00
|
|
|
//===- X86TargetParser.def - X86 target parsing defines ---------*- C++ -*-===//
|
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-11-10 18:10:57 +01:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file provides defines to build up the X86 target parser's logic.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// NOTE: NO INCLUDE GUARD DESIRED!
|
|
|
|
|
|
|
|
#ifndef X86_VENDOR
|
2017-11-15 00:54:28 +01:00
|
|
|
#define X86_VENDOR(ENUM, STR)
|
2017-11-10 18:10:57 +01:00
|
|
|
#endif
|
|
|
|
X86_VENDOR(VENDOR_INTEL, "intel")
|
|
|
|
X86_VENDOR(VENDOR_AMD, "amd")
|
|
|
|
#undef X86_VENDOR
|
|
|
|
|
|
|
|
// This macro is used for cpu types present in compiler-rt/libgcc.
|
|
|
|
#ifndef X86_CPU_TYPE
|
2020-07-13 01:58:27 +02:00
|
|
|
#define X86_CPU_TYPE(ENUM, STR)
|
2017-11-10 18:10:57 +01:00
|
|
|
#endif
|
2020-06-03 20:57:03 +02:00
|
|
|
|
2020-07-13 01:58:27 +02:00
|
|
|
#ifndef X86_CPU_TYPE_ALIAS
|
|
|
|
#define X86_CPU_TYPE_ALIAS(ENUM, STR)
|
2020-06-03 20:57:03 +02:00
|
|
|
#endif
|
|
|
|
|
2020-07-13 01:58:27 +02:00
|
|
|
// This list must match what is implemented in libgcc and compilert-rt. Clang
|
|
|
|
// uses this to know how to implement __builtin_cpu_is.
|
|
|
|
X86_CPU_TYPE(INTEL_BONNELL, "bonnell")
|
|
|
|
X86_CPU_TYPE(INTEL_CORE2, "core2")
|
|
|
|
X86_CPU_TYPE(INTEL_COREI7, "corei7")
|
|
|
|
X86_CPU_TYPE(AMDFAM10H, "amdfam10h")
|
|
|
|
X86_CPU_TYPE(AMDFAM15H, "amdfam15h")
|
|
|
|
X86_CPU_TYPE(INTEL_SILVERMONT, "silvermont")
|
|
|
|
X86_CPU_TYPE(INTEL_KNL, "knl")
|
|
|
|
X86_CPU_TYPE(AMD_BTVER1, "btver1")
|
|
|
|
X86_CPU_TYPE(AMD_BTVER2, "btver2")
|
|
|
|
X86_CPU_TYPE(AMDFAM17H, "amdfam17h")
|
|
|
|
X86_CPU_TYPE(INTEL_KNM, "knm")
|
|
|
|
X86_CPU_TYPE(INTEL_GOLDMONT, "goldmont")
|
|
|
|
X86_CPU_TYPE(INTEL_GOLDMONT_PLUS, "goldmont-plus")
|
|
|
|
X86_CPU_TYPE(INTEL_TREMONT, "tremont")
|
2020-12-05 19:07:09 +01:00
|
|
|
X86_CPU_TYPE(AMDFAM19H, "amdfam19h")
|
2020-06-03 20:57:03 +02:00
|
|
|
|
|
|
|
// Alternate names supported by __builtin_cpu_is and target multiversioning.
|
2020-07-13 01:58:27 +02:00
|
|
|
X86_CPU_TYPE_ALIAS(INTEL_BONNELL, "atom")
|
|
|
|
X86_CPU_TYPE_ALIAS(AMDFAM10H, "amdfam10")
|
|
|
|
X86_CPU_TYPE_ALIAS(AMDFAM15H, "amdfam15")
|
|
|
|
X86_CPU_TYPE_ALIAS(INTEL_SILVERMONT, "slm")
|
2020-06-03 20:57:03 +02:00
|
|
|
|
2020-07-13 01:58:27 +02:00
|
|
|
#undef X86_CPU_TYPE_ALIAS
|
2017-11-10 18:10:57 +01:00
|
|
|
#undef X86_CPU_TYPE
|
|
|
|
|
|
|
|
// This macro is used for cpu subtypes present in compiler-rt/libgcc.
|
|
|
|
#ifndef X86_CPU_SUBTYPE
|
2020-07-13 01:58:27 +02:00
|
|
|
#define X86_CPU_SUBTYPE(ENUM, STR)
|
2017-11-10 18:10:57 +01:00
|
|
|
#endif
|
|
|
|
|
2020-07-13 01:58:27 +02:00
|
|
|
// This list must match what is implemented in libgcc and compilert-rt. Clang
|
|
|
|
// uses this to know how to implement __builtin_cpu_is.
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_NEHALEM, "nehalem")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_WESTMERE, "westmere")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_SANDYBRIDGE, "sandybridge")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM10H_BARCELONA, "barcelona")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM10H_SHANGHAI, "shanghai")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM10H_ISTANBUL, "istanbul")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM15H_BDVER1, "bdver1")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM15H_BDVER2, "bdver2")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM15H_BDVER3, "bdver3")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM15H_BDVER4, "bdver4")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM17H_ZNVER1, "znver1")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_IVYBRIDGE, "ivybridge")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_HASWELL, "haswell")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_BROADWELL, "broadwell")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_SKYLAKE, "skylake")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_SKYLAKE_AVX512, "skylake-avx512")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_CANNONLAKE, "cannonlake")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_ICELAKE_CLIENT, "icelake-client")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_ICELAKE_SERVER, "icelake-server")
|
|
|
|
X86_CPU_SUBTYPE(AMDFAM17H_ZNVER2, "znver2")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_CASCADELAKE, "cascadelake")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_TIGERLAKE, "tigerlake")
|
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_COOPERLAKE, "cooperlake")
|
[X86] Support -march=sapphirerapids
Support -march=sapphirerapids for x86.
Compare with Icelake Server, it includes 14 more new features. They are
amxtile, amxint8, amxbf16, avx512bf16, avx512vp2intersect, cldemote,
enqcmd, movdir64b, movdiri, ptwrite, serialize, shstk, tsxldtrk, waitpkg.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D86503
2020-08-25 06:27:02 +02:00
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_SAPPHIRERAPIDS, "sapphirerapids")
|
2020-10-24 18:00:33 +02:00
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_ALDERLAKE, "alderlake")
|
2020-12-05 19:07:09 +01:00
|
|
|
X86_CPU_SUBTYPE(AMDFAM19H_ZNVER3, "znver3")
|
2021-04-13 03:24:34 +02:00
|
|
|
X86_CPU_SUBTYPE(INTEL_COREI7_ROCKETLAKE, "rocketlake")
|
2017-11-10 18:10:57 +01:00
|
|
|
#undef X86_CPU_SUBTYPE
|
2017-11-22 00:36:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
// This macro is used for cpu types present in compiler-rt/libgcc.
|
|
|
|
#ifndef X86_FEATURE_COMPAT
|
2020-06-30 20:59:03 +02:00
|
|
|
#define X86_FEATURE_COMPAT(ENUM, STR) X86_FEATURE(ENUM, STR)
|
2017-11-22 00:36:42 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef X86_FEATURE
|
2020-06-30 20:59:03 +02:00
|
|
|
#define X86_FEATURE(ENUM, STR)
|
2017-11-22 00:36:42 +01:00
|
|
|
#endif
|
2020-06-22 05:20:04 +02:00
|
|
|
|
2020-06-30 20:59:03 +02:00
|
|
|
X86_FEATURE_COMPAT(CMOV, "cmov")
|
|
|
|
X86_FEATURE_COMPAT(MMX, "mmx")
|
|
|
|
X86_FEATURE_COMPAT(POPCNT, "popcnt")
|
|
|
|
X86_FEATURE_COMPAT(SSE, "sse")
|
|
|
|
X86_FEATURE_COMPAT(SSE2, "sse2")
|
|
|
|
X86_FEATURE_COMPAT(SSE3, "sse3")
|
|
|
|
X86_FEATURE_COMPAT(SSSE3, "ssse3")
|
|
|
|
X86_FEATURE_COMPAT(SSE4_1, "sse4.1")
|
|
|
|
X86_FEATURE_COMPAT(SSE4_2, "sse4.2")
|
|
|
|
X86_FEATURE_COMPAT(AVX, "avx")
|
|
|
|
X86_FEATURE_COMPAT(AVX2, "avx2")
|
|
|
|
X86_FEATURE_COMPAT(SSE4_A, "sse4a")
|
|
|
|
X86_FEATURE_COMPAT(FMA4, "fma4")
|
|
|
|
X86_FEATURE_COMPAT(XOP, "xop")
|
|
|
|
X86_FEATURE_COMPAT(FMA, "fma")
|
|
|
|
X86_FEATURE_COMPAT(AVX512F, "avx512f")
|
|
|
|
X86_FEATURE_COMPAT(BMI, "bmi")
|
|
|
|
X86_FEATURE_COMPAT(BMI2, "bmi2")
|
|
|
|
X86_FEATURE_COMPAT(AES, "aes")
|
|
|
|
X86_FEATURE_COMPAT(PCLMUL, "pclmul")
|
|
|
|
X86_FEATURE_COMPAT(AVX512VL, "avx512vl")
|
|
|
|
X86_FEATURE_COMPAT(AVX512BW, "avx512bw")
|
|
|
|
X86_FEATURE_COMPAT(AVX512DQ, "avx512dq")
|
|
|
|
X86_FEATURE_COMPAT(AVX512CD, "avx512cd")
|
|
|
|
X86_FEATURE_COMPAT(AVX512ER, "avx512er")
|
|
|
|
X86_FEATURE_COMPAT(AVX512PF, "avx512pf")
|
|
|
|
X86_FEATURE_COMPAT(AVX512VBMI, "avx512vbmi")
|
|
|
|
X86_FEATURE_COMPAT(AVX512IFMA, "avx512ifma")
|
|
|
|
X86_FEATURE_COMPAT(AVX5124VNNIW, "avx5124vnniw")
|
|
|
|
X86_FEATURE_COMPAT(AVX5124FMAPS, "avx5124fmaps")
|
|
|
|
X86_FEATURE_COMPAT(AVX512VPOPCNTDQ, "avx512vpopcntdq")
|
|
|
|
X86_FEATURE_COMPAT(AVX512VBMI2, "avx512vbmi2")
|
|
|
|
X86_FEATURE_COMPAT(GFNI, "gfni")
|
|
|
|
X86_FEATURE_COMPAT(VPCLMULQDQ, "vpclmulqdq")
|
|
|
|
X86_FEATURE_COMPAT(AVX512VNNI, "avx512vnni")
|
|
|
|
X86_FEATURE_COMPAT(AVX512BITALG, "avx512bitalg")
|
|
|
|
X86_FEATURE_COMPAT(AVX512BF16, "avx512bf16")
|
|
|
|
X86_FEATURE_COMPAT(AVX512VP2INTERSECT, "avx512vp2intersect")
|
2017-11-22 00:36:42 +01:00
|
|
|
// Features below here are not in libgcc/compiler-rt.
|
2020-06-30 20:59:03 +02:00
|
|
|
X86_FEATURE (3DNOW, "3dnow")
|
|
|
|
X86_FEATURE (3DNOWA, "3dnowa")
|
2020-07-07 09:27:50 +02:00
|
|
|
X86_FEATURE (64BIT, "64bit")
|
2020-06-30 20:59:03 +02:00
|
|
|
X86_FEATURE (ADX, "adx")
|
2020-07-07 07:47:54 +02:00
|
|
|
X86_FEATURE (AMX_BF16, "amx-bf16")
|
|
|
|
X86_FEATURE (AMX_INT8, "amx-int8")
|
|
|
|
X86_FEATURE (AMX_TILE, "amx-tile")
|
2020-06-30 20:59:03 +02:00
|
|
|
X86_FEATURE (CLDEMOTE, "cldemote")
|
|
|
|
X86_FEATURE (CLFLUSHOPT, "clflushopt")
|
|
|
|
X86_FEATURE (CLWB, "clwb")
|
|
|
|
X86_FEATURE (CLZERO, "clzero")
|
|
|
|
X86_FEATURE (CMPXCHG16B, "cx16")
|
|
|
|
X86_FEATURE (CMPXCHG8B, "cx8")
|
|
|
|
X86_FEATURE (ENQCMD, "enqcmd")
|
|
|
|
X86_FEATURE (F16C, "f16c")
|
|
|
|
X86_FEATURE (FSGSBASE, "fsgsbase")
|
|
|
|
X86_FEATURE (FXSR, "fxsr")
|
|
|
|
X86_FEATURE (INVPCID, "invpcid")
|
2020-09-30 12:01:15 +02:00
|
|
|
X86_FEATURE (KL, "kl")
|
|
|
|
X86_FEATURE (WIDEKL, "widekl")
|
2020-06-30 20:59:03 +02:00
|
|
|
X86_FEATURE (LWP, "lwp")
|
|
|
|
X86_FEATURE (LZCNT, "lzcnt")
|
|
|
|
X86_FEATURE (MOVBE, "movbe")
|
|
|
|
X86_FEATURE (MOVDIR64B, "movdir64b")
|
|
|
|
X86_FEATURE (MOVDIRI, "movdiri")
|
|
|
|
X86_FEATURE (MWAITX, "mwaitx")
|
|
|
|
X86_FEATURE (PCONFIG, "pconfig")
|
|
|
|
X86_FEATURE (PKU, "pku")
|
|
|
|
X86_FEATURE (PREFETCHWT1, "prefetchwt1")
|
|
|
|
X86_FEATURE (PRFCHW, "prfchw")
|
|
|
|
X86_FEATURE (PTWRITE, "ptwrite")
|
|
|
|
X86_FEATURE (RDPID, "rdpid")
|
|
|
|
X86_FEATURE (RDRND, "rdrnd")
|
|
|
|
X86_FEATURE (RDSEED, "rdseed")
|
|
|
|
X86_FEATURE (RTM, "rtm")
|
|
|
|
X86_FEATURE (SAHF, "sahf")
|
|
|
|
X86_FEATURE (SERIALIZE, "serialize")
|
|
|
|
X86_FEATURE (SGX, "sgx")
|
|
|
|
X86_FEATURE (SHA, "sha")
|
|
|
|
X86_FEATURE (SHSTK, "shstk")
|
|
|
|
X86_FEATURE (TBM, "tbm")
|
|
|
|
X86_FEATURE (TSXLDTRK, "tsxldtrk")
|
2020-10-22 10:46:07 +02:00
|
|
|
X86_FEATURE (UINTR, "uintr")
|
2020-06-30 20:59:03 +02:00
|
|
|
X86_FEATURE (VAES, "vaes")
|
2020-07-07 07:47:54 +02:00
|
|
|
X86_FEATURE (VZEROUPPER, "vzeroupper")
|
2020-06-30 20:59:03 +02:00
|
|
|
X86_FEATURE (WAITPKG, "waitpkg")
|
|
|
|
X86_FEATURE (WBNOINVD, "wbnoinvd")
|
|
|
|
X86_FEATURE (X87, "x87")
|
|
|
|
X86_FEATURE (XSAVE, "xsave")
|
|
|
|
X86_FEATURE (XSAVEC, "xsavec")
|
|
|
|
X86_FEATURE (XSAVEOPT, "xsaveopt")
|
|
|
|
X86_FEATURE (XSAVES, "xsaves")
|
2020-10-13 02:42:46 +02:00
|
|
|
X86_FEATURE (HRESET, "hreset")
|
2020-10-30 05:58:05 +01:00
|
|
|
X86_FEATURE (AVXVNNI, "avxvnni")
|
2020-07-07 07:47:54 +02:00
|
|
|
// These features aren't really CPU features, but the frontend can set them.
|
2020-07-07 09:27:50 +02:00
|
|
|
X86_FEATURE (RETPOLINE_EXTERNAL_THUNK, "retpoline-external-thunk")
|
2020-07-07 07:47:54 +02:00
|
|
|
X86_FEATURE (RETPOLINE_INDIRECT_BRANCHES, "retpoline-indirect-branches")
|
|
|
|
X86_FEATURE (RETPOLINE_INDIRECT_CALLS, "retpoline-indirect-calls")
|
|
|
|
X86_FEATURE (LVI_CFI, "lvi-cfi")
|
|
|
|
X86_FEATURE (LVI_LOAD_HARDENING, "lvi-load-hardening")
|
2017-11-22 00:36:42 +01:00
|
|
|
#undef X86_FEATURE_COMPAT
|
|
|
|
#undef X86_FEATURE
|