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 C156B3858D37; Thu, 1 Dec 2022 06:11:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C156B3858D37 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 2B15wF9W024236; Thu, 1 Dec 2022 06:11:47 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=ZggKvOnorqbgICStY88ny2VfIRXnL5v7Hgpd87mQ9dU=; b=oHDBdcqJQibbqLqatDapOyElZSDoR/hgPqEd6KO1kUmspLKej62cdnzHNVGc3Q/8Xcpj 1GBN+lBf9/t+Kd5Xqeglw3qESimZQB+VgWREodsk9MQu5GBOKAjRqUeVdmEZX+VHKEM0 jsUHIlJtoCQvblrfNIZG32wzbHwQGIlz1OcJl/6czORhB6tr0DJMn1Pq8FVgyZzvnHrp EgYAKn1is32IBxWLNECwyiZ7YCb0FJ45vxFPKXbfeCKF4KJoVrupwzjDdjy+D015gnLY p1HQlSBXXBhs6fxTsdae4JEFS5L1YJkScn7dipAxLM5+Dnr4js0wwRJ8O+ZWl+H57fiU mA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m6pk0gdmy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 06:11:47 +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 2B161EWY000567; Thu, 1 Dec 2022 06:11:47 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m6pk0gdkw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 06:11:46 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2B165jKY009866; Thu, 1 Dec 2022 06:11:44 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 3m3ae9euqf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 06:11:44 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B16CPcM7209654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Dec 2022 06:12:25 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D37CA405B; Thu, 1 Dec 2022 06:11:42 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD37BA405C; Thu, 1 Dec 2022 06:11:39 +0000 (GMT) Received: from [9.197.236.127] (unknown [9.197.236.127]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 1 Dec 2022 06:11:39 +0000 (GMT) Message-ID: Date: Thu, 1 Dec 2022 14:11:37 +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 2/3]rs6000: NFC use sext_hwi to replace ((v&0xf..f)^0x80..0) - 0x80..0 Content-Language: en-US To: Jiufu Guo Cc: segher@kernel.crashing.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, gcc-patches@gcc.gnu.org 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> From: "Kewen.Lin" In-Reply-To: <9cbc0b3d-0d4b-5646-0ed8-fa2d4f8dc8c3@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fVw5jXSA7jBEsOL0dTPE7Z8i33D3Umue X-Proofpoint-ORIG-GUID: _nWxjR9osvzybYfgZLlrpfHdCEWfw_jg 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_03,2022-11-30_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 mlxscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 adultscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212010042 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,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/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! BR, Kewen