This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [MIPS][LS2][5/5] Support for native MIPS GCC
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Maxim Kuvyrkov <maxim at codesourcery dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Zhang Le <r0bertz at gentoo dot org>, Eric Fisher <joefoxreal at gmail dot com>
- Date: Sun, 25 May 2008 12:35:08 +0100
- Subject: Re: [MIPS][LS2][5/5] Support for native MIPS GCC
- References: <4835A9B4.9000709@codesourcery.com> <4835B68C.3020106@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com> writes:
> This patch adds support for -march=native and -mtune=native options.
>
> File driver-st.c contains a routine that checks "cpu model" line in
> /proc/cpuinfo and appends a proper option to compiler command line.
>
> This patch also specifies layout for Loongson multilibs.
OK, the obvious question here is: should the -march=native support
be specific to mips*-st*-linux* configurations, or should it apply
to all mips*-linux* configurations? I can imagine you discussed
this internally; if you did, why settle on the former?
My gut feeling was that -march=native ought to be supported for all
mips*-linux* configurations, and that mips*-st*-linux* ought simply to
specify a particular selection of multilibs (and associated multilib
layout). Thus driver-st.c would be called something more generic and
would be included by config/mips/linux.h. We could then add other
names to the list as the need arises.
I think it would be worth adding a comment saying that, if we can't
detect a known processor, we simply discard the -march or -mtune option.
This is in contrast to x86, where we force a lowest common demoninator.
(For the record, I agree the behaviour you've got makes sense.)
You need to document the new option.
The implementation itself looks fine, thanks.
Richard