From patchwork Tue Aug 31 15:16:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 63277 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 A9A4DB70F8 for ; Wed, 1 Sep 2010 01:17:10 +1000 (EST) Received: (qmail 32555 invoked by alias); 31 Aug 2010 15:17:08 -0000 Received: (qmail 32545 invoked by uid 22791); 31 Aug 2010 15:17: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; Tue, 31 Aug 2010 15:16:57 +0000 Received: (qmail 7963 invoked from network); 31 Aug 2010 15:16:55 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 31 Aug 2010 15:16:55 -0000 Date: Tue, 31 Aug 2010 08:16:55 -0700 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: uweigand@de.ibm.com Subject: [s390] hookize FUNCTION_ARG &co. Message-ID: <20100831151655.GZ16898@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 s390 backend. The only unusual changes are the constification of various tree arguments. Sanity-checked with a cross to s390-linux-gnu. I plan to commit this under the obvious rule after waiting a week for comments. -Nathan * config/s390/s390-protos.h (s390_function_arg_advance): Delete. (s390_function_arg): Delete. * config/s390/s390.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/s390/s390.c (s390_function_arg_float): Take a const_tree. (s390_function_arg_integer): Likewise. (s390_function_arg_advance): Make static. Take a const_tree and a bool. (s390_function_arg): Likewise. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h index 8a2f1b7..604dc5a 100644 --- a/gcc/config/s390/s390-protos.h +++ b/gcc/config/s390/s390-protos.h @@ -118,10 +118,7 @@ extern int s390_compare_and_branch_condition_mask (rtx); #endif /* RTX_CODE */ #ifdef TREE_CODE -extern void s390_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, - tree, int); #ifdef RTX_CODE -extern rtx s390_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern rtx s390_function_value (const_tree, const_tree, enum machine_mode); #endif /* RTX_CODE */ #endif /* TREE_CODE */ diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 56cbac2..d262527 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -8263,7 +8263,7 @@ s390_function_arg_size (enum machine_mode mode, const_tree type) is to be passed in a floating-point register, if available. */ static bool -s390_function_arg_float (enum machine_mode mode, tree type) +s390_function_arg_float (enum machine_mode mode, const_tree type) { int size = s390_function_arg_size (mode, type); if (size > 8) @@ -8308,7 +8308,7 @@ s390_function_arg_float (enum machine_mode mode, tree type) registers, if available. */ static bool -s390_function_arg_integer (enum machine_mode mode, tree type) +s390_function_arg_integer (enum machine_mode mode, const_tree type) { int size = s390_function_arg_size (mode, type); if (size > 8) @@ -8370,9 +8370,9 @@ s390_pass_by_reference (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED, argument is a named argument (as opposed to an unnamed argument matching an ellipsis). */ -void +static void s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, - tree type, int named ATTRIBUTE_UNUSED) + const_tree type, bool named ATTRIBUTE_UNUSED) { if (s390_function_arg_float (mode, type)) { @@ -8406,9 +8406,9 @@ s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, to pass floating point arguments. All remaining arguments are pushed to the stack. */ -rtx -s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, - int named ATTRIBUTE_UNUSED) +static rtx +s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named ATTRIBUTE_UNUSED) { if (s390_function_arg_float (mode, type)) { @@ -10483,6 +10483,10 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop) #undef TARGET_FUNCTION_OK_FOR_SIBCALL #define TARGET_FUNCTION_OK_FOR_SIBCALL s390_function_ok_for_sibcall +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG s390_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE s390_function_arg_advance #undef TARGET_FIXED_CONDITION_CODE_REGS #define TARGET_FIXED_CONDITION_CODE_REGS s390_fixed_condition_code_regs diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index cbe2899..94f1810 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -686,12 +686,6 @@ CUMULATIVE_ARGS; #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, NN, N_NAMED_ARGS) \ ((CUM).gprs=0, (CUM).fprs=0) -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - s390_function_arg_advance (&CUM, MODE, TYPE, NAMED) - -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - s390_function_arg (&CUM, MODE, TYPE, NAMED) - /* Arguments can be placed in general registers 2 to 6, or in floating point registers 0 and 2 for 31 bit and fprs 0, 2, 4 and 6 for 64 bit. */