From patchwork Fri Aug 2 06:20:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 1968168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=fUKuotzy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WZwgj276Zz1ybX for ; Fri, 2 Aug 2024 16:20:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BD2D385E45A for ; Fri, 2 Aug 2024 06:20:47 +0000 (GMT) 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 76082385E457 for ; Fri, 2 Aug 2024 06:20:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 76082385E457 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 76082385E457 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722579629; cv=none; b=iHauCH06JE6aB5ulRJ8fZau0q3j4UNib0G+RTZBJ7zHCOVx5/t1qewl7v9CcwrYIMsHJA6LOwMmBozEjnnHIRtqpT0JwvVPwnI+vAtD3f2jiOb5FS0B+VgisAqki2ccU+79G5Rv53enZ3n2KF8JSO24WRBmmzs0XL61o3g9IFh0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722579629; c=relaxed/simple; bh=ySkX+A17s+bPx1JMVrPCTf8cg3PmYP4MBVnT+3P1600=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=XOexhiJ/y9uhe00ZCmu5iAA3uy6LtV1Wqb2aOGCO77MvoOeLGqI8ZBp7ZGe5nnFjDKfjuBZDeX3TxqMcT0K+oRuKgkv1SNmnpkjlwWo/9YYBNJ8O3UG5XV3UrQg6BTbTt9TU+yzBzp6eg3552I4qqBg1Nil94pdzSipvv0ALbFA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4725REqv007850; Fri, 2 Aug 2024 06:20:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=pp1; bh=RmSY3MWdown8+gj26LDEw+XDrG6WYLSCUbGJ2ev/ rcw=; b=fUKuotzyI7zfd5tOThiazjZqphxVr6XIZdvX0aUde4oXLa9ZuEBnRlwc q/qzw3TnYAP1E+juuCDmK4UgqIzNEZwbfMN2Sgsj73nTlqDK5lRsy1RKRtgbefMz 36zEgd7ztziQUlahpIdNLGBdzIx92sQNZNVcOzaHuTF0p3ClIZj8Os/OXn4eeCpS LIhboDiPdreqJasr8cPr5hizmyf24kVqP9rCni4WgNdnyBn3FI62yPnrQbhBnpnV 7c5Xh/VIwL6x1WVDD/qOgv9hKEmdQTG/sRxvUGgJiQ35U0TRNQY5emEb16QX2K12 jtw577GrNzB8L5YhMfdQzsjLltg9nA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40rqk1897t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Aug 2024 06:20:26 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4726HE4H030666; Fri, 2 Aug 2024 06:20:25 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40rqk1897n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Aug 2024 06:20:25 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 4725IHuL007470; Fri, 2 Aug 2024 06:20:24 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 40nb7up3a6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Aug 2024 06:20:24 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4726KLTb39846476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 Aug 2024 06:20:24 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B520958064; Fri, 2 Aug 2024 06:20:21 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 119635805C; Fri, 2 Aug 2024 06:20:21 +0000 (GMT) Received: from cowardly-lion.the-meissners.org (unknown [9.61.67.12]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Fri, 2 Aug 2024 06:20:20 +0000 (GMT) Date: Fri, 2 Aug 2024 02:20:17 -0400 From: Michael Meissner To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , David Edelsohn , Peter Bergner Subject: [PATCH 8/9] Change TARGET_MODULO to TARGET_POWER9 Message-ID: Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , David Edelsohn , Peter Bergner References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: B_p8f-L8Qx6Ecu8ZGuT-7HzZnvCiC9Jo X-Proofpoint-ORIG-GUID: 6mvDKKg65gigvp1iIhCCl-lckMrWFeu_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-02_02,2024-08-01_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 bulkscore=0 mlxlogscore=810 spamscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408020039 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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~incoming=patchwork.ozlabs.org@gcc.gnu.org As part of the architecture flags patches, this patch changes the use of TARGET_MODULO to TARGET_POWER9. The modulo instructions were added in power9 (ISA 3.0). Note, I did not change the uses of TARGET_MODULO where it was explicitly generating different code if the machine had a modulo instruction. I have built both big endian and little endian bootstrap compilers and there were no regressions. In addition, I constructed a test case that used every archiecture define (like _ARCH_PWR4, etc.) and I also looked at the .machine directive generated. I ran this test for all supported combinations of -mcpu, big/little endian, and 32/64 bit support. Every single instance generated exactly the same code with the patches installed compared to the compiler before installing the patches. Can I install this patch on the GCC 15 trunk? 2024-08-01 Michael Meissner * config/rs6000/rs6000-builtin.cc (rs6000_builtin_is_supported): Use TARGET_POWER9 instead of TARGET_MODULO. * config/rs6000/rs6000.h (TARGET_CTZ): Likewise. (TARGET_EXTSWSLI): Likewise. (TARGET_MADDLD): Likewise. * config/rs6000/rs6000.md (enabled attribute): Likewise. --- gcc/config/rs6000/rs6000-builtin.cc | 4 ++-- gcc/config/rs6000/rs6000.h | 6 +++--- gcc/config/rs6000/rs6000.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc index 140422170a1..1f808f69e8f 100644 --- a/gcc/config/rs6000/rs6000-builtin.cc +++ b/gcc/config/rs6000/rs6000-builtin.cc @@ -169,9 +169,9 @@ rs6000_builtin_is_supported (enum rs6000_gen_builtins fncode) case ENB_P8V: return TARGET_P8_VECTOR; case ENB_P9: - return TARGET_MODULO; + return TARGET_POWER9; case ENB_P9_64: - return TARGET_MODULO && TARGET_POWERPC64; + return TARGET_POWER9 && TARGET_POWERPC64; case ENB_P9V: return TARGET_P9_VECTOR; case ENB_P10: diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index b5b9c01683b..14dc66676c1 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -461,9 +461,9 @@ extern int rs6000_vector_align[]; #define TARGET_FCTIWUZ TARGET_POWER7 /* Only powerpc64 and powerpc476 support fctid. */ #define TARGET_FCTID (TARGET_POWERPC64 || rs6000_cpu == PROCESSOR_PPC476) -#define TARGET_CTZ TARGET_MODULO -#define TARGET_EXTSWSLI (TARGET_MODULO && TARGET_POWERPC64) -#define TARGET_MADDLD TARGET_MODULO +#define TARGET_CTZ TARGET_POWER9 +#define TARGET_EXTSWSLI (TARGET_POWER9 && TARGET_POWERPC64) +#define TARGET_MADDLD TARGET_POWER9 /* TARGET_DIRECT_MOVE is redundant to TARGET_P8_VECTOR, so alias it to that. */ #define TARGET_DIRECT_MOVE TARGET_P8_VECTOR diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 089377e5b6a..0524cf8ee6f 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -389,7 +389,7 @@ (define_attr "enabled" "" (const_int 1) (and (eq_attr "isa" "p9") - (match_test "TARGET_MODULO")) + (match_test "TARGET_POWER9")) (const_int 1) (and (eq_attr "isa" "p9v")