From patchwork Fri Oct 14 07:54:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiang, Haochen" X-Patchwork-Id: 2555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp54222wrs; Fri, 14 Oct 2022 00:57:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Xpx+Vjw5za50wV5eWYX77LEI9pR6KHhj+QEk2gEwV/qCdWx72ijaReJG+6D0KcBFRs6D+ X-Received: by 2002:a17:906:9b93:b0:78d:eb36:1ce7 with SMTP id dd19-20020a1709069b9300b0078deb361ce7mr2669510ejc.621.1665734260462; Fri, 14 Oct 2022 00:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665734260; cv=none; d=google.com; s=arc-20160816; b=XW6zdOEYevC8Jw4PdVholQmudzroq8mCB9tyyEW+8dBObN/4lSUXvqnR+sGs8Cdv9L g4aMVxdFPXVWdKZkhAuE3EYRiuy4l9lrgfm8sey7SNpcNyvPRJn5+h8dt6rCp2fwJsKS GNcNGNZNcwVaQBgePnrIaPaE137TL+qOSesoUEzcT57/qjBZGaRdRe9hTyQvY8twhF0N +0ftNMHaG6NT/6fNVY0kQifeHjO4TfLaWTX+s6sp0oq0Uxafyz6eHN56cVV8TqWFbiVl IezvdLxGP7I74U+k1WLSYS0lpHJlCNPWpDYi0urljmWkWEwmjJd/7y4MyRfUi2A+8mDc 1oUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=ozpIppgD5pcW6YpT0hJI9u8MQmIhHmk4FltAuyvbzVU=; b=qa8IKnY83y3svFAgFwn3Wac/Il3DNwE66lvmt43rCBskujwwaDHpTvBMdduEo9Jm/V us6rfKmWV8yqTKd41zFX3PTZ7MiojztGgPPya6SPt03LvUwnsvQ4Vb+S7odJuu5cIilr qfSFHGh7yY0RzHipeXK3V8OO6otW9a3NJsef/ste43OCrdPk+SuZOh/kuLjqMfYrBu4l ddfg0IzZV2prwad6Gr4wxpWqorFRnGyrGdrlTtRuf/Tm8pZIUsZe29Iy48iBvHcXciIi qDplY0Eixvbz06Rvilc4b8q9YzAJnG9fvHKU2JZ+cptvG538TZiPCQFt6X8P5kiIZsDy il/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Vf8asQ02; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id sc12-20020a1709078a0c00b0077fadd74307si1931872ejc.128.2022.10.14.00.57.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 00:57:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Vf8asQ02; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 03FEE3854141 for ; Fri, 14 Oct 2022 07:56:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03FEE3854141 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665734193; bh=ozpIppgD5pcW6YpT0hJI9u8MQmIhHmk4FltAuyvbzVU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Vf8asQ02ruopUAQt+pZC5ntrZ2S2R8DXvjC3wU77lq8MNt8O8Px2vtbvdEBpWeApO xT9CCDbwcELYIX8K9wf5ujH9Ps8FjE9+Y40v/xBBso1uanpT+DCtCBxNibHju1qrjD jnPogoTvrS473Da2WJ2hGemJpfH5BLFGpcKcSpgo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id 4EC623858C39 for ; Fri, 14 Oct 2022 07:54:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4EC623858C39 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="288597856" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="288597856" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 00:54:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="627488365" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="627488365" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga002.jf.intel.com with ESMTP; 14 Oct 2022 00:54:50 -0700 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 078861009C91; Fri, 14 Oct 2022 15:54:48 +0800 (CST) To: gcc-patches@gcc.gnu.org Subject: [PATCH 6/6] Initial Sierra Forest Support Date: Fri, 14 Oct 2022 15:54:45 +0800 Message-Id: <20221014075445.7938-7-haochen.jiang@intel.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20221014075445.7938-1-haochen.jiang@intel.com> References: <20221014075445.7938-1-haochen.jiang@intel.com> X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Haochen Jiang via Gcc-patches From: "Jiang, Haochen" Reply-To: Haochen Jiang Cc: hongtao.liu@intel.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746648967991441880?= X-GMAIL-MSGID: =?utf-8?q?1746648967991441880?= gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_intel_cpu): Add Sierra Forest. * common/config/i386/i386-common.cc (processor_names): Add Sierra Forest. (processor_alias_table): Ditto. * common/config/i386/i386-cpuinfo.h (enum processor_types): Add INTEL_SIERRAFOREST. * config.gcc: Add -march=sierraforest. * config/i386/driver-i386.cc (host_detect_local_cpu): Handle Sierra Forest. * config/i386/i386-c.cc (ix86_target_macros_internal): Ditto. * config/i386/i386-options.cc (m_SIERRAFOREST): New define. (processor_cost_table): Add sierra forest. * config/i386/i386.h (enum processor_type): Add PROCESSOR_SIERRA_FOREST. (PTA_SIERRAFOREST): Ditto. * doc/extend.texi: Add sierra forest. * doc/invoke.texi: Ditto. gcc/testsuite/ChangeLog: * g++.target/i386/mv16.C: Add sierra forest. * 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 | 3 ++- gcc/config/i386/driver-i386.cc | 5 ++++- gcc/config/i386/i386-c.cc | 7 +++++++ gcc/config/i386/i386-options.cc | 2 ++ gcc/config/i386/i386.h | 3 +++ gcc/doc/extend.texi | 3 +++ gcc/doc/invoke.texi | 8 ++++++++ gcc/testsuite/g++.target/i386/mv16.C | 6 ++++++ gcc/testsuite/gcc.target/i386/funcspec-56.inc | 1 + 12 files changed, 46 insertions(+), 2 deletions(-) diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index f73834b086c..cc499c46ed0 100644 --- a/gcc/common/config/i386/cpuinfo.h +++ b/gcc/common/config/i386/cpuinfo.h @@ -516,6 +516,12 @@ get_intel_cpu (struct __processor_model *cpu_model, cpu_model->__cpu_type = INTEL_COREI7; cpu_model->__cpu_subtype = INTEL_COREI7_SAPPHIRERAPIDS; break; + case 0xaf: + /* Sierra Forest. */ + cpu = "sierraforest"; + CHECK___builtin_cpu_is ("sierraforest"); + cpu_model->__cpu_type = INTEL_SIERRAFOREST; + 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 75966779d82..6ccc4d2f03c 100644 --- a/gcc/common/config/i386/i386-common.cc +++ b/gcc/common/config/i386/i386-common.cc @@ -1874,6 +1874,7 @@ const char *const processor_names[] = "goldmont", "goldmont-plus", "tremont", + "sierraforest", "knl", "knm", "skylake", @@ -2019,6 +2020,8 @@ const pta processor_alias_table[] = M_CPU_TYPE (INTEL_GOLDMONT_PLUS), P_PROC_SSE4_2}, {"tremont", PROCESSOR_TREMONT, CPU_HASWELL, PTA_TREMONT, M_CPU_TYPE (INTEL_TREMONT), P_PROC_SSE4_2}, + {"sierraforest", PROCESSOR_SIERRAFOREST, CPU_HASWELL, PTA_SIERRAFOREST, + M_CPU_SUBTYPE (INTEL_SIERRAFOREST), 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 5a61d817007..a71a10ebbd7 100644 --- a/gcc/common/config/i386/i386-cpuinfo.h +++ b/gcc/common/config/i386/i386-cpuinfo.h @@ -58,6 +58,7 @@ enum processor_types INTEL_TREMONT, AMDFAM19H, ZHAOXIN_FAM7H, + INTEL_SIERRAFOREST, CPU_TYPE_MAX, BUILTIN_CPU_TYPE_MAX = CPU_TYPE_MAX }; diff --git a/gcc/config.gcc b/gcc/config.gcc index fe063bfbb26..c0e10a72bd5 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -665,7 +665,8 @@ slm nehalem westmere sandybridge ivybridge haswell broadwell bonnell \ silvermont knl knm skylake-avx512 cannonlake icelake-client icelake-server \ 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 native" +nano-x2 eden-x4 nano-x4 lujiazui x86-64 x86-64-v2 x86-64-v3 x86-64-v4 \ +sierraforest 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 ef567045c67..be205a56ea2 100644 --- a/gcc/config/i386/driver-i386.cc +++ b/gcc/config/i386/driver-i386.cc @@ -589,8 +589,11 @@ const char *host_detect_local_cpu (int argc, const char **argv) /* This is unknown family 0x6 CPU. */ if (has_feature (FEATURE_AVX)) { + /* Assume Sierra Forest. */ + if (has_feature (FEATURE_AVXVNNIINT8)) + cpu = "sierraforest"; /* Assume Tiger Lake */ - if (has_feature (FEATURE_AVX512VP2INTERSECT)) + else if (has_feature (FEATURE_AVX512VP2INTERSECT)) cpu = "tigerlake"; /* Assume Sapphire Rapids. */ else if (has_feature (FEATURE_TSXLDTRK)) diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc index 9885a724d0f..4494c412995 100644 --- a/gcc/config/i386/i386-c.cc +++ b/gcc/config/i386/i386-c.cc @@ -198,6 +198,10 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__tremont"); def_or_undef (parse_in, "__tremont__"); break; + case PROCESSOR_SIERRAFOREST: + def_or_undef (parse_in, "__sierraforest"); + def_or_undef (parse_in, "__sierraforest__"); + break; case PROCESSOR_KNL: def_or_undef (parse_in, "__knl"); def_or_undef (parse_in, "__knl__"); @@ -377,6 +381,9 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_TREMONT: def_or_undef (parse_in, "__tune_tremont__"); break; + case PROCESSOR_SIERRAFOREST: + def_or_undef (parse_in, "__tune_sierraforest__"); + 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 fb872afdfb5..4526dc09fc4 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -136,6 +136,7 @@ along with GCC; see the file COPYING3. If not see #define m_GOLDMONT (HOST_WIDE_INT_1U<