PATCH: Add --with-arch=cpu (Re: Should gcc configurted for CPU to generate code for CPU by default?)
Daniel Jacobowitz
drow@mvista.com
Sat Jul 20 07:52:00 GMT 2002
On Fri, Jul 19, 2002 at 11:10:53AM -0700, H. J. Lu wrote:
> On Fri, Jul 19, 2002 at 02:03:29PM -0400, Daniel Jacobowitz wrote:
> > On Fri, Jul 19, 2002 at 10:55:47AM -0700, H. J. Lu wrote:
> > > On Fri, Jul 19, 2002 at 01:49:52PM -0400, Daniel Jacobowitz wrote:
> > > > > >
> > > > > > Can't this be done at the driver level? We have different handling of
> > > > > >
> > > > >
> > > > > What do you mean by that?
> > > >
> > > > I.E. make the GCC driver supply a default value of -mcpu if none is
> > > > specified on the command line, the same way sane programs set defaults.
> > > >
> > >
> > > That is exactly what the gcc driver is doing today. My patch provides
> > > a way to choose a different default value for -march at the configure
> > > time. Without my change, the default value for -march is i386 for all
> > > ia32 processors and it is fixed.
> >
> > No, that's not what the driver does today. I mean that if the driver
> > was built with --with-arch=, and the driver does not see an -march=,
> > then the driver should supply one. Then we won't need any changes to
> > backends.
>
> I am really confused here. To me, my patch does exactly what you said
> above. Wait, did you mean gcc.c should handle -march=, not i386.c?
> I have an impresssion that most, if not all, "-mxxx" switches are
> handled in the backend. I don't see why my patch should change that.
>
> FWIW, "-mxxx" switches are backend dependent by definition. Did I miss
> something here?
Right now, we have a handful of architectures that support --with-cpu=.
They all do it in different ways. Most don't recognize it at all.
What I am suggesting is that the driver (gcc.c) should recognize
-march= and -mcpu= if TARGET_{ARCH,CPU}_DEFAULT are defined. The only
thing it should do with them is supply one if none is present. The
backend handles the rest, as before.
That way we don't keep having to do this for different platforms.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
More information about the Gcc
mailing list