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: 65291 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 91D013858CDB for ; Tue, 21 Feb 2023 03:16:34 +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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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.