x86: Update Intel processor detection

Message ID 20200518115853.3468-1-hjl.tools@gmail.com
State New
Headers show
Series
  • x86: Update Intel processor detection
Related show

Commit Message

Jakub Jelinek via Gcc-patches May 18, 2020, 11:58 a.m.
Add cpu model numbers for Intel Airmont, Tremont, Comet Lake, Ice Lake
and Tiger Lake processor families.

OK for master?

Thanks.

H.J.
--
	* config/i386/driver-i386.c (host_detect_local_cpu): Support
	Intel Airmont, Tremont, Comet Lake, Ice Lake and Tiger Lake
	processor families.
---
 gcc/config/i386/driver-i386.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

-- 
2.26.2

Comments

Jakub Jelinek via Gcc-patches May 18, 2020, 12:18 p.m. | #1
On Mon, May 18, 2020 at 1:58 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> Add cpu model numbers for Intel Airmont, Tremont, Comet Lake, Ice Lake

> and Tiger Lake processor families.

>

> OK for master?


OK.

Please also update cpuinfo.c from libgcc and corresponding
gcc.target/i386/builtin_target.c testcase.

Thanks,
Uros.

> Thanks.

>

> H.J.

> --

>         * config/i386/driver-i386.c (host_detect_local_cpu): Support

>         Intel Airmont, Tremont, Comet Lake, Ice Lake and Tiger Lake

>         processor families.

> ---

>  gcc/config/i386/driver-i386.c | 30 +++++++++++++++++++++++++++++-

>  1 file changed, 29 insertions(+), 1 deletion(-)

>

> diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c

> index 6926f0beb0a..7612ddfb846 100644

> --- a/gcc/config/i386/driver-i386.c

> +++ b/gcc/config/i386/driver-i386.c

> @@ -777,9 +777,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>         case 0x37:

>         case 0x4a:

>         case 0x4d:

> -       case 0x5a:

>         case 0x5d:

>           /* Silvermont.  */

> +       case 0x4c:

> +       case 0x5a:

> +       case 0x75:

> +         /* Airmont.  */

>           cpu = "silvermont";

>           break;

>         case 0x5c:

> @@ -791,6 +794,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>           /* Goldmont Plus.  */

>           cpu = "goldmont-plus";

>           break;

> +       case 0x86:

> +       case 0x96:

> +       case 0x9c:

> +         /* Tremont.  */

> +         cpu = "tremont";

> +         break;

>         case 0x0f:

>           /* Merom.  */

>         case 0x17:

> @@ -841,6 +850,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>         case 0x8e:

>         case 0x9e:

>           /* Kaby Lake.  */

> +       case 0xa5:

> +       case 0xa6:

> +         /* Comet Lake.  */

>           cpu = "skylake";

>           break;

>         case 0x55:

> @@ -851,6 +863,22 @@ const char *host_detect_local_cpu (int argc, const char **argv)

>             /* Skylake with AVX-512.  */

>             cpu = "skylake-avx512";

>           break;

> +       case 0x6a:

> +       case 0x6c:

> +         /* Ice Lake server.  */

> +         cpu = "icelake-server";

> +         break;

> +       case 0x7e:

> +       case 0x7d:

> +       case 0x9d:

> +         /* Ice Lake client.  */

> +         cpu = "icelake-client";

> +         break;

> +       case 0x8c:

> +       case 0x8d:

> +         /* Tiger Lake.  */

> +         cpu = "tigerlake";

> +         break;

>         case 0x57:

>           /* Knights Landing.  */

>           cpu = "knl";

> --

> 2.26.2

>
Jakub Jelinek via Gcc-patches May 18, 2020, 12:34 p.m. | #2
On Mon, May 18, 2020 at 5:18 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>

> On Mon, May 18, 2020 at 1:58 PM H.J. Lu <hjl.tools@gmail.com> wrote:

> >

> > Add cpu model numbers for Intel Airmont, Tremont, Comet Lake, Ice Lake

> > and Tiger Lake processor families.

> >

> > OK for master?

>

> OK.


I am checking in my patch.

> Please also update cpuinfo.c from libgcc and corresponding


I will take a look to see if we share the same CPU detection code between
libgcc and config/i386/driver-i386.c.

> gcc.target/i386/builtin_target.c testcase.

>

> Thanks,

> Uros.

>

> > Thanks.

> >

> > H.J.

> > --

> >         * config/i386/driver-i386.c (host_detect_local_cpu): Support

> >         Intel Airmont, Tremont, Comet Lake, Ice Lake and Tiger Lake

> >         processor families.

> > ---

> >  gcc/config/i386/driver-i386.c | 30 +++++++++++++++++++++++++++++-

> >  1 file changed, 29 insertions(+), 1 deletion(-)

> >

> > diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c

> > index 6926f0beb0a..7612ddfb846 100644

> > --- a/gcc/config/i386/driver-i386.c

> > +++ b/gcc/config/i386/driver-i386.c

> > @@ -777,9 +777,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >         case 0x37:

> >         case 0x4a:

> >         case 0x4d:

> > -       case 0x5a:

> >         case 0x5d:

> >           /* Silvermont.  */

> > +       case 0x4c:

> > +       case 0x5a:

> > +       case 0x75:

> > +         /* Airmont.  */

> >           cpu = "silvermont";

> >           break;

> >         case 0x5c:

> > @@ -791,6 +794,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >           /* Goldmont Plus.  */

> >           cpu = "goldmont-plus";

> >           break;

> > +       case 0x86:

> > +       case 0x96:

> > +       case 0x9c:

> > +         /* Tremont.  */

> > +         cpu = "tremont";

> > +         break;

> >         case 0x0f:

> >           /* Merom.  */

> >         case 0x17:

> > @@ -841,6 +850,9 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >         case 0x8e:

> >         case 0x9e:

> >           /* Kaby Lake.  */

> > +       case 0xa5:

> > +       case 0xa6:

> > +         /* Comet Lake.  */

> >           cpu = "skylake";

> >           break;

> >         case 0x55:

> > @@ -851,6 +863,22 @@ const char *host_detect_local_cpu (int argc, const char **argv)

> >             /* Skylake with AVX-512.  */

> >             cpu = "skylake-avx512";

> >           break;

> > +       case 0x6a:

> > +       case 0x6c:

> > +         /* Ice Lake server.  */

> > +         cpu = "icelake-server";

> > +         break;

> > +       case 0x7e:

> > +       case 0x7d:

> > +       case 0x9d:

> > +         /* Ice Lake client.  */

> > +         cpu = "icelake-client";

> > +         break;

> > +       case 0x8c:

> > +       case 0x8d:

> > +         /* Tiger Lake.  */

> > +         cpu = "tigerlake";

> > +         break;

> >         case 0x57:

> >           /* Knights Landing.  */

> >           cpu = "knl";

> > --

> > 2.26.2

> >




-- 
H.J.
Jakub Jelinek via Gcc-patches May 18, 2020, 12:43 p.m. | #3
On Mon, May 18, 2020 at 2:34 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> On Mon, May 18, 2020 at 5:18 AM Uros Bizjak <ubizjak@gmail.com> wrote:

> >

> > On Mon, May 18, 2020 at 1:58 PM H.J. Lu <hjl.tools@gmail.com> wrote:

> > >

> > > Add cpu model numbers for Intel Airmont, Tremont, Comet Lake, Ice Lake

> > > and Tiger Lake processor families.

> > >

> > > OK for master?

> >

> > OK.

>

> I am checking in my patch.

>

> > Please also update cpuinfo.c from libgcc and corresponding

>

> I will take a look to see if we share the same CPU detection code between

> libgcc and config/i386/driver-i386.c.


I don't think it will bring any benefit, this is mainly one huge
switch statement that maps to different stuff in libgcc and
driver-i386.

Uros.
Jakub Jelinek via Gcc-patches May 18, 2020, 12:57 p.m. | #4
On Mon, May 18, 2020 at 5:43 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>

> On Mon, May 18, 2020 at 2:34 PM H.J. Lu <hjl.tools@gmail.com> wrote:

> >

> > On Mon, May 18, 2020 at 5:18 AM Uros Bizjak <ubizjak@gmail.com> wrote:

> > >

> > > On Mon, May 18, 2020 at 1:58 PM H.J. Lu <hjl.tools@gmail.com> wrote:

> > > >

> > > > Add cpu model numbers for Intel Airmont, Tremont, Comet Lake, Ice Lake

> > > > and Tiger Lake processor families.

> > > >

> > > > OK for master?

> > >

> > > OK.

> >

> > I am checking in my patch.

> >

> > > Please also update cpuinfo.c from libgcc and corresponding

> >

> > I will take a look to see if we share the same CPU detection code between

> > libgcc and config/i386/driver-i386.c.

>

> I don't think it will bring any benefit, this is mainly one huge

> switch statement that maps to different stuff in libgcc and

> driver-i386.


libgcc and config/i386/driver-i386.c differ even before my patch.
I think we can do better.


-- 
H.J.

Patch

diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 6926f0beb0a..7612ddfb846 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -777,9 +777,12 @@  const char *host_detect_local_cpu (int argc, const char **argv)
 	case 0x37:
 	case 0x4a:
 	case 0x4d:
-	case 0x5a:
 	case 0x5d:
 	  /* Silvermont.  */
+	case 0x4c:
+	case 0x5a:
+	case 0x75:
+	  /* Airmont.  */
 	  cpu = "silvermont";
 	  break;
 	case 0x5c:
@@ -791,6 +794,12 @@  const char *host_detect_local_cpu (int argc, const char **argv)
 	  /* Goldmont Plus.  */
 	  cpu = "goldmont-plus";
 	  break;
+	case 0x86:
+	case 0x96:
+	case 0x9c:
+	  /* Tremont.  */
+	  cpu = "tremont";
+	  break;
 	case 0x0f:
 	  /* Merom.  */
 	case 0x17:
@@ -841,6 +850,9 @@  const char *host_detect_local_cpu (int argc, const char **argv)
 	case 0x8e:
 	case 0x9e:
 	  /* Kaby Lake.  */
+	case 0xa5:
+	case 0xa6:
+	  /* Comet Lake.  */
 	  cpu = "skylake";
 	  break;
 	case 0x55:
@@ -851,6 +863,22 @@  const char *host_detect_local_cpu (int argc, const char **argv)
 	    /* Skylake with AVX-512.  */
 	    cpu = "skylake-avx512";
 	  break;
+	case 0x6a:
+	case 0x6c:
+	  /* Ice Lake server.  */
+	  cpu = "icelake-server";
+	  break;
+	case 0x7e:
+	case 0x7d:
+	case 0x9d:
+	  /* Ice Lake client.  */
+	  cpu = "icelake-client";
+	  break;
+	case 0x8c:
+	case 0x8d:
+	  /* Tiger Lake.  */
+	  cpu = "tigerlake";
+	  break;
 	case 0x57:
 	  /* Knights Landing.  */
 	  cpu = "knl";