From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 06BC23858D32; Thu, 1 Dec 2022 12:16:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 06BC23858D32 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 (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B1BmZCP007229; Thu, 1 Dec 2022 12:16:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=mime-version : date : from : to : cc : subject : in-reply-to : references : message-id : content-type : content-transfer-encoding; s=pp1; bh=6qETX7yoRc+7KuDwGS3VIauSVOI+EpyAsz4IeFIDWmY=; b=TX8OTvnHcp7iQJMlruIwqZxCvMp9rWmb8Wc3wntw27TXX57vncE5RNe8N/FO3JbQxdCc M/4vmRjJbsZ14YXV4BWEMYMGmfCEvwrSqCLKnXu9mkJjtoFmeJACYXD4rUnaev0vqdx9 HkyFnyd48KlCwhT3VPoibJogSxbaEaaQ/eKWA1vxOAnco0sxcjmutWslnHDNJD6TdaEV ijY4e9+5ZmAgMdjWIYP3UtYGTE9tGW/ZQDApvgrq2owNostmxnfYROORsqpcJDSbJ+qO ys0AaiPcIF77XxR26jYPHoBt0bOKuFoUsaO00OMbIpS2CJX8v5xxL1uCU+XBkYmg9cew eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m6uqm0k4x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 12:16:10 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2B1BqNWZ019884; Thu, 1 Dec 2022 12:16:10 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m6uqm0k4g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 12:16:10 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2B1C5dBh008355; Thu, 1 Dec 2022 12:16:09 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01dal.us.ibm.com with ESMTP id 3m3aeamah9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 12:16:09 +0000 Received: from smtpav06.wdc07v.mail.ibm.com ([9.208.128.115]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B1CG7H148759294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Dec 2022 12:16:08 GMT Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5004058060; Thu, 1 Dec 2022 12:16:07 +0000 (GMT) Received: from smtpav06.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF9C15804E; Thu, 1 Dec 2022 12:16:06 +0000 (GMT) Received: from ltc.linux.ibm.com (unknown [9.5.196.140]) by smtpav06.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 1 Dec 2022 12:16:06 +0000 (GMT) MIME-Version: 1.0 Date: Thu, 01 Dec 2022 20:16:06 +0800 From: guojiufu To: Jiufu Guo Cc: "Kewen.Lin" , segher@kernel.crashing.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH 2/3]rs6000: NFC use sext_hwi to replace ((v&0xf..f)^0x80..0) - 0x80..0 In-Reply-To: <81db0995-8ba5-766c-1e0e-67d3d47c40ce@linux.ibm.com> References: <20221201013619.196004-1-guojiufu@linux.ibm.com> <20221201013619.196004-2-guojiufu@linux.ibm.com> <94338e4c-baf4-ec09-68a7-064a23c79327@linux.ibm.com> <9cbc0b3d-0d4b-5646-0ed8-fa2d4f8dc8c3@linux.ibm.com> <81db0995-8ba5-766c-1e0e-67d3d47c40ce@linux.ibm.com> Message-ID: X-Sender: guojiufu@linux.ibm.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: oKg0quJappTAXqYDoJfi8NIAx5AUEdi4 X-Proofpoint-ORIG-GUID: r-mwB6VcZIhkmMVuv6zLpgN5q9yUkc6u X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-01_04,2022-12-01_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212010086 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-12-01 15:10, Jiufu Guo via Gcc-patches wrote: > Hi Kewen, > > 在 12/1/22 2:11 PM, Kewen.Lin 写道: >> on 2022/12/1 13:35, Jiufu Guo wrote: >>> Hi Kewen, >>> >>> Thanks for your quick and insight review! >>> >>> 在 12/1/22 1:17 PM, Kewen.Lin 写道: >>>> Hi Jeff, >>>> >>>> on 2022/12/1 09:36, Jiufu Guo wrote: >>>>> Hi, >>>>> >>>>> This patch just uses sext_hwi to replace the expression like: >>>>> ((value & 0xf..f) ^ 0x80..0) - 0x80..0 for rs6000.cc and rs6000.md. >>>>> >>>>> Bootstrap & regtest pass on ppc64{,le}. >>>>> Is this ok for trunk? >>>> >>>> You didn't say it clearly but I guessed you have grepped in the >>>> whole >>>> config/rs6000 directory, right? I noticed there are still two >>>> places >>>> using this kind of expression in function >>>> constant_generates_xxspltiw, >>>> but I assumed it's intentional as their types are not HOST_WIDE_INT. >>>> >>>> gcc/config/rs6000/rs6000.cc: short sign_h_word = ((h_word & >>>> 0xffff) ^ 0x8000) - 0x8000; >>>> gcc/config/rs6000/rs6000.cc: int sign_word = ((word & 0xffffffff) ^ >>>> 0x80000000) - 0x80000000; >>>> >>>> If so, could you state it clearly in commit log like "with type >>>> signed/unsigned HOST_WIDE_INT" or similar? >>>> >>> Good question! >>> >>> And as you said sext_hwi is more for "signed/unsigned HOST_WIDE_INT". >>> For these two places, it seems sext_hwi is not needed actually! >>> And I did see why these expressions are used, may be just an >>> assignment >>> is ok. >> >> ah, I see. I agree using the assignment is quite enough. Could you >> please also simplify them together? Since they are with the form >> "((value & 0xf..f) ^ 0x80..0) - 0x80..0" too, and can be refactored >> in a better way. Thanks! > > Sure, I believe just "short sign_h_word = vsx_const->half_words[0];" > should be correct :-), and included in the updated patch. > > Updated patch is attached, bootstrap®test is on going. Bootstrap and regtest pass on ppc64{,le}. BR, Jeff (Jiufu) > > > BR, > Jeff (Jiufu) > >> >> BR, >> Kewen >>