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: [arm] Fix arm_tune


On Wednesday 21 April 2004 12:00, Richard Earnshaw wrote:
> On Tue, 2004-04-20 at 22:23, Paul Brook wrote:
> > We currently set arm_tune incorrectly when the user specifies -march=. We
> > were using indices of all_architectures as an index into all_codes.
> >
> > Patch below makes use the member added for this purpose.
> >
> > Tested with cross-compiler to arm-none-elf.
> > Ok?
> >
> > Paul
> >
> > 2004-04-20  Paul Brook  <paul@codesourcery.com>
> >
> > 	* config/arm/arm.c (all_cores): Set core.
> > 	(arm_override_options): Set arm_tune to sel->core.
>
> No, I don't think this is correct either.
>
> Consider:
>
> -march=armv4 -mtune=arm1136
>
> Your patch will cause the tuning to be selected from the arch flag and
> for -mtune to be ignored.
>
> I need to think about this a bit (and don't have time at this minute).
> I suspect we're missing a level of indirection that would allow us to
> make the whole thing far more table driven.  The idea would be to parse
> all the options and use them to fill in a table ordered by preference,
> then we pick the most preferred entry for each of the two targets.
>
> So tuning would be ordered (possibly)
>
> {-mtune, -mcpu, -march, --with-tune, --with-cpu, --with-arch}

This is easy to achieve with my patch by reordering the elements of 
arm_select. Specifically they should be in order of preference.

> while architecture might be ordered
>
> {-march, -mcpu, --with-arch, --with-cpu, --mtune, --with-tune}

I don't think that -mtune should effect the architecture.

--with-foo= is converted into an explicit -mfoo= by the driver. With the 
exception of --with-cpu= we never see these options directly.

Paul


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