From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by sourceware.org (Postfix) with ESMTPS id CF2393858C74 for ; Mon, 7 Nov 2022 01:41:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF2393858C74 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667785279; x=1699321279; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=a3RsKdxsv414sorb4QvcCIqnJdFY9qivg8SmkN00i1E=; b=NX+Icv9cw6yTMdAMHH7hXv6+e1rId0r/xHiLDZ3AOuRWxSqEwFwTN9Br qAKadO0sayGBiXm7VaZwAKReml/6Iz23w4VMZ5xQwAxwFtxE/SpNtZC9a WiXCnz9TW8IYfl//aUjkftAvK1+JGRU7MkzhuaXOZRDL6pTJH2LvSDNmq B9yqiZhSuAULlMejISuJcK2j4QNHsQbnUgn5fluHPzwuA1+vI/7RErpcg TKneWIRULpE+pqOJkBGLoVhgEKygzfI6euE41L62LQebKdXdXoS0at/IO S13fvuRlDXp418goe5BgqmyODhv4SGPyZxnQo479LOo6IiM7M7vSpwH82 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="396601347" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="396601347" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2022 17:41:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="880887332" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="880887332" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga006.fm.intel.com with ESMTP; 06 Nov 2022 17:41:17 -0800 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 31D0B1005674; Mon, 7 Nov 2022 09:41:16 +0800 (CST) From: Haochen Jiang To: gcc-patches@gcc.gnu.org Cc: ubizjak@gmail.com, hongtao.liu@intel.com Subject: [PATCH 1/2] Initial Grand Ridge support Date: Mon, 7 Nov 2022 09:41:13 +0800 Message-Id: <20221107014114.71155-2-haochen.jiang@intel.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20221107014114.71155-1-haochen.jiang@intel.com> References: <20221107014114.71155-1-haochen.jiang@intel.com> X-Spam-Status: No, score=-11.1 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 List-Id: gcc/ChangeLog: * common/config/i386/i386-common.cc (processor_names): Add grandridge. (processor_alias_table): Ditto. * common/config/i386/i386-cpuinfo.h: (enum processor_types): Add INTEL_GRANDRIDGE. * config.gcc: Add -march=grandridge. * config/i386/driver-i386.cc (host_detect_local_cpu): Handle grandridge. * config/i386/i386-c.cc (ix86_target_macros_internal): Ditto. * config/i386/i386-options.cc (m_GRANDRIDGE): New define. (processor_cost_table): Add grandridge. * config/i386/i386.h (enum processor_type): Add PROCESSOR_GRANDRIDGE. (PTA_GRANDRIDGE): Ditto. * doc/extend.texi: Add grandridge. * doc/invoke.texi: Ditto. gcc/testsuite/ChangeLog: * gcc/testsuite/g++.target/i386/mv16.C: Add grandridge. * 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 | 2 ++ gcc/config/i386/i386.h | 2 ++ 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, 45 insertions(+), 2 deletions(-) diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index df3500adc83..4d1bcffb978 100644 --- a/gcc/common/config/i386/cpuinfo.h +++ b/gcc/common/config/i386/cpuinfo.h @@ -573,6 +573,12 @@ get_intel_cpu (struct __processor_model *cpu_model, cpu_model->__cpu_type = INTEL_COREI7; cpu_model->__cpu_subtype = INTEL_COREI7_GRANITERAPIDS; break; + case 0xb6: + /* Grand Ridge. */ + cpu = "grandridge"; + CHECK___builtin_cpu_is ("grandridge"); + cpu_model->__cpu_type = INTEL_GRANDRIDGE; + 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 60a193a651c..431fd0d3ad1 100644 --- a/gcc/common/config/i386/i386-common.cc +++ b/gcc/common/config/i386/i386-common.cc @@ -1920,6 +1920,7 @@ const char *const processor_names[] = "goldmont-plus", "tremont", "sierraforest", + "grandridge", "knl", "knm", "skylake", @@ -2071,6 +2072,8 @@ const pta processor_alias_table[] = M_CPU_TYPE (INTEL_TREMONT), P_PROC_SSE4_2}, {"sierraforest", PROCESSOR_SIERRAFOREST, CPU_HASWELL, PTA_SIERRAFOREST, M_CPU_SUBTYPE (INTEL_SIERRAFOREST), P_PROC_AVX2}, + {"grandridge", PROCESSOR_GRANDRIDGE, CPU_HASWELL, PTA_GRANDRIDGE, + M_CPU_TYPE (INTEL_GRANDRIDGE), 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 345fda648ff..fe2e9e21fd2 100644 --- a/gcc/common/config/i386/i386-cpuinfo.h +++ b/gcc/common/config/i386/i386-cpuinfo.h @@ -61,6 +61,7 @@ enum processor_types AMDFAM19H, ZHAOXIN_FAM7H, INTEL_SIERRAFOREST, + INTEL_GRANDRIDGE, CPU_TYPE_MAX, BUILTIN_CPU_TYPE_MAX = CPU_TYPE_MAX }; diff --git a/gcc/config.gcc b/gcc/config.gcc index 84c040746dc..b5eda046033 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -669,7 +669,7 @@ 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 \ -sierraforest graniterapids native" +sierraforest graniterapids grandridge 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 3117d83de00..95c16c23c7f 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 Grand Ridge. */ + if (has_feature (FEATURE_RAOINT)) + cpu = "grandridge"; /* Assume Granite Rapids. */ - if (has_feature (FEATURE_AMX_FP16)) + else if (has_feature (FEATURE_AMX_FP16)) cpu = "graniterapids"; /* Assume Sierra Forest. */ else if (has_feature (FEATURE_AVXVNNIINT8)) diff --git a/gcc/config/i386/i386-c.cc b/gcc/config/i386/i386-c.cc index a877d24148d..44fab6e80ae 100644 --- a/gcc/config/i386/i386-c.cc +++ b/gcc/config/i386/i386-c.cc @@ -206,6 +206,10 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, def_or_undef (parse_in, "__sierraforest"); def_or_undef (parse_in, "__sierraforest__"); break; + case PROCESSOR_GRANDRIDGE: + def_or_undef (parse_in, "__grandridge"); + def_or_undef (parse_in, "__grandridge__"); + break; case PROCESSOR_KNL: def_or_undef (parse_in, "__knl"); def_or_undef (parse_in, "__knl__"); @@ -395,6 +399,9 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag, case PROCESSOR_SIERRAFOREST: def_or_undef (parse_in, "__tune_sierraforest__"); break; + case PROCESSOR_GRANDRIDGE: + def_or_undef (parse_in, "__tune_grandridge__"); + 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 3c7570c5edd..23ab1f867d0 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -138,6 +138,7 @@ along with GCC; see the file COPYING3. If not see #define m_GOLDMONT_PLUS (HOST_WIDE_INT_1U<