From patchwork Fri Aug 27 15:05:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 62859 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 5AE86B7105 for ; Sat, 28 Aug 2010 01:05:13 +1000 (EST) Received: (qmail 22146 invoked by alias); 27 Aug 2010 15:05:09 -0000 Received: (qmail 22060 invoked by uid 22791); 27 Aug 2010 15:05:07 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Aug 2010 15:05:02 +0000 Received: (qmail 4983 invoked from network); 27 Aug 2010 15:05:00 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Aug 2010 15:05:00 -0000 Date: Fri, 27 Aug 2010 08:05:00 -0700 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: nickc@redhat.com Subject: [rx] hookize FUNCTION_ARG &co. Message-ID: <20100827150500.GV16898@codesourcery.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) 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 This patch hookizes FUNCTION_ARG and related macros for the rx backend. Nothing unusual here; we can staticize rx_function_arg_size because it's no longer exposed via FUNCTION_ARG_ADVANCE. Tested on rx-elf. I plan to commit this under the obvious rule after waiting a week for comments. -Nathan * config/rx/rx-protos.h (rx_function_arg, rx_function_arg_size): Delete. * config/rx/rx.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/rx/rx.c (rx_function_arg_size): Make static. (rx_function_arg): Likewise. (rx_function_arg_advance): New function. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. diff --git a/gcc/config/rx/rx-protos.h b/gcc/config/rx/rx-protos.h index 166290d..3adce24 100644 --- a/gcc/config/rx/rx-protos.h +++ b/gcc/config/rx/rx-protos.h @@ -44,9 +44,4 @@ extern bool rx_is_restricted_memory_address (rtx, Mmode); extern void rx_notice_update_cc (rtx body, rtx insn); #endif -#ifdef TREE_CODE -extern unsigned int rx_function_arg_size (Mmode, const_tree); -extern struct rtx_def * rx_function_arg (Fargs *, Mmode, const_tree, bool); -#endif - #endif /* GCC_RX_PROTOS_H */ diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index 503a5cf..86d8ad4 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -758,7 +758,7 @@ rx_round_up (unsigned int value, unsigned int alignment) /* Return the number of bytes in the argument registers occupied by an argument of type TYPE and mode MODE. */ -unsigned int +static unsigned int rx_function_arg_size (Mmode mode, const_tree type) { unsigned int num_bytes; @@ -778,7 +778,7 @@ rx_function_arg_size (Mmode mode, const_tree type) parameter list, or the last named parameter before the start of a variable parameter list. */ -rtx +static rtx rx_function_arg (Fargs * cum, Mmode mode, const_tree type, bool named) { unsigned int next_reg; @@ -815,6 +815,13 @@ rx_function_arg (Fargs * cum, Mmode mode, const_tree type, bool named) return gen_rtx_REG (mode, next_reg); } +static void +rx_function_arg_advance (Fargs * cum, Mmode mode, const_tree type, + bool named ATTRIBUTE_UNUSED) +{ + *cum += rx_function_arg_size (mode, type); +} + /* Return an RTL describing where a function return value of type RET_TYPE is held. */ @@ -2746,6 +2753,12 @@ rx_memory_move_cost (enum machine_mode mode, enum reg_class regclass, bool in) #undef TARGET_FUNCTION_OK_FOR_SIBCALL #define TARGET_FUNCTION_OK_FOR_SIBCALL rx_function_ok_for_sibcall +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG rx_function_arg + +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE rx_function_arg_advance + #undef TARGET_SET_CURRENT_FUNCTION #define TARGET_SET_CURRENT_FUNCTION rx_set_current_function diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h index b3a1269..5e5167e 100644 --- a/gcc/config/rx/rx.h +++ b/gcc/config/rx/rx.h @@ -321,11 +321,6 @@ typedef unsigned int CUMULATIVE_ARGS; #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ (CUM) = 0 -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - rx_function_arg (& CUM, MODE, TYPE, NAMED) - -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - (CUM) += rx_function_arg_size (MODE, TYPE) #define TRAMPOLINE_SIZE (! TARGET_BIG_ENDIAN_DATA ? 14 : 20) #define TRAMPOLINE_ALIGNMENT 32