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]

Re: [PATCH] RFC, start to add attribute target support to powerpc


Here is a rewritten patch that pushes the target variables to the opt files.

In the opt files, I added 3 new directives:

TargetVariable
==============
Declare target variables that are in the global options, and also automatically
saved and restored by the cl_option_target* functions.  Unlike yesterday's
patch, this one handles enums normally, without converting them to int.

HeaderInclude
=============
Add include files that must be included by options.h  This is where the enum
definitions are pushed too.

SourceInclude
=============
I don't need this particular one, but I added it for symmetry with
HeaderInclude, in case there are #ifdef's or builtin functions needed by the
options.c code.

I updated configure and configure.ac so that it automatically adds the include
files specified by the HeaderInclude and SourceInclude options.

I moved most of the rs6000.c variables into the rs6000.opt definition, except
for things that will be recalculated instead of saved/restored.  So far, I
haven't moved any pointers into the structure.  I moved the enum's to the new
file rs6000-opts.h.

I did have to rename the cmodel variable, as using a define for the name plays
havoc with using the same name as a structure tag or a structure member.

This patch is a lot less invasive as the previous patch.  It touches fewer
files, and is about 1/2 the size in terms of bytes.

I just did a full bootstrap run on ppc64, and it worked fine.

2010-10-08  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* doc/options.texi (Option file format): Document TargetVariable,
	HeaderInclude, and SourceInclude.
	* optc-gen.awk: Add support for TargetVariable, HeaderInclude, and
	SourceInclude.  Add GTY(()) on main option structure for the
	compiler proper, but not in the driver file.
	* opth-gen.awk: Ditto.

	* configure.ac: Figure out the additional include files specified
	by the HeaderInclude and SourceInclude options directives.
	* configure: Regenerate.

	* Makefile.in (OPTIONS_H_EXTRA): New make variable for HeaderInclude.
	(OPTIONS_C_EXTRA): New make variable for SourceInclude.
	(@options_include@): Add the include files if any specified by the
	various .opt files.
	(OPTIONS_H): New make variable for options.h and any files it
	includes.
	(TREE_H): Use $(OPTIONS_H) instead of options.h.
	(FLAGS_H): Ditto.
	(c-family/c-opts.o): Ditto.
	(lto-opts.o): Ditto.
	(opts.o): Ditto.
	(opts-common.o): Ditto.
	(options.o): Add $(OPTIONS_C_EXTRA) to the dependencies.
	(gcc-options.o): Ditto.

	* opt-include.awk: New awk script to output the include files
	specified by option HeaderInclude and SourceInclude options.

	* config/rs6000/rs6000.opt (HeaderInclude): Include rs6000-opts.h.
	(rs6000_cpu): Move definition here as a TargetVariable, from
	rs6000.c.
	(rs6000_always_hint): Ditto.
	(rs6000_sched_groups): Ditto.
	(rs6000_align_branch_targets): Ditto.
	(rs6000_sched_costly_dep): Ditto.
	(rs6000_sched_insert_nops): Ditto.
	(rs6000_long_double_type_size): Ditto.
	(rs6000_ieeequad): Ditto.
	(rs6000_spe): Ditto.
	(rs6000_spe_abi): Ditto.
	(rs6000_float_gprs): Ditto.
	(rs6000_darwin64_abi): Ditto.
	(rs6000_sdata): Ditto.
	(rs6000_tls_size): Ditto.
	(rs6000_current_abi): Ditto.
	(rs6000_tracebback): Ditto.
	(rs6000_alignment_flags): Ditto.
	(rs6000_recip_control): Ditto.
	(rs6000_current_cmode): Rename from cmodel.  Move definition here
	as a TargetVariable, from rs6000.c.
	(rs6000_debug): Combine separate debug flags to a single
	variable.

	* config/rs6000/linux64.h (cmodel): Delete.
	(TARGET_CMODE): Change cmodel to rs6000_current_cmodel.
	(SUBSUBTARGET_OVERRIDE_OPTIONS): Ditto.

	* config/rs6000/rs6000.c (rs6000_cpu): Move definition to
	rs6000.opt as TargetVariables.
	(rs6000_always_hint): Ditto.
	(rs6000_sched_groups): Ditto.
	(rs6000_align_branch_targets): Ditto.
	(rs6000_sched_costly_dep): Ditto.
	(rs6000_sched_insert_nops): Ditto.
	(rs6000_long_double_type_size): Ditto.
	(rs6000_ieeequad): Ditto.
	(rs6000_spe): Ditto.
	(rs6000_spe_abi): Ditto.
	(rs6000_float_gprs): Ditto.
	(rs6000_darwin64_abi): Ditto.
	(rs6000_sdata): Ditto.
	(rs6000_tls_size): Ditto.
	(rs6000_current_abi): Ditto.
	(rs6000_tracebback): Ditto.
	(rs6000_alignment_flags): Ditto.
	(rs6000_recip_control): Ditto.
	(rs6000_current_cmode): Rename from cmodel.  Move to rs6000.opt.
	(rs6000_sched_insert_nops_str): Make static.
	(rs6000_sched_costly_dep_str): Ditto.
	(rs6000_tls_size_string): Ditto.
	(rs6000_debug_name): Ditto.
	(rs6000_traceback_name): Ditto.
	(rs6000_recip_name): Ditto.
	(rs6000_debug_stack): Delete, combine debug flags into a single
	variable.  Allow -mdebug=foo,bar.
	(rs6000_debug_arg): Ditto.
	(rs6000_debug_reg): Ditto.
	(rs6000_debug_addr): Ditto.
	(rs6000_debug_cost): Ditto.
	(rs6000_option_override_internal): Ditto.
	(traceback enum): Move to rs6000-opts.h.
	(rs6000_handle_option): Rename cmodel to rs6000_current_cmodel.

	* gcc/config/rs6000/rs6000.h (toplevel): Include rs6000-opts.h if
	it hasn't already been included.
	(enum rs6000_cmodel): Move enumerations to rs6000-opts.h so they
	can be used by target variables.
	(enum processor_type): Ditto.
	(enum fpu_type_t): Ditto.
	(enum rs6000_dependence_cost): Ditto.
	(enum rs6000_nop_insertion): Ditto.
	(enum group_formation): Ditto.
	(enum rs6000_vector): Ditto.
	(enum rs6000_abi): Ditto.
	(TARGET_DEBUG_*): Use a single rs6000_debug variable instead of
	having a separate variable for each debug flag.
	(rs6000_cpu): Delete variable definitons that are now defined as
	TargetVariables in rs6000.opt.
	(rs6000_long_double_type_size): Ditto.
	(rs6000_ieeequad): Ditto.
	(rs6000_altivec_abi): Ditto.
	(rs6000_spe_abi): Ditto.
	(rs6000_spe): Ditto.
	(rs6000_float_gprs): Ditto.
	(rs6000_alignment_flags): Ditto.
	(rs6000_current_abi): Ditto.
	(rs6000_sched_insert_nop_str): Delete.

	* gcc/config/rs6000/rs6000-opts.h: New file.  Move all enums here
	from rs6000.h and sysv4.h to allow target variables to be declared
	as enums.

	* gcc/config/rs6000/sysv4.h (enum rs6000_sdata_type): Move to
	rs6000-opts.h.
	(rs6000_sdata): Delete, this is now a TargetVariable.
	(rs6000_tls_size_string): Ditto.
	(rs6000_abi_name): Delete.
	(rs6000_sdata_name): Ditto.

-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com

Attachment: gcc-power7.patch168b
Description: Text document


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