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 7C8E43857838; Thu, 15 Jun 2023 09:10:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C8E43857838 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 (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35F8xiuI026547; Thu, 15 Jun 2023 09:10:08 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=IBYopnzKZuc9b9ih51PxRIZl+ypEhg6IJjYHTOMQ+OE=; b=bBFt7EgHpQKeyfyj6/7tLhyK7Q6u4Wd8dPEU3ZX+7Ww7bCvresInRvAKOnmFGKHc1oG7 CmbUpnSnCTO3fZSQGGtlqIeiHHPlXROkuiZpMeECidu5Hw1WLdmTpiTE51pP37AQqgq+ naGAbWNZdWciQQ+iBKLAuyicemlTdmra6YjzDb4b2LaRCfNaX3KixJUVpPc7aIi1dDgx IfChN3oZ3N/yBmdyWTZXfbmu6H3CdYp6URI/+6J8P8tpGyxfgZ0j9fXq6kpEfIxvYI8S R7jhAd+88iMjiX3RHFlNyHWe2DKHWEwERQpnMGWD0GIJ9ub4CmxnLjHZZ4NiekeJni8c xQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3r7ymf8gxk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jun 2023 09:10:06 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35F90DEa028275; Thu, 15 Jun 2023 09:10:02 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3r7ymf8gqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jun 2023 09:10:02 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35F5cZUa010724; Thu, 15 Jun 2023 09:09:57 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([9.208.130.98]) by ppma04wdc.us.ibm.com (PPS) with ESMTPS id 3r4gt5t35r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jun 2023 09:09:57 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35F99ufC1311442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Jun 2023 09:09:56 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE6455805A; Thu, 15 Jun 2023 09:09:56 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7BD4058051; Thu, 15 Jun 2023 09:09:56 +0000 (GMT) Received: from ltc.linux.ibm.com (unknown [9.5.196.140]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 15 Jun 2023 09:09:56 +0000 (GMT) MIME-Version: 1.0 Date: Thu, 15 Jun 2023 17:09:56 +0800 From: guojiufu To: Jiufu Guo Cc: David Edelsohn , gcc-patches@gcc.gnu.org, segher@kernel.crashing.org, linkw@gcc.gnu.org, bergner@linux.ibm.com Subject: Re: [PATCH 4/4] rs6000: build constant via li/lis;rldic In-Reply-To: <7nsfavbu0g.fsf@ltcden2-lp1.aus.stglabs.ibm.com> References: <20230608015547.3432691-1-guojiufu@linux.ibm.com> <20230608015547.3432691-5-guojiufu@linux.ibm.com> <7nsfavbu0g.fsf@ltcden2-lp1.aus.stglabs.ibm.com> Message-ID: <71d7c67cf4a888573fc4096d78b693e5@linux.ibm.com> X-Sender: guojiufu@linux.ibm.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 0fNJMsTrGz2E808cXDyXT78QsLvI9Gxz X-Proofpoint-ORIG-GUID: EVY8ocLIBVJEtqVdhT6v-yOq5KNn7dHj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-15_06,2023-06-14_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306150077 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,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 2023-06-13 17:18, Jiufu Guo via Gcc-patches wrote: > Hi David, > > Thanks for your valuable comments! > > David Edelsohn writes: >> ... >> Do you have any measurement of how expensive it is to test all of >> these additional methods to generate a constant? How much does this >> affect the >> compile time? > > Yeap, Thanks for this very good question! > This patch is mostly using bitwise operations and if-conditions, > it would be expected not expensive. > > Testcases were checked. For example: > A case with ~1000 constants: most of them hit this feature. > With this feature, the compiling time is slightly faster. > > 0m1.985s(without patch) vs. 0m1.874s(with patch) > (note:D rs6000_emit_set_long_const does not occur in hot perf > functions. So, the tricky time saving would not directly cause > by this feature.) > > A case with ~1000 constants:(most are not hit by this feature) > 0m2.493s(without patch) vs. 0m2.558s(with patch). Typo, this should be: 0m2.493s(with patch) vs. 0m2.558s(without patch). It is also faster with the patch :) BR, Jeff (Jiufu Guo) > > For runtime, actually, with the patch, it seems there is no visible > improvement in SPEC2017. While I still feel this patch is > doing the right thing: use fewer instructions to build the constant. > > BR, > Jeff (Jiufu Guo) > >> >> Thanks, David >>