From patchwork Thu Jun 25 23:36:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 1317266 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=mq7ZNmfM; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49tGdF00fTz9sRR for ; Fri, 26 Jun 2020 09:37:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 89DAF386F465; Thu, 25 Jun 2020 23:36:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89DAF386F465 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593128219; bh=nAiaDczQBUvmx/OSTUIOFpgiXh4izDtg5NETXOjD2Ls=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=mq7ZNmfMWd3sYwUspNRalcg0gviXoKq8BBg7b/z9EZZhi5hUTMBkgkPsX8lM7prxS Whp9LZoMQZhbu/9lXsSnlA+e1J6QcQPGPwu4WaP6uQww6OCjjCmmgNnACqg/BVXb0k mnYKj4spyH4on7SeqhDgsVyr7OJGLNC0alPPcqqU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 869FF3851C07 for ; Thu, 25 Jun 2020 23:36:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 869FF3851C07 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05PNW7jA167431; Thu, 25 Jun 2020 19:36:55 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 31ux08eb83-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jun 2020 19:36:55 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05PNa7sc013910; Thu, 25 Jun 2020 23:36:54 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03dal.us.ibm.com with ESMTP id 31uurw3qxt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jun 2020 23:36:54 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05PNar7Q26476854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Jun 2020 23:36:53 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 03B636E04C; Thu, 25 Jun 2020 23:36:53 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4348B6E053; Thu, 25 Jun 2020 23:36:52 +0000 (GMT) Received: from [9.160.107.156] (unknown [9.160.107.156]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 25 Jun 2020 23:36:52 +0000 (GMT) To: Segher Boessenkool Subject: [PATCH] rs6000: Add support for __builtin_cpu_is ("power10") Message-ID: <1e6cebca-72aa-e2b3-f71e-965e0a57847e@linux.ibm.com> Date: Thu, 25 Jun 2020 18:36:51 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-25_19:2020-06-25, 2020-06-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 impostorscore=0 cotscore=-2147483648 mlxlogscore=999 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006250134 X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Peter Bergner via Gcc-patches From: Peter Bergner Reply-To: Peter Bergner Cc: Bill Schmidt , GCC Patches , Michael Meissner Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" rs6000: Add support for __builtin_cpu_is ("power10") Add support for __builtin_cpu_is ("power10"). Also add documentation for the recently added "arch_3_1" and "mma" __builtin_cpu_supports arguments. This passed bootstrap and regtesting with no regressions. Ok for trunk? Peter gcc/ * config/rs6000/rs6000-call.c (cpu_is_info) : New. : Remove unneeded ','. * gcc/doc/extend.texi (PowerPC Built-in Functions): Document power10, arch_3_1 and mma. gcc/testsuite/ * gcc.target/powerpc/cpu-builtin-1.c: Add tests for power10, arch_3_1 and mma. diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index 3a109fe626f..4bc1e588a2f 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -105,6 +105,7 @@ static const struct const char *cpu; unsigned int cpuid; } cpu_is_info[] = { + { "power10", PPC_PLATFORM_POWER10 }, { "power9", PPC_PLATFORM_POWER9 }, { "power8", PPC_PLATFORM_POWER8 }, { "power7", PPC_PLATFORM_POWER7 }, @@ -174,7 +175,7 @@ static const struct { "darn", PPC_FEATURE2_DARN, 1 }, { "scv", PPC_FEATURE2_SCV, 1 }, { "arch_3_1", PPC_FEATURE2_ARCH_3_1, 1 }, - { "mma", PPC_FEATURE2_MMA, 1 }, + { "mma", PPC_FEATURE2_MMA, 1 } }; static void altivec_init_builtins (void); diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 95f7192e41e..343fbba8223 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -17123,6 +17123,8 @@ issues a warning. The following CPU names can be detected: @table @samp +@item power10 +IBM POWER10 Server CPU. @item power9 IBM POWER9 Server CPU. @item power8 @@ -17199,6 +17201,8 @@ CPU supports ISA 2.06 (eg, POWER7) CPU supports ISA 2.07 (eg, POWER8) @item arch_3_00 CPU supports ISA 3.0 (eg, POWER9) +@item arch_3_1 +CPU supports ISA 3.1 (eg, POWER10) @item archpmu CPU supports the set of compatible performance monitoring events. @item booke @@ -17232,6 +17236,8 @@ CPU supports icache snooping capabilities. CPU supports 128-bit IEEE binary floating point instructions. @item isel CPU supports the integer select instruction. +@item mma +CPU supports the matrix-multiply assist instructions. @item mmu CPU has a memory management unit. @item notb diff --git a/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c b/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c index 960e7fb4f5f..2bcf6f679da 100644 --- a/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c +++ b/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c @@ -24,6 +24,7 @@ use_cpu_is_builtins (unsigned int *p) p[12] = __builtin_cpu_is ("ppc440"); p[13] = __builtin_cpu_is ("ppc405"); p[14] = __builtin_cpu_is ("ppc-cell-be"); + p[15] = __builtin_cpu_is ("power10"); #else p[0] = 0; #endif @@ -74,6 +75,8 @@ use_cpu_supports_builtins (unsigned int *p) p[38] = __builtin_cpu_supports ("darn"); p[39] = __builtin_cpu_supports ("scv"); p[40] = __builtin_cpu_supports ("htm-no-suspend"); + p[41] = __builtin_cpu_supports ("arch_3_1"); + p[42] = __builtin_cpu_supports ("mma"); #else p[0] = 0; #endif