From patchwork Tue Feb 21 03:16:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Liu X-Patchwork-Id: 59737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1645773wrn; Mon, 20 Feb 2023 19:16:48 -0800 (PST) X-Google-Smtp-Source: AK7set+LqvIqH1wNlXHqeEWi9xlBipXbC7iP+dbis6Bcl9u/CczKgaGGthSufHSveWQ8JhOZVJKL X-Received: by 2002:a17:907:76f3:b0:878:50f7:a35a with SMTP id kg19-20020a17090776f300b0087850f7a35amr11015237ejc.72.1676949408211; Mon, 20 Feb 2023 19:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676949408; cv=none; d=google.com; s=arc-20160816; b=tYH/yAwYoT9Wcz6pmCH6sGrUlUYxnQ3gvI1y4MLFvnE2qS5Bgi+6el524DBxMT3Gqo QL540//QnpUQBYIZ6msgZFvkbsoe48mOAFmNOLVqrpl7lJLJRw/XF3g14sM25+Kc5wr0 kuQTJix/GMgWz+vtvWI5FKsX8CIhXDfuUhCe4VdrqTvgaxFyl4AAjlRRmRRlZsEppAWA muKl3mvnSDAVBwUhwg9M/zd0F+WUVol5djXbIlQAQqlBLm/uIS3wfL1oSgce5J9GkrAW wYqPmaedDrP4kWcF7Lta1ivGqzObz8FLhI5PoG68IqviclKAVKA9EcVz1oCmVydcA+7y HAJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding:from :cc:mime-version:date:to:message-id:subject:dkim-signature :dmarc-filter:delivered-to; bh=6EkOFpyfWofkOUX/Dk5XsCFK8PbGLV8LLgtLgHEbdrQ=; b=RQcaxWK0pUYKpU8ZJutbT1b80wWqqe7hmvYZT/JqXzPMw7EGrDl8tq2dMl9z4Amvz6 4O7HCiec69tHrtQUWwInZjSF/OreH3NT3oZ/n6w9IrIhB4z2W7tnzoNY0HPNGPWS9+Kj XqnHTb8AzHyA6SmFHA7KNq0vR+6yX43rHHSSX5m+gbHx4kNb7G3A9cTnEGwiN7dcrHzV txnA0pcD8U1NL0BoZ8vHRDo2bI61BmwRdRZCE6RKN2h20o27V7kqtgWkLDB0o3iUXXsL 1dLCJJ54TGehdwgEsguRxAVpDkhcYSt6b3Nz0y1bSJJ1pdjXDJCCz1JncqueNh4W2NC4 gg8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@oss-cipunited-com.20200927.dkim.feishu.cn header.s=s1 header.b=PoZJlAR0; 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" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id uk41-20020a170907ca2900b008b13a207b53si16025110ejc.759.2023.02.20.19.16.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 19:16:48 -0800 (PST) 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=neutral (body hash did not verify) header.i=@oss-cipunited-com.20200927.dkim.feishu.cn header.s=s1 header.b=PoZJlAR0; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E42B38582A1 for ; Tue, 21 Feb 2023 03:16:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from t03.bc.larksuite.com (t03.bc.larksuite.com [209.127.231.39]) by sourceware.org (Postfix) with UTF8SMTPS id B02033858D20 for ; Tue, 21 Feb 2023 03:16:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B02033858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oss.cipunited.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oss.cipunited.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=oss-cipunited-com.20200927.dkim.feishu.cn; t=1676949364; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=2kdJUnG/aFUJ0EO3Jis2zy6VEtXzUyL6/okYJh1wonI=; b=PoZJlAR0X7IGCYncJIhLMSnN7noZGaDClJ2P+2UdxE1Fyxnsg4iE1pM579PwdVA3fXx6dy +Gsy8Kelulh2ZWuRryKXTPg9yPjDCPO6zqj8jyydrVtIsKgr/Uf8LUA1yRS2746NUZpiGs s1/4KGUBLSQ5sJRL+31yccoA5sRu/arkjdxeHhcEq7Lc7O5S2qJATPh7HqMBb7od4aAhcb On27I5TMIGdvy4qrglUfwQ3cEvL27apIXVuh2OjStPkRlZorY7WNLOVlvUaXJN9KIt592j Uu0d1zA7LzHmbLJGK/WTUjzUSqkS+3+M74eCYHpTRKo1NslcJBGHT55LUdCTrQ== Subject: [PATCH] MIPS: Account for LWL/LWR in store_by_pieces_p. Message-Id: <20230221031524.220339-1-xin.liu@oss.cipunited.com> To: Date: Tue, 21 Feb 2023 11:16:04 +0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.30.2 Cc: "Matthew Fortune" From: "Xin Liu" X-Lms-Return-Path: X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, HTML_MESSAGE, HTML_NONELEMENT_30_40, 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-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 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 Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758408902571520129?= X-GMAIL-MSGID: =?utf-8?q?1758408902571520129?= From: Matthew Fortune --- gcc/config/mips/mips.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc index 590c311e98c..bb9f4e19c22 100644 --- a/gcc/config/mips/mips.cc +++ b/gcc/config/mips/mips.cc @@ -8853,7 +8853,7 @@ mips_store_by_pieces_p (unsigned HOST_WIDE_INT size, unsigned int align) LW/SWL/SWR sequence. This is often better than the 4 LIs and 4 SBs that we would generate when storing by pieces. */ if (align <= BITS_PER_UNIT) - return size < 4; + return size < 4 || !ISA_HAS_LWL_LWR; /* If the data is 2-byte aligned, then: @@ -8888,7 +8888,9 @@ mips_store_by_pieces_p (unsigned HOST_WIDE_INT size, unsigned int align) (c4) A block move of 8 bytes can use two LW/SW sequences or a single LD/SD sequence, and in these cases we've traditionally preferred the memory copy over the more bulky constant moves. */ - return size < 8; + return (size < 8 + || (align < 4 * BITS_PER_UNIT + && !ISA_HAS_LWL_LWR)); } /* Emit straight-line code to move LENGTH bytes from SRC to DEST.