From patchwork Tue Jun 25 20:22:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Sawdey X-Patchwork-Id: 1122258 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-503720-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jwqCnt87"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45YHnK5n35z9s3l for ; Wed, 26 Jun 2019 06:29:09 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; q=dns; s=default; b=CfX/A/Xrekus0xAJK18 kNm4e9EkB0scD7zcb3KrihzrsBqpcK8IGR1PnMmFSyQBTfeGu9D2m/2xGJc2HQMP 9LJbXkICQ7DMEPi+j9TRNahlwmA4aeCySqHckZJ+SQwaB15ZBUTTS8Ji+45Ldw38 rIEDhGqB84lrO5YUxD863iLI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; s=default; bh=vqFZ11oQvlP68V1IEu/bYaSOm aQ=; b=jwqCnt87H+1SFfx8WIHYntq4Ej4dkMoDEiZmBjSNla0a5DLfRAfkPpKWA QUB1LNYiPnlAmfI+uhGn/5K9terHM0FgeNmbUMTcqrr93rMwoKYydAjCrvT4akYU ucRXMr+0gD/hQ6M+5udrBIKgzhnDxMOCVael7tWfHVE76B5rlU= Received: (qmail 57680 invoked by alias); 25 Jun 2019 20:28:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 57593 invoked by uid 89); 25 Jun 2019 20:28:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Jun 2019 20:28:55 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5PKQioT096734; Tue, 25 Jun 2019 16:28:54 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tbrtj4g40-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2019 16:28:53 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x5PKR2QF099561; Tue, 25 Jun 2019 16:28:53 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tbrtj4g3s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2019 16:28:53 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x5PKEexs029263; Tue, 25 Jun 2019 20:23:52 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01dal.us.ibm.com with ESMTP id 2t9by72gt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jun 2019 20:23:52 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5PKNpOE33030648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2019 20:23:51 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8BE6E28086; Tue, 25 Jun 2019 20:23:51 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5FB1F28079; Tue, 25 Jun 2019 20:23:51 +0000 (GMT) Received: from genoa.aus.stglabs.ibm.com (unknown [9.40.192.157]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 25 Jun 2019 20:23:51 +0000 (GMT) Received: by genoa.aus.stglabs.ibm.com (Postfix, from userid 1025) id 2C928A60E3E; Tue, 25 Jun 2019 15:23:50 -0500 (CDT) From: acsawdey@linux.ibm.com To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org, wschmidt@linux.ibm.com, dje.gcc@gmail.com, acsawdey@linux.ibm.com, rguenther@suse.de, jakub@redhat.com, matz@suse.de Subject: [PATCH 01/30] Changes to machine independent code Date: Tue, 25 Jun 2019 15:22:10 -0500 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes From: Aaron Sawdey * builtins.c (get_memory_rtx): Fix comment. * optabs.def (movmem_optab): Change to cpymem_optab. * expr.c (emit_block_move_via_cpymem): Change movmem to cpymem. (emit_block_move_hints): Change movmem to cpymem. * defaults.h: Change movmem to cpymem. * targhooks.c (get_move_ratio): Change movmem to cpymem. (default_use_by_pieces_infrastructure_p): Ditto. --- gcc/builtins.c | 2 +- gcc/defaults.h | 6 +++--- gcc/expr.c | 10 +++++----- gcc/optabs.def | 2 +- gcc/targhooks.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gcc/builtins.c b/gcc/builtins.c index 4ecfd49..40afd03 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -1416,7 +1416,7 @@ expand_builtin_prefetch (tree exp) } /* Get a MEM rtx for expression EXP which is the address of an operand - to be used in a string instruction (cmpstrsi, movmemsi, ..). LEN is + to be used in a string instruction (cmpstrsi, cpymemsi, ..). LEN is the maximum length of the block of memory that might be accessed or NULL if unknown. */ diff --git a/gcc/defaults.h b/gcc/defaults.h index b753425..af7ea18 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -1318,10 +1318,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #endif /* If a memory-to-memory move would take MOVE_RATIO or more simple - move-instruction sequences, we will do a movmem or libcall instead. */ + move-instruction sequences, we will do a cpymem or libcall instead. */ #ifndef MOVE_RATIO -#if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti) +#if defined (HAVE_cpymemqi) || defined (HAVE_cpymemhi) || defined (HAVE_cpymemsi) || defined (HAVE_cpymemdi) || defined (HAVE_cpymemti) #define MOVE_RATIO(speed) 2 #else /* If we are optimizing for space (-Os), cut down the default move ratio. */ @@ -1342,7 +1342,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #endif /* If a memory set (to value other than zero) operation would take - SET_RATIO or more simple move-instruction sequences, we will do a movmem + SET_RATIO or more simple move-instruction sequences, we will do a setmem or libcall instead. */ #ifndef SET_RATIO #define SET_RATIO(speed) MOVE_RATIO (speed) diff --git a/gcc/expr.c b/gcc/expr.c index c78bc74..4d39569 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -73,7 +73,7 @@ along with GCC; see the file COPYING3. If not see int cse_not_expected; static bool block_move_libcall_safe_for_call_parm (void); -static bool emit_block_move_via_movmem (rtx, rtx, rtx, unsigned, unsigned, HOST_WIDE_INT, +static bool emit_block_move_via_cpymem (rtx, rtx, rtx, unsigned, unsigned, HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT); static void emit_block_move_via_loop (rtx, rtx, rtx, unsigned); @@ -1624,7 +1624,7 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method, if (CONST_INT_P (size) && can_move_by_pieces (INTVAL (size), align)) move_by_pieces (x, y, INTVAL (size), align, RETURN_BEGIN); - else if (emit_block_move_via_movmem (x, y, size, align, + else if (emit_block_move_via_cpymem (x, y, size, align, expected_align, expected_size, min_size, max_size, probable_max_size)) ; @@ -1722,11 +1722,11 @@ block_move_libcall_safe_for_call_parm (void) return true; } -/* A subroutine of emit_block_move. Expand a movmem pattern; +/* A subroutine of emit_block_move. Expand a cpymem pattern; return true if successful. */ static bool -emit_block_move_via_movmem (rtx x, rtx y, rtx size, unsigned int align, +emit_block_move_via_cpymem (rtx x, rtx y, rtx size, unsigned int align, unsigned int expected_align, HOST_WIDE_INT expected_size, unsigned HOST_WIDE_INT min_size, unsigned HOST_WIDE_INT max_size, @@ -1755,7 +1755,7 @@ emit_block_move_via_movmem (rtx x, rtx y, rtx size, unsigned int align, FOR_EACH_MODE_IN_CLASS (mode_iter, MODE_INT) { scalar_int_mode mode = mode_iter.require (); - enum insn_code code = direct_optab_handler (movmem_optab, mode); + enum insn_code code = direct_optab_handler (cpymem_optab, mode); if (code != CODE_FOR_nothing /* We don't need MODE to be narrower than BITS_PER_HOST_WIDE_INT diff --git a/gcc/optabs.def b/gcc/optabs.def index feee96f..03a08da 100644 --- a/gcc/optabs.def +++ b/gcc/optabs.def @@ -256,7 +256,7 @@ OPTAB_D (umul_highpart_optab, "umul$a3_highpart") OPTAB_D (cmpmem_optab, "cmpmem$a") OPTAB_D (cmpstr_optab, "cmpstr$a") OPTAB_D (cmpstrn_optab, "cmpstrn$a") -OPTAB_D (movmem_optab, "movmem$a") +OPTAB_D (cpymem_optab, "cpymem$a") OPTAB_D (setmem_optab, "setmem$a") OPTAB_D (strlen_optab, "strlen$a") diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 0da885e..676885b 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1746,9 +1746,9 @@ get_move_ratio (bool speed_p ATTRIBUTE_UNUSED) #ifdef MOVE_RATIO move_ratio = (unsigned int) MOVE_RATIO (speed_p); #else -#if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti) +#if defined (HAVE_cpymemqi) || defined (HAVE_cpymemhi) || defined (HAVE_cpymemsi) || defined (HAVE_cpymemdi) || defined (HAVE_cpymemti) move_ratio = 2; -#else /* No movmem patterns, pick a default. */ +#else /* No cpymem patterns, pick a default. */ move_ratio = ((speed_p) ? 15 : 3); #endif #endif @@ -1756,7 +1756,7 @@ get_move_ratio (bool speed_p ATTRIBUTE_UNUSED) } /* Return TRUE if the move_by_pieces/set_by_pieces infrastructure should be - used; return FALSE if the movmem/setmem optab should be expanded, or + used; return FALSE if the cpymem/setmem optab should be expanded, or a call to memcpy emitted. */ bool