From patchwork Tue Feb 13 03:21:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andrew Pinski (QUIC)" X-Patchwork-Id: 200197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp303858dyb; Mon, 12 Feb 2024 19:22:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWvgDvDFs2dB6OzQvNgK47Mf3tu3hwDKtovDCp341ybYeHiKz6/pxG7SP8sUAmbGjziNb3k/rXLF6gvarhKe8jqYgN8Lg== X-Google-Smtp-Source: AGHT+IGNiHhA7t/7Nl+B5IRNk0fKG7Wd83TTex8+t+2QQs9WvwvMyPgsMpK6fy6a6L+guhMMgkHb X-Received: by 2002:a05:6808:398d:b0:3be:b787:e461 with SMTP id gq13-20020a056808398d00b003beb787e461mr14358588oib.43.1707794556557; Mon, 12 Feb 2024 19:22:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707794556; cv=pass; d=google.com; s=arc-20160816; b=zvm6HWrgidDeYC9ZxO8kI3Dj56NZwvgaSLoc0AARPhZtDj+9iN69heKva5nRXt4Q+i TudqQUtb3DBSfhLElJ4JoV4wo+GHFwSIDpZrRp4Nicgfz/m2Ujwb3OwhPWxQYoUkedhA h5leiDaTTW5s4ITlh2Os/fnwzv7w5/DfGZ/LlHoQ2NFyptWCowD4lJugou4+LbRa7D2m rqStwACqqlSv+5uXF8T3yZvTSeN8BZaJ76iRcvcPIG8mBZUzEMEv2bgNmVn41RfX8N7N q92ycvyUEtmntBCykDSdjxVQZBWyC1+bOgzILZZseDRa2PiIBSwsE32oyg2LUVBfaoYJ EOGw== 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:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=51bd6CaN2H6jGrYhdCrq7SbyYWG5D9pFa1U+AxTEWO0=; fh=hAyG5v9sSCnzI09hnZhTiZ+FNsQC+em9vwKfJk9HjXM=; b=FF2AC6Fo2NtwJthVPvLqRC1KOTm/XPvpOnghthqIOYv1ZFTIqAzCn35vSfLR3tIAqO +93J123BfgimDRINFoW8i/jZpGhHVdn3Pkvso/sqJ2Hqv/TvK6zAdR7Md+lYq/kgmIv1 mJhp+c3Z3WpNaZarGknx1t8Jem00pvtCs/b+K58GCDfdZuYmDQQnBiYFpCAY0SC1TFek yQLRuw5XI1+CRw44yRN8Wq83Og8FIWOmJuFlOaXGOJ29cnKWP1WLMG4JbXeGelAl4zzM InnNUIBpF5+ilCRAuCpx0gnrPE7sFSGNBrB0QmNMFdKPfoI87RMLYsk+3lOR+sPJ+uyZ 9/rQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=opLJ8gH9; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCU3rbZpBd3DO43VqDheRnSTpA213f1Bdme0GMYBwKwMiot8CMkZxKaCOLwd1Qy3YlqQKw6G/xgyxFMQsP8UNtW0jUeIzg== Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x5-20020ac85385000000b0042cee77dd50si1751496qtp.238.2024.02.12.19.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 19:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=opLJ8gH9; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 439843858C3A for ; Tue, 13 Feb 2024 03:22:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by sourceware.org (Postfix) with ESMTPS id BC4373858401 for ; Tue, 13 Feb 2024 03:21:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC4373858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=quicinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BC4373858401 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707794517; cv=none; b=b38BsAffPwX7v9sJjAiu2WdLH+dPJfyXGKmJjrJbqhU2dIKBaw3LiJAY3kHJJfKpWSWFetA0gOZI0Uf1xCN9PJ5i4/aNnaxNH9jcdKbJ8y+ztn02n6wMvMIqqelrpNbV17QmFP3BP4jnoANMtQseUxHjzZoW126iEU83XIAFds0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707794517; c=relaxed/simple; bh=BtndpGQaSU61AphVUD7MmqWbsbK75GEsjAo0Czebrh4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jEykPQZ1/XSQ6CaumHByoUIuEtYsl64zXOG4IYRDCzfAzhBKVXfwommr0fTaPbOogvv9QGxyWWNkwVIAlf/o8Qzb7HDk11LzJD92OyMrLFen8CqEwJDHtB3z10hTPKssccPw6a4jb0pC0l4r9VETrNTb962uWZ9BOhEyAwXuExE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41D3AU66012118 for ; Tue, 13 Feb 2024 03:21:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=51bd6Ca N2H6jGrYhdCrq7SbyYWG5D9pFa1U+AxTEWO0=; b=opLJ8gH9TUi4g2MLpa6YWNs kUn5p8iIqPawxmSmPbEVjaLlbxL6PscromfikDRmbqcf4ENmsj4fjcZYtQkA/vRR MCtcVDN6kQobmBS/Xy7U3psEZ3AYzy1LhrslKY+f3X3mqb4Vku/5Y3/7B5VpVd9L 4fZgx5wK2LldxDWupB/91498JYT1wtUa50FtB+lrjtI+jgKTcU7NDs9RoqOEJKMx 1LlnbYIVXGVyglYb9q2NPNXT25MnzoxT3RSOG/hUjU4Ju2Pu2CjFA58OsqAXvq/N y9aYpwy4Od36Dahmu3oCEb5hfl3aYVmp3pHtkr9e7lqz3yxJNFwCpFU6MLRRqeQ= = Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w7gse20sa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Feb 2024 03:21:54 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41D3Lrru010121 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 13 Feb 2024 03:21:53 GMT Received: from hu-apinski-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 12 Feb 2024 19:21:53 -0800 From: Andrew Pinski To: CC: Andrew Pinski Subject: [PATCH] aarch64: Use vec_perm_indices::new_shrunk_vector in aarch64_evpc_reencode Date: Mon, 12 Feb 2024 19:21:29 -0800 Message-ID: <20240213032129.3744441-1-quic_apinski@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: gDeB4CFATVcQKUyiGlNV458BgtDsSD9S X-Proofpoint-ORIG-GUID: gDeB4CFATVcQKUyiGlNV458BgtDsSD9S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-12_20,2024-02-12_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 clxscore=1015 phishscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402130023 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 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: 1790752384817331582 X-GMAIL-MSGID: 1790752384817331582 While working on PERM related stuff, I can across that aarch64_evpc_reencode was manually figuring out if we shrink the perm indices instead of using vec_perm_indices::new_shrunk_vector; shrunk was added after reencode was added. Built and tested for aarch64-linux-gnu with no regressions. gcc/ChangeLog: PR target/113822 * config/aarch64/aarch64.cc (aarch64_evpc_reencode): Use vec_perm_indices::new_shrunk_vector instead of manually going through the indices. Signed-off-by: Andrew Pinski --- gcc/config/aarch64/aarch64.cc | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 32eae49d4e9..f4ed8b86532 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -25431,7 +25431,6 @@ static bool aarch64_evpc_reencode (struct expand_vec_perm_d *d) { expand_vec_perm_d newd; - unsigned HOST_WIDE_INT nelt; if (d->vec_flags != VEC_ADVSIMD) return false; @@ -25446,24 +25445,10 @@ aarch64_evpc_reencode (struct expand_vec_perm_d *d) if (new_mode == word_mode) return false; - /* to_constant is safe since this routine is specific to Advanced SIMD - vectors. */ - nelt = d->perm.length ().to_constant (); - - vec_perm_builder newpermconst; - newpermconst.new_vector (nelt / 2, nelt / 2, 1); + vec_perm_indices newpermindices; - /* Convert the perm constant if we can. Require even, odd as the pairs. */ - for (unsigned int i = 0; i < nelt; i += 2) - { - poly_int64 elt0 = d->perm[i]; - poly_int64 elt1 = d->perm[i + 1]; - poly_int64 newelt; - if (!multiple_p (elt0, 2, &newelt) || maybe_ne (elt0 + 1, elt1)) - return false; - newpermconst.quick_push (newelt.to_constant ()); - } - newpermconst.finalize (); + if (!newpermindices.new_shrunk_vector (d->perm, 2)) + return false; newd.vmode = new_mode; newd.vec_flags = VEC_ADVSIMD; @@ -25475,7 +25460,8 @@ aarch64_evpc_reencode (struct expand_vec_perm_d *d) newd.testing_p = d->testing_p; newd.one_vector_p = d->one_vector_p; - newd.perm.new_vector (newpermconst, newd.one_vector_p ? 1 : 2, nelt / 2); + newd.perm.new_vector (newpermindices.encoding (), newd.one_vector_p ? 1 : 2, + newpermindices.nelts_per_input ()); return aarch64_expand_vec_perm_const_1 (&newd); }