2016-12-03 09:44:35 +00:00
|
|
|
/* Get CPU type and Features for x86 processors.
|
2018-01-03 11:03:58 +01:00
|
|
|
Copyright (C) 2012-2018 Free Software Foundation, Inc.
|
2016-12-03 09:44:35 +00:00
|
|
|
Contributed by Sriraman Tallam (tmsriram@google.com)
|
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
Software Foundation; either version 3, or (at your option) any later
|
|
|
|
version.
|
|
|
|
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
|
|
3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License and
|
|
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
/* Processor Vendor and Models. */
|
|
|
|
|
|
|
|
enum processor_vendor
|
|
|
|
{
|
|
|
|
VENDOR_INTEL = 1,
|
|
|
|
VENDOR_AMD,
|
|
|
|
VENDOR_OTHER,
|
|
|
|
VENDOR_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Any new types or subtypes have to be inserted at the end. */
|
|
|
|
|
|
|
|
enum processor_types
|
|
|
|
{
|
|
|
|
INTEL_BONNELL = 1,
|
|
|
|
INTEL_CORE2,
|
|
|
|
INTEL_COREI7,
|
|
|
|
AMDFAM10H,
|
|
|
|
AMDFAM15H,
|
|
|
|
INTEL_SILVERMONT,
|
|
|
|
INTEL_KNL,
|
|
|
|
AMD_BTVER1,
|
|
|
|
AMD_BTVER2,
|
|
|
|
AMDFAM17H,
|
2017-09-20 15:47:30 +02:00
|
|
|
INTEL_KNM,
|
2018-05-08 12:23:08 +00:00
|
|
|
INTEL_GOLDMONT,
|
2018-05-17 08:13:23 +00:00
|
|
|
INTEL_GOLDMONT_PLUS,
|
2016-12-03 09:44:35 +00:00
|
|
|
CPU_TYPE_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
enum processor_subtypes
|
|
|
|
{
|
|
|
|
INTEL_COREI7_NEHALEM = 1,
|
|
|
|
INTEL_COREI7_WESTMERE,
|
|
|
|
INTEL_COREI7_SANDYBRIDGE,
|
|
|
|
AMDFAM10H_BARCELONA,
|
|
|
|
AMDFAM10H_SHANGHAI,
|
|
|
|
AMDFAM10H_ISTANBUL,
|
|
|
|
AMDFAM15H_BDVER1,
|
|
|
|
AMDFAM15H_BDVER2,
|
|
|
|
AMDFAM15H_BDVER3,
|
|
|
|
AMDFAM15H_BDVER4,
|
|
|
|
AMDFAM17H_ZNVER1,
|
|
|
|
INTEL_COREI7_IVYBRIDGE,
|
|
|
|
INTEL_COREI7_HASWELL,
|
|
|
|
INTEL_COREI7_BROADWELL,
|
|
|
|
INTEL_COREI7_SKYLAKE,
|
|
|
|
INTEL_COREI7_SKYLAKE_AVX512,
|
2017-11-26 17:11:29 +01:00
|
|
|
INTEL_COREI7_CANNONLAKE,
|
2018-03-14 11:26:38 +01:00
|
|
|
INTEL_COREI7_ICELAKE_CLIENT,
|
|
|
|
INTEL_COREI7_ICELAKE_SERVER,
|
2016-12-03 09:44:35 +00:00
|
|
|
CPU_SUBTYPE_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ISA Features supported. New features have to be inserted at the end. */
|
|
|
|
|
|
|
|
enum processor_features
|
|
|
|
{
|
|
|
|
FEATURE_CMOV = 0,
|
|
|
|
FEATURE_MMX,
|
|
|
|
FEATURE_POPCNT,
|
|
|
|
FEATURE_SSE,
|
|
|
|
FEATURE_SSE2,
|
|
|
|
FEATURE_SSE3,
|
|
|
|
FEATURE_SSSE3,
|
|
|
|
FEATURE_SSE4_1,
|
|
|
|
FEATURE_SSE4_2,
|
|
|
|
FEATURE_AVX,
|
|
|
|
FEATURE_AVX2,
|
|
|
|
FEATURE_SSE4_A,
|
|
|
|
FEATURE_FMA4,
|
|
|
|
FEATURE_XOP,
|
|
|
|
FEATURE_FMA,
|
|
|
|
FEATURE_AVX512F,
|
|
|
|
FEATURE_BMI,
|
|
|
|
FEATURE_BMI2,
|
|
|
|
FEATURE_AES,
|
|
|
|
FEATURE_PCLMUL,
|
|
|
|
FEATURE_AVX512VL,
|
|
|
|
FEATURE_AVX512BW,
|
|
|
|
FEATURE_AVX512DQ,
|
|
|
|
FEATURE_AVX512CD,
|
|
|
|
FEATURE_AVX512ER,
|
|
|
|
FEATURE_AVX512PF,
|
|
|
|
FEATURE_AVX512VBMI,
|
|
|
|
FEATURE_AVX512IFMA,
|
|
|
|
FEATURE_AVX5124VNNIW,
|
2017-01-10 12:55:41 +00:00
|
|
|
FEATURE_AVX5124FMAPS,
|
Add builtin_cpu for cannonlake and new isa features.
gcc/
* config/i386/i386.c (F_AVX512VBMI2, F_GFNI, F_VPCLMULQDQ,
F_AVX512VNNI, F_AVX512BITALG): New.
gcc/testsuite/
* gcc.target/i386/builtin_target.c (check_intel_cpu_model): Add
cannonlake.
(check_features): Add avx512vbmi2, gfni, vpclmulqdq, avx512vnni,
avx512bitalg.
libgcc/
* config/i386/cpuinfo.c (get_available_features): Add
FEATURE_AVX512VBMI2, FEATURE_GFNI, FEATURE_VPCLMULQDQ,
FEATURE_AVX512VNNI, FEATURE_AVX512BITALG.
* config/i386/cpuinfo.h (processor_features) Add
FEATURE_AVX512VBMI2, FEATURE_GFNI, FEATURE_VPCLMULQDQ,
FEATURE_AVX512VNNI, FEATURE_AVX512BITALG.
From-SVN: r258551
2018-03-15 08:52:36 +01:00
|
|
|
FEATURE_AVX512VPOPCNTDQ,
|
|
|
|
FEATURE_AVX512VBMI2,
|
|
|
|
FEATURE_GFNI,
|
|
|
|
FEATURE_VPCLMULQDQ,
|
|
|
|
FEATURE_AVX512VNNI,
|
|
|
|
FEATURE_AVX512BITALG
|
2016-12-03 09:44:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct __processor_model
|
|
|
|
{
|
|
|
|
unsigned int __cpu_vendor;
|
|
|
|
unsigned int __cpu_type;
|
|
|
|
unsigned int __cpu_subtype;
|
|
|
|
unsigned int __cpu_features[1];
|
|
|
|
} __cpu_model;
|
2018-03-20 09:14:42 +01:00
|
|
|
extern unsigned int __cpu_features2;
|