From patchwork Tue Mar 1 21:42:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 84993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3497FB70D0 for ; Wed, 2 Mar 2011 08:42:22 +1100 (EST) Received: (qmail 24054 invoked by alias); 1 Mar 2011 21:42:16 -0000 Received: (qmail 23972 invoked by uid 22791); 1 Mar 2011 21:42:15 -0000 X-SWARE-Spam-Status: No, hits=1.9 required=5.0 tests=AWL, BAYES_50, KAM_THEBAT, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from contrabass.post.ru (HELO contrabass.post.ru) (85.21.78.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Mar 2011 21:42:09 +0000 Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 4E54CCB326; Wed, 2 Mar 2011 00:42:06 +0300 (MSK) Received: from [93.80.237.154] (account aesok@post.ru HELO Vista.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPA id 304882020; Wed, 02 Mar 2011 00:42:06 +0300 Date: Wed, 2 Mar 2011 00:42:13 +0300 From: Anatoly Sokolov Message-ID: <1446125776.20110302004213@post.ru> To: gcc-patches CC: nickc@redhat.com Subject: [STORMY16] Hookize REGISTER_MOVE_COST and MEMORY_MOVE_COST MIME-Version: 1.0 X-IsSubscribed: yes 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 Hi. This patch removes obsolete REGISTER_MOVE_COST and MEMORY_MOVE_COST macros from the STORMY16 back end in the GCC and introduces equivalent TARGET_MEMORY_MOVE_COST target hook. Default version of the TARGET_REGISTER_MOVE_COST target hook is used. Regression tested on xstormy16-unknown-elf. OK to install? * config/stormy16/stormy16.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove. * config/stormy16/stormy16.c: Include reload.h. (xstormy16_memory_move_cost): New function. (TARGET_MEMORY_MOVE_COST): Define. Anatoly. Index: gcc/config/stormy16/stormy16.c =================================================================== --- gcc/config/stormy16/stormy16.c (revision 170573) +++ gcc/config/stormy16/stormy16.c (working copy) @@ -46,6 +46,7 @@ #include "langhooks.h" #include "gimple.h" #include "df.h" +#include "reload.h" #include "ggc.h" static rtx emit_addhi3_postreload (rtx, rtx, rtx); @@ -108,6 +109,16 @@ : 5); } +/* Worker function for TARGET_MEMORY_MOVE_COST. */ + +static int +xstormy16_memory_move_cost (enum machine_mode mode, reg_class_t rclass, + bool in) +{ + return (5 + memory_move_secondary_cost (mode, rclass, in)); +} + + /* Branches are handled as follows: 1. HImode compare-and-branches. The machine supports these @@ -2598,6 +2609,8 @@ #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK #define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall +#undef TARGET_MEMORY_MOVE_COST +#define TARGET_MEMORY_MOVE_COST xstormy16_memory_move_cost #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS xstormy16_rtx_costs #undef TARGET_ADDRESS_COST Index: gcc/config/stormy16/stormy16.h =================================================================== --- gcc/config/stormy16/stormy16.h (revision 170573) +++ gcc/config/stormy16/stormy16.h (working copy) @@ -354,10 +354,6 @@ /* Describing Relative Costs of Operations. */ -#define REGISTER_MOVE_COST(MODE, FROM, TO) 2 - -#define MEMORY_MOVE_COST(M,C,I) (5 + memory_move_secondary_cost (M, C, I)) - #define BRANCH_COST(speed_p, predictable_p) 5 #define SLOW_BYTE_ACCESS 0