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] Add attribute((target("..."))) and pragma target to PowerPC


On Mon, Nov 01, 2010 at 11:52:37PM +0000, Joseph S. Myers wrote:
> On Mon, 1 Nov 2010, Michael Meissner wrote:
> 
> > On Mon, Nov 01, 2010 at 01:49:06PM -0400, Michael Meissner wrote:
> > > The simplest way to fix this is to require the user on 32-bit to use an
> > > explicit -maltivec-abi switch if they want to switch to a power7 cpu or enable
> > > altivec (similarly for the rs6000_spe_abi, rs6000_float_gprs, and
> > > rs6000_darwin64_abi variables).
> > 
> > Whoops, that should be -mabi=altivec.
> > 
> > The following patch applied on top of my previous patch, will give an error if
> > any option changes the various abi's.  It also changes the debug information
> > somewhat.  Does this answer your objection?
> 
> It looks like it.  Note that there are problems with diagnostic 
> formatting:
> 
> > +	error ("You cannot change long double size within a target attribute "
> > +	       "or pragma");
> 
> Diagnostics should not start with a capital letter, and "You cannot" is 
> not the normal style; I'd think the message should be something like
> 
>   error ("target attribute or pragma changes long double size");
> 
> or use sorry () if you think the feature should be supported (that's more 
> likely with the AltiVec ABI, though maybe that should be a separate 
> attribute instead) and the lack of support is a limitation of the 
> implementation.
> 
> > +	error ("You cannot switch to the altivec abi within a target "
> 
> "AltiVec" and "ABI".  Likewise elsewhere.

This patch fixes the error messages in rs6000.c to address the concerns from
Joesph Myers.

In addition, as we discussed on irc, I made the variable flag_fp_contract_mode
saved with the optimization options, so that if a backend decides to change the
FMA mode, it will be automatically swapped.  Originally I was going to add more
infrastructure to declare such variables as optimization variables, but I
decided for just one more variable, it was simpler to just add it in, rather
than come up with new infrastructure.  While I was there, I changed the
ordering within the structure so that enums come between ints and shorts.  I
also fixed an obvious typo I made originally with these patches.

Assuming David gives me the ok to check in the powerpc side of things, are the
awk script changes ok for the machine independent changes?

2010-11-17  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_option_override_internal): Make
	error messages for target attributes or pragmas conform to
	existing usage.
	(rs6000_inner_target_options): Ditto.

	* opth-gen.awk: Add flag_fp_contract_mode to variables saved as
	optimization variables.  Sort enums between ints and shorts.  Fix
	cut+paste error in restoration of enum optimize variables.  Cast
	enum values to int before printing.
	* optc-gen.awk: Ditto.


-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com	fax +1 (978) 399-6988

Attachment: gcc-power7.patch189b
Description: Text document


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