From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 6A6653858D32; Thu, 1 Dec 2022 08:56:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A6653858D32 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 (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B18orv3004017; Thu, 1 Dec 2022 08:56:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=OQRKbMOvOL2fX0qmdVPKgTVVxCiKA7Snzlkdi3Y3LeU=; b=PUOXLi7oAnjlZ8DiNv1SZat0NPMxXQ7bq4MKRTw1jK7uAWICBYbK/yIP850CbgAGq6DE +IufXEfPYE8d7FX2QHnCu+S6/13xYllgt2BtKaOTfWpv/rSMhQBEpL1ZDLhgsd+Fe7nX DKbXv9FYiI4G00CJfdWx3ORCMJr02zEuhUKB+s6V6zdM/9CQ6rDDr/coYjlEndj/IlPX eAdS1qxD4sDwcYdVXNiFuigBfXFSsVlrT1aJ0HKGxPFCjpZOagS0vEHYwd4rjrSJQNty qqjdwTxJd+tkkIFT9mW9p0JQAn2q4oBmLLSNduuIEM4oeR2JUvzFn9m9tm2bxht1/JVH lA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3m6s4ar49b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 08:56:35 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2B18puOX006806; Thu, 1 Dec 2022 08:56:35 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3m6s4ar48j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 08:56:35 +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 2B18pehh009710; Thu, 1 Dec 2022 08:56:33 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 3m3ae9f222-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Dec 2022 08:56:33 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B18vEZt65012092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Dec 2022 08:57:14 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C24C52050; Thu, 1 Dec 2022 08:56:31 +0000 (GMT) Received: from [9.200.99.34] (unknown [9.200.99.34]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4E0DA5204E; Thu, 1 Dec 2022 08:56:29 +0000 (GMT) Message-ID: <2eeda662-9ae7-11b6-a9ab-60c267e682e0@linux.ibm.com> Date: Thu, 1 Dec 2022 16:56:27 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH V2] rs6000: Support to build constants by li/lis+oris/xoris Content-Language: en-US To: Segher Boessenkool Cc: "Kewen.Lin" , dje.gcc@gmail.com, linkw@gcc.gnu.org, gcc-patches@gcc.gnu.org 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> From: Jiufu Guo In-Reply-To: <20221128141822.GM25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: LtZaBnYDuV7mH3HGsZBh7VDYImTizkz3 X-Proofpoint-GUID: WYRMs_rZJdgsk0eaECtI9jmv9654Gy3_ Content-Transfer-Encoding: 8bit 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-12-01_04,2022-11-30_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 malwarescore=0 clxscore=1015 impostorscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212010057 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,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, 在 11/28/22 10:18 PM, Segher Boessenkool 写道: > 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. > I just send out two patches, one for "lis; xoris" and one for "li; x?oris". https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607617.html https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607618.html Maybe, do we prefer to separate into 3 patches for review easily :-)? Thanks for review! BR, Jeff (Jiufu) >> 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. > > > Segher