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] [MIPS] Pass -mdsp if compiling for DSP core


Catherine Moore <clm@codesourcery.com> writes:
> This patch will cause gcc to pass -mdsp by default if the arch setting
> is for the 24ke, 74k or 34k families.  Current behavior requires that -mdsp
> be passed on the command line.

Thanks for following the existing style here.  Unfortunately,
I think -mdsp is a slightly different case.

We have three reasons for wanting to simulate command lines:

(1) To make implicit options appear explicitly.  This makes other specs
    easier to write, and can help in picking the right multilib.

    MIPS_ISA_LEVEL_SPEC is an example of this.  It sets -mips* from -march*.

(2) To select a calling convention based on other flags.

    MIPS_ARCH_FLOAT_SPEC is an example of this.  It selects the hard-float
    or soft-float ABI from -march.

(3) To select processor-specific features that do not affect the
    calling convention.

    Your new spec is an example of this.

(1) is at worst a no-op, so it doesn't matter whether we do it for all
targets or not.  We have traditionally only done it when we've needed to,
but that can be changed.

On the other hand, (2) _must_ be target-specific.  It is a
configuration-specific decision whether -march affects the calling
convention.  Many configurations don't support hard-float and soft-float
simultaneously.

I think (3) should be target-independent.  The idea behind the patch
is that -march=* should enable all features of the processor _within
the confines of the current ABI_.  It would be confusing if -march only
did that for some configurations.

So I think we finally have a reason to have a definition of
DEFAULT_SELF_SPECS in mips.h.  Something like:

mips.h:
#define BASE_DRIVER_SELF_SPECS  /* your new stuff */
#define DRIVER_SELF_SPECS BASE_DRIVER_SELF_SPECS

linux.h:
rename BASE_DRIVER_SELF_SPECS to LINUX_DRIVER_SELF_SPECS
update uses
include BASE_DRIVER_SELF_SPECS in LINUX_DRIVER_SELF_SPECS
undef DRIVER_SELF_SPECS before redefining it

elfoabi.h:
iris.h:
sde.h:
vr.h:
undef DRIVER_SELF_SPECS before redefining it
add BASE_DRIVER_SELF_SPECS to DRIVER_SELF_SPECS

The reason for doing it this way round (and the reason we do it
this way round in linux.h already) is that we might in general
want to add target-specific rules both before and after the
target-independent rules.  E.g. vr.h starts with rules that
insert a default -march.

Richard


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