From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 3CA3C3858419 for ; Wed, 10 Aug 2022 07:37:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3CA3C3858419 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27A6bemt030374; Wed, 10 Aug 2022 07:37:22 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hv4526hmb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Aug 2022 07:37:22 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27A6cjcq001919; Wed, 10 Aug 2022 07:37:22 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 3hv4526hk5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Aug 2022 07:37:22 +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 27A7NIZd025711; Wed, 10 Aug 2022 07:37:20 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03fra.de.ibm.com with ESMTP id 3huwvfrd9g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Aug 2022 07:37:20 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27A7YkQC25756098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 07:34:46 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C2D1952050; Wed, 10 Aug 2022 07:37:16 +0000 (GMT) Received: from [9.197.226.101] (unknown [9.197.226.101]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 037565204E; Wed, 10 Aug 2022 07:37:14 +0000 (GMT) Message-ID: <856dfcb9-1fd5-8f3c-825b-635ee35df9dd@linux.ibm.com> Date: Wed, 10 Aug 2022 15:37:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v2, rs6000] Add multiply-add expand pattern [PR103109] Content-Language: en-US To: Segher Boessenkool Cc: HAO CHEN GUI , David , Peter Bergner , gcc-patches References: <9c7df6aa-c768-114e-4b1e-df6ce65a63b9@linux.ibm.com> <3a98158e-a26a-8e40-151d-6910782b27da@linux.ibm.com> <20220809213408.GU25951@gate.crashing.org> From: "Kewen.Lin" In-Reply-To: <20220809213408.GU25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: dh3WtPeG9PB2Npix2dfaotcrDDr-QYQZ X-Proofpoint-GUID: ZAAzFx3FkJ-vitmvOdeMucAoMNVOMIf8 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-10_03,2022-08-09_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 impostorscore=0 mlxlogscore=717 clxscore=1015 adultscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208100021 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2022 07:37:24 -0000 on 2022/8/10 05:34, Segher Boessenkool wrote: > On Tue, Aug 09, 2022 at 11:14:16AM +0800, Kewen.Lin wrote: >> on 2022/8/8 14:04, HAO CHEN GUI wrote: >>> +/* { dg-do run { target { has_arch_ppc64 } } } */ >>> +/* { dg-options "-O2 -mdejagnu-cpu=power9 -save-temps" } */ >>> +/* { dg-require-effective-target int128 } */ >>> +/* { dg-require-effective-target p9modulo_hw } */ >>> +/* { dg-final { scan-assembler-times {\mmaddld\M} 2 } } */ >>> +/* { dg-final { scan-assembler-times {\mmaddhd\M} 1 } } */ >>> +/* { dg-final { scan-assembler-times {\mmaddhdu\M} 1 } } */ >>> + >> >> Maybe it's good to split this case into two, one for compiling and the other for running. >> Since the generated asm is a test point here, with one separated case for compiling, we >> can still have that part of test coverage on hosts which are unable to run this case. >> You can move functions multiply_add and multiply_addu into one common header file, then >> include it in both source files. > > Yeah, good point. You cannot make dg-do do different things on > different targets. Fortunatelt just duplicating this test and then > removing the things not relevant to run resp. compile testing makes > things even more clear :-) > >> Nit: better to add one explicit "return 0;" to avoid possible warning. > > This is in main(), the C standard requires this to work without return > (and it is common). But, before C99 the implicit return value from > main() was undefined, so yes, it could warn then. Does it? > Yes, exactly, with explicit -std=c89 -Wreturn-type it will have a warning: warning: control reaches end of non-void function... BR, Kewen