From patchwork Mon Oct 16 06:23:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiang, Haochen" X-Patchwork-Id: 153208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3269319vqb; Sun, 15 Oct 2023 23:26:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSPIJTIYX8+htOnpyT9ecGAOBuOHweqWpkR969qPQ1UrzF8u/GJ/U0ORRdMJiRrFYHOVmB X-Received: by 2002:a05:622a:14cc:b0:41b:774b:b1a2 with SMTP id u12-20020a05622a14cc00b0041b774bb1a2mr200075qtx.22.1697437601341; Sun, 15 Oct 2023 23:26:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697437601; cv=pass; d=google.com; s=arc-20160816; b=C/b736osQtZNYs9ImqxdHFeCRqZR1tzZi3TE0Vjf4rY5WI3ktdofHD5JGqW0tA69Fp 6II3AWbH26TSuEPnwnrkEwSkSlmzmC6LOxvLOvPZnbCzGKQIg4N3Nc9cOM0M4xkYeYm2 qo+Q2lBr1etiAo1hizLNOc6v6HTMECtaGN/0Gah3w6fM8p45RhTgV/gCfckGbUHzjxs6 9GIOUI3zmkWhmYHcUKqoB2jAki9r14dPtJzlfPpim69rGraGbEnhUlosYxPxIjjEuRfE luKsMubNw1j8kzmNiXsj0fbLg6/W2knmVUCJ85eTsPAlvGU8m/QvrJDwpFXoSp853x+X /tdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=4fkZbvZAqdIP9xJhE3F6ItuoitrfBBkW5mlilsqL8JE=; fh=M9HM6ASxJ13myMyxe6+D5Y8nbneXlY5qT/Udj6S6pN8=; b=j/lnpFDVB5phRkHmVQWoqbPzAQw7JKE8Xi5JYxM1Dl3kmmis90Mk8mTK4nGq/DEhCr tXeg15/D8vjyaAkrEqKtlI8gGYS7VFnPtJ/1N7AASF7b0cD3fiRiVwL+Mb2zCn2C9Yxr meLR0QHNWkMYg4DOkcmvCk2JoYVefZ7OPOaCqwdrxpLZNRbSt6Y/hmPi6Hx122dA60mb rkwnXFV38liHsm+PuFsepUdjX3sdxw8Y+/Y4/hdzH6GgHzSjURk1aSyyXMTprbKbfug7 seesS/st6T34diAlOjbtjZgCpG8wtjWAmh4T1RE51Q498mOh0XskwUpRayES90geCJya QK+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dXyVkpqU; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d2-20020a05622a15c200b00418194af9ecsi4886307qty.51.2023.10.15.23.26.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 23:26:41 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dXyVkpqU; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1EB463858433 for ; Mon, 16 Oct 2023 06:26:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id 2BF363858C39 for ; Mon, 16 Oct 2023 06:25:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BF363858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2BF363858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.55.52.88 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697437551; cv=none; b=XV2HcS2d+fH9lS8vyNh3fc6XHSGtKjM9MR18vBdfWCw+UfsUc5FYUmuRc2DcBsG1nB8+kGAt9rllzKRuPs2NuWCUkAsT57ViIuI/2z30pjGQyBRWzMKxmUs8ZvtfvxfWt6FslYaY0MUyenK8RRv0ez/syPfj2hOVteRZG7FE9dQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697437551; c=relaxed/simple; bh=HvBCZ0O1qBeELHf3bEQuYyblRagW81Ray/Z/lSPErF4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=wkGatrWlz7xEK1JmcbRD1QRLOO8il9971g0dpyM0CFMFW/5C2JYfQd3/d/kkwk227ZaHoUCqhlLg1wqhEv7ofwV70Sg0fgPGdjB1RC4M9QIC4Kk5aYpyiNOMpWg5izpO/pj8GsxD10MOonhwdDtX9j8yPkihxN20WmDILdZpQ8Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697437549; x=1728973549; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HvBCZ0O1qBeELHf3bEQuYyblRagW81Ray/Z/lSPErF4=; b=dXyVkpqUteUKVzG+9EB6Bm/HgFg1q3Up9M56wQM08Mx/cW3KHKdMVS5t Gh2v0RmoBn1ScTE3fa7JXgwnLGEHq7XxlMuGYq9WUpyY8o8N0JrHJ9hIU beBFcjkslL689wq8oFKA0Tjt/pxyAW1YSA2Qdon5wxhW6NdHSIlmfAwmM bwUNdFdkjbOmE1HXoDXPX67Qfz42vi4AphRaFofqYIcWpWN+modAE/SzP ZV5JE6I1HiSY93ce7b8VU4JXkZAheyy5s8bLMdAFpJMFx8UVsbqARt29c B3cYUsRLWGxPyyXLSLD9ciM2sFGV3aXPk1St7t6BjNgEdEjJOlWv1aT9v g==; X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="416523706" X-IronPort-AV: E=Sophos;i="6.03,228,1694761200"; d="scan'208";a="416523706" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2023 23:25:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="705483457" X-IronPort-AV: E=Sophos;i="6.03,228,1694761200"; d="scan'208";a="705483457" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga003.jf.intel.com with ESMTP; 15 Oct 2023 23:25:44 -0700 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 164861005682; Mon, 16 Oct 2023 14:25:43 +0800 (CST) From: Haochen Jiang To: gcc-patches@gcc.gnu.org Cc: hongtao.liu@intel.com, ubizjak@gmail.com Subject: [PATCH 1/3] Initial Clear Water Forest Support Date: Mon, 16 Oct 2023 14:23:38 +0800 Message-Id: <20231016062340.2639697-2-haochen.jiang@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231016062340.2639697-1-haochen.jiang@intel.com> References: <20231016062340.2639697-1-haochen.jiang@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779892330274949922 X-GMAIL-MSGID: 1779892330274949922 gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_intel_cpu): Handle Clear Water Forest. * common/config/i386/i386-common.cc (processor_name): Add Clear Water Forest. (processor_alias_table): Ditto. * common/config/i386/i386-cpuinfo.h (enum processor_types): Add INTEL_CLEARWATERFOREST. * config.gcc: Add -march=clearwaterforest. * config/i386/driver-i386.cc (host_detect_local_cpu): Handle clearwaterforest. * config/i386/i386-c.cc (ix86_target_macros_internal): Ditto. * config/i386/i386-options.cc (processor_cost_table): Ditto. (m_CLEARWATERFOREST): New. (m_CORE_ATOM): Add clearwaterforest. * config/i386/i386.h (enum processor_type): Ditto. * doc/extend.texi: Ditto. * doc/invoke.texi: Ditto. gcc/testsuite/ChangeLog: * g++.target/i386/mv16.C: Ditto. * gcc.target/i386/funcspec-56.inc: Handle new march. --- gcc/common/config/i386/cpuinfo.h | 6 ++++++ gcc/common/config/i386/i386-common.cc | 3 +++ gcc/common/config/i386/i386-cpuinfo.h | 1 + gcc/config.gcc | 2 +- gcc/config/i386/driver-i386.cc | 5 ++++- gcc/config/i386/i386-c.cc | 7 +++++++ gcc/config/i386/i386-options.cc | 4 +++- gcc/config/i386/i386.h | 3 +++ gcc/doc/extend.texi | 3 +++ gcc/doc/invoke.texi | 9 +++++++++ gcc/testsuite/g++.target/i386/mv16.C | 6 ++++++ gcc/testsuite/gcc.target/i386/funcspec-56.inc | 1 + 12 files changed, 47 insertions(+), 3 deletions(-) diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index 0f86b44730b..57394a18c67 100644 --- a/gcc/common/config/i386/cpuinfo.h +++ b/gcc/common/config/i386/cpuinfo.h @@ -608,6 +608,12 @@ get_intel_cpu (struct __processor_model *cpu_model, cpu_model->__cpu_type = INTEL_COREI7; cpu_model->__cpu_subtype = INTEL_COREI7_ARROWLAKE_S; break; + case 0xdd: + /* Clear Water Forest. */ + cpu = "clearwaterforest"; + CHECK___builtin_cpu_is ("clearwaterforest"); + cpu_model->__cpu_type = INTEL_CLEARWATERFOREST; + break; case 0x17: case 0x1d: /* Penryn. */ diff --git a/gcc/common/config/i386/i386-common.cc b/gcc/common/config/i386/i386-common.cc index 13e423deceb..903034d2afd 100644 --- a/gcc/common/config/i386/i386-common.cc +++ b/gcc/common/config/i386/i386-common.cc @@ -2077,6 +2077,7 @@ const char *const processor_names[] = "tremont", "sierraforest", "grandridge", + "clearwaterforest", "knl", "knm", "skylake", @@ -2246,6 +2247,8 @@ const pta processor_alias_table[] = M_CPU_SUBTYPE (INTEL_SIERRAFOREST), P_PROC_AVX2}, {"grandridge", PROCESSOR_GRANDRIDGE, CPU_HASWELL, PTA_GRANDRIDGE, M_CPU_TYPE (INTEL_GRANDRIDGE), P_PROC_AVX2}, + {"clearwaterforest", PROCESSOR_CLEARWATERFOREST, CPU_HASWELL, + PTA_CLEARWATERFOREST, M_CPU_TYPE (INTEL_CLEARWATERFOREST), P_PROC_AVX2}, {"knl", PROCESSOR_KNL, CPU_SLM, PTA_KNL, M_CPU_TYPE (INTEL_KNL), P_PROC_AVX512F}, {"knm", PROCESSOR_KNM, CPU_SLM, PTA_KNM, diff --git a/gcc/common/config/i386/i386-cpuinfo.h b/gcc/common/config/i386/i386-cpuinfo.h index 47e9dcfb8f7..44db6a07076 100644 --- a/gcc/common/config/i386/i386-cpuinfo.h +++ b/gcc/common/config/i386/i386-cpuinfo.h @@ -62,6 +62,7 @@ enum processor_types ZHAOXIN_FAM7H, INTEL_SIERRAFOREST, INTEL_GRANDRIDGE, + INTEL_CLEARWATERFOREST, CPU_TYPE_MAX, BUILTIN_CPU_TYPE_MAX = CPU_TYPE_MAX }; diff --git a/gcc/config.gcc b/gcc/config.gcc index fa192637a52..2d045d6d00f 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -708,7 +708,7 @@ skylake goldmont goldmont-plus tremont cascadelake tigerlake cooperlake \ sapphirerapids alderlake rocketlake eden-x2 nano nano-1000 nano-2000 nano-3000 \ nano-x2 eden-x4 nano-x4 lujiazui x86-64 x86-64-v2 x86-64-v3 x86-64-v4 \ sierraforest graniterapids graniterapids-d grandridge arrowlake arrowlake-s \ -native" +clearwaterforest native" # Additional x86 processors supported by --with-cpu=. Each processor # MUST be separated by exactly one space. diff --git a/gcc/config/i386/driver-i386.cc b/gcc/config/i386/driver-i386.cc index 08d0aed6183..a21f2dfe82f 100644 --- a/gcc/config/i386/driver-i386.cc +++ b/gcc/config/i386/driver-i386.cc @@ -591,8 +591,11 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* This is unknown family 0x6 CPU. */ if (has_feature (FEATURE_AVX)) { + /* Assume Clear Water Forest. */ + if (has_feature (FEATURE_USER_MSR)) + cpu = "clearwaterforest"; /* Assume Arrow Lake S. */ - if (has_feature (FEATURE_SM3)) + else if (has_feature (FEATURE_SM3)) cpu = "arrowlake-s"; /* Assume Grand Ridge. */ else if (has_feature (FEATURE_RAOINT)) diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc index 042ad8b9d9c..7ac95a923be 100644 --- a/gcc/config/i386/i386-c.cc +++ b/gcc/config/i386/i386-c.cc @@ -210,6 +210,10 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__grandridge"); def_or_undef (parse_in, "__grandridge__"); break; + case PROCESSOR_CLEARWATERFOREST: + def_or_undef (parse_in, "__clearwaterforest"); + def_or_undef (parse_in, "__clearwaterforest__"); + break; case PROCESSOR_KNL: def_or_undef (parse_in, "__knl"); def_or_undef (parse_in, "__knl__"); @@ -415,6 +419,9 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_GRANDRIDGE: def_or_undef (parse_in, "__tune_grandridge__"); break; + case PROCESSOR_CLEARWATERFOREST: + def_or_undef (parse_in, "__tune_clearwaterforest__"); + break; case PROCESSOR_KNL: def_or_undef (parse_in, "__tune_knl__"); break; diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc index 818954d6dbc..1d28258b4fa 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -141,7 +141,8 @@ along with GCC; see the file COPYING3. If not see #define m_GRANDRIDGE (HOST_WIDE_INT_1U<