From patchwork Wed Mar 6 10:20:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu X-Patchwork-Id: 1052239 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-497446-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="DsVhb2wi"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g0EVrfit"; 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 44DqYM4NJfz9s9N for ; Wed, 6 Mar 2019 21:21:27 +1100 (AEDT) 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 :mime-version:content-transfer-encoding; q=dns; s=default; b=EtM rSx6B7F8LZuY4QFLsR8sCFpDA44qTeDeT7RQE0kRyhrCsJ+xhZI5EDSIWxzZeQU0 3o1saCLvBcRbB0UgTYXhuqIcvg0XIXVJNayFAmCf8jk2b1X32td2Ixxz3HuGbxLc CSnKuxE5C2unlxXTWwR8ViOF4uCYtOWEOFDjBMgo= 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 :mime-version:content-transfer-encoding; s=default; bh=1qvwpzpzm g2wGF/iWI+OMcVqCd0=; b=DsVhb2wijpFAQEau3mWhhZ6yPaT/6cVRR7UUbXedn SjHWVOt5p7BI7Nf1YbIkBOWYPrVRGg32bAEJCoixsFGsQhxyJPjRDRawDbfBIr7q 8eSXKgXaP8wKZsbez194R/DEQHpB3XjHb5fYa2wB8FPGoDRoabeEGlaiapjmmZaa VQ= Received: (qmail 103131 invoked by alias); 6 Mar 2019 10:20:27 -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 103044 invoked by uid 89); 6 Mar 2019 10:20:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:3555 X-HELO: mail-yw1-f53.google.com Received: from mail-yw1-f53.google.com (HELO mail-yw1-f53.google.com) (209.85.161.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Mar 2019 10:20:24 +0000 Received: by mail-yw1-f53.google.com with SMTP id u200so9502308ywu.10 for ; Wed, 06 Mar 2019 02:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bjLTFgxEg3GijmhFHR5AfUobmMUKh0TiTp1sd2BX+XA=; b=g0EVrfitv+TMLhfJBYYBvHZYjYXv9QvhEuKfW6t3fGSVstEM/IH7SlV91+avmBB2y4 KGCDms3TZOPZBn6BscEup3vHPwVctZI4XBMIcxBlsOHfYD6asdVPJKQ2VdeXxKmpprPx 3WG9JMNCvHji1lPVWzrN3ey+xIe1ADtdWlh8Y+aMDW5ryXKWcKn0IypzpcbMZ0UVoQ62 wfm6KXvlXVjWVvic1v4vWxT8Z4t+KaOA4nK0JTNx0B0TiH6/f8o0mkdUa3KpU8s6DYub 80TLi5Qnm11w8y5QfIBV2nApkdXHuhKoAIimKC0Iu/iX3jLAQ9op4hF0IaF2Rql8ZrbP oGGA== Received: from localhost.localdomain ([193.187.151.25]) by smtp.gmail.com with ESMTPSA id d85sm403718ywd.96.2019.03.06.02.20.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Mar 2019 02:20:22 -0800 (PST) From: Claudiu Zissulescu To: gcc-patches@gcc.gnu.org Cc: fbedard@synopsys.com, andrew.burgess@embecosm.com, claziss@synopsys.com Subject: [PATCH 5/5] [ARC] Refactor deprecated macros. Date: Wed, 6 Mar 2019 12:20:05 +0200 Message-Id: <20190306102005.15413-6-claziss@gmail.com> In-Reply-To: <20190306102005.15413-1-claziss@gmail.com> References: <20190306102005.15413-1-claziss@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes xxxx-xx-xx Claudiu Zissulescu * config/arc/arc-protos.h (arc_register_move_cost): Remove. * config/arc/arc.c (arc_register_move_cost): Re-purpose it to implement target hook. (arc_memory_move_cost): New function. (TARGET_REGISTER_MOVE_COST): Define. (TARGET_MEMORY_MOVE_COST): Likewise. * config/arc/arc.h (REGISTER_MOVE_COST): Remove. (MEMORY_MOVE_COST): Likewise. --- gcc/config/arc/arc-protos.h | 2 -- gcc/config/arc/arc.c | 26 ++++++++++++++++++++++++-- gcc/config/arc/arc.h | 11 ----------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h index 8f0f197f14a..ac0de6b2874 100644 --- a/gcc/config/arc/arc-protos.h +++ b/gcc/config/arc/arc-protos.h @@ -68,8 +68,6 @@ extern bool arc_is_shortcall_p (rtx); extern bool valid_brcc_with_delay_p (rtx *); extern bool arc_ccfsm_cond_exec_p (void); struct secondary_reload_info; -extern int arc_register_move_cost (machine_mode, enum reg_class, - enum reg_class); extern rtx disi_highpart (rtx); extern int arc_adjust_insn_length (rtx_insn *, int, bool); extern int arc_corereg_hazard (rtx, rtx); diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index a3a013e90e1..50977704c45 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -8686,9 +8686,11 @@ arc_preserve_reload_p (rtx in) && !((INTVAL (XEXP (in, 1)) & 511))); } -int +/* Implement TARGET_REGISTER_MOVE_COST. */ + +static int arc_register_move_cost (machine_mode, - enum reg_class from_class, enum reg_class to_class) + reg_class_t from_class, reg_class_t to_class) { /* Force an attempt to 'mov Dy,Dx' to spill. */ if ((TARGET_ARC700 || TARGET_EM) && TARGET_DPFP @@ -11428,6 +11430,20 @@ arc_adjust_reg_alloc_order (void) memcpy (reg_alloc_order, size_alloc_order, sizeof (size_alloc_order)); } +/* Implement TARGET_MEMORY_MOVE_COST. */ + +static int +arc_memory_move_cost (machine_mode mode, + reg_class_t rclass ATTRIBUTE_UNUSED, + bool in ATTRIBUTE_UNUSED) +{ + if ((GET_MODE_SIZE (mode) <= UNITS_PER_WORD) + || ((GET_MODE_SIZE (mode) <= UNITS_PER_WORD * 2) && TARGET_LL64)) + return 6; + + return (2 * GET_MODE_SIZE (mode)); +} + #undef TARGET_USE_ANCHORS_FOR_SYMBOL_P #define TARGET_USE_ANCHORS_FOR_SYMBOL_P arc_use_anchors_for_symbol_p @@ -11443,6 +11459,12 @@ arc_adjust_reg_alloc_order (void) #undef TARGET_HAVE_SPECULATION_SAFE_VALUE #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed +#undef TARGET_REGISTER_MOVE_COST +#define TARGET_REGISTER_MOVE_COST arc_register_move_cost + +#undef TARGET_MEMORY_MOVE_COST +#define TARGET_MEMORY_MOVE_COST arc_memory_move_cost + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-arc.h" diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 90420a9d474..46ca2dde413 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -925,17 +925,6 @@ arc_select_cc_mode (OP, X, Y) /* Costs. */ -/* Compute extra cost of moving data between one register class - and another. */ -#define REGISTER_MOVE_COST(MODE, CLASS, TO_CLASS) \ - arc_register_move_cost ((MODE), (CLASS), (TO_CLASS)) - -/* Compute the cost of moving data between registers and memory. */ -/* Memory is 3 times as expensive as registers. - ??? Is that the right way to look at it? */ -#define MEMORY_MOVE_COST(MODE,CLASS,IN) \ -(GET_MODE_SIZE (MODE) <= UNITS_PER_WORD ? 6 : 12) - /* The cost of a branch insn. */ /* ??? What's the right value here? Branches are certainly more expensive than reg->reg moves. */