This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Matt Turner <mattst88 at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>, "H . J . Lu" <hjl dot tools at gmail dot com>
- Date: Sun, 18 Jun 2017 19:56:46 +0200
- Subject: Re: [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake
- Authentication-results: sourceware.org; auth=none
- References: <20170616214249.21194-1-mattst88@gmail.com>
On Fri, Jun 16, 2017 at 11:42 PM, Matt Turner <mattst88@gmail.com> wrote:
> Currently -march=native selects -march=broadwell on Kaby Lake systems,
> since its model numbers are missing from the switch statement. It falls
> back to the default case and chooses -march=broadwell because of the
> presence of the ADX instruction set.
>
> gcc/
> * config/i386/driver-i386.c (host_detect_local_cpu): Add Kaby
> Lake models to skylake case.
>
> gcc/testsuite/
>
> * gcc.target/i386/builtin_target.c: Add Kaby Lake models to
> skylake check.
>
> libgcc/
>
> * config/i386/cpuinfo.c (get_intel_cpu): Add Kaby Lake models to
> skylake case.
OK.
Thanks,
Uros.
> ---
> gcc/config/i386/driver-i386.c | 3 +++
> gcc/testsuite/gcc.target/i386/builtin_target.c | 3 +++
> libgcc/config/i386/cpuinfo.c | 3 +++
> 3 files changed, 9 insertions(+)
>
> diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
> index 6c812514239..09faad0af0e 100644
> --- a/gcc/config/i386/driver-i386.c
> +++ b/gcc/config/i386/driver-i386.c
> @@ -781,6 +781,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)
> case 0x4e:
> case 0x5e:
> /* Skylake. */
> + case 0x8e:
> + case 0x9e:
> + /* Kaby Lake. */
> cpu = "skylake";
> break;
> case 0x57:
> diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c
> index 374f0292453..9c190eb7ebc 100644
> --- a/gcc/testsuite/gcc.target/i386/builtin_target.c
> +++ b/gcc/testsuite/gcc.target/i386/builtin_target.c
> @@ -88,6 +88,9 @@ check_intel_cpu_model (unsigned int family, unsigned int model,
> case 0x4e:
> case 0x5e:
> /* Skylake. */
> + case 0x8e:
> + case 0x9e:
> + /* Kaby Lake. */
> assert (__builtin_cpu_is ("corei7"));
> assert (__builtin_cpu_is ("skylake"));
> break;
> diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
> index a1dc011525f..b008fb6e396 100644
> --- a/libgcc/config/i386/cpuinfo.c
> +++ b/libgcc/config/i386/cpuinfo.c
> @@ -183,6 +183,9 @@ get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id)
> case 0x4e:
> case 0x5e:
> /* Skylake. */
> + case 0x8e:
> + case 0x9e:
> + /* Kaby Lake. */
> __cpu_model.__cpu_type = INTEL_COREI7;
> __cpu_model.__cpu_subtype = INTEL_COREI7_SKYLAKE;
> break;
> --
> 2.13.0
>