/* Subroutines for the gcc driver.
- Copyright (C) 2006-2018 Free Software Foundation, Inc.
+ Copyright (C) 2006-2020 Free Software Foundation, Inc.
This file is part of GCC.
unsigned int has_shstk = 0;
unsigned int has_avx512vnni = 0, has_vaes = 0;
unsigned int has_vpclmulqdq = 0;
+ unsigned int has_avx512vp2intersect = 0;
unsigned int has_movdiri = 0, has_movdir64b = 0;
+ unsigned int has_enqcmd = 0;
unsigned int has_waitpkg = 0;
unsigned int has_cldemote = 0;
+ unsigned int has_avx512bf16 = 0;
+
+ unsigned int has_ptwrite = 0;
bool arch;
has_avx512bitalg = ecx & bit_AVX512BITALG;
has_movdiri = ecx & bit_MOVDIRI;
has_movdir64b = ecx & bit_MOVDIR64B;
+ has_enqcmd = ecx & bit_ENQCMD;
has_cldemote = ecx & bit_CLDEMOTE;
has_avx5124vnniw = edx & bit_AVX5124VNNIW;
has_avx5124fmaps = edx & bit_AVX5124FMAPS;
+ has_avx512vp2intersect = edx & bit_AVX512VP2INTERSECT;
has_shstk = ecx & bit_SHSTK;
has_pconfig = edx & bit_PCONFIG;
has_waitpkg = ecx & bit_WAITPKG;
+
+ __cpuid_count (7, 1, eax, ebx, ecx, edx);
+ has_avx512bf16 = eax & bit_AVX512BF16;
}
if (max_level >= 13)
has_xsaves = eax & bit_XSAVES;
}
+ if (max_level >= 0x14)
+ {
+ __cpuid_count (0x14, 0, eax, ebx, ecx, edx);
+
+ has_ptwrite = ebx & bit_PTWRITE;
+ }
+
/* Check cpuid level of extended features. */
__cpuid (0x80000000, ext_level, ebx, ecx, edx);
processor = PROCESSOR_GEODE;
else if (has_movbe && family == 22)
processor = PROCESSOR_BTVER2;
+ else if (has_clwb)
+ processor = PROCESSOR_ZNVER2;
else if (has_clzero)
processor = PROCESSOR_ZNVER1;
else if (has_avx2)
cpu = "skylake";
break;
case 0x55:
- /* Skylake with AVX-512. */
- cpu = "skylake-avx512";
+ if (has_avx512vnni)
+ /* Cascade Lake. */
+ cpu = "cascadelake";
+ else
+ /* Skylake with AVX-512. */
+ cpu = "skylake-avx512";
break;
case 0x57:
/* Knights Landing. */
if (arch)
{
/* This is unknown family 0x6 CPU. */
- /* Assume Ice Lake Server. */
- if (has_wbnoinvd)
- cpu = "icelake-server";
- /* Assume Ice Lake. */
- else if (has_gfni)
- cpu = "icelake-client";
- /* Assume Cannon Lake. */
- else if (has_avx512vbmi)
- cpu = "cannonlake";
- /* Assume Knights Mill. */
- else if (has_avx5124vnniw)
- cpu = "knm";
- /* Assume Knights Landing. */
- else if (has_avx512er)
- cpu = "knl";
- /* Assume Skylake with AVX-512. */
- else if (has_avx512f)
- cpu = "skylake-avx512";
- /* Assume Skylake. */
- else if (has_clflushopt)
- cpu = "skylake";
- /* Assume Broadwell. */
- else if (has_adx)
- cpu = "broadwell";
- else if (has_avx2)
+ if (has_avx)
+ {
+ /* Assume Tiger Lake */
+ if (has_avx512vp2intersect)
+ cpu = "tigerlake";
+ /* Assume Cooper Lake */
+ else if (has_avx512bf16)
+ cpu = "cooperlake";
+ /* Assume Ice Lake Server. */
+ else if (has_wbnoinvd)
+ cpu = "icelake-server";
+ /* Assume Ice Lake. */
+ else if (has_avx512bitalg)
+ cpu = "icelake-client";
+ /* Assume Cannon Lake. */
+ else if (has_avx512vbmi)
+ cpu = "cannonlake";
+ /* Assume Knights Mill. */
+ else if (has_avx5124vnniw)
+ cpu = "knm";
+ /* Assume Knights Landing. */
+ else if (has_avx512er)
+ cpu = "knl";
+ /* Assume Skylake with AVX-512. */
+ else if (has_avx512f)
+ cpu = "skylake-avx512";
+ /* Assume Skylake. */
+ else if (has_clflushopt)
+ cpu = "skylake";
+ /* Assume Broadwell. */
+ else if (has_adx)
+ cpu = "broadwell";
+ else if (has_avx2)
/* Assume Haswell. */
- cpu = "haswell";
- else if (has_avx)
+ cpu = "haswell";
+ else
/* Assume Sandy Bridge. */
- cpu = "sandybridge";
+ cpu = "sandybridge";
+ }
else if (has_sse4_2)
{
- if (has_sgx)
+ if (has_gfni)
+ /* Assume Tremont. */
+ cpu = "tremont";
+ else if (has_sgx)
/* Assume Goldmont Plus. */
cpu = "goldmont-plus";
else if (has_xsave)
case PROCESSOR_ZNVER1:
cpu = "znver1";
break;
+ case PROCESSOR_ZNVER2:
+ cpu = "znver2";
+ break;
case PROCESSOR_BTVER1:
cpu = "btver1";
break;
const char *shstk = has_shstk ? " -mshstk" : " -mno-shstk";
const char *vaes = has_vaes ? " -mvaes" : " -mno-vaes";
const char *vpclmulqdq = has_vpclmulqdq ? " -mvpclmulqdq" : " -mno-vpclmulqdq";
+ const char *avx512vp2intersect = has_avx512vp2intersect ? " -mavx512vp2intersect" : " -mno-avx512vp2intersect";
const char *avx512bitalg = has_avx512bitalg ? " -mavx512bitalg" : " -mno-avx512bitalg";
const char *movdiri = has_movdiri ? " -mmovdiri" : " -mno-movdiri";
const char *movdir64b = has_movdir64b ? " -mmovdir64b" : " -mno-movdir64b";
+ const char *enqcmd = has_enqcmd ? " -menqcmd" : " -mno-enqcmd";
const char *waitpkg = has_waitpkg ? " -mwaitpkg" : " -mno-waitpkg";
const char *cldemote = has_cldemote ? " -mcldemote" : " -mno-cldemote";
+ const char *ptwrite = has_ptwrite ? " -mptwrite" : " -mno-ptwrite";
+ const char *avx512bf16 = has_avx512bf16 ? " -mavx512bf16" : " -mno-avx512bf16";
+
options = concat (options, mmx, mmx3dnow, sse, sse2, sse3, ssse3,
sse4a, cx16, sahf, movbe, aes, sha, pclmul,
popcnt, abm, lwp, fma, fma4, xop, bmi, sgx, bmi2,
clwb, mwaitx, clzero, pku, rdpid, gfni, shstk,
avx512vbmi2, avx512vnni, vaes, vpclmulqdq,
avx512bitalg, movdiri, movdir64b, waitpkg, cldemote,
+ ptwrite, avx512bf16, enqcmd, avx512vp2intersect,
NULL);
}