Message ID | 315e43e5-3167-50de-08ec-ab83202e55a0@linux.ibm.com |
---|---|
State | Committed |
Commit | 4574dad43f77100f401375e6c9df6402e99ab682 |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6CBEA3857824 for <patchwork@sourceware.org>; Thu, 4 Aug 2022 09:56:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CBEA3857824 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659606962; bh=U1ZcerasweBslQwXfWGwwaRg/VBUhHcm+Yn6P4h0TXQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=jRHXix/a3ePfSxKtBvF38xqqjE+io0U/LaZgmbNrYMjayo2NicD/gkVZGQH/q3N+1 DzV/cqRALFcfG0KGnaLT1Bk1/rwLUw1V1wZat+MJsrsbyLxPUGAw1tP7un+Y/qb7tG vPCcIQI3Bntjd9L1fnwnzwuy/7bKU3qHTywwGW2k= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 165E63858C00 for <gcc-patches@gcc.gnu.org>; Thu, 4 Aug 2022 09:55:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 165E63858C00 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2749Khh5015711; Thu, 4 Aug 2022 09:55:30 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hrbda0vhp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Aug 2022 09:55:30 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2749bt7X023022; Thu, 4 Aug 2022 09:55:30 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hrbda0vgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Aug 2022 09:55:30 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2749opbM006182; Thu, 4 Aug 2022 09:55:28 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma05fra.de.ibm.com with ESMTP id 3hmv994faq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Aug 2022 09:55:28 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2749r77f33161668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Aug 2022 09:53:07 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2CB45A4062; Thu, 4 Aug 2022 09:55:25 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 831D4A4060; Thu, 4 Aug 2022 09:55:23 +0000 (GMT) Received: from [9.197.249.181] (unknown [9.197.249.181]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 4 Aug 2022 09:55:23 +0000 (GMT) Message-ID: <315e43e5-3167-50de-08ec-ab83202e55a0@linux.ibm.com> Date: Thu, 4 Aug 2022 17:55:20 +0800 MIME-Version: 1.0 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] Correct return value of check_p9modulo_hw_available Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: wJDnJakGt8TQqhVBF7x4_nt9cv9T1bdr X-Proofpoint-ORIG-GUID: KqUgMRXwMUlw2_MKSijH42nkj1OgOwda 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-04_03,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 phishscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208040041 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[rs6000] Correct return value of check_p9modulo_hw_available
|
|
Commit Message
HAO CHEN GUI
Aug. 4, 2022, 9:55 a.m. UTC
Hi, This patch corrects return value of check_p9modulo_hw_available. It should return 0 when p9modulo is supported. 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-04 Haochen Gui <guihaoc@linux.ibm.com> gcc/testsuite/ * lib/target-supports.exp (check_p9modulo_hw_available): Correct return value. patch.diff
Comments
Hi Haochen, on 2022/8/4 17:55, HAO CHEN GUI wrote: > Hi, > This patch corrects return value of check_p9modulo_hw_available. It should > return 0 when p9modulo is supported. Good catch! There is no case using p9modulo_hw for now, no coverage, sigh... > > Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. > Is this okay for trunk? Any recommendations? Thanks a lot. This patch is OK, thanks! BR, Kewen > > ChangeLog > 2022-08-04 Haochen Gui <guihaoc@linux.ibm.com> > > gcc/testsuite/ > * lib/target-supports.exp (check_p9modulo_hw_available): Correct return > value. > > > patch.diff > diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp > index 4ed7b25b9a4..04a2a8e8659 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -2288,7 +2288,7 @@ proc check_p9modulo_hw_available { } { > { > int i = 5, j = 3, r = -1; > asm ("modsw %0,%1,%2" : "+r" (r) : "r" (i), "r" (j)); > - return (r == 2); > + return (r != 2); > } > } $options > }
Hi! On Thu, Aug 04, 2022 at 05:55:20PM +0800, HAO CHEN GUI wrote: > This patch corrects return value of check_p9modulo_hw_available. It should > return 0 when p9modulo is supported. It would be harder to make such mistakes if it used exit() explicitly, so that the reader is reminded the shell semantics are used here instead of the C conventions. > - return (r == 2); > + return (r != 2); so that then would be smth like if (r == 2) exit (0); else exit (1); (which makes the exit code for failure explicit as well). Terse is good. Explicit is good as well :-) (You don't have to make this change here of course, but keep it in mind for the future :-) ) Segher
Hi Segher, Thanks so much for your explanation. Now I have a clear picture about the usage of return value. Patch was committed as r13-1971. Thanks Gui Haochen On 5/8/2022 上午 1:09, Segher Boessenkool wrote: > Hi! > > On Thu, Aug 04, 2022 at 05:55:20PM +0800, HAO CHEN GUI wrote: >> This patch corrects return value of check_p9modulo_hw_available. It should >> return 0 when p9modulo is supported. > > It would be harder to make such mistakes if it used exit() explicitly, > so that the reader is reminded the shell semantics are used here instead > of the C conventions. > >> - return (r == 2); >> + return (r != 2); > > so that then would be smth like > > if (r == 2) > exit (0); > else > exit (1); > > (which makes the exit code for failure explicit as well). > > Terse is good. Explicit is good as well :-) > > (You don't have to make this change here of course, but keep it in mind > for the future :-) ) > > > Segher
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4ed7b25b9a4..04a2a8e8659 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2288,7 +2288,7 @@ proc check_p9modulo_hw_available { } { { int i = 5, j = 3, r = -1; asm ("modsw %0,%1,%2" : "+r" (r) : "r" (i), "r" (j)); - return (r == 2); + return (r != 2); } } $options }