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: fix ppc-vxworks not to clobber explicit options for E500


On Sat, Aug 21, 2010 at 12:44 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Sat, 21 Aug 2010, David Edelsohn wrote:

>> More fundamentally,
>>
>> e500.h:#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
>>
>> is wrong. ?TARGET_E500 should not be checking for a specific CPU.
>> This broken logic was introduced when E500 support initially was
>> added.
>
> r89416 introduced e500 double and 8548 support without adding a separate
> PROCESSOR_PPC8548 value - before then, there was only one e500 processor
> supported so that definition was reasonable enough.
>
> Though there is very little use of the TARGET_E500 macro; the basic
> concept of having such a macro for a particular set of processors rather
> than basing things purely on features is dubious. ?Logically it would seem
> better to:
>
> * Enable rs6000_spe, rs6000_spe_abi, rs6000_float_gprs based on
> information in the processor_target_table used to enable other features
> based on the CPU, or failing that based on direct comparisons with
> PROCESSOR_PPC8540 and PROCESSOR_PPC8548 as done for various other
> processor peculiarities in rs6000_override_options. ?Don't limit this to
> vxworks.h; do it for all targets.
>
> * If rs6000_spe is set while TARGET_SPE is 0, or similarly for the other
> settings, give an error that the options given are not supported in this
> compiler configuration (it's been built without e500 support). ?(There's
> code checking for such a case in the handling of the -mabi=spe option, but
> that's the wrong place if you want to catch implicit settings as well; you
> should do it in rs6000_override_options after things have been defaulted
> from the CPU.)
>
> * Remove various special settings of defaults in eabispe.h and linuxspe.h
> and e500-double.h, and the "For the powerpc-eabispe configuration, we set
> all these by default" code in rs6000_override_options. ?Instead,
> config.gcc should enable --with-cpu=8540 / --with-cpu=8548 given one of
> the *spe targets, selecting which of those options to enable based on
> whether --enable-e500-double is passed - as well as ensuring e500.h is in
> tm_file so the e500 support is built into the compiler, of course. ?Then
> the logic to default things from the CPU would do the rest.
>
> * Remove the TARGET_E500 macro. ?Everything using it should check either
> features or specific PROCESSOR_* settings.

Yes.  Exactly.

- David


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