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 D5DFA3858D28; Wed, 7 Sep 2022 02:58:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D5DFA3858D28 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 (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2871frOR031479; Wed, 7 Sep 2022 02:58:15 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 : mime-version : content-type; s=pp1; bh=48MzIJH7r+7sS0GjPAcjke3cmGYpNx4Xsy8Ox14iTkg=; b=LqB2WQR1u1EhGNwbnRIYhqWaFc1JsT9CNygJIwuBOLYrkE134+NOMdi/nFlL7mO6UYTX OlTRP71py+NrroxFnvuq6cT0pz3jCJPewXRaSRVkeAHk8Fvi8h9OTKsm7DCkPtjb/E95 YXFXpx008vqAP4r1NgLG0IuVIZPHo6i0qWqtR1CVDYgN0F507YYr7wuWwNuP4kjtNoJC RMs0gJDliq+3KxT5ajiCDe9Q1ONleU17ZMat+AugkdZmytxEZpUa1NQ1HuEsnJMDitFm HIFJTBOzY5J5O0uNeRdtxFt3Td/rygKhkLxDhbWH+sry9b2AXYz1L3YWflP93egi1q5X bA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jehv0hc0v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Sep 2022 02:58:15 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2871kMNR014493; Wed, 7 Sep 2022 02:58:15 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jehv0hc0f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Sep 2022 02:58:14 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2872pwYK011583; Wed, 7 Sep 2022 02:58:13 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma03wdc.us.ibm.com with ESMTP id 3jbxj9fatw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Sep 2022 02:58:13 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2872wDCD16515670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Sep 2022 02:58:13 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4035A112062; Wed, 7 Sep 2022 02:58:13 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EDCB9112061; Wed, 7 Sep 2022 02:58:12 +0000 (GMT) Received: from pike (unknown [9.5.12.127]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTPS; Wed, 7 Sep 2022 02:58:12 +0000 (GMT) From: Jiufu Guo To: "Kewen.Lin" Cc: dje.gcc@gmail.com, segher@kernel.crashing.org, linkw@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Using pli(paddi) and rotate to build 64bit constants References: <20220906122756.76006-1-guojiufu@linux.ibm.com> <6a92a4d3-a89a-a644-c024-b33f12144e04@linux.ibm.com> Date: Wed, 07 Sep 2022 10:58:11 +0800 In-Reply-To: <6a92a4d3-a89a-a644-c024-b33f12144e04@linux.ibm.com> (Kewen Lin's message of "Wed, 7 Sep 2022 09:26:42 +0800") Message-ID: <7eleqvubzw.fsf@pike.rch.stglabs.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: wux9xPgxSeTkvJXOl7eYnM8cJHyj0h6C X-Proofpoint-GUID: XG1RHzchARZ5uc-sqbaYVAJYO4mJilhM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-06_11,2022-09-06_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 spamscore=0 impostorscore=0 malwarescore=0 mlxlogscore=849 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209070009 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,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: "Kewen.Lin" writes: > Hi! > >> + >> + /* Use paddi for the low 32 bits. */ >> + if (ud2 != 0 && ud1 != 0 && can_use_paddi) >> + emit_move_insn (dest, gen_rtx_PLUS (DImode, dest, >> + GEN_INT ((ud2 << 16) | ud1))); >> + >> + /* Use oris, ori for low 32 bits. */ >> + if (ud2 != 0 && (ud1 == 0 || !can_use_paddi)) >> + emit_move_insn (ud1 != 0 ? dest : dest, > > Nit: "ud1 != 0 ? dest : dest" => dest Thanks! Yes, only 'dest' is ok. > >> + gen_rtx_IOR (DImode, dest, GEN_INT (ud2 << 16))); >> + if (ud1 != 0 && (ud2 == 0 || !can_use_paddi)) >> + emit_move_insn (dest, gen_rtx_IOR (DImode, dest, GEN_INT (ud1))); >> + } >> + } >> else >> { >> temp = !can_create_pseudo_p () ? dest : gen_reg_rtx (DImode); >> diff --git a/gcc/testsuite/gcc.target/powerpc/pr106550.c b/gcc/testsuite/gcc.target/powerpc/pr106550.c >> new file mode 100644 >> index 00000000000..d023fac4676 >> --- /dev/null >> +++ b/gcc/testsuite/gcc.target/powerpc/pr106550.c >> @@ -0,0 +1,14 @@ >> +/* PR target/106550 */ >> +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ >> +/* { dg-require-effective-target power10_ok } */ >> + >> +void >> +foo (unsigned long long *a) >> +{ >> + *a++ = 0x020805006106003; /* pli+pli+rldimi */ >> + *a++ = 0x2351847027482577;/* pli+pli+rldimi */ >> +} >> + >> +/* { dg-final { scan-assembler-times {\mpli\M} 4 } } */ >> +/* { dg-final { scan-assembler-times {\mrldimi\M} 2 } } */ >> + >> diff --git a/gcc/testsuite/gcc.target/powerpc/pr106550_1.c b/gcc/testsuite/gcc.target/powerpc/pr106550_1.c >> new file mode 100644 >> index 00000000000..48f76ca3da9 >> --- /dev/null >> +++ b/gcc/testsuite/gcc.target/powerpc/pr106550_1.c >> @@ -0,0 +1,22 @@ >> +/* PR target/106550 */ >> +/* { dg-require-effective-target power10_ok } */ >> +/* { dg-options "-O2 -mdejagnu-cpu=power10 -fdisable-rtl-split1" } */ >> +/* force the constant splitter run after RA: -fdisable-rtl-split1. */ >> + >> +void >> +foo (unsigned long long *a) >> +{ >> + /* Test oris/ori is used where paddi does not work with 'r0'. */ >> + register long long d asm("r0") = 0x1245abcef9240dec; /* pli+sldi+oris+ori */ >> + long long n; >> + asm("cntlzd %0, %1" : "=r"(n) : "r"(d)); >> + *a++ = n; >> + >> + *a++ = 0x235a8470a7480000ULL; /* pli+sldi+oris*/ >> + *a++ = 0x23a184700000b677ULL; /* pli+sldi+ori*/ > > Nit: I guess you want one space at the separated end of these two comment lines > since the comment lines at the other places have. :) Yeap, thanks for your careful review! BR, Jeff(Jiufu) > > BR, > Kewen