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 137A33858C54; Fri, 2 Sep 2022 15:29:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 137A33858C54 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.5/8.17.1.5) with ESMTP id 282EfiPw028175; Fri, 2 Sep 2022 15:29:41 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=8mlfrAntBRmPB7yS+xP7KKaFNWbDs2DJY6Jh8Seld4U=; b=SL8cqBF5QiNdm/oPYDgWrBr/u0HSK5XKVg50rlvNT4jA2G4w1oms7KKEQwvdCRGq5Gzr PJhNbhbogD4ODh78SntPI0dHRiH3njcZuGSB80EsBsrMIUWTcoEbwTc2+EfYysnxu+p6 rx/nhAVm62VFh6HwlgUXnBF9DVEmqkCQhOPpCg0qXl27y/HV3HLqXb3axi/iJumRwKUj Z6qy0K89DVK3TOO9xAEiXlSuWAfvag8Xr79zfZTkk2oURXlHQHGQsQ0CbNK92+++vKz/ W9c/qD+wmlH8bmwZoFkguyVmxjwHFjqdNVsZgPVdWVApjGCSmxGOUUOvE+rEcPyRgxqv +A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jbktn9gdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Sep 2022 15:29:40 +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 282FLBFm013704; Fri, 2 Sep 2022 15:29:40 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jbktn9gcv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Sep 2022 15:29:39 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 282FKJiD008136; Fri, 2 Sep 2022 15:29:38 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma03dal.us.ibm.com with ESMTP id 3j7awbjwy0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Sep 2022 15:29:38 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 282FTbhv60621134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 Sep 2022 15:29:37 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 364F56E053; Fri, 2 Sep 2022 15:29:37 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AF186E050; Fri, 2 Sep 2022 15:29:36 +0000 (GMT) Received: from [9.160.4.32] (unknown [9.160.4.32]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 2 Sep 2022 15:29:36 +0000 (GMT) Message-ID: Date: Fri, 2 Sep 2022 10:29:35 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 1/2] Using pli(paddi) and rotate to build 64bit constants Content-Language: en-US To: Segher Boessenkool , Jiufu Guo Cc: meissner@linux.ibm.com, gcc-patches@gcc.gnu.org, linkw@gcc.gnu.org, dje.gcc@gmail.com References: <20220901032400.23692-1-guojiufu@linux.ibm.com> <20220901215233.GJ25951@gate.crashing.org> From: Peter Bergner In-Reply-To: <20220901215233.GJ25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ZQl-fHX-Db976kv8MyML9gIsXR9EoIYn X-Proofpoint-GUID: 0WR3O7z5_CL6v6cArtEf1iOZxU3rcUng X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-02_02,2022-08-31_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 phishscore=0 mlxlogscore=983 impostorscore=0 suspectscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209020073 X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,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: On 9/1/22 4:52 PM, Segher Boessenkool wrote: > On Thu, Sep 01, 2022 at 11:24:00AM +0800, Jiufu Guo wrote: >> As mentioned in PR106550, since pli could support 34bits immediate, we could >> use less instructions(3insn would be ok) to build 64bits constant with pli. > >> For example, for constant 0x020805006106003, we could generate it with: >> asm code1: >> pli 9,101736451 (0x6106003) >> sldi 9,9,32 >> paddi 9,9, 2130000 (0x0208050) > > 3 insns, 2 insns dependent on the previous, each. > >> or asm code2: >> pli 10, 2130000 >> pli 9, 101736451 >> rldimi 9, 10, 32, 0 > > 3 insns, 1 insn dependent on both others. Yeah, the improvement here is the fewer dependent instructions, since 2 64-bit + 1 32-bit instructions is the same size as 5 32-bit insns. Those 5 32-bit insns are all dependent on the previous insn, so not ideal. It's too bad we don't have a paddis or poris insns where we could specify in the prefix a shift of 32-bits rather than the normal 16-bits. If we had those, we could generate the constant with just 2 64-bit insns. Peter