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 8535A3858C00 for ; Mon, 24 Jul 2023 01:55:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8535A3858C00 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 Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36O1c4gT021683; Mon, 24 Jul 2023 01:55:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=SlZl+S72SqpHCjZLG1OPSuezU5KyQMGXt2Gi/+eDywk=; b=Y5KejAxwkH3xC/DobOFzA+anfOOEjnc4G07fKEEgnIaHUItT3jiS7UxO4M+Khd+3VWul XFRSTIFoj88Quf/IE628s8GvUJun3qg6/HQkcZd/ZOfBpQimeEb+7fzo9DbiQEwLrfjg T0G7v097snqmdb/adkgHZM0d/xBGwfOmF5KYLUlxenZVayR0NcMcu0OpvK93FYQ5fWM/ PdnrJyADwjRs9055kFPdN4VuFKY6QPzm1C5HUgvyPFCkRXMdvPIdPSFNXmE/VFUnF5PF VjVMUAbGKWIFtql6yzyt2oT9ngZL3Pc/SBrtdqD2q+vOSQGesN4P3LR7G9L2sGc9aY5j tw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s0hw27j8u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jul 2023 01:55:17 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36O1c6Df022008; Mon, 24 Jul 2023 01:55:17 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 3s0hw27j8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jul 2023 01:55:17 +0000 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 36NNQ4a6026197; Mon, 24 Jul 2023 01:55:16 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3s0serfsh6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 24 Jul 2023 01:55:16 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36O1tE6P43450964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Jul 2023 01:55:14 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 780E120043; Mon, 24 Jul 2023 01:55:14 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 391A120040; Mon, 24 Jul 2023 01:55:12 +0000 (GMT) Received: from [9.177.12.38] (unknown [9.177.12.38]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 24 Jul 2023 01:55:11 +0000 (GMT) Message-ID: <98628c27-5134-d1af-635b-a150125b3932@linux.ibm.com> Date: Mon, 24 Jul 2023 09:55:10 +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 1/2 ver 2] rs6000, add argument to function find_instance Content-Language: en-US To: Carl Love Cc: Peter Bergner , David Edelsohn , Segher Boessenkool , gcc-patches@gcc.gnu.org References: <03669543c8fc64dfb6a7f5324606bf9209f25ad7.camel@us.ibm.com> From: "Kewen.Lin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ZytiICryX3d1-w2gONupNwswYmbwawZi X-Proofpoint-GUID: StjQn7gJTyjI2wL8LEOR6qMaN83zJYBw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-23_12,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307240013 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 List-Id: Hi Carl, on 2023/7/22 07:38, Carl Love wrote: > GCC maintainers: > > Version 2: Updated a number of formatting and spacing issues. Added > the NARGS description to the header comment for function find_instance. > This patch was tested on Power 8 LE/BE, Power 9 LE/BE and Power 10 LE > with no regressions. > > The rs6000 function find_instance assumes that it is called for built- > ins with only two arguments. There is no checking for the actual > number of aruguments used in the built-in. This patch adds an > additional parameter to the function call containing the number of > aruguments in the built-in. The function will now do the needed checks > for all of the arguments. > > This fix is needed for the next patch in the series that fixes the > vec_replace_unaligned built-in.c test. > > Please let me know if this patch is acceptable for mainline. Thanks. > > Carl > > > > > ------------------------------------- > rs6000, add argument to function find_instance > > The function find_instance assumes it is called to check a built-in with > only two arguments. This patch extends the function by adding a parameter > specifying the number of built-in arguments to check. > > gcc/ChangeLog: > * config/rs6000/rs6000-c.cc (find_instance): Add new parameter that > specifies the number of built-in arguments to check. > (altivec_resolve_overloaded_builtin): Update calls to find_instance > to pass the number of built-in arguments to be checked. > --- > gcc/config/rs6000/rs6000-c.cc | 40 +++++++++++++++++++++++------------ > 1 file changed, 26 insertions(+), 14 deletions(-) > > diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc > index a353bca19ef..de35490de42 100644 > --- a/gcc/config/rs6000/rs6000-c.cc > +++ b/gcc/config/rs6000/rs6000-c.cc > @@ -1668,18 +1668,20 @@ resolve_vec_step (resolution *res, vec *arglist, unsigned nargs) > /* Look for a matching instance in a chain of instances. INSTANCE points to > the chain of instances; INSTANCE_CODE is the code identifying the specific > built-in being searched for; FCODE is the overloaded function code; TYPES > - contains an array of two types that must match the types of the instance's > - parameters; and ARGS contains an array of two arguments to be passed to > - the instance. If found, resolve the built-in and return it, unless the > - built-in is not supported in context. In that case, set > - UNSUPPORTED_BUILTIN to true. If we don't match, return error_mark_node > - and leave UNSUPPORTED_BUILTIN alone. */ > + contains an array of NARGS types that must match the types of the > + instance's parameters; ARGS contains an array of NARGS arguments to be > + passed to the instance; and NARGS is the number of built-in arguments to > + check. If found, resolve the built-in and return it, unless the built-in > + is not supported in context. In that case, set UNSUPPORTED_BUILTIN to > + true. If we don't match, return error_mark_node and leave > + UNSUPPORTED_BUILTIN alone. > +*/ Minor nit: "*/" doesn't need to start with a new line, just "... alone. */". This patch is okay for trunk with this fixed. Thanks! BR, Kewen