Message ID | 315e43e5-3167-50de-08ec-ab83202e55a0@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 v22csp264889pxt; Thu, 4 Aug 2022 02:56:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7afwqoQBBXwhalV8bTNyXU3sbLdVTnKbbAQO0PMYJ70pmJAFho/5KSR/D4VmQBfc82Gv6L X-Received: by 2002:a17:907:96ac:b0:72f:1dea:5b66 with SMTP id hd44-20020a17090796ac00b0072f1dea5b66mr850289ejc.266.1659606977550; Thu, 04 Aug 2022 02:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659606977; cv=none; d=google.com; s=arc-20160816; b=iythLLafqpHdxjAwS2nbvNR9sDSMhmtq1jMtl4sz+PlqsNz7ZaTeAZ9RPerv1WKWOC c2S/luJIV/sMMItAtV7x/vNEJlw7WxHME1Wpvo7apIgwWFvgy7R9Rh1cn4VKSadwEG/+ JlHJYQCpmoY8K8pZV3uUdDdDCWTf1HYK7/E5H4sn7JRgtAFZfYfr7UG4OFvc5RrECe7N VKtviEOIGA2Pf/Rc6dq3AYi485AuDztfeDf88xskVzi/Hpqo23xAGZ1JpEp8vrpaFrLU mNqnLhhUBfS5CpyNGqFRxMFwxG8ljjOjOhHcPjiOJ5KpLXTUCYNgvBBPPKrGA8GbmFba iOxA== 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 :content-transfer-encoding:subject:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=U1ZcerasweBslQwXfWGwwaRg/VBUhHcm+Yn6P4h0TXQ=; b=rfYNefYVDMCuT/t/OB/+aWPOKEh7j/pYc7J3F5xDPYcfw73BfCChQUfIOs5evkJ8eo eergTy+ku7w3Pi2MLNXMdlm9+mY7zWaXBcaUmYRD40FXqeWyFxQ88MGKbBwKG8IyEEza DOe21p7wR2g9Be2WZZphjFE6kU5VeYjgQ7dcVcL2UGrm1nJWzgX4QWbbR347nRvbVZO/ 9lhju9nq+X9dYOm30Tbtq9whHgp/gn3eDHwERuAq9vBgf3jN4dMU/T/ilyQXHKtmlSZx uVuac/jbouQwQhMO9UByk5xP+O/15vuFasKoCpXMef0s81jYpE8QjHDaH+1/brQjSgOc OgSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Ckew1U3a; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dd17-20020a1709069b9100b0072f190400f7si554755ejc.1.2022.08.04.02.56.17 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 02:56:17 -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=Ckew1U3a; 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 7B6873857409 for <ouuuleilei@gmail.com>; Thu, 4 Aug 2022 09:56:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B6873857409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659606976; 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=Ckew1U3aLRFRnu7PeCDTetqZGL/eJ0SeHg4CSPOTRHFElDGjN1NXL25MO15np/jEt m2ImPlsVzRtwmZZHVnSYIUOV+PEVQx1kkfML/43ghcfmaVpZUYQyN1e3IabpJL+pbO XjsYlNgfjk9qwgOtKV1tzoYQO6f4s7rMgPmM5OoY= 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+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?1740224046128806654?= X-GMAIL-MSGID: =?utf-8?q?1740224046128806654?= |
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 }