Message ID | eae863c9-661b-328d-3bbe-66b8e97c8fd1@linux.ibm.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp200839pxt; Wed, 3 Aug 2022 01:25:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vM5C1VEWFuOyBT1ftsGbgA4dIDviI9eEB+XYIriF4WlQV2Tq+n+HUYUU7X+vjQle4D9WMn X-Received: by 2002:a05:6402:5388:b0:435:71b:5d44 with SMTP id ew8-20020a056402538800b00435071b5d44mr23845374edb.364.1659515111616; Wed, 03 Aug 2022 01:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659515111; cv=none; d=google.com; s=arc-20160816; b=apB1kJQMOFHiOrLsVzwyaL5AVdmfBGrRVb/zpGYETyItwLz/G5fUabhk8lSA3VMzXG ACuqimJx9ZeKrug10mHrPMoem8GeQShBS1g6ZDdByRyTtQqoNzOtZ3H5K5jeqIgr0JSb jsBFInq7IktWX4yZtETQVGin5bSXxd8rlp11Q34AZfXb+oUF1lS4qpWx1bZrCXLlbrH5 xmHPxYOF+cY0vqV4suvmViYLMxEM09qeXPpQNI/zpFtbLyYM+EM42QY6EGv2FDJjxY+a sKBQjDUxFu1ewEbbqlx8YF3OFoenswZ2sdKMZRXrGX5+KXrbFx9HUt1OKaXszM9Ba3wV X7NQ== 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 :mime-version:content-transfer-encoding:subject:to:content-language :user-agent:date:message-id:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=mT9/3h9RqV2sOzvxCacOHTUutFYPABhJKgCV4KITyGs=; b=k2BqLCtuyDcNmF8NdbUW4SiviOhA8TxhS4G2FdZ/DXw84lDBfzv/StrdBqtuHUVy2l xVvt5xhGYIDT4J/wVZPJC6tFXnt2pdKqXS7yCMx0MHXR7XjQP6WS/ISKO1drSCCviRp1 lP3wp/LJZuw1XTwuBID3I2XKCpUu60fUyAHUvpSQvvj8kB2ZtMXIXsBd7rFeJMdRcfJm 5R82JfE0tbKobD0oM8nqVs/ocYMB4HHuTE4hVMvvkxOW/y7b88s3lYYtGfsEUuYwdfwc Pj+D6sXk4kCZjvWNiFh26SDez1M7ytxeiHWdnbQeNB44NFvgLJrRwm5rx/IK8c2/70WK zRpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ql+Nu4Td; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ds21-20020a170907725500b0072f2ce19e49si16443746ejc.10.2022.08.03.01.25.11 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 01:25:11 -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=ql+Nu4Td; 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 7BC7638515FA for <ouuuleilei@gmail.com>; Wed, 3 Aug 2022 08:25:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BC7638515FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659515110; bh=mT9/3h9RqV2sOzvxCacOHTUutFYPABhJKgCV4KITyGs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ql+Nu4TdUR3qYKLLnOaH0ZQ1rRTt6yVGZTsg4Ai23nf0qga93EOWDAkNFEan0GmBu wIfONY1kiftm+zKotPaxrjN1MiCXnLx7iBmnGiXIvbg6i0tr3FA8y6MDt7/wXbDrNb o65j1/H4bzQvWHqysnmctIoLRMwfuykrSL762yjI= 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 44B5D3858CDB for <gcc-patches@gcc.gnu.org>; Wed, 3 Aug 2022 08:24:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 44B5D3858CDB Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2737Msx5023584; Wed, 3 Aug 2022 08:24:25 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hqmk31m4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Aug 2022 08:24:24 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2738OOR5032626; Wed, 3 Aug 2022 08:24:24 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hqmk31m3w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Aug 2022 08:24:24 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2738KxKW023909; Wed, 3 Aug 2022 08:24:22 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03fra.de.ibm.com with ESMTP id 3hmv98uebm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Aug 2022 08:24:21 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2738OIuT28115338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Aug 2022 08:24:18 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A4592A4051; Wed, 3 Aug 2022 08:24:18 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 530F9A4040; Wed, 3 Aug 2022 08:24:17 +0000 (GMT) Received: from [9.200.100.136] (unknown [9.200.100.136]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 3 Aug 2022 08:24:17 +0000 (GMT) Message-ID: <eae863c9-661b-328d-3bbe-66b8e97c8fd1@linux.ibm.com> Date: Wed, 3 Aug 2022 16:24:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: gcc-patches <gcc-patches@gcc.gnu.org> Subject: [PATCH, rs6000] TARGET_MADDLD should include TARGET_POWERPC64 Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ydX5SDjdv5CNtVjNAPlFQEqjq6v7IjEv X-Proofpoint-GUID: efZzzqohMIxKmhrEle205UdeDeO_Yuxq Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-03_03,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 clxscore=1015 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208030037 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_MSPIKE_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: HAO CHEN GUI via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: HAO CHEN GUI <guihaoc@linux.ibm.com> Cc: Peter Bergner <bergner@linux.ibm.com>, David <dje.gcc@gmail.com>, Segher Boessenkool <segher@kernel.crashing.org> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1740127717554181756?= X-GMAIL-MSGID: =?utf-8?q?1740127717554181756?= |
Series |
[rs6000] TARGET_MADDLD should include TARGET_POWERPC64
|
|
Commit Message
HAO CHEN GUI
Aug. 3, 2022, 8:24 a.m. UTC
Hi, This patch changes the definition of TARGET_MADDLD and includes TARGET_POWERPC64, since maddld is a 64 bit instruction. maddld-1.c now checks "has_arch_ppc64". It depends on a patch which fixes empty TU problem. https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598744.html Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. Is this okay for trunk? Any recommendations? Thanks a lot. ChangeLog 2022-08-03 Haochen Gui <guihaoc@linux.ibm.com> gcc/ * config/rs6000/rs6000.h (TARGET_MADDLD): Define. gcc/testsuite/ * gcc.target/powerpc/maddld-1.c: Modify target requirement to compile it on the target which supports 64 bit instructions. patch.diff
Comments
Hi Haochen, on 2022/8/3 16:24, HAO CHEN GUI wrote: > Hi, > This patch changes the definition of TARGET_MADDLD and includes > TARGET_POWERPC64, since maddld is a 64 bit instruction. > > maddld-1.c now checks "has_arch_ppc64". It depends on a patch which fixes > empty TU problem. > https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598744.html > aha, I'm going to push it if Segher doesn't have further comments. :) > Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. > Is this okay for trunk? Any recommendations? Thanks a lot. > > ChangeLog > 2022-08-03 Haochen Gui <guihaoc@linux.ibm.com> > > gcc/ > * config/rs6000/rs6000.h (TARGET_MADDLD): Define. May be ": Adjust." or ": Adjust with TARGET_POWERPC64.". > > gcc/testsuite/ > * gcc.target/powerpc/maddld-1.c: Modify target requirement to compile > it on the target which supports 64 bit instructions. > May be ": Add effective target has_arch_ppc64." OK with these nits adjusted or not. BR, Kewen > > patch.diff > diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h > index 7d04556304a..2f15451fd8b 100644 > --- a/gcc/config/rs6000/rs6000.h > +++ b/gcc/config/rs6000/rs6000.h > @@ -466,7 +466,7 @@ extern int rs6000_vector_align[]; > #define TARGET_FCTIWUZ TARGET_POPCNTD > #define TARGET_CTZ TARGET_MODULO > #define TARGET_EXTSWSLI (TARGET_MODULO && TARGET_POWERPC64) > -#define TARGET_MADDLD TARGET_MODULO > +#define TARGET_MADDLD (TARGET_MODULO && TARGET_POWERPC64) > > #define TARGET_XSCVDPSPN (TARGET_DIRECT_MOVE || TARGET_P8_VECTOR) > #define TARGET_XSCVSPDPN (TARGET_DIRECT_MOVE || TARGET_P8_VECTOR) > diff --git a/gcc/testsuite/gcc.target/powerpc/maddld-1.c b/gcc/testsuite/gcc.target/powerpc/maddld-1.c > index 4edecf1c86d..0a53658e058 100644 > --- a/gcc/testsuite/gcc.target/powerpc/maddld-1.c > +++ b/gcc/testsuite/gcc.target/powerpc/maddld-1.c > @@ -1,4 +1,4 @@ > -/* { dg-do compile } */ > +/* { dg-do compile { target { has_arch_ppc64 } } } */ > /* { dg-options "-mdejagnu-cpu=power9 -O2" } */ > > /* This file tests the maddld instruction can be used in SI mode
Hi! On Wed, Aug 03, 2022 at 04:24:15PM +0800, HAO CHEN GUI wrote: > This patch changes the definition of TARGET_MADDLD and includes > TARGET_POWERPC64, since maddld is a 64 bit instruction. Hrm. But the maddld insn is useful for SImode as well, in 32-bit mode, it is just its name that is a bit confusing then. Sorry for confusing things :-( Add a test for SImode maddld as well? Please fix things up once again and resend? Sorry again! Segher
Hi Segher, On 4/8/2022 上午 12:54, Segher Boessenkool wrote: > Hrm. But the maddld insn is useful for SImode as well, in 32-bit mode, > it is just its name that is a bit confusing then. Sorry for confusing > things :-( > > Add a test for SImode maddld as well? Thanks for your comments. Just want to double confirm that a maddld test case with "-m32" and "-mpowerpc64" is needed. As far as I understand, maddld is a 64-bit instruction and it should be used with "-mpowerpc64" in a 32-bit register environment. Thanks again Gui Haochen
Hi! On Thu, Aug 04, 2022 at 11:17:48AM +0800, HAO CHEN GUI wrote: > On 4/8/2022 上午 12:54, Segher Boessenkool wrote: > > Hrm. But the maddld insn is useful for SImode as well, in 32-bit mode, > > it is just its name that is a bit confusing then. Sorry for confusing > > things :-( > > > > Add a test for SImode maddld as well? > > Thanks for your comments. > > Just want to double confirm that a maddld test case with "-m32" and > "-mpowerpc64" is needed. As far as I understand, maddld is a 64-bit > instruction and it should be used with "-mpowerpc64" in a 32-bit register > environment. Nope. The instruction is fine in pure 32 bit as well. Almost all instructions actually work on 64 bits, but for many (including this maddld) the low 32 bits of the result make sense on their own, as a 32-bit operation done on the low 32 bits of the input registers. We have (define_mode_iterator GPR [SI (DI "TARGET_POWERPC64")]) so that :DI will not be used for plain -m32 compilations, but it can (and will, and should) be used for -m32 -mpowerpc64, and :SI can be used for -m32 in every case. Instructions that look at the top 32 bits of a GPR need an explicit TARGET_POWERPC64. Segher
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 7d04556304a..2f15451fd8b 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -466,7 +466,7 @@ extern int rs6000_vector_align[]; #define TARGET_FCTIWUZ TARGET_POPCNTD #define TARGET_CTZ TARGET_MODULO #define TARGET_EXTSWSLI (TARGET_MODULO && TARGET_POWERPC64) -#define TARGET_MADDLD TARGET_MODULO +#define TARGET_MADDLD (TARGET_MODULO && TARGET_POWERPC64) #define TARGET_XSCVDPSPN (TARGET_DIRECT_MOVE || TARGET_P8_VECTOR) #define TARGET_XSCVSPDPN (TARGET_DIRECT_MOVE || TARGET_P8_VECTOR) diff --git a/gcc/testsuite/gcc.target/powerpc/maddld-1.c b/gcc/testsuite/gcc.target/powerpc/maddld-1.c index 4edecf1c86d..0a53658e058 100644 --- a/gcc/testsuite/gcc.target/powerpc/maddld-1.c +++ b/gcc/testsuite/gcc.target/powerpc/maddld-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { has_arch_ppc64 } } } */ /* { dg-options "-mdejagnu-cpu=power9 -O2" } */ /* This file tests the maddld instruction can be used in SI mode