From patchwork Wed Oct 25 02:00:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiufu Guo X-Patchwork-Id: 157786 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2315191vqx; Tue, 24 Oct 2023 19:00:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyeZ2cJsSN+ittZJOXOFmdk27iDR8cUywRwmYys/SoOSuxI+JEX8PqJOz45L3pO6QE5j1z X-Received: by 2002:a05:6214:1c09:b0:663:95d0:a50b with SMTP id u9-20020a0562141c0900b0066395d0a50bmr18150501qvc.30.1698199251731; Tue, 24 Oct 2023 19:00:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698199251; cv=pass; d=google.com; s=arc-20160816; b=mS08nAcHteBvvMnylZGmroBon7L3WhWpDPqZZXe4PY4MLAAKRRxwKepIvR274mIYLf emMoQCDOXW9pYb96XjevcHiIkmh68qBXGmwjjmR2B+dhVMQ6LgQgS/9OK0uas+QTI1cA eSF+GvxZe01AFQAhdv1F0MQ+6Jjx4XJpNMpqOELjxPmyLJ5B8NcUF/wrqGbUBKm2SdRV g3bVm/QGXJRz/be5yCz4KNBqO7NRel2bSMnZv6JALEnkJwnIg+/sjOMwDDscu5OIIlOK 6vujk1PAKCyYHBDEgDeGiZ2w9mq8rjAyzHqYlWI2z//4x3i4wD7ulA0tyLR/aCDIUfJf QmnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=1bvybwQ756Wm0TuJRJVN22yG+VH49gejxK1ucan7U+s=; fh=AJ+XyiCK9C45D31PcueuCqgpHIDRP2j25uBOQsJKm1w=; b=Ua3x/OTEGyGRzZ9dJA/WmNEnSbSS6JZfivAPat84pSEl0ved9XQhkCiYNjJnbl82ex SAw/3ZMaoTJ+VmR2Kf80m/WLwVBmcmSTanHSIjJ2G3/Mvm9pYKFig2V+9P//2OKHxCU9 sJKFj4eJurDRKQ8cRzrhnC2rOqQq04jb+9ke3SxBI2Xhjh16FKDcENvFmplLOxK5VQ08 /QR8YYsyaXKbzD83+nlGdBRkMaFeWGHx69efcX3XVwdexWsf9RIGfzdZUw2dgH/ksXBi 56FpIuLpGsGRc/zNZUh1m8pXRPEB72Sd/u2f6Tm6MVVPpZj0pplLTsc0y2iDfF4lBeSQ 1k9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=sir9iFBp; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id oh8-20020a056214438800b0066d1385b824si8226529qvb.544.2023.10.24.19.00.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 19:00:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=sir9iFBp; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F650385841B for ; Wed, 25 Oct 2023 02:00:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 6DE7D3858CDB; Wed, 25 Oct 2023 02:00:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6DE7D3858CDB 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 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6DE7D3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698199219; cv=none; b=S29e1qTXyAxq7j5J45F/Z1b5aSspxk2bk+wKlrOJM/6//3Ja1Vsm3/a6YyrHw8Sr9n4Kvpw6aSxJsOJUQ/PU/Rws1voApAYcAM2UqGoVsaLb/vx84bfbEVV5hqqMo1xvvZwDr/XoIuuxCDPJgFzQUWA+Wbe88X/EO8vdnZde6+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698199219; c=relaxed/simple; bh=3aaqQYJmxxAuOolvQ9WLowT8pkKbHPjfGtZtIiuZvs0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=g4T6pr+EIAM9rSKj0lwvcRqECYSPJgXNu9Y8pTdaMlD8P4bnLwPAVKQL5oB6KuJL76J05G7/bDyZ2HoLON/zCB5sHzwhOMazQWguTSvnEzGC490+K35UPYidiI6CoWAZ8pa0/wOiR4hhOnQF4JMgMMYtmun3P0E5CKqMez327mA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39P1qZLQ010063; Wed, 25 Oct 2023 02:00:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=1bvybwQ756Wm0TuJRJVN22yG+VH49gejxK1ucan7U+s=; b=sir9iFBpuHi64TVIcAweSWRfPPLgnRokgVS3fpm5QS12e+FujzNyar8q4+tiydwTthc6 Sy3QwJ5c+5utTh7yK1BSUnyr0belkKSjEJYT+2cuU6zanVMzAxL0Xq7JsEDGy4qdY8B4 D5wLDmun62J+EDCPxL7bfVCCsXKI0gWSCWCbakVVxbvZaBVOA5KRZNQ7E7EmhgxkqGR+ qGtkkxQiwLK5FseXS8PNO8VI16NMRWElqUUfZhmFAwBHGNCcJzVjTWfFzV6pO0BgWsbR 9z/XkNj/0yc7g3PEKzZiuI2Vv6Mm12xKcKgTdTUtLTMWHRblY/kwGev4WzFTYy8sIrpR Uw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3txsr105s9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 02:00:16 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39P1rwis015335; Wed, 25 Oct 2023 02:00:15 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3txsr105rj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 02:00:15 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39P04C7p012363; Wed, 25 Oct 2023 02:00:15 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tvup1u1kt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 02:00:14 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39P20C4Z16777864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Oct 2023 02:00:12 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AA372004E; Wed, 25 Oct 2023 02:00:12 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C848E20040; Wed, 25 Oct 2023 02:00:10 +0000 (GMT) Received: from genoa.aus.stglabs.ibm.com (unknown [9.40.192.157]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 25 Oct 2023 02:00:10 +0000 (GMT) From: Jiufu Guo To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org, dje.gcc@gmail.com, linkw@gcc.gnu.org, bergner@linux.ibm.com, guojiufu@linux.ibm.com Subject: [PATCH 2/3]rs6000: using 'pli' to load 34bit-constant Date: Wed, 25 Oct 2023 10:00:07 +0800 Message-Id: <20231025020008.2256911-2-guojiufu@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231025020008.2256911-1-guojiufu@linux.ibm.com> References: <20231025020008.2256911-1-guojiufu@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: uBHem7olCm06xwskwvdWDllkddX0B1jw X-Proofpoint-GUID: 5Plo1P1_zcOXyLs6j8As3cH4Dmnn6kBt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-25_01,2023-10-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 phishscore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310250015 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780690978597341890 X-GMAIL-MSGID: 1780690978597341890 Hi, For constants with 16bit values, 'li or lis' can be used to generate the value. For 34bit constant, 'pli' is ok to generate the value. Bootstrap®test pass on ppc64{,le}. Is this ok for trunk? BR, Jeff (Jiufu Guo) gcc/ChangeLog: * config/rs6000/rs6000.cc (rs6000_emit_set_long_const): Add code to use pli for 34bit constant. --- gcc/config/rs6000/rs6000.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index b23ff3d7917..4690384cdbe 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -10530,7 +10530,11 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c) ud3 = (c >> 32) & 0xffff; ud4 = (c >> 48) & 0xffff; - if ((ud4 == 0xffff && ud3 == 0xffff && ud2 == 0xffff && (ud1 & 0x8000)) + if (TARGET_PREFIXED && SIGNED_INTEGER_34BIT_P (c)) + { + emit_move_insn (dest, GEN_INT (c)); + } + else if ((ud4 == 0xffff && ud3 == 0xffff && ud2 == 0xffff && (ud1 & 0x8000)) || (ud4 == 0 && ud3 == 0 && ud2 == 0 && ! (ud1 & 0x8000))) emit_move_insn (dest, GEN_INT (sext_hwi (ud1, 16)));