From patchwork Fri Oct 8 13:58:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 67220 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 90EC4B70A7 for ; Sat, 9 Oct 2010 01:05:36 +1100 (EST) Received: (qmail 22138 invoked by alias); 8 Oct 2010 14:05:31 -0000 Received: (qmail 22120 invoked by uid 22791); 8 Oct 2010 14:05:30 -0000 X-SWARE-Spam-Status: No, hits=-1.8 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, 08 Oct 2010 14:05:19 +0000 Received: (qmail 30973 invoked from network); 8 Oct 2010 13:58:38 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Oct 2010 13:58:38 -0000 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: matt@3am-software.com Subject: [vax] hookize FUNCTION_ARG &co. Date: Fri, 8 Oct 2010 09:58:36 -0400 Message-Id: <1286546316-17605-1-git-send-email-froydnj@codesourcery.com> 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 The patch below hookizes FUNCTION_ARG and related macros for the vax backend. Nothing special here. Tested by inspection with cross to vax-linux-gnu. I plan to commit this under the obvious rule after waiting a week for comments/approval. * config/vax/vax.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/vax/vax.c (vax_function_arg): New function. (vax_function_arg_advance): New function. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. --- gcc/config/vax/vax.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ gcc/config/vax/vax.h | 26 -------------------------- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 001a226..9459b7f 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -56,6 +56,10 @@ static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, static int vax_address_cost_1 (rtx); static int vax_address_cost (rtx, bool); static bool vax_rtx_costs (rtx, int, int, int *, bool); +static rtx vax_function_arg (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); +static void vax_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static rtx vax_struct_value_rtx (tree, int); static rtx vax_builtin_setjmp_frame_value (void); static void vax_asm_trampoline_template (FILE *); @@ -93,6 +97,11 @@ static int vax_return_pops_args (tree, tree, int); #undef TARGET_PROMOTE_PROTOTYPES #define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG vax_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE vax_function_arg_advance + #undef TARGET_STRUCT_VALUE_RTX #define TARGET_STRUCT_VALUE_RTX vax_struct_value_rtx @@ -2095,3 +2104,40 @@ vax_return_pops_args (tree fundecl ATTRIBUTE_UNUSED, { return size > 255 * 4 ? 0 : size; } + +/* Define where to put the arguments to a function. + Value is zero to push the argument on the stack, + or a hard register in which to store the argument. + + MODE is the argument's machine mode. + TYPE is the data type of the argument (as a tree). + This is null for libcalls where that information may + not be available. + CUM is a variable of type CUMULATIVE_ARGS which gives info about + the preceding args and about the function being called. + NAMED is nonzero if this argument is a named parameter + (otherwise it is an extra parameter matching an ellipsis). */ + +/* On the VAX all args are pushed. */ + +static rtx +vax_function_arg (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + const_tree type ATTRIBUTE_UNUSED, + bool named ATTRIBUTE_UNUSED) +{ + return NULL_RTX; +} + +/* Update the data in CUM to advance over an argument of mode MODE and + data type TYPE. (TYPE is null for libcalls where that information + may not be available.) */ + +static void +vax_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named ATTRIBUTE_UNUSED) +{ + *cum += (mode != BLKmode + ? (GET_MODE_SIZE (mode) + 3) & ~3 + : (int_size_in_bytes (type) + 3) & ~3); +} diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h index bce9666..35965dc 100644 --- a/gcc/config/vax/vax.h +++ b/gcc/config/vax/vax.h @@ -355,32 +355,6 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ ((CUM) = 0) -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ - -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - ((CUM) += ((MODE) != BLKmode \ - ? (GET_MODE_SIZE (MODE) + 3) & ~3 \ - : (int_size_in_bytes (TYPE) + 3) & ~3)) - -/* Define where to put the arguments to a function. - Value is zero to push the argument on the stack, - or a hard register in which to store the argument. - - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. - CUM is a variable of type CUMULATIVE_ARGS which gives info about - the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ - -/* On the VAX all args are pushed. */ - -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0 - /* Output assembler code to FILE to increment profiler label # LABELNO for profiling a function entry. */