This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] New m68k target option -mregparm


Hello!

This patch adds the target option -mregparm to the m68k backend. Its
similiar to the i386 backend option with one difference: it can be used
without specifying the parameter count. Then a default count is used.
Using -mregparm= and -mno-regparm has an unfortunate effect: since
-mregparm= is handled in override_options() it disables -mno-regparm.
This feature was originally developed by Kamil Iskra for the AmigaOS port
of GCC 2.7.2.1. I adapted the code as part of the AmigaOS port modifications
for GCC3. I would like to get some feedback which parts of this patch need
changes.

Thank you,
Gunther

2004-06-24  Kamil Iskra  <kamil@science.uva.nl>
	    Gunther Nikl  <gni@gecko.de>

	* config/m68k/m68k-protos.h (m68k_init_cumulative_args,
	m68k_function_arg_advance, m68k_function_arg): Add prototypes.
	* config/m68k/m68k.h (MASK_REGPARM, TARGET_REGPARM, M68K_MAX_REGPARM,
	M68K_DEFAULT_REGPARM): New defines.
	(TARGET_SWITCHES): Add -mregparm and -mno-regparm.
	(TARGET_OPTIONS): Add -mregparm=.
	(CLASS_MAX_NREGS): Return GET_MODE_NUNITS(MODE) for FP_REGS.
	(struct m68k_args): New structure.
	(CUMULATIVE_ARGS): Use it.
	(FUNCTION_ARG_REGNO_P, INIT_CUMULATIVE_ARGS, FUNCTION_ARG_ADVANCE,
	FUNCTION_ARG): Use new infrastucture for register parameters.
	(m68k_regparm_string, m68k_regparm) Add extern declarations.
	* config/m68k/m68k.c (m68k_handle_type_attribute,
	m68k_comp_type_attributes): Add prototypes. New functions.
	(m68k_regparm_string, m68k_regparm): New.
	(m68k_attribute_table): Add stkparm and regparm attributes.
	(TARGET_COMP_TYPE_ATTRIBUTES): Define to m68k_comp_type_attributes.
	(override_options): Handle m68k_regparm_string and TARGET_REGPARM.
	(m68k_init_cumulative_args, m68k_function_arg_advance,
	m68k_function_arg): New functions.

Attachment: diffs.350-regparm
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]