public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/2] i386: Assume Skylake for unknown models with clflushopt
  2017-06-16 21:43 [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake Matt Turner
@ 2017-06-16 21:43 ` Matt Turner
  2017-06-18 17:57   ` Uros Bizjak
  2017-06-18 17:56 ` [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake Uros Bizjak
  1 sibling, 1 reply; 5+ messages in thread
From: Matt Turner @ 2017-06-16 21:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka, Uros Bizjak, H . J . Lu, Matt Turner

gcc/
	* config/i386/driver-i386.c (host_detect_local_cpu): Assume
	skylake for unknown models with clflushopt.
---
 gcc/config/i386/driver-i386.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 09faad0af0e..570c49031bd 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -797,6 +797,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)
 	      /* Assume Knights Landing.  */
 	      if (has_avx512f)
 		cpu = "knl";
+	      /* Assume Skylake.  */
+	      else if (has_clflushopt)
+		cpu = "skylake";
 	      /* Assume Broadwell.  */
 	      else if (has_adx)
 		cpu = "broadwell";
-- 
2.13.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake
@ 2017-06-16 21:43 Matt Turner
  2017-06-16 21:43 ` [PATCH 2/2] i386: Assume Skylake for unknown models with clflushopt Matt Turner
  2017-06-18 17:56 ` [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake Uros Bizjak
  0 siblings, 2 replies; 5+ messages in thread
From: Matt Turner @ 2017-06-16 21:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka, Uros Bizjak, H . J . Lu, Matt Turner

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.
---
 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake
  2017-06-16 21:43 [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake Matt Turner
  2017-06-16 21:43 ` [PATCH 2/2] i386: Assume Skylake for unknown models with clflushopt Matt Turner
@ 2017-06-18 17:56 ` Uros Bizjak
  2017-06-22 17:34   ` Matt Turner
  1 sibling, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2017-06-18 17:56 UTC (permalink / raw)
  To: Matt Turner; +Cc: gcc-patches, Jan Hubicka, H . J . Lu

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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] i386: Assume Skylake for unknown models with clflushopt
  2017-06-16 21:43 ` [PATCH 2/2] i386: Assume Skylake for unknown models with clflushopt Matt Turner
@ 2017-06-18 17:57   ` Uros Bizjak
  0 siblings, 0 replies; 5+ messages in thread
From: Uros Bizjak @ 2017-06-18 17:57 UTC (permalink / raw)
  To: Matt Turner; +Cc: gcc-patches, Jan Hubicka, H . J . Lu

On Fri, Jun 16, 2017 at 11:42 PM, Matt Turner <mattst88@gmail.com> wrote:
> gcc/
>         * config/i386/driver-i386.c (host_detect_local_cpu): Assume
>         skylake for unknown models with clflushopt.

Also OK.

Thanks,
Uros.

> ---
>  gcc/config/i386/driver-i386.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
> index 09faad0af0e..570c49031bd 100644
> --- a/gcc/config/i386/driver-i386.c
> +++ b/gcc/config/i386/driver-i386.c
> @@ -797,6 +797,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)
>               /* Assume Knights Landing.  */
>               if (has_avx512f)
>                 cpu = "knl";
> +             /* Assume Skylake.  */
> +             else if (has_clflushopt)
> +               cpu = "skylake";
>               /* Assume Broadwell.  */
>               else if (has_adx)
>                 cpu = "broadwell";
> --
> 2.13.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake
  2017-06-18 17:56 ` [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake Uros Bizjak
@ 2017-06-22 17:34   ` Matt Turner
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Turner @ 2017-06-22 17:34 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, Jan Hubicka, H . J . Lu

On Sun, Jun 18, 2017 at 10:56 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> 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.

Thank you very much. I do not have write access, so please check the
patches in for me if you would not mind.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-06-22 17:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 21:43 [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake Matt Turner
2017-06-16 21:43 ` [PATCH 2/2] i386: Assume Skylake for unknown models with clflushopt Matt Turner
2017-06-18 17:57   ` Uros Bizjak
2017-06-18 17:56 ` [PATCH 1/2] i386: Consider Kaby Lake to be equivalent to Skylake Uros Bizjak
2017-06-22 17:34   ` Matt Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).