[x86] Add detection of Icelake Client and Server
diff mbox series

Message ID 20191016214750.1002660-1-thiago.macieira@intel.com
State New
Headers show
Series
  • [x86] Add detection of Icelake Client and Server
Related show

Commit Message

Thiago Macieira Oct. 16, 2019, 9:47 p.m. UTC
gcc/ChangeLog:
        * config/i386/driver-i386.c (host_detect_local_cpu): Handle
          icelake-client and icelake-server.
        * testsuite/gcc.target/i386/builtin_target.c (check_intel_cpu_model):
          Verify icelakes are detected correctly.

libgcc/ChangeLog:
        * config/i386/cpuinfo.c (get_intel_cpu): Handle icelake-client
          and icelake-server.
---
 gcc/config/i386/driver-i386.c                  | 11 +++++++++++
 gcc/testsuite/gcc.target/i386/builtin_target.c | 11 +++++++++++
 libgcc/config/i386/cpuinfo.c                   | 13 +++++++++++++
 3 files changed, 35 insertions(+)

Patch
diff mbox series

diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 8e8b4d21950..996308c7eaa 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -855,6 +855,17 @@  const char *host_detect_local_cpu (int argc, const char **argv)
 	  /* Cannon Lake.  */
 	  cpu = "cannonlake";
 	  break;
+	case 0x6a:
+	case 0x6c:
+	  /* Icelake Server. */
+	  cpu = "icelake-server";
+	  break;
+	case 0x7d:
+	case 0x7e:
+	case 0x9d:
+	  /* Icelake Client. */
+	  cpu = "icelake-client";
+	  break;
 	case 0x85:
 	  /* Knights Mill.  */
 	  cpu = "knm";
diff --git a/gcc/testsuite/gcc.target/i386/builtin_target.c b/gcc/testsuite/gcc.target/i386/builtin_target.c
index 7a8b6e805ed..ef15d48f84d 100644
--- a/gcc/testsuite/gcc.target/i386/builtin_target.c
+++ b/gcc/testsuite/gcc.target/i386/builtin_target.c
@@ -124,6 +124,17 @@  check_intel_cpu_model (unsigned int family, unsigned int model,
 	      /* Cannon Lake.  */
 	      assert (__builtin_cpu_is ("cannonlake"));
 	      break;
+	    case 0x7d:
+	    case 0x7e:
+	    case 0x9d:
+	      /* Icelake Client. */
+	      assert (__builtin_cpu_is ("icelake-client"));
+	      break;
+	    case 0x6a:
+	    case 0x6c:
+	      /* Icelake Server. */
+	      assert (__builtin_cpu_is ("icelake-server"));
+	      break;
 	    case 0x17:
 	    case 0x1d:
 	      /* Penryn.  */
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
index 5659ec89546..cc9c62f053b 100644
--- a/libgcc/config/i386/cpuinfo.c
+++ b/libgcc/config/i386/cpuinfo.c
@@ -232,6 +232,19 @@  get_intel_cpu (unsigned int family, unsigned int model, unsigned int brand_id)
 	      __cpu_model.__cpu_type = INTEL_COREI7;
 	      __cpu_model.__cpu_subtype = INTEL_COREI7_CANNONLAKE;
 	      break;
+	    case 0x7d:
+	    case 0x7e:
+	    case 0x9d:
+	      /* Icelake Client. */
+	      __cpu_model.__cpu_type = INTEL_COREI7;
+	      __cpu_model.__cpu_subtype = INTEL_COREI7_ICELAKE_CLIENT;
+	      break;
+	    case 0x6a:
+	    case 0x6c:
+	      /* Icelake Server. */
+	      __cpu_model.__cpu_type = INTEL_COREI7;
+	      __cpu_model.__cpu_subtype = INTEL_COREI7_ICELAKE_SERVER;
+	      break;
 	    case 0x17:
 	    case 0x1d:
 	      /* Penryn.  */