From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id AFE8F38493C6; Mon, 20 Feb 2023 09:49:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFE8F38493C6 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=linux.ibm.com Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTxzX-0007vq-Gk; Sun, 19 Feb 2023 23:41:33 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31K4RaCx025942; Mon, 20 Feb 2023 04:41:27 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 : content-type : mime-version; s=pp1; bh=2UqSZTqpPnq6LZOS+5QPPHfT/wnhXIdfNoZ/M89PIbU=; b=bka1o0mawShB1id3mMuGzpXWPExPy3VqJm/GylU0iMawYotjdGlG+WKyzeCqkg+PoMGu qy/xABoDRvgiL0mCt9RmAa/OyTdZVrh+XuhzZ5naf5Wl/SkANMhj4jOpPa7MnWe/ExJZ TAuxGlXmgi+9jMi3WSoJTf8guMcJhhJZCrlANjystDlJkPK90BFXQi2CgdRKQneveH71 s+C3qtY6BejNnWJHkXvbMn0yU0GMRU+gY1nuXnRXJLlmj0tlgZ1cC9bTqUP/hRwsLbOe uYIUd/VQiPTUFzBzy2aMqKOjp6/MPS59Vgnt+eq2YnDdULoZur74lDbnT8gyUK4BhrJa fQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nv1uk85tp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Feb 2023 04:41:27 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 31K4cMYg025307; Mon, 20 Feb 2023 04:41:26 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nv1uk85tg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Feb 2023 04:41:26 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31K1tdFW013024; Mon, 20 Feb 2023 04:41:26 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([9.208.129.116]) by ppma03wdc.us.ibm.com (PPS) with ESMTPS id 3ntpa6k617-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Feb 2023 04:41:26 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31K4fPIk5702196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Feb 2023 04:41:25 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1FDA58058; Mon, 20 Feb 2023 04:41:24 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9533E5805D; Mon, 20 Feb 2023 04:41:24 +0000 (GMT) Received: from ltcden2-lp1.aus.stglabs.ibm.com (unknown [9.3.90.43]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Mon, 20 Feb 2023 04:41:24 +0000 (GMT) From: Jiufu Guo To: Jiufu Guo via Gcc-patches Cc: segher@kernel.crashing.org, dje.gcc@gmail.com, linkw@gcc.gnu.org Subject: Ping^^ [PATCH V4 2/2] rs6000: use li;x?oris to build constant References: <20221212013829.111739-1-guojiufu@linux.ibm.com> <20221212013829.111739-2-guojiufu@linux.ibm.com> <7ezgayde2f.fsf@pike.rch.stglabs.ibm.com> Date: Mon, 20 Feb 2023 12:41:20 +0800 In-Reply-To: <7ezgayde2f.fsf@pike.rch.stglabs.ibm.com> (Jiufu Guo via Gcc-patches's message of "Wed, 04 Jan 2023 14:11:20 +0800") Message-ID: <7n4jrhj6dr.fsf_-_@ltcden2-lp1.aus.stglabs.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-GUID: KV9FY5ouHsY7kXIerni1cIvB6D1Q92sm X-Proofpoint-ORIG-GUID: 2C8jVCAtMrEyAftd4TFpNpMLhCbA_Ka4 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.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-20_02,2023-02-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302200041 Received-SPF: pass client-ip=148.163.158.5; envelope-from=guojiufu@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_EF=-0.1,RCVD_IN_MSPIKE_H2=-0.001,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_PASS,SPF_SOFTFAIL,TXREP autolearn=unavailable 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, Gentle ping: https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608292.html BR, Jeff (Jiufu) Jiufu Guo via Gcc-patches writes: > Hi, > > I would like to have a ping on this patch: > https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608292.html > > > BR, > Jeff (Jiufu) > > > Jiufu Guo writes: > >> Hi, >> >> For constant C: >> If '(c & 0xFFFFFFFF0000FFFFULL) == 0xFFFFFFFF00000000' or say: >> 32(1) || 1(0) || 15(x) || 16(0), we could use "lis; xoris" to build. >> >> Here N(M) means N continuous bit M, x for M means it is ok for either >> 1 or 0; '||' means concatenation. >> >> This patch update rs6000_emit_set_long_const to support those constants. >> >> Compare with previous version: >> https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607618.htm >> This patch fix conflicts with trunk. >> >> Bootstrap and regtest pass on ppc64{,le}. >> >> Is this ok for trunk? >> >> BR, >> Jeff (Jiufu) >> >> >> PR target/106708 >> >> gcc/ChangeLog: >> >> * config/rs6000/rs6000.cc (rs6000_emit_set_long_const): Add to build >> constants through "lis; xoris". >> >> gcc/testsuite/ChangeLog: >> >> * gcc.target/powerpc/pr106708.c: Add test function. >> >> --- >> gcc/config/rs6000/rs6000.cc | 7 +++++++ >> gcc/testsuite/gcc.target/powerpc/pr106708.c | 10 +++++++++- >> 2 files changed, 16 insertions(+), 1 deletion(-) >> >> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc >> index 8c1192a10c8..1138d5e8cd4 100644 >> --- a/gcc/config/rs6000/rs6000.cc >> +++ b/gcc/config/rs6000/rs6000.cc >> @@ -10251,6 +10251,13 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c) >> if (ud1 != 0) >> emit_move_insn (dest, gen_rtx_IOR (DImode, temp, GEN_INT (ud1))); >> } >> + else if (ud4 == 0xffff && ud3 == 0xffff && !(ud2 & 0x8000) && ud1 == 0) >> + { >> + /* lis; xoris */ >> + temp = !can_create_pseudo_p () ? dest : gen_reg_rtx (DImode); >> + emit_move_insn (temp, GEN_INT (sext_hwi ((ud2 | 0x8000) << 16, 32))); >> + emit_move_insn (dest, gen_rtx_XOR (DImode, temp, GEN_INT (0x80000000))); >> + } >> else if (ud4 == 0xffff && ud3 == 0xffff && (ud1 & 0x8000)) >> { >> /* li; xoris */ >> diff --git a/gcc/testsuite/gcc.target/powerpc/pr106708.c b/gcc/testsuite/gcc.target/powerpc/pr106708.c >> index dc9ceda8367..a015c71e630 100644 >> --- a/gcc/testsuite/gcc.target/powerpc/pr106708.c >> +++ b/gcc/testsuite/gcc.target/powerpc/pr106708.c >> @@ -4,7 +4,7 @@ >> /* { dg-require-effective-target has_arch_ppc64 } */ >> >> long long arr[] >> - = {0xffffffff7cdeab55LL, 0x98765432LL, 0xabcd0000LL}; >> += {0xffffffff7cdeab55LL, 0x98765432LL, 0xabcd0000LL, 0xffffffff65430000LL}; >> >> void __attribute__ ((__noipa__)) lixoris (long long *arg) >> { >> @@ -27,6 +27,13 @@ void __attribute__ ((__noipa__)) lisrldicl (long long *arg) >> /* { dg-final { scan-assembler-times {\mlis .*,0xabcd\M} 1 } } */ >> /* { dg-final { scan-assembler-times {\mrldicl .*,0,32\M} 1 } } */ >> >> +void __attribute__ ((__noipa__)) lisxoris (long long *arg) >> +{ >> + *arg = 0xffffffff65430000LL; >> +} >> +/* { dg-final { scan-assembler-times {\mlis .*,0xe543\M} 1 } } */ >> +/* { dg-final { scan-assembler-times {\mxoris .*0x8000\M} 1 } } */ >> + >> int >> main () >> { >> @@ -35,6 +42,7 @@ main () >> lixoris (a); >> lioris (a + 1); >> lisrldicl (a + 2); >> + lisxoris (a + 3); >> if (__builtin_memcmp (a, arr, sizeof (arr)) != 0) >> __builtin_abort (); >> return 0;