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 1B4BB3858D33; Tue, 29 Nov 2022 09:09:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B4BB3858D33 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 (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AT7Bc0K036937; Tue, 29 Nov 2022 09:09:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : references : date : in-reply-to : message-id : content-type : mime-version; s=pp1; bh=5NFnfOeMU3UtARhHfbjHK71zyqH/oIB/2se8QQthvfY=; b=ECOPd9Z/7NYPYyz4oIvIWZKd84RbkU1WkwnM88YrgMFkg2oM5eFJSd3zRkG6KNS3i6nR wxVmST5WRUICrvpdOkxEIt2j8AqRPw4/BBPrY0+B2WEgnl47P46DwySxNxDkDbA30hT2 LSpZlDxoVDbxk7iUjs/XamlR9xSrn+yiWYDyRFc9xdyZjjgsjXvZL9yB4XLSuxwWLeew M4DzrP49y9LLwXvCVMppOY2sl+hw1bMEX+IJKcRqWXLkYOFFbabjCUtAeoz9nyWGJlGj CzFyQ8mP7Ch3Ypo+p1LJ6f7zDLo8XrV4mXGgKpqB1XHNZRl7ZnHUvf5C7nSTJGUkNnoR zA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m5dfs2rm7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 09:09:02 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AT8ncEC030092; Tue, 29 Nov 2022 09:09:01 GMT Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m5dfs2rku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 09:09:01 +0000 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AT964T2020761; Tue, 29 Nov 2022 09:09:00 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04dal.us.ibm.com with ESMTP id 3m3aea05p2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 09:09:00 +0000 Received: from smtpav02.dal12v.mail.ibm.com ([9.208.128.128]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AT98x6l25231690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Nov 2022 09:09:00 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71E3C58065; Tue, 29 Nov 2022 09:08:59 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 376C158066; Tue, 29 Nov 2022 09:08:59 +0000 (GMT) Received: from pike (unknown [9.5.12.127]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTPS; Tue, 29 Nov 2022 09:08:59 +0000 (GMT) From: Jiufu Guo To: Segher Boessenkool Cc: "Kewen.Lin" , dje.gcc@gmail.com, linkw@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH V2] rs6000: Support to build constants by li/lis+oris/xoris References: <20221026114052.17713-1-guojiufu@linux.ibm.com> <9331dba8-f346-37e5-3340-055f2c4d9245@linux.ibm.com> <20221125144309.GG25951@gate.crashing.org> <7ebkor21hd.fsf@pike.rch.stglabs.ibm.com> <20221128141822.GM25951@gate.crashing.org> Date: Tue, 29 Nov 2022 17:08:57 +0800 In-Reply-To: <20221128141822.GM25951@gate.crashing.org> (Segher Boessenkool's message of "Mon, 28 Nov 2022 08:18:23 -0600") Message-ID: <7e8rjuyvo6.fsf@pike.rch.stglabs.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fYDAZhnbXATb_xHXR0-qQaRVhGYvyXXL X-Proofpoint-ORIG-GUID: HDVmcr7yL2MFYX1I0kWQay1R9pQJOJc6 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-11-29_06,2022-11-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 phishscore=0 spamscore=0 adultscore=0 clxscore=1015 mlxscore=0 mlxlogscore=727 priorityscore=1501 bulkscore=0 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211290056 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_SHORT,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 List-Id: Hi Segher, Thanks for your review! Segher Boessenkool writes: > On Mon, Nov 28, 2022 at 11:37:34AM +0800, Jiufu Guo wrote: >> Segher Boessenkool writes: >> > On Fri, Nov 25, 2022 at 04:11:49PM +0800, Kewen.Lin wrote: >> >> on 2022/10/26 19:40, Jiufu Guo wrote: >> >> for "li/lis + oris/xoris", I interpreted it into four combinations: >> >> >> >> li + oris, lis + oris, li + xoris, lis + xoris. >> >> >> >> not sure just me interpreting like that, but the actual combinations >> >> which this patch adopts are: >> >> >> >> li + oris, li + xoris, lis + xoris. >> >> >> >> It's a bit off, but not a big deal, up to you to reword it or not. :) >> > >> > The first two are obvious, but the last one is almost never a good idea, >> > there usually are better ways to do the same. I cannot even think of >> > any case where this is best? A lis;rl* is always prefered (it can >> > optimise better, be combined with other insns). >> I understant your point here. The first two: 'li' for lowest 16bits, >> 'oris/xoris' for next 16bits. >> >> While for 'lis + xoris', it may not obvious, because both 'lis' and >> 'xoris' operates on 17-31bits. >> 'lis + xoris' is for case "32(1) || 1(0) || 15(x) || 16(0)". xoris is >> used to clean bit31. This case seems hard to be supported by 'rlxx'. > > Please put that in a separate patch? First do a patch with just > lis;x?oris. They are unrelated and different in almost every way. Sure, Thanks for the advice! > >> I hit to find this case when I analyze what kind of constants can be >> build by two instructions. Checked the posssible combinations: >> "addi/addis" + "neg/ori/../xoris/rldX/rlwX/../sradi/extswsli"(those >> instructions which accept one register and one immediate). >> >> I also drafted the patch to use "li/lis+rlxx" to build constant. >> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601276.html >> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601277.html > > Those seem to do many things in one patch as well :-( It is very hard > to review such things, it takes many hours each to do properly. Sorry, I will try to seperate them to smaller granularities! BR, Jeff (Jiufu) > > > Segher